From 23ed5f27d980cc32d23c05073d2b70906302800f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 2 Sep 2024 13:34:41 +0200 Subject: [PATCH] Enhancement: Configure trailing_comma_in_multiline fixer to include array_destructuring in elements option --- CHANGELOG.md | 3 +++ src/RuleSet/Php71.php | 1 + src/RuleSet/Php72.php | 1 + src/RuleSet/Php73.php | 1 + src/RuleSet/Php74.php | 1 + src/RuleSet/Php80.php | 1 + src/RuleSet/Php81.php | 1 + src/RuleSet/Php82.php | 1 + src/RuleSet/Php83.php | 1 + test/Unit/RuleSet/Php71Test.php | 1 + test/Unit/RuleSet/Php72Test.php | 1 + test/Unit/RuleSet/Php73Test.php | 1 + test/Unit/RuleSet/Php74Test.php | 1 + test/Unit/RuleSet/Php80Test.php | 1 + test/Unit/RuleSet/Php81Test.php | 1 + test/Unit/RuleSet/Php82Test.php | 1 + test/Unit/RuleSet/Php83Test.php | 1 + 17 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7da2968f..d4f5bc86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ For a full diff see [`6.35.0...main`][6.35.0...main]. - Updated `kubawerlos/php-cs-fixer-custom-fixers` ([#1095]), by [@dependabot] - Updated `friendsofphp/php-cs-fixer` ([#1102]), by [@dependabot] +- Configured `trailing_comma_in_multiline` fixer to include `array_destructuring` in the `elements` option ([#1103]), by [@localheinz] + ## [`6.35.0`][6.35.0] @@ -1742,6 +1744,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#1093]: https://github.com/ergebnis/php-cs-fixer-config/pull/1093 [#1095]: https://github.com/ergebnis/php-cs-fixer-config/pull/1095 [#1102]: https://github.com/ergebnis/php-cs-fixer-config/pull/1102 +[#1103]: https://github.com/ergebnis/php-cs-fixer-config/pull/1103 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/RuleSet/Php71.php b/src/RuleSet/Php71.php index 4f96d150..3585dc2b 100644 --- a/src/RuleSet/Php71.php +++ b/src/RuleSet/Php71.php @@ -844,6 +844,7 @@ public static function create(): RuleSet 'trailing_comma_in_multiline' => [ 'after_heredoc' => false, 'elements' => [ + 'array_destructuring', 'arrays', ], ], diff --git a/src/RuleSet/Php72.php b/src/RuleSet/Php72.php index f7cfb6c2..8dcaeefc 100644 --- a/src/RuleSet/Php72.php +++ b/src/RuleSet/Php72.php @@ -844,6 +844,7 @@ public static function create(): RuleSet 'trailing_comma_in_multiline' => [ 'after_heredoc' => false, 'elements' => [ + 'array_destructuring', 'arrays', ], ], diff --git a/src/RuleSet/Php73.php b/src/RuleSet/Php73.php index 9d477c4c..a87061fe 100644 --- a/src/RuleSet/Php73.php +++ b/src/RuleSet/Php73.php @@ -845,6 +845,7 @@ public static function create(): RuleSet 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', ], ], diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index 53b2b3da..5fdd9ac1 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -848,6 +848,7 @@ public static function create(): RuleSet 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', ], ], diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 1280ac48..fe1439b5 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -865,6 +865,7 @@ public static function create(): RuleSet 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', 'match', 'parameters', diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index 5d0c8a6d..8902d96a 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -868,6 +868,7 @@ public static function create(): RuleSet 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', 'match', 'parameters', diff --git a/src/RuleSet/Php82.php b/src/RuleSet/Php82.php index a4531da2..25aa5925 100644 --- a/src/RuleSet/Php82.php +++ b/src/RuleSet/Php82.php @@ -868,6 +868,7 @@ public static function create(): RuleSet 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', 'match', 'parameters', diff --git a/src/RuleSet/Php83.php b/src/RuleSet/Php83.php index 23c6c463..e9c8971e 100644 --- a/src/RuleSet/Php83.php +++ b/src/RuleSet/Php83.php @@ -868,6 +868,7 @@ public static function create(): RuleSet 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', 'match', 'parameters', diff --git a/test/Unit/RuleSet/Php71Test.php b/test/Unit/RuleSet/Php71Test.php index cc95c977..ec6dce9e 100644 --- a/test/Unit/RuleSet/Php71Test.php +++ b/test/Unit/RuleSet/Php71Test.php @@ -867,6 +867,7 @@ protected function expectedRules(): Rules 'trailing_comma_in_multiline' => [ 'after_heredoc' => false, 'elements' => [ + 'array_destructuring', 'arrays', ], ], diff --git a/test/Unit/RuleSet/Php72Test.php b/test/Unit/RuleSet/Php72Test.php index 20638cd3..53e491cb 100644 --- a/test/Unit/RuleSet/Php72Test.php +++ b/test/Unit/RuleSet/Php72Test.php @@ -867,6 +867,7 @@ protected function expectedRules(): Rules 'trailing_comma_in_multiline' => [ 'after_heredoc' => false, 'elements' => [ + 'array_destructuring', 'arrays', ], ], diff --git a/test/Unit/RuleSet/Php73Test.php b/test/Unit/RuleSet/Php73Test.php index 78f87bbf..8bfd7d2f 100644 --- a/test/Unit/RuleSet/Php73Test.php +++ b/test/Unit/RuleSet/Php73Test.php @@ -868,6 +868,7 @@ protected function expectedRules(): Rules 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', ], ], diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 44a3d5de..a5dfeb10 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -871,6 +871,7 @@ protected function expectedRules(): Rules 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', ], ], diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index b9ec281a..d4d235bf 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -888,6 +888,7 @@ protected function expectedRules(): Rules 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', 'match', 'parameters', diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index 1b418fbb..341e822a 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -891,6 +891,7 @@ protected function expectedRules(): Rules 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', 'match', 'parameters', diff --git a/test/Unit/RuleSet/Php82Test.php b/test/Unit/RuleSet/Php82Test.php index d1705f5e..218b055a 100644 --- a/test/Unit/RuleSet/Php82Test.php +++ b/test/Unit/RuleSet/Php82Test.php @@ -891,6 +891,7 @@ protected function expectedRules(): Rules 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', 'match', 'parameters', diff --git a/test/Unit/RuleSet/Php83Test.php b/test/Unit/RuleSet/Php83Test.php index ab954b4f..ce369027 100644 --- a/test/Unit/RuleSet/Php83Test.php +++ b/test/Unit/RuleSet/Php83Test.php @@ -891,6 +891,7 @@ protected function expectedRules(): Rules 'after_heredoc' => false, 'elements' => [ 'arguments', + 'array_destructuring', 'arrays', 'match', 'parameters',