Skip to content

Commit

Permalink
Merge 012a2cc into ffb842a
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Apr 28, 2021
2 parents ffb842a + 012a2cc commit 75a3053
Show file tree
Hide file tree
Showing 9 changed files with 172 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
# @link https://github.com/JBZoo/Data
#

/.phan export-ignore
/build export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.phan.php export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/Makefile export-ignore

* text eol=lf
* text eol=lf
144 changes: 144 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
#
# JBZoo Toolbox - Data
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package Data
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/Data
#

name: CI

on:
pull_request:
branches:
- "*"
push:
branches:
- 'master'
schedule:
- cron: '55 */8 * * *'

env:
COLUMNS: 120
TERM_PROGRAM: Hyper

jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
env:
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
strategy:
matrix:
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
experimental: [ false ]
coverage: [ xdebug, none ]
composer_flags: [ "--prefer-lowest", "" ]
include:
- php-version: "8.1"
experimental: true
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: ${{ matrix.coverage }}
tools: composer

- name: Build the Project
continue-on-error: ${{ matrix.experimental }}
run: make update --no-print-directory

- name: 🧪 PHPUnit Tests
continue-on-error: ${{ matrix.experimental }}
run: make test --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
path: build/


linters:
name: Linters
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
experimental: [ false ]
include:
- php-version: "8.1"
experimental: true
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer

- name: Build the Project
continue-on-error: ${{ matrix.experimental }}
run: make update --no-print-directory

- name: 👍 Code Quality
continue-on-error: ${{ matrix.experimental }}
run: make codestyle --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Linters - ${{ matrix.php-version }}
path: build/


report:
name: Reports
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
experimental: [ false ]
include:
- php-version: "8.1"
experimental: true
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer

- name: Build the Project
continue-on-error: ${{ matrix.experimental }}
run: make update --no-print-directory

- name: 📝 Build Reports
continue-on-error: ${{ matrix.experimental }}
run: make report-all --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Reports - ${{ matrix.php-version }}
path: build/
2 changes: 1 addition & 1 deletion .phan/config.php → .phan.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

declare(strict_types=1);

$default = include __DIR__ . '/../vendor/jbzoo/codestyle/src/phan/default.php';
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php';

$config = array_merge($default, [
'file_list' => [
Expand Down
13 changes: 3 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,22 @@ language: php
os: linux
dist: xenial

git:
depth: false

php:
- 7.2
- 7.3
- 7.4
- 8.0
- nightly

jobs:
fast_finish: true
allow_failures:
- php: 8.0
- php: nightly

env:
matrix:
- JBZOO_COMPOSER_UPDATE_FLAGS="--prefer-lowest --prefer-stable"
- JBZOO_COMPOSER_UPDATE_FLAGS=""
- XDEBUG_OFF="yes"

before_script:
- composer self-update
- if [[ $XDEBUG_OFF = yes ]]; then phpenv config-rm xdebug.ini; fi;
- sudo apt update && sudo apt install graphviz

script:
- make update --no-print-directory
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ endif
update: ##@Project Install/Update all 3rd party dependencies
$(call title,"Install/Update all 3rd party dependencies")
@echo "Composer flags: $(JBZOO_COMPOSER_UPDATE_FLAGS)"
@composer update $(JBZOO_COMPOSER_UPDATE_FLAGS)
@composer update --no-progress $(JBZOO_COMPOSER_UPDATE_FLAGS)


test-all: ##@Project Run all project tests at once
@make test
@make test-performance-travis
@make codestyle
35 changes: 16 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"name" : "jbzoo/data",
"type" : "library",
"description" : "An extended version of the ArrayObject object for working with system settings or just for working with data arrays",
"license" : "MIT",
"keywords" : ["ArrayObject", "Array", "Config", "Data", "ini", "yml", "params", "json"],
"authors" : [
"name" : "jbzoo/data",
"type" : "library",
"description" : "An extended version of the ArrayObject object for working with system settings or just for working with data arrays",
"license" : "MIT",
"keywords" : ["ArrayObject", "Array", "Config", "Data", "ini", "yml", "params", "json"],
"authors" : [
{
"name" : "Denis Smetannikov",
"email" : "admin@jbzoo.com",
"role" : "lead"
}
],
"require" : {
"require" : {
"php" : ">=7.2",
"ext-json" : "*"
},

"require-dev" : {
"jbzoo/toolbox-dev" : "^2.9.2",
"jbzoo/utils" : "^4.2.3",
"symfony/yaml" : "^5.2.2"
"require-dev" : {
"jbzoo/toolbox-dev" : "^2.13.0",
"jbzoo/utils" : "^4.4.0",
"symfony/yaml" : "^4.4|^5.0"
},

"suggest" : {
"suggest" : {
"symfony/yaml" : ">=4.4",
"jbzoo/utils" : ">=4.2.2"
},

"autoload" : {
"autoload" : {
"files" : [
"src/functions.php"
],
Expand All @@ -36,18 +36,15 @@
}
},

"minimum-stability" : "dev",
"prefer-stable" : true,

"autoload-dev" : {
"autoload-dev" : {
"classmap" : ["tests"]
},

"config" : {
"config" : {
"optimize-autoloader" : true
},

"extra" : {
"extra" : {
"branch-alias" : {
"dev-master" : "4.x-dev"
}
Expand Down
2 changes: 1 addition & 1 deletion src/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function find(string $key, $default = null, $filter = null, string $separ
}

// explode search key and init search data
$parts = (array)\explode($separator, $key);
$parts = \explode($separator, $key);
$data = $this;

foreach ($parts as $part) {
Expand Down
2 changes: 2 additions & 0 deletions src/PhpArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ protected function decode(string $string)
if (\file_exists($string)) {
return include $string;
}

return null;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
// @codingStandardsIgnoreFile

// main autoload
if ($autoload = realpath('./vendor/autoload.php')) {
if ($autoload = dirname(__DIR__) . '/vendor/autoload.php') {
require_once $autoload;
} else {
echo 'Please execute "composer update" !' . PHP_EOL;
exit(1);
}

if ($fixturesPath = realpath(PROJECT_TESTS . '/fixtures.php')) {
require_once PROJECT_TESTS . '/fixtures.php';
require_once $fixturesPath;
}

0 comments on commit 75a3053

Please sign in to comment.