From d3a9425fa8cbe8f25ffbca5fdd43948072968b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 17 Mar 2024 18:57:55 +0100 Subject: [PATCH] Enhancement: Enable namespaces option of no_unneeded_braces fixer --- CHANGELOG.md | 2 ++ src/RuleSet/Php53.php | 2 +- src/RuleSet/Php54.php | 2 +- src/RuleSet/Php55.php | 2 +- src/RuleSet/Php56.php | 2 +- src/RuleSet/Php70.php | 2 +- src/RuleSet/Php71.php | 2 +- src/RuleSet/Php72.php | 2 +- src/RuleSet/Php73.php | 2 +- src/RuleSet/Php74.php | 2 +- src/RuleSet/Php80.php | 2 +- src/RuleSet/Php81.php | 2 +- src/RuleSet/Php82.php | 2 +- src/RuleSet/Php83.php | 2 +- test/Unit/RuleSet/Php53Test.php | 2 +- test/Unit/RuleSet/Php54Test.php | 2 +- test/Unit/RuleSet/Php55Test.php | 2 +- test/Unit/RuleSet/Php56Test.php | 2 +- test/Unit/RuleSet/Php70Test.php | 2 +- test/Unit/RuleSet/Php71Test.php | 2 +- test/Unit/RuleSet/Php72Test.php | 2 +- test/Unit/RuleSet/Php73Test.php | 2 +- test/Unit/RuleSet/Php74Test.php | 2 +- test/Unit/RuleSet/Php80Test.php | 2 +- test/Unit/RuleSet/Php81Test.php | 2 +- test/Unit/RuleSet/Php82Test.php | 2 +- test/Unit/RuleSet/Php83Test.php | 2 +- 27 files changed, 28 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be3528f6..3f7c47be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ For a full diff see [`6.23.0...main`][6.23.0...main]. - Updated `kubawerlos/php-cs-fixer-custom-fixers` ([#1025]), by [@dependabot] - Updated `friendsofphp/php-cs-fixer` ([#1026]), by [@dependabot] +- Enabled the `namespaces` option of `no_uneeded_braces` fixer ([#1036]), by [@localheinz] ## [`6.23.0`][6.23.0] @@ -1569,6 +1570,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#1023]: https://github.com/ergebnis/php-cs-fixer-config/pull/1023 [#1025]: https://github.com/ergebnis/php-cs-fixer-config/pull/1025 [#1026]: https://github.com/ergebnis/php-cs-fixer-config/pull/1026 +[#1036]: https://github.com/ergebnis/php-cs-fixer-config/pull/1036 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/RuleSet/Php53.php b/src/RuleSet/Php53.php index 4ee07368..0fa90221 100644 --- a/src/RuleSet/Php53.php +++ b/src/RuleSet/Php53.php @@ -387,7 +387,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php54.php b/src/RuleSet/Php54.php index 4602f28f..856767c0 100644 --- a/src/RuleSet/Php54.php +++ b/src/RuleSet/Php54.php @@ -388,7 +388,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php55.php b/src/RuleSet/Php55.php index fbb25289..2d939129 100644 --- a/src/RuleSet/Php55.php +++ b/src/RuleSet/Php55.php @@ -392,7 +392,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php56.php b/src/RuleSet/Php56.php index 738524d9..1f3d58f4 100644 --- a/src/RuleSet/Php56.php +++ b/src/RuleSet/Php56.php @@ -392,7 +392,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php70.php b/src/RuleSet/Php70.php index 530639df..9f3f9908 100644 --- a/src/RuleSet/Php70.php +++ b/src/RuleSet/Php70.php @@ -392,7 +392,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php71.php b/src/RuleSet/Php71.php index 6b1dcdb8..5916e238 100644 --- a/src/RuleSet/Php71.php +++ b/src/RuleSet/Php71.php @@ -392,7 +392,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php72.php b/src/RuleSet/Php72.php index 7ef1d293..dde9a475 100644 --- a/src/RuleSet/Php72.php +++ b/src/RuleSet/Php72.php @@ -392,7 +392,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php73.php b/src/RuleSet/Php73.php index d80b0ff0..47992eee 100644 --- a/src/RuleSet/Php73.php +++ b/src/RuleSet/Php73.php @@ -392,7 +392,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index b59d3f5f..0f9ac240 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -392,7 +392,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 7aaf5bc4..eb87c336 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -400,7 +400,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index 193cc129..c549c95c 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -401,7 +401,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php82.php b/src/RuleSet/Php82.php index 286adf64..48d23f38 100644 --- a/src/RuleSet/Php82.php +++ b/src/RuleSet/Php82.php @@ -401,7 +401,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/src/RuleSet/Php83.php b/src/RuleSet/Php83.php index 609e2f7d..dd003197 100644 --- a/src/RuleSet/Php83.php +++ b/src/RuleSet/Php83.php @@ -401,7 +401,7 @@ public static function create(): RuleSet 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php53Test.php b/test/Unit/RuleSet/Php53Test.php index 0a60e334..017bdfa5 100644 --- a/test/Unit/RuleSet/Php53Test.php +++ b/test/Unit/RuleSet/Php53Test.php @@ -410,7 +410,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php54Test.php b/test/Unit/RuleSet/Php54Test.php index 13009621..3e8a19da 100644 --- a/test/Unit/RuleSet/Php54Test.php +++ b/test/Unit/RuleSet/Php54Test.php @@ -411,7 +411,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php55Test.php b/test/Unit/RuleSet/Php55Test.php index ed0be421..793ca4cb 100644 --- a/test/Unit/RuleSet/Php55Test.php +++ b/test/Unit/RuleSet/Php55Test.php @@ -415,7 +415,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php56Test.php b/test/Unit/RuleSet/Php56Test.php index 41c7a51f..f44a3c7b 100644 --- a/test/Unit/RuleSet/Php56Test.php +++ b/test/Unit/RuleSet/Php56Test.php @@ -415,7 +415,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php70Test.php b/test/Unit/RuleSet/Php70Test.php index 2bac8f2e..7b57fdc2 100644 --- a/test/Unit/RuleSet/Php70Test.php +++ b/test/Unit/RuleSet/Php70Test.php @@ -415,7 +415,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php71Test.php b/test/Unit/RuleSet/Php71Test.php index 4ab09da2..2b6b572b 100644 --- a/test/Unit/RuleSet/Php71Test.php +++ b/test/Unit/RuleSet/Php71Test.php @@ -415,7 +415,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php72Test.php b/test/Unit/RuleSet/Php72Test.php index 3b0c8632..87fa82ee 100644 --- a/test/Unit/RuleSet/Php72Test.php +++ b/test/Unit/RuleSet/Php72Test.php @@ -415,7 +415,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php73Test.php b/test/Unit/RuleSet/Php73Test.php index fbcc2203..7db10c1a 100644 --- a/test/Unit/RuleSet/Php73Test.php +++ b/test/Unit/RuleSet/Php73Test.php @@ -415,7 +415,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index b1b8e5f7..8b907f73 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -415,7 +415,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index d89d8c0f..b635e65d 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -423,7 +423,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index 1568e0e4..5b2b4d0c 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -424,7 +424,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php82Test.php b/test/Unit/RuleSet/Php82Test.php index 41105b3e..fb1a9255 100644 --- a/test/Unit/RuleSet/Php82Test.php +++ b/test/Unit/RuleSet/Php82Test.php @@ -424,7 +424,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [ diff --git a/test/Unit/RuleSet/Php83Test.php b/test/Unit/RuleSet/Php83Test.php index 326637e4..cb2b155d 100644 --- a/test/Unit/RuleSet/Php83Test.php +++ b/test/Unit/RuleSet/Php83Test.php @@ -424,7 +424,7 @@ protected function expectedRules(): Rules 'no_trailing_whitespace_in_comment' => true, 'no_trailing_whitespace_in_string' => true, 'no_unneeded_braces' => [ - 'namespaces' => false, + 'namespaces' => true, ], 'no_unneeded_control_parentheses' => [ 'statements' => [