Skip to content

Commit 9258478

Browse files
authored
Symfony 7 compatibility (#7)
1 parent 0f6f708 commit 9258478

File tree

5 files changed

+54
-19
lines changed

5 files changed

+54
-19
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ jobs:
2424
strategy:
2525
matrix:
2626
php: ['8.0', '8.1', '8.2', '8.3']
27-
symfony_version: ['5.4.*', '6.0.*', '6.1.*', '6.2.*' , '6.3.*', '6.4.*']
27+
symfony_version: ['5.4.*', '6.0.*', '6.1.*', '6.2.*' , '6.3.*', '6.4.*', '7.0.*']
2828
composer-flags: ['--prefer-stable']
2929
exclude:
30-
- php: '8.0'
31-
symfony_version: '5.4.*' # Exclusion due to issues with ECS
3230
- php: '8.0'
3331
symfony_version: '6.1.*' # Requires PHP >= 8.1 for compatibility
3432
- php: '8.0'
@@ -37,8 +35,12 @@ jobs:
3735
symfony_version: '6.3.*' # Requires PHP >= 8.1 for compatibility
3836
- php: '8.0'
3937
symfony_version: '6.4.*' # Requires PHP >= 8.1 for compatibility
38+
- php: '8.0'
39+
symfony_version: '7.0.*' # Requires PHP >= 8.2 for compatibility
40+
- php: '8.1'
41+
symfony_version: '7.0.*' # Requires PHP >= 8.2 for compatibility
4042
steps:
41-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4244

4345
- name: Setup PHP
4446
id: setup-php
@@ -63,16 +65,33 @@ jobs:
6365
run: echo "dir="$(composer config cache-files-dir)"" >> $GITHUB_OUTPUT
6466

6567
- name: Cache dependencies
66-
uses: actions/cache@v3
68+
uses: actions/cache@v4
6769
with:
6870
path: ${{ steps.composer-cache.outputs.dir }}
6971
key: "key-os-${{ runner.os }}-php-${{matrix.php}}-symfony-${{ matrix.symfony_version }}-composer-${{ hashFiles('composer.json') }}"
7072
restore-keys: "key-os-${{ runner.os }}-php-${{matrix.php}}-symfony-${{ matrix.symfony_version }}-composer-"
7173

74+
- name: Remove ECS for PHP 8.0
75+
if: ${{ matrix.php == '8.0' }}
76+
run: jq 'del(."require-dev"."symplify/coding-standard", ."require-dev"."symplify/easy-coding-standard")' --indent 4 composer.json > composer.json.tmp && mv composer.json.tmp composer.json
77+
env:
78+
SYMFONY_REQUIRE: ${{ matrix.symfony_version }}
79+
80+
- name: Install composer dependencies with nikic/php-parser:^4.0
81+
if: ${{ matrix.php == '8.0' }}
82+
run: composer require --dev nikic/php-parser:^4.0 ${{ matrix.composer-flags }}
83+
env:
84+
SYMFONY_REQUIRE: ${{ matrix.symfony_version }}
85+
7286
- name: Install composer dependencies
87+
if: ${{ matrix.php != '8.0' }}
7388
run: composer update ${{ matrix.composer-flags }}
7489
env:
7590
SYMFONY_REQUIRE: ${{ matrix.symfony_version }}
7691

7792
- name: Launch test suite
7893
run: make test
94+
95+
- name: Launch ECS
96+
if: ${{ matrix.php != '8.0' }}
97+
run: make ecs

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
test:
2-
@vendor/bin/grumphp run --no-interaction
2+
@vendor/bin/grumphp run --testsuite=default --no-interaction
3+
4+
ecs:
5+
@vendor/bin/grumphp run --testsuite=ecs --no-interaction
36

47
fix:
58
@vendor/bin/ecs check --fix

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@
88
"ext-json": "*",
99
"composer-plugin-api": "^2.3",
1010
"colinodell/indentation": "^1.0",
11-
"symfony/config": "^5.4 || ^6.0",
12-
"symfony/dependency-injection": "^5.4 || ^6.0",
13-
"symfony/filesystem": "^5.4 || ^6.0",
14-
"symfony/finder": "^5.4 || ^6.0",
15-
"symfony/options-resolver": "^5.4 || ^6.0",
16-
"symfony/validator": "^5.4 || ^6.0",
17-
"symfony/var-exporter": "^5.4 || ^6.0",
18-
"symfony/yaml": "^5.4 || ^6.0"
11+
"symfony/config": "^5.4 || ^6.0 || ^7.0",
12+
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
13+
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
14+
"symfony/finder": "^5.4 || ^6.0 || ^7.0",
15+
"symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
16+
"symfony/validator": "^5.4 || ^6.0 || ^7.0",
17+
"symfony/var-exporter": "^5.4 || ^6.0 || ^7.0",
18+
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
1919
},
2020
"require-dev": {
2121
"composer/composer": "^2.3",
2222
"ergebnis/composer-normalize": "^2.29",
2323
"kubawerlos/php-cs-fixer-custom-fixers": "^3.11",
2424
"mockery/mockery": "^1.5",
25-
"nikic/php-parser": "^4.15",
25+
"nikic/php-parser": "^4.15 || ^5.0",
2626
"php-parallel-lint/php-parallel-lint": "^1.3",
2727
"phpro/grumphp": "^1.13 || ^2.4",
2828
"phpunit/phpunit": "^9.5.22",
2929
"roave/security-advisories": "dev-latest",
30-
"symfony/var-dumper": "^5.4 || ^6.0",
31-
"symplify/coding-standard": "^11.0",
32-
"symplify/easy-coding-standard": "^11.0"
30+
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
31+
"symplify/coding-standard": "^12.0",
32+
"symplify/easy-coding-standard": "^12.0"
3333
},
3434
"minimum-stability": "dev",
3535
"prefer-stable": true,

grumphp.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,16 @@ grumphp:
5252
- 'function dump'
5353
triggered_by: ['php']
5454
regexp_type: G
55+
testsuites:
56+
default:
57+
tasks:
58+
- phpunit
59+
- composer
60+
- composer_normalize
61+
- phplint
62+
- phpparser
63+
- git_commit_message
64+
- git_blacklist
65+
ecs:
66+
tasks:
67+
- ecs

src/Merger/PhpArrayMerger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function merge(array $file): void
3030
$this->state->getProjectDirectory(),
3131
$this->state->replacePathPlaceholders($file['destination']),
3232
);
33-
$output = $this->filesystem->exists($destinationPathname) ? require($destinationPathname) : [];
33+
$output = $this->filesystem->exists($destinationPathname) ? require ($destinationPathname) : [];
3434
$changedCount = 0;
3535

3636
foreach ($file['entries'] as $key => $value) {

0 commit comments

Comments
 (0)