From c2762c405ef60a6f111c7dc2148bd88b1d98c189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 19 Aug 2022 09:41:53 +0200 Subject: [PATCH 1/7] Fix: Require all configurable rules to be explicitly configured when enabled --- psalm-baseline.xml | 5 ---- test/Unit/RuleSet/ExplicitRuleSetTestCase.php | 30 ++++++++++++------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index d54e5399..7f63f94c 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -25,9 +25,4 @@ registerBuiltInFixers - - - static function (FixerConfiguration\FixerOptionInterface $fixerOption) { - - diff --git a/test/Unit/RuleSet/ExplicitRuleSetTestCase.php b/test/Unit/RuleSet/ExplicitRuleSetTestCase.php index 41124f5c..0f02051c 100644 --- a/test/Unit/RuleSet/ExplicitRuleSetTestCase.php +++ b/test/Unit/RuleSet/ExplicitRuleSetTestCase.php @@ -86,8 +86,8 @@ final public function testRuleSetConfiguresAllRulesThatAreConfigurableAndNotDepr $rulesWithAllNonDeprecatedConfigurationOptions = \array_combine( $namesOfRules, \array_map(static function (string $nameOfRule, $ruleConfiguration) use ($fixersThatAreBuiltIn) { - if (!\is_array($ruleConfiguration)) { - return $ruleConfiguration; + if (false === $ruleConfiguration) { + return false; } $fixer = $fixersThatAreBuiltIn[$nameOfRule]; @@ -106,15 +106,25 @@ final public function testRuleSetConfiguresAllRulesThatAreConfigurableAndNotDepr return !$fixerOption instanceof FixerConfiguration\DeprecatedFixerOptionInterface; }); + $ruleConfigurationWithAllNonDeprecatedConfigurationOptionsAndDefaultValues = \array_combine( + \array_map(static function (FixerConfiguration\FixerOptionInterface $fixerOption): string { + return $fixerOption->getName(); + }, $nonDeprecatedConfigurationOptions), + \array_map(static function (FixerConfiguration\FixerOptionInterface $fixerOption) { + if (!$fixerOption->hasDefault()) { + return null; + } + + return $fixerOption->getDefault(); + }, $nonDeprecatedConfigurationOptions), + ); + + if (!\is_array($ruleConfiguration)) { + return $ruleConfigurationWithAllNonDeprecatedConfigurationOptionsAndDefaultValues; + } + $diff = \array_diff_key( - \array_combine( - \array_map(static function (FixerConfiguration\FixerOptionInterface $fixerOption): string { - return $fixerOption->getName(); - }, $nonDeprecatedConfigurationOptions), - \array_map(static function (FixerConfiguration\FixerOptionInterface $fixerOption) { - return $fixerOption->getDefault(); - }, $nonDeprecatedConfigurationOptions), - ), + $ruleConfigurationWithAllNonDeprecatedConfigurationOptionsAndDefaultValues, $ruleConfiguration, ); From 2a440d202dc24ef5d716daaa2ac3b52c509ecaf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 19 Aug 2022 09:46:26 +0200 Subject: [PATCH 2/7] Fix: Explicitly configure whitespace_after_comma_in_array fixer --- src/RuleSet/Php74.php | 4 +++- src/RuleSet/Php80.php | 4 +++- src/RuleSet/Php81.php | 4 +++- test/Unit/RuleSet/Php74Test.php | 4 +++- test/Unit/RuleSet/Php80Test.php | 4 +++- test/Unit/RuleSet/Php81Test.php | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index 2ef918ac..a5619c30 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -746,7 +746,9 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet ], ], 'void_return' => true, - 'whitespace_after_comma_in_array' => true, + 'whitespace_after_comma_in_array' => [ + 'ensure_single_space' => false, + ], 'yoda_style' => [ 'always_move_variable' => true, 'equal' => true, diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 352a44a6..23643db0 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -749,7 +749,9 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet ], ], 'void_return' => true, - 'whitespace_after_comma_in_array' => true, + 'whitespace_after_comma_in_array' => [ + 'ensure_single_space' => false, + ], 'yoda_style' => [ 'always_move_variable' => true, 'equal' => true, diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index 52334ae1..bf13abcf 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -752,7 +752,9 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet ], ], 'void_return' => true, - 'whitespace_after_comma_in_array' => true, + 'whitespace_after_comma_in_array' => [ + 'ensure_single_space' => false, + ], 'yoda_style' => [ 'always_move_variable' => true, 'equal' => true, diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 9502b0e2..368fe6f2 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -752,7 +752,9 @@ final class Php74Test extends ExplicitRuleSetTestCase ], ], 'void_return' => true, - 'whitespace_after_comma_in_array' => true, + 'whitespace_after_comma_in_array' => [ + 'ensure_single_space' => false, + ], 'yoda_style' => [ 'always_move_variable' => true, 'equal' => true, diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index cc8d5b12..aa49a3b7 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -755,7 +755,9 @@ final class Php80Test extends ExplicitRuleSetTestCase ], ], 'void_return' => true, - 'whitespace_after_comma_in_array' => true, + 'whitespace_after_comma_in_array' => [ + 'ensure_single_space' => false, + ], 'yoda_style' => [ 'always_move_variable' => true, 'equal' => true, diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index 77866b74..07b4eab3 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -758,7 +758,9 @@ final class Php81Test extends ExplicitRuleSetTestCase ], ], 'void_return' => true, - 'whitespace_after_comma_in_array' => true, + 'whitespace_after_comma_in_array' => [ + 'ensure_single_space' => false, + ], 'yoda_style' => [ 'always_move_variable' => true, 'equal' => true, From ac1567a5f207b4d0a2c69151b662115bf64da6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 19 Aug 2022 09:48:29 +0200 Subject: [PATCH 3/7] Fix: Explicitly configure single_import_per_statement fixer --- src/RuleSet/Php74.php | 4 +++- src/RuleSet/Php80.php | 4 +++- src/RuleSet/Php81.php | 4 +++- test/Unit/RuleSet/Php74Test.php | 4 +++- test/Unit/RuleSet/Php80Test.php | 4 +++- test/Unit/RuleSet/Php81Test.php | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index a5619c30..2f969f85 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -631,7 +631,9 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'property', ], ], - 'single_import_per_statement' => true, + 'single_import_per_statement' => [ + 'group_to_single_imports' => true, + ], 'single_line_after_imports' => true, 'single_line_comment_spacing' => true, 'single_line_comment_style' => [ diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 23643db0..fc99ce71 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -632,7 +632,9 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'property', ], ], - 'single_import_per_statement' => true, + 'single_import_per_statement' => [ + 'group_to_single_imports' => true, + ], 'single_line_after_imports' => true, 'single_line_comment_spacing' => true, 'single_line_comment_style' => [ diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index bf13abcf..a0f051bc 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -633,7 +633,9 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'property', ], ], - 'single_import_per_statement' => true, + 'single_import_per_statement' => [ + 'group_to_single_imports' => true, + ], 'single_line_after_imports' => true, 'single_line_comment_spacing' => true, 'single_line_comment_style' => [ diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 368fe6f2..5a7afa0e 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -637,7 +637,9 @@ final class Php74Test extends ExplicitRuleSetTestCase 'property', ], ], - 'single_import_per_statement' => true, + 'single_import_per_statement' => [ + 'group_to_single_imports' => true, + ], 'single_line_after_imports' => true, 'single_line_comment_spacing' => true, 'single_line_comment_style' => [ diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index aa49a3b7..0110b655 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -638,7 +638,9 @@ final class Php80Test extends ExplicitRuleSetTestCase 'property', ], ], - 'single_import_per_statement' => true, + 'single_import_per_statement' => [ + 'group_to_single_imports' => true, + ], 'single_line_after_imports' => true, 'single_line_comment_spacing' => true, 'single_line_comment_style' => [ diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index 07b4eab3..41ad3825 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -639,7 +639,9 @@ final class Php81Test extends ExplicitRuleSetTestCase 'property', ], ], - 'single_import_per_statement' => true, + 'single_import_per_statement' => [ + 'group_to_single_imports' => true, + ], 'single_line_after_imports' => true, 'single_line_comment_spacing' => true, 'single_line_comment_style' => [ From 2aaf3519f84ea2a5dbe55646dfac7a175166e600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 19 Aug 2022 09:50:28 +0200 Subject: [PATCH 4/7] Fix: Explicitly configure phpdoc_order fixer --- src/RuleSet/Php74.php | 8 +++++++- src/RuleSet/Php80.php | 8 +++++++- src/RuleSet/Php81.php | 8 +++++++- test/Unit/RuleSet/Php74Test.php | 8 +++++++- test/Unit/RuleSet/Php80Test.php | 8 +++++++- test/Unit/RuleSet/Php81Test.php | 8 +++++++- 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index 2f969f85..11005a47 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -524,7 +524,13 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'phpdoc_no_empty_return' => true, 'phpdoc_no_package' => true, 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_order' => true, + 'phpdoc_order' => [ + 'order' => [ + 'param', + 'throws', + 'return', + ], + ], 'phpdoc_order_by_value' => [ 'annotations' => [ 'author', diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index fc99ce71..a69d24d5 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -525,7 +525,13 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'phpdoc_no_empty_return' => true, 'phpdoc_no_package' => true, 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_order' => true, + 'phpdoc_order' => [ + 'order' => [ + 'param', + 'throws', + 'return', + ], + ], 'phpdoc_order_by_value' => [ 'annotations' => [ 'author', diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index a0f051bc..cf26eaf6 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -526,7 +526,13 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'phpdoc_no_empty_return' => true, 'phpdoc_no_package' => true, 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_order' => true, + 'phpdoc_order' => [ + 'order' => [ + 'param', + 'throws', + 'return', + ], + ], 'phpdoc_order_by_value' => [ 'annotations' => [ 'author', diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 5a7afa0e..71215e0c 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -530,7 +530,13 @@ final class Php74Test extends ExplicitRuleSetTestCase 'phpdoc_no_empty_return' => true, 'phpdoc_no_package' => true, 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_order' => true, + 'phpdoc_order' => [ + 'order' => [ + 'param', + 'throws', + 'return', + ], + ], 'phpdoc_order_by_value' => [ 'annotations' => [ 'author', diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index 0110b655..77a60015 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -531,7 +531,13 @@ final class Php80Test extends ExplicitRuleSetTestCase 'phpdoc_no_empty_return' => true, 'phpdoc_no_package' => true, 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_order' => true, + 'phpdoc_order' => [ + 'order' => [ + 'param', + 'throws', + 'return', + ], + ], 'phpdoc_order_by_value' => [ 'annotations' => [ 'author', diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index 41ad3825..8456e473 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -532,7 +532,13 @@ final class Php81Test extends ExplicitRuleSetTestCase 'phpdoc_no_empty_return' => true, 'phpdoc_no_package' => true, 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_order' => true, + 'phpdoc_order' => [ + 'order' => [ + 'param', + 'throws', + 'return', + ], + ], 'phpdoc_order_by_value' => [ 'annotations' => [ 'author', From 95416a4f6c084a6d144b8e77b796d9205cf427bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 19 Aug 2022 09:52:27 +0200 Subject: [PATCH 5/7] Fix: Explicitly configure no_alternative_syntax fixer --- src/RuleSet/Php74.php | 4 +++- src/RuleSet/Php80.php | 4 +++- src/RuleSet/Php81.php | 4 +++- test/Unit/RuleSet/Php74Test.php | 4 +++- test/Unit/RuleSet/Php80Test.php | 4 +++- test/Unit/RuleSet/Php81Test.php | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index 11005a47..b1e45a30 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -284,7 +284,9 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet ], ], 'no_alias_language_construct_call' => true, - 'no_alternative_syntax' => true, + 'no_alternative_syntax' => [ + 'fix_non_monolithic_code' => false, + ], 'no_binary_string' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index a69d24d5..658b47de 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -284,7 +284,9 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet ], ], 'no_alias_language_construct_call' => true, - 'no_alternative_syntax' => true, + 'no_alternative_syntax' => [ + 'fix_non_monolithic_code' => false, + ], 'no_binary_string' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index cf26eaf6..e71eb73c 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -284,7 +284,9 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet ], ], 'no_alias_language_construct_call' => true, - 'no_alternative_syntax' => true, + 'no_alternative_syntax' => [ + 'fix_non_monolithic_code' => false, + ], 'no_binary_string' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 71215e0c..81d2fa27 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -290,7 +290,9 @@ final class Php74Test extends ExplicitRuleSetTestCase ], ], 'no_alias_language_construct_call' => true, - 'no_alternative_syntax' => true, + 'no_alternative_syntax' => [ + 'fix_non_monolithic_code' => false, + ], 'no_binary_string' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index 77a60015..5fda8fd5 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -290,7 +290,9 @@ final class Php80Test extends ExplicitRuleSetTestCase ], ], 'no_alias_language_construct_call' => true, - 'no_alternative_syntax' => true, + 'no_alternative_syntax' => [ + 'fix_non_monolithic_code' => false, + ], 'no_binary_string' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index 8456e473..e0feb417 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -290,7 +290,9 @@ final class Php81Test extends ExplicitRuleSetTestCase ], ], 'no_alias_language_construct_call' => true, - 'no_alternative_syntax' => true, + 'no_alternative_syntax' => [ + 'fix_non_monolithic_code' => false, + ], 'no_binary_string' => true, 'no_blank_lines_after_class_opening' => true, 'no_blank_lines_after_phpdoc' => true, From a4e1c937717e90a3de174e663592e1e9f938112e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 19 Aug 2022 09:54:40 +0200 Subject: [PATCH 6/7] Fix: Explicitly configure new_with_braces fixer --- src/RuleSet/Php74.php | 5 ++++- src/RuleSet/Php80.php | 5 ++++- src/RuleSet/Php81.php | 5 ++++- test/Unit/RuleSet/Php74Test.php | 5 ++++- test/Unit/RuleSet/Php80Test.php | 5 ++++- test/Unit/RuleSet/Php81Test.php | 5 ++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index b1e45a30..3f75871c 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -276,7 +276,10 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet 'strict' => false, ], 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, + 'new_with_braces' => [ + 'anonymous_class' => true, + 'named_class' => true, + ], 'no_alias_functions' => [ 'sets' => [ '@IMAP', diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 658b47de..e89107ae 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -276,7 +276,10 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet 'strict' => false, ], 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, + 'new_with_braces' => [ + 'anonymous_class' => true, + 'named_class' => true, + ], 'no_alias_functions' => [ 'sets' => [ '@IMAP', diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index e71eb73c..649987c7 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -276,7 +276,10 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet 'strict' => false, ], 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, + 'new_with_braces' => [ + 'anonymous_class' => true, + 'named_class' => true, + ], 'no_alias_functions' => [ 'sets' => [ '@IMAP', diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index 81d2fa27..8df9eaf7 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -282,7 +282,10 @@ final class Php74Test extends ExplicitRuleSetTestCase 'strict' => false, ], 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, + 'new_with_braces' => [ + 'anonymous_class' => true, + 'named_class' => true, + ], 'no_alias_functions' => [ 'sets' => [ '@IMAP', diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index 5fda8fd5..238ee482 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -282,7 +282,10 @@ final class Php80Test extends ExplicitRuleSetTestCase 'strict' => false, ], 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, + 'new_with_braces' => [ + 'anonymous_class' => true, + 'named_class' => true, + ], 'no_alias_functions' => [ 'sets' => [ '@IMAP', diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index e0feb417..8c58947e 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -282,7 +282,10 @@ final class Php81Test extends ExplicitRuleSetTestCase 'strict' => false, ], 'native_function_type_declaration_casing' => true, - 'new_with_braces' => true, + 'new_with_braces' => [ + 'anonymous_class' => true, + 'named_class' => true, + ], 'no_alias_functions' => [ 'sets' => [ '@IMAP', From c0a2688e2845258432a67602c1c0d576446ff527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 19 Aug 2022 09:56:13 +0200 Subject: [PATCH 7/7] Fix: Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index edfa15d1..65775c67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ For a full diff see [`4.6.0...main`][4.6.0...main]. - Updated `friendsofphp/php-cs-fixer` ([#642]), by [@dependabot] +### Fixed + +- Require all configurable rules to be explicitly configured when enabled and part of an `ExplicitRuleSet` ([#644]), by [@localheinz] + ## [`4.6.0`][4.6.0] For a full diff see [`4.5.3...4.6.0`][4.5.3...4.6.0]. @@ -717,6 +721,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#636]: https://github.com/ergebnis/php-cs-fixer-config/pull/636 [#637]: https://github.com/ergebnis/php-cs-fixer-config/pull/637 [#642]: https://github.com/ergebnis/php-cs-fixer-config/pull/642 +[#644]: https://github.com/ergebnis/php-cs-fixer-config/pull/644 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler