From 0ddf9cb972047ccf735ce2e935ae5f485d24f531 Mon Sep 17 00:00:00 2001 From: Paul Brand Date: Tue, 15 Oct 2024 10:15:21 +0200 Subject: [PATCH] Change trailing_comma fixer, the Symfony ruleset adjusted their configuration https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8161 https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8188 --- .github/workflows/php-cs-fixer.yml | 1 - .php-cs-fixer.dist.php | 2 +- composer.json | 2 +- src/PhpCsFixer/Rules.php | 12 +++++++++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 1396d1a..c0e7862 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -13,7 +13,6 @@ jobs: strategy: matrix: php-version: - - "7.4" - "8.0" - "8.1" - "8.2" diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 822b24c..089b623 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -16,4 +16,4 @@ return (new Config()) ->setFinder($finder) ->setRiskyAllowed(true) - ->setRules(Rules::getForPhp71($overrides)); + ->setRules(Rules::getForPhp80($overrides)); diff --git a/composer.json b/composer.json index 133d181..0957994 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": "^7.1.3 || ^8.0", - "friendsofphp/php-cs-fixer": "^3.40" + "friendsofphp/php-cs-fixer": "^3.64" }, "minimum-stability": "stable", "autoload": { diff --git a/src/PhpCsFixer/Rules.php b/src/PhpCsFixer/Rules.php index 9802235..98621b4 100644 --- a/src/PhpCsFixer/Rules.php +++ b/src/PhpCsFixer/Rules.php @@ -5,7 +5,7 @@ namespace Mollie\PhpCodingStandards\PhpCsFixer; /* - * Last updated for php-cs-fixer version: 3.40.2 + * Last updated for php-cs-fixer version: 3.64.0 */ class Rules { @@ -226,6 +226,16 @@ private static function getBaseRules(): array 'identical' => false, 'less_and_greater' => false, ], + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => true, + 'elements' => [ + 'arguments', + 'array_destructuring', + 'arrays', + 'match', + 'parameters', + ], + ], ]; } }