Skip to content

Commit c912a1f

Browse files
authored
Updated PHP deps (#14)
* Updated PHP deps * Fixed phan config
1 parent ffb842a commit c912a1f

File tree

9 files changed

+177
-36
lines changed

9 files changed

+177
-36
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
# @link https://github.com/JBZoo/Data
1212
#
1313

14-
/.phan export-ignore
1514
/build export-ignore
1615
/tests export-ignore
1716
/.editorconfig export-ignore
1817
/.gitattributes export-ignore
1918
/.gitignore export-ignore
19+
/.phan.php export-ignore
2020
/.travis.yml export-ignore
2121
/phpunit.xml.dist export-ignore
2222
/Makefile export-ignore
2323

24-
* text eol=lf
24+
* text eol=lf

.github/workflows/main.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
#
2+
# JBZoo Toolbox - Data
3+
#
4+
# This file is part of the JBZoo Toolbox project.
5+
# For the full copyright and license information, please view the LICENSE
6+
# file that was distributed with this source code.
7+
#
8+
# @package Data
9+
# @license MIT
10+
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11+
# @link https://github.com/JBZoo/Data
12+
#
13+
14+
name: CI
15+
16+
on:
17+
pull_request:
18+
branches:
19+
- "*"
20+
push:
21+
branches:
22+
- 'master'
23+
schedule:
24+
- cron: '55 */8 * * *'
25+
26+
env:
27+
COLUMNS: 120
28+
TERM_PROGRAM: Hyper
29+
30+
jobs:
31+
phpunit:
32+
name: PHPUnit
33+
runs-on: ubuntu-latest
34+
env:
35+
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
36+
strategy:
37+
matrix:
38+
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
39+
experimental: [ false ]
40+
coverage: [ xdebug, none ]
41+
composer_flags: [ "--prefer-lowest", "" ]
42+
include:
43+
- php-version: "8.1"
44+
experimental: true
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v2
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Setup PHP
52+
uses: shivammathur/setup-php@v2
53+
with:
54+
php-version: ${{ matrix.php-version }}
55+
coverage: ${{ matrix.coverage }}
56+
tools: composer
57+
58+
- name: Build the Project
59+
continue-on-error: ${{ matrix.experimental }}
60+
run: make update --no-print-directory
61+
62+
- name: 🧪 PHPUnit Tests
63+
continue-on-error: ${{ matrix.experimental }}
64+
run: make test --no-print-directory
65+
66+
- name: Upload Artifacts
67+
uses: actions/upload-artifact@v2
68+
with:
69+
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
70+
path: build/
71+
72+
73+
linters:
74+
name: Linters
75+
runs-on: ubuntu-latest
76+
strategy:
77+
matrix:
78+
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
79+
experimental: [ false ]
80+
include:
81+
- php-version: "8.1"
82+
experimental: true
83+
steps:
84+
- name: Checkout code
85+
uses: actions/checkout@v2
86+
with:
87+
fetch-depth: 0
88+
89+
- name: Setup PHP
90+
uses: shivammathur/setup-php@v2
91+
with:
92+
php-version: ${{ matrix.php-version }}
93+
tools: composer
94+
95+
- name: Build the Project
96+
continue-on-error: ${{ matrix.experimental }}
97+
run: make update --no-print-directory
98+
99+
- name: 👍 Code Quality
100+
continue-on-error: ${{ matrix.experimental }}
101+
run: make codestyle --no-print-directory
102+
103+
- name: Upload Artifacts
104+
uses: actions/upload-artifact@v2
105+
with:
106+
name: Linters - ${{ matrix.php-version }}
107+
path: build/
108+
109+
110+
report:
111+
name: Reports
112+
runs-on: ubuntu-latest
113+
strategy:
114+
matrix:
115+
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
116+
experimental: [ false ]
117+
include:
118+
- php-version: "8.1"
119+
experimental: true
120+
steps:
121+
- name: Checkout code
122+
uses: actions/checkout@v2
123+
with:
124+
fetch-depth: 0
125+
126+
- name: Setup PHP
127+
uses: shivammathur/setup-php@v2
128+
with:
129+
php-version: ${{ matrix.php-version }}
130+
tools: composer
131+
132+
- name: Build the Project
133+
continue-on-error: ${{ matrix.experimental }}
134+
run: make update --no-print-directory
135+
136+
- name: 📝 Build Reports
137+
continue-on-error: ${{ matrix.experimental }}
138+
run: make report-all --no-print-directory
139+
140+
- name: Upload Artifacts
141+
uses: actions/upload-artifact@v2
142+
with:
143+
name: Reports - ${{ matrix.php-version }}
144+
path: build/

.phan/config.php renamed to .phan.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
declare(strict_types=1);
1717

18-
$default = include __DIR__ . '/../vendor/jbzoo/codestyle/src/phan/default.php';
18+
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php';
1919

2020
$config = array_merge($default, [
2121
'file_list' => [
@@ -34,4 +34,9 @@
3434

3535
$config['plugins'][] = 'NotFullyQualifiedUsagePlugin';
3636

37+
$configIndex = array_search('UnusedSuppressionPlugin', $config['plugins'], true);
38+
if ($configIndex !== false) {
39+
unset($config['plugins'][$configIndex]);
40+
}
41+
3742
return $config;

.travis.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,22 @@ language: php
1515
os: linux
1616
dist: xenial
1717

18+
git:
19+
depth: false
20+
1821
php:
1922
- 7.2
2023
- 7.3
2124
- 7.4
2225
- 8.0
23-
- nightly
24-
25-
jobs:
26-
fast_finish: true
27-
allow_failures:
28-
- php: 8.0
29-
- php: nightly
3026

3127
env:
3228
matrix:
3329
- JBZOO_COMPOSER_UPDATE_FLAGS="--prefer-lowest --prefer-stable"
3430
- JBZOO_COMPOSER_UPDATE_FLAGS=""
35-
- XDEBUG_OFF="yes"
3631

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

4235
script:
4336
- make update --no-print-directory

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ endif
1818
update: ##@Project Install/Update all 3rd party dependencies
1919
$(call title,"Install/Update all 3rd party dependencies")
2020
@echo "Composer flags: $(JBZOO_COMPOSER_UPDATE_FLAGS)"
21-
@composer update $(JBZOO_COMPOSER_UPDATE_FLAGS)
21+
@composer update --no-progress $(JBZOO_COMPOSER_UPDATE_FLAGS)
2222

2323

2424
test-all: ##@Project Run all project tests at once
2525
@make test
26-
@make test-performance-travis
2726
@make codestyle

composer.json

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
{
2-
"name" : "jbzoo/data",
3-
"type" : "library",
4-
"description" : "An extended version of the ArrayObject object for working with system settings or just for working with data arrays",
5-
"license" : "MIT",
6-
"keywords" : ["ArrayObject", "Array", "Config", "Data", "ini", "yml", "params", "json"],
7-
"authors" : [
2+
"name" : "jbzoo/data",
3+
"type" : "library",
4+
"description" : "An extended version of the ArrayObject object for working with system settings or just for working with data arrays",
5+
"license" : "MIT",
6+
"keywords" : ["ArrayObject", "Array", "Config", "Data", "ini", "yml", "params", "json"],
7+
"authors" : [
88
{
99
"name" : "Denis Smetannikov",
1010
"email" : "[email protected]",
1111
"role" : "lead"
1212
}
1313
],
14-
"require" : {
14+
"require" : {
1515
"php" : ">=7.2",
1616
"ext-json" : "*"
1717
},
1818

19-
"require-dev" : {
20-
"jbzoo/toolbox-dev" : "^2.9.2",
21-
"jbzoo/utils" : "^4.2.3",
22-
"symfony/yaml" : "^5.2.2"
19+
"require-dev" : {
20+
"jbzoo/toolbox-dev" : "^2.13.0",
21+
"jbzoo/utils" : "^4.4.0",
22+
"symfony/yaml" : "^4.4|^5.0"
2323
},
2424

25-
"suggest" : {
25+
"suggest" : {
2626
"symfony/yaml" : ">=4.4",
2727
"jbzoo/utils" : ">=4.2.2"
2828
},
2929

30-
"autoload" : {
30+
"autoload" : {
3131
"files" : [
3232
"src/functions.php"
3333
],
@@ -36,18 +36,15 @@
3636
}
3737
},
3838

39-
"minimum-stability" : "dev",
40-
"prefer-stable" : true,
41-
42-
"autoload-dev" : {
39+
"autoload-dev" : {
4340
"classmap" : ["tests"]
4441
},
4542

46-
"config" : {
43+
"config" : {
4744
"optimize-autoloader" : true
4845
},
4946

50-
"extra" : {
47+
"extra" : {
5148
"branch-alias" : {
5249
"dev-master" : "4.x-dev"
5350
}

src/Data.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public function find(string $key, $default = null, $filter = null, string $separ
167167
}
168168

169169
// explode search key and init search data
170+
/** @phan-suppress-next-line PhanRedundantCondition */
170171
$parts = (array)\explode($separator, $key);
171172
$data = $this;
172173

src/PhpArray.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ protected function decode(string $string)
4848
if (\file_exists($string)) {
4949
return include $string;
5050
}
51+
52+
return null;
5153
}
5254

5355
/**

tests/autoload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
// @codingStandardsIgnoreFile
2121

2222
// main autoload
23-
if ($autoload = realpath('./vendor/autoload.php')) {
23+
if ($autoload = dirname(__DIR__) . '/vendor/autoload.php') {
2424
require_once $autoload;
2525
} else {
2626
echo 'Please execute "composer update" !' . PHP_EOL;
2727
exit(1);
2828
}
2929

3030
if ($fixturesPath = realpath(PROJECT_TESTS . '/fixtures.php')) {
31-
require_once PROJECT_TESTS . '/fixtures.php';
31+
require_once $fixturesPath;
3232
}

0 commit comments

Comments
 (0)