diff --git a/doc/ruleSets/PSR12.rst b/doc/ruleSets/PSR12.rst index 2595a1b0299..147bc2713d5 100644 --- a/doc/ruleSets/PSR12.rst +++ b/doc/ruleSets/PSR12.rst @@ -14,7 +14,7 @@ Rules ``['allow_single_line_anonymous_class_with_empty_body' => true]`` - `class_definition <./../rules/class_notation/class_definition.rst>`_ config: - ``['space_before_parenthesis' => true]`` + ``['fix_constructor_arguments' => false, 'space_before_parenthesis' => true]`` - `compact_nullable_typehint <./../rules/whitespace/compact_nullable_typehint.rst>`_ - `declare_equal_normalize <./../rules/language_construct/declare_equal_normalize.rst>`_ - `lowercase_cast <./../rules/cast_notation/lowercase_cast.rst>`_ diff --git a/doc/rules/class_notation/class_definition.rst b/doc/rules/class_notation/class_definition.rst index 9499ee363bb..2404ecfe84c 100644 --- a/doc/rules/class_notation/class_definition.rst +++ b/doc/rules/class_notation/class_definition.rst @@ -175,7 +175,7 @@ The rule is part of the following rule sets: @PSR12 Using the `@PSR12 <./../../ruleSets/PSR12.rst>`_ rule set will enable the ``class_definition`` rule with the config below: - ``['space_before_parenthesis' => true]`` + ``['fix_constructor_arguments' => false, 'space_before_parenthesis' => true]`` @PSR2 Using the `@PSR2 <./../../ruleSets/PSR2.rst>`_ rule set will enable the ``class_definition`` rule with the default config. diff --git a/src/RuleSet/Sets/PSR12Set.php b/src/RuleSet/Sets/PSR12Set.php index 9a8e4c1bf1e..7311ea12502 100644 --- a/src/RuleSet/Sets/PSR12Set.php +++ b/src/RuleSet/Sets/PSR12Set.php @@ -29,7 +29,10 @@ public function getRules(): array 'braces' => [ 'allow_single_line_anonymous_class_with_empty_body' => true, ], - 'class_definition' => ['space_before_parenthesis' => true], // defined in PSR12 ¶8. Anonymous Classes + 'class_definition' => [ + 'fix_constructor_arguments' => false, // handled by method_argument_space fixer + 'space_before_parenthesis' => true, // defined in PSR12 ¶8. Anonymous Classes + ], 'compact_nullable_typehint' => true, 'declare_equal_normalize' => true, 'lowercase_cast' => true,