Skip to content

Commit

Permalink
[BUGFIX] Restore PHP 7.2 compatibility (#85)
Browse files Browse the repository at this point in the history
This patch reverts with PHP-CS-Fixer for PHP 7.2 incompatible changes again.
  • Loading branch information
gilbertsoft authored Dec 20, 2022
1 parent dd8ca5a commit 16985b8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ jobs:
run: composer update ${{ env.COMPOSER_UPDATE_FLAGS }} ${{ env.COMPOSER_INSTALL_FLAGS }} ${{ env.COMPOSER_FLAGS }}

- name: Validation of coding standards for PHP files
env:
PHP_CS_FIXER_IGNORE_ENV: 1
continue-on-error: ${{ matrix.experimental }}
run: composer ci:php:cs

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"require": {
"php": "^7.2 || ^8.0",
"ext-json": "*",
"friendsofphp/php-cs-fixer": "^3.11",
"friendsofphp/php-cs-fixer": "^3.0",
"symfony/console": "^4.4.30 || ^5.3.7 || ^6.0",
"symfony/filesystem": "^4.4 || ^5.0 || ^6.0"
},
Expand Down
7 changes: 3 additions & 4 deletions src/CsFixerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CsFixerConfig extends Config implements CsFixerConfigInterface
*/
protected static $typo3Rules = [
'@DoctrineAnnotation' => true,
'@PER' => true,
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => true,
'braces' => ['allow_single_line_closure' => true],
Expand All @@ -68,11 +68,10 @@ class CsFixerConfig extends Config implements CsFixerConfigInterface
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_superfluous_elseif' => true,
'no_trailing_comma_in_singleline' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_nullsafe_operator' => true,
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']],
Expand All @@ -90,7 +89,7 @@ class CsFixerConfig extends Config implements CsFixerConfigInterface
'single_line_comment_style' => ['comment_types' => ['hash']],
'single_trait_insert_per_statement' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
'whitespace_after_comma_in_array' => true,
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
];

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/CsFixerConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testCreateReturnsCorrectClass(): void
$csFixerConfig = CsFixerConfig::create();
self::assertInstanceOf(CsFixerConfig::class, $csFixerConfig);
self::assertTrue($csFixerConfig->getRiskyAllowed());
self::assertCount(52, $csFixerConfig->getRules());
self::assertCount(51, $csFixerConfig->getRules());
}

public function testAddRules(): void
Expand Down

0 comments on commit 16985b8

Please sign in to comment.