Skip to content

Commit 4589cb3

Browse files
authored
Add PHP 8.4 compatibility and improve testing configurations (#29)
Update GitHub Actions workflow to include PHP 8.4 in the testing matrix. Modify the test file to define supported PHP versions in a centralized method, ensuring consistency. Additionally, create a phpstan.neon file for improved static analysis with strict rules. These changes enhance the project's compatibility with the latest PHP version, ensure better test coverage, and facilitate improved code quality through static analysis.
1 parent eaf5e09 commit 4589cb3

File tree

4 files changed

+48
-14
lines changed

4 files changed

+48
-14
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
3535
strategy:
3636
matrix:
37-
php-version: [ 8.1, 8.2, 8.3 ]
37+
php-version: [ 8.1, 8.2, 8.3, 8.4 ]
3838
coverage: [ xdebug, none ]
3939
composer_flags: [ "--prefer-lowest", "" ]
4040
steps:
@@ -65,7 +65,7 @@ jobs:
6565
run: make report-coveralls --no-print-directory || true
6666

6767
- name: Upload Artifacts
68-
uses: actions/upload-artifact@v3
68+
uses: actions/upload-artifact@v4
6969
continue-on-error: true
7070
with:
7171
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
@@ -77,7 +77,7 @@ jobs:
7777
runs-on: ubuntu-latest
7878
strategy:
7979
matrix:
80-
php-version: [ 8.1, 8.2, 8.3 ]
80+
php-version: [ 8.1, 8.2, 8.3, 8.4 ]
8181
steps:
8282
- name: Checkout code
8383
uses: actions/checkout@v3
@@ -99,7 +99,7 @@ jobs:
9999
run: make codestyle --no-print-directory
100100

101101
- name: Upload Artifacts
102-
uses: actions/upload-artifact@v3
102+
uses: actions/upload-artifact@v4
103103
continue-on-error: true
104104
with:
105105
name: Linters - ${{ matrix.php-version }}
@@ -111,7 +111,7 @@ jobs:
111111
runs-on: ubuntu-latest
112112
strategy:
113113
matrix:
114-
php-version: [ 8.1, 8.2, 8.3 ]
114+
php-version: [ 8.1, 8.2, 8.3, 8.4 ]
115115
steps:
116116
- name: Checkout code
117117
uses: actions/checkout@v3
@@ -133,7 +133,7 @@ jobs:
133133
run: make report-all --no-print-directory
134134

135135
- name: Upload Artifacts
136-
uses: actions/upload-artifact@v3
136+
uses: actions/upload-artifact@v4
137137
continue-on-error: true
138138
with:
139139
name: Reports - ${{ matrix.php-version }}

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@
3434
"prefer-stable" : true,
3535

3636
"require" : {
37-
"php" : "^8.1",
37+
"php" : "^8.1",
3838

39-
"jbzoo/utils" : "^7.1",
40-
"jbzoo/event" : "^7.0",
39+
"jbzoo/utils" : "^7.1",
40+
"jbzoo/event" : "^7.0",
4141

42-
"symfony/process" : ">=6.4",
43-
"symfony/console" : ">=6.4",
44-
"symfony/lock" : ">=6.4",
45-
"bluepsyduck/symfony-process-manager" : ">=1.3.3",
46-
"monolog/monolog" : "^3.4"
42+
"symfony/process" : ">=6.4",
43+
"symfony/console" : ">=6.4",
44+
"symfony/lock" : ">=6.4",
45+
"smetdenis/symfony-process-manager" : ">=1.3.3",
46+
"monolog/monolog" : "^3.4"
4747
},
4848

4949
"require-dev" : {

phpstan.neon

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# JBZoo Toolbox - Cli.
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+
# @license MIT
9+
# @copyright Copyright (C) JBZoo.com, All rights reserved.
10+
# @see https://github.com/JBZoo/Cli
11+
#
12+
13+
includes:
14+
- ./vendor/phpstan/phpstan-strict-rules/rules.neon
15+
16+
parameters:
17+
level: max
18+
checkExplicitMixed: false
19+
reportUnmatchedIgnoredErrors: false

tests/CliPackageTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,19 @@ protected function setUp(): void
2626

2727
$this->excludePaths[] = '.github/assets';
2828
}
29+
30+
protected static function phpVersions(): array
31+
{
32+
return [8.1, 8.2, 8.3, 8.4];
33+
}
34+
35+
protected static function uploadArtifactsStep(string $stepName): array
36+
{
37+
return [
38+
'name' => 'Upload Artifacts',
39+
'uses' => 'actions/upload-artifact@v4',
40+
'continue-on-error' => true,
41+
'with' => ['name' => $stepName, 'path' => 'build/'],
42+
];
43+
}
2944
}

0 commit comments

Comments
 (0)