Back to Php Cs Fixer

Rule set ``@PSR2``

doc/ruleSets/PSR2.rst

3.95.13.2 KB
Original Source

================== Rule set @PSR2

Rules that follow PSR-2 <https://www.php-fig.org/psr/psr-2/>_ standard.

Rules

  • @PSR1 <./PSR1.rst>_

  • blank_line_after_namespace <./../rules/namespace_notation/blank_line_after_namespace.rst>_

  • braces_position <./../rules/basic/braces_position.rst>_ with config:

    ['allow_single_line_anonymous_functions' => false]

  • class_definition <./../rules/class_notation/class_definition.rst>_

  • constant_case <./../rules/casing/constant_case.rst>_

  • control_structure_braces <./../rules/control_structure/control_structure_braces.rst>_

  • control_structure_continuation_position <./../rules/control_structure/control_structure_continuation_position.rst>_

  • elseif <./../rules/control_structure/elseif.rst>_

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

    ['closure_fn_spacing' => 'one']

  • indentation_type <./../rules/whitespace/indentation_type.rst>_

  • line_ending <./../rules/whitespace/line_ending.rst>_

  • lowercase_keywords <./../rules/casing/lowercase_keywords.rst>_

  • method_argument_space <./../rules/function_notation/method_argument_space.rst>_ with config:

    ['after_heredoc' => false, 'attribute_placement' => 'ignore', 'on_multiline' => 'ensure_fully_multiline']

  • modifier_keywords <./../rules/class_notation/modifier_keywords.rst>_ with config:

    ['elements' => ['method', 'property']]

  • no_break_comment <./../rules/control_structure/no_break_comment.rst>_

  • no_closing_tag <./../rules/php_tag/no_closing_tag.rst>_

  • no_multiple_statements_per_line <./../rules/basic/no_multiple_statements_per_line.rst>_

  • no_space_around_double_colon <./../rules/operator/no_space_around_double_colon.rst>_

  • no_spaces_after_function_name <./../rules/function_notation/no_spaces_after_function_name.rst>_

  • no_trailing_whitespace <./../rules/whitespace/no_trailing_whitespace.rst>_

  • no_trailing_whitespace_in_comment <./../rules/comment/no_trailing_whitespace_in_comment.rst>_

  • single_blank_line_at_eof <./../rules/whitespace/single_blank_line_at_eof.rst>_

  • single_class_element_per_statement <./../rules/class_notation/single_class_element_per_statement.rst>_ with config:

    ['elements' => ['property']]

  • single_import_per_statement <./../rules/import/single_import_per_statement.rst>_

  • single_line_after_imports <./../rules/import/single_line_after_imports.rst>_

  • single_space_around_construct <./../rules/language_construct/single_space_around_construct.rst>_ with config:

    ['constructs_followed_by_a_single_space' => ['abstract', 'as', 'case', 'catch', 'class', 'do', 'else', 'elseif', 'final', 'for', 'foreach', 'function', 'if', 'interface', 'namespace', 'private', 'protected', 'public', 'static', 'switch', 'trait', 'try', 'use_lambda', 'while'], 'constructs_preceded_by_a_single_space' => ['as', 'else', 'elseif', 'use_lambda']]

  • spaces_inside_parentheses <./../rules/whitespace/spaces_inside_parentheses.rst>_

  • statement_indentation <./../rules/whitespace/statement_indentation.rst>_

  • switch_case_semicolon_to_colon <./../rules/control_structure/switch_case_semicolon_to_colon.rst>_

  • switch_case_space <./../rules/control_structure/switch_case_space.rst>_