diff --git a/ecs.php b/ecs.php index 62d16a1..8a605a8 100644 --- a/ecs.php +++ b/ecs.php @@ -140,6 +140,7 @@ PhpUnitConstructFixer::class, PhpUnitDedicateAssertFixer::class, PhpUnitDedicateAssertInternalTypeFixer::class, + PhpUnitExpectationFixer::class, PhpUnitMethodCasingFixer::class, SelfStaticAccessorFixer::class, SemicolonAfterInstructionFixer::class, @@ -197,12 +198,10 @@ 'use', ]]); - // The check fails on PHP <8.0. See https://github.com/symplify/symplify/issues/3130 - if (\PHP_VERSION_ID >= 80000) { - $config->rule(PhpUnitExpectationFixer::class); - } - if (\PHP_VERSION_ID < 80000) { + // The check fails on PHP <8.0. See https://github.com/symplify/symplify/issues/3130 + $config->skip([PhpUnitExpectationFixer::class]); + // Override, parameters are only available in PHP 8+ $config->ruleWithConfiguration(TrailingCommaInMultilineFixer::class, ['elements' => ['arguments', 'arrays']]); } diff --git a/tests/errors/trailing_comma_in_multiline.php b/tests/errors/trailing_comma_in_multiline.php index 9541cc2..4421b3c 100644 --- a/tests/errors/trailing_comma_in_multiline.php +++ b/tests/errors/trailing_comma_in_multiline.php @@ -6,3 +6,12 @@ 'hello', 'yo' ]; + +class A { + public function analyse( + $a, + $b, + $c + ) { + } +}