Skip to content

Commit

Permalink
PSR12 - disable fix_constructor_arguments in ClassDefinitionFixer
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmajor committed Oct 27, 2021
1 parent fafb79b commit 12ee304
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/ruleSets/PSR12.rst
Expand Up @@ -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>`_
Expand Down
2 changes: 1 addition & 1 deletion doc/rules/class_notation/class_definition.rst
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion src/RuleSet/Sets/PSR12Set.php
Expand Up @@ -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,
Expand Down

0 comments on commit 12ee304

Please sign in to comment.