Skip to content

Commit

Permalink
PER - The fn keyword MUST NOT be succeeded by a space.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacePossum committed Oct 4, 2023
1 parent 84dd90e commit 8b791a0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
4 changes: 4 additions & 0 deletions doc/ruleSets/PER-CS2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ Rules

``['spacing' => 'one']``

- `function_declaration <./../rules/function_notation/function_declaration.rst>`_ with config:

``['closure_fn_spacing' => 'none', 'closure_function_spacing' => 'one', 'trailing_comma_single_line' => false]``

- `method_argument_space <./../rules/function_notation/method_argument_space.rst>`_
- `single_line_empty_body <./../rules/basic/single_line_empty_body.rst>`_
15 changes: 12 additions & 3 deletions doc/rules/function_notation/function_declaration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,19 @@ Rule sets

The rule is part of the following rule sets:

- `@PER <./../../ruleSets/PER.rst>`_
- `@PER-CS <./../../ruleSets/PER-CS.rst>`_
- `@PER <./../../ruleSets/PER.rst>`_ with config:

``['closure_fn_spacing' => 'none', 'closure_function_spacing' => 'one', 'trailing_comma_single_line' => false]``

- `@PER-CS <./../../ruleSets/PER-CS.rst>`_ with config:

``['closure_fn_spacing' => 'none', 'closure_function_spacing' => 'one', 'trailing_comma_single_line' => false]``

- `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
- `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
- `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_ with config:

``['closure_fn_spacing' => 'none', 'closure_function_spacing' => 'one', 'trailing_comma_single_line' => false]``

- `@PSR2 <./../../ruleSets/PSR2.rst>`_
- `@PSR12 <./../../ruleSets/PSR12.rst>`_
- `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Sets/PERCS2x0Set.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public function getRules(): array
return [
'@PER-CS1.0' => true,
'concat_space' => ['spacing' => 'one'],
'function_declaration' => [
'closure_fn_spacing' => 'none',
'closure_function_spacing' => 'one',
'trailing_comma_single_line' => false,
],
'method_argument_space' => true,
'single_line_empty_body' => true,
];
Expand Down

0 comments on commit 8b791a0

Please sign in to comment.