Skip to content

Commit 16985b8

Browse files
authored
[BUGFIX] Restore PHP 7.2 compatibility (#85)
This patch reverts with PHP-CS-Fixer for PHP 7.2 incompatible changes again.
1 parent dd8ca5a commit 16985b8

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ jobs:
213213
run: composer update ${{ env.COMPOSER_UPDATE_FLAGS }} ${{ env.COMPOSER_INSTALL_FLAGS }} ${{ env.COMPOSER_FLAGS }}
214214

215215
- name: Validation of coding standards for PHP files
216+
env:
217+
PHP_CS_FIXER_IGNORE_ENV: 1
216218
continue-on-error: ${{ matrix.experimental }}
217219
run: composer ci:php:cs
218220

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"require": {
3232
"php": "^7.2 || ^8.0",
3333
"ext-json": "*",
34-
"friendsofphp/php-cs-fixer": "^3.11",
34+
"friendsofphp/php-cs-fixer": "^3.0",
3535
"symfony/console": "^4.4.30 || ^5.3.7 || ^6.0",
3636
"symfony/filesystem": "^4.4 || ^5.0 || ^6.0"
3737
},

src/CsFixerConfig.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class CsFixerConfig extends Config implements CsFixerConfigInterface
4141
*/
4242
protected static $typo3Rules = [
4343
'@DoctrineAnnotation' => true,
44-
'@PER' => true,
44+
'@PSR2' => true,
4545
'array_syntax' => ['syntax' => 'short'],
4646
'blank_line_after_opening_tag' => true,
4747
'braces' => ['allow_single_line_closure' => true],
@@ -68,11 +68,10 @@ class CsFixerConfig extends Config implements CsFixerConfigInterface
6868
'no_short_bool_cast' => true,
6969
'no_singleline_whitespace_before_semicolons' => true,
7070
'no_superfluous_elseif' => true,
71-
'no_trailing_comma_in_singleline' => true,
71+
'no_trailing_comma_in_singleline_array' => true,
7272
'no_unneeded_control_parentheses' => true,
7373
'no_unused_imports' => true,
7474
'no_useless_else' => true,
75-
'no_useless_nullsafe_operator' => true,
7675
'no_whitespace_in_blank_line' => true,
7776
'ordered_imports' => true,
7877
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']],
@@ -90,7 +89,7 @@ class CsFixerConfig extends Config implements CsFixerConfigInterface
9089
'single_line_comment_style' => ['comment_types' => ['hash']],
9190
'single_trait_insert_per_statement' => true,
9291
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
93-
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
92+
'whitespace_after_comma_in_array' => true,
9493
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
9594
];
9695

tests/Unit/CsFixerConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testCreateReturnsCorrectClass(): void
2929
$csFixerConfig = CsFixerConfig::create();
3030
self::assertInstanceOf(CsFixerConfig::class, $csFixerConfig);
3131
self::assertTrue($csFixerConfig->getRiskyAllowed());
32-
self::assertCount(52, $csFixerConfig->getRules());
32+
self::assertCount(51, $csFixerConfig->getRules());
3333
}
3434

3535
public function testAddRules(): void

0 commit comments

Comments
 (0)