diff --git a/composer.json b/composer.json index 86860f9..fe47ab6 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,8 @@ "type": "library", "require": { "php": "^8.0", - "friendsofphp/php-cs-fixer": "^3.8.0", - "kubawerlos/php-cs-fixer-custom-fixers": "^3.11.0" + "friendsofphp/php-cs-fixer": "^3.9.2", + "kubawerlos/php-cs-fixer-custom-fixers": "^3.11.1" }, "require-dev": { "jetbrains/phpstorm-attributes": "^1.0", diff --git a/src/Configuration/Defaults/CommonRules.php b/src/Configuration/Defaults/CommonRules.php index bb61967..3afea5a 100644 --- a/src/Configuration/Defaults/CommonRules.php +++ b/src/Configuration/Defaults/CommonRules.php @@ -193,6 +193,7 @@ class CommonRules extends Rules "arrays", "parameters", "arguments", + "match", ], ], NullableTypeDeclarationForDefaultNullValueFixer::class => true, diff --git a/tests/codestyle/fixtures/trailingCommas/actual.php b/tests/codestyle/fixtures/trailingCommas/actual.php index bbbe23d..f1651a6 100644 --- a/tests/codestyle/fixtures/trailingCommas/actual.php +++ b/tests/codestyle/fixtures/trailingCommas/actual.php @@ -25,4 +25,13 @@ public function testArrays(): array 3 ]; } + + public function match(int $i): int + { + return match ($i) { + 1 => 1, + 2 => 3, + default => 0 + }; + } } diff --git a/tests/codestyle/fixtures/trailingCommas/expected.php b/tests/codestyle/fixtures/trailingCommas/expected.php index 272572f..8d19bef 100644 --- a/tests/codestyle/fixtures/trailingCommas/expected.php +++ b/tests/codestyle/fixtures/trailingCommas/expected.php @@ -27,4 +27,13 @@ public function testArrays(): array 3, ]; } + + public function match(int $i): int + { + return match ($i) { + 1 => 1, + 2 => 3, + default => 0, + }; + } }