<?php
use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->ruleWithConfiguration(TrailingCommaInMultilineFixer::class, [
'elements' => ['arrays', 'arguments', 'parameters', 'match'],
]);
};
Fatal error: Uncaught ECSPrefix202207\Symfony\Component\OptionsResolver\Exception\InvalidOptionsException: The option "elements" with value array is invalid. in /Users/anthony/Sites/whomar/vendor/symplify/easy-coding-standard/vendor/symfony/options-resolver/OptionsResolver.php:904
This configuration works:
<?php
use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->ruleWithConfiguration(TrailingCommaInMultilineFixer::class, [
'elements' => ['arrays', 'arguments', 'parameters'],
]);
};
I'm running into an issue when trying to configure
TrailingCommaInMultilineFixer
with the newmatch
rule added in 3.9.1.https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/6381 https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/tag/v3.9.1
I'm using ECS 11.0.8.
This configuration works: