From c4fe061a2e32aeadcff72ab603ab57159c69afd6 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Mon, 11 Nov 2024 17:02:34 +0100 Subject: [PATCH] phpcs: override trailing comma rule The @Symfony ruleSet comes with trailing_comma_in_multiline's elements set to ['array', 'array_destructuring', 'match', 'parameters']. However, 'parameters' breaks PHP 7.4 Reference: https://cs.symfony.com/doc/rules/control_structure/trailing_comma_in_multiline.html Signed-off-by: Kevin Decherf --- .php-cs-fixer.dist.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index e9e8e70f1..73bc89296 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -37,6 +37,17 @@ return $config // 'psr_autoloading' => true, 'strict_comparison' => true, 'strict_param' => true, + // We override next rule because of current @Symfony ruleSet + // 'parameters' element is breaking PHP 7.4 + // https://cs.symfony.com/doc/rules/control_structure/trailing_comma_in_multiline.html + // TODO: remove this configuration after dropping support of PHP 7.4 + 'trailing_comma_in_multiline' => [ + 'elements' => [ + 'arrays', + 'array_destructuring', + 'match', + ], + ], 'concat_space' => [ 'spacing' => 'one', ],