PSR2.rst 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ==================
  2. Rule set ``@PSR2``
  3. ==================
  4. Rules that follow `PSR-2 <https://www.php-fig.org/psr/psr-2/>`_ standard.
  5. Rules
  6. -----
  7. - `@PSR1 <./PSR1.rst>`_
  8. - `blank_line_after_namespace <./../rules/namespace_notation/blank_line_after_namespace.rst>`_
  9. - `braces_position <./../rules/basic/braces_position.rst>`_
  10. - `class_definition <./../rules/class_notation/class_definition.rst>`_
  11. - `constant_case <./../rules/casing/constant_case.rst>`_
  12. - `control_structure_braces <./../rules/control_structure/control_structure_braces.rst>`_
  13. - `control_structure_continuation_position <./../rules/control_structure/control_structure_continuation_position.rst>`_
  14. - `elseif <./../rules/control_structure/elseif.rst>`_
  15. - `function_declaration <./../rules/function_notation/function_declaration.rst>`_
  16. - `indentation_type <./../rules/whitespace/indentation_type.rst>`_
  17. - `line_ending <./../rules/whitespace/line_ending.rst>`_
  18. - `lowercase_keywords <./../rules/casing/lowercase_keywords.rst>`_
  19. - `method_argument_space <./../rules/function_notation/method_argument_space.rst>`_ with config:
  20. ``['attribute_placement' => 'ignore', 'on_multiline' => 'ensure_fully_multiline']``
  21. - `no_break_comment <./../rules/control_structure/no_break_comment.rst>`_
  22. - `no_closing_tag <./../rules/php_tag/no_closing_tag.rst>`_
  23. - `no_multiple_statements_per_line <./../rules/basic/no_multiple_statements_per_line.rst>`_
  24. - `no_space_around_double_colon <./../rules/operator/no_space_around_double_colon.rst>`_
  25. - `no_spaces_after_function_name <./../rules/function_notation/no_spaces_after_function_name.rst>`_
  26. - `no_trailing_whitespace <./../rules/whitespace/no_trailing_whitespace.rst>`_
  27. - `no_trailing_whitespace_in_comment <./../rules/comment/no_trailing_whitespace_in_comment.rst>`_
  28. - `single_blank_line_at_eof <./../rules/whitespace/single_blank_line_at_eof.rst>`_
  29. - `single_class_element_per_statement <./../rules/class_notation/single_class_element_per_statement.rst>`_ with config:
  30. ``['elements' => ['property']]``
  31. - `single_import_per_statement <./../rules/import/single_import_per_statement.rst>`_
  32. - `single_line_after_imports <./../rules/import/single_line_after_imports.rst>`_
  33. - `single_space_around_construct <./../rules/language_construct/single_space_around_construct.rst>`_ with config:
  34. ``['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']]``
  35. - `spaces_inside_parentheses <./../rules/whitespace/spaces_inside_parentheses.rst>`_
  36. - `statement_indentation <./../rules/whitespace/statement_indentation.rst>`_
  37. - `switch_case_semicolon_to_colon <./../rules/control_structure/switch_case_semicolon_to_colon.rst>`_
  38. - `switch_case_space <./../rules/control_structure/switch_case_space.rst>`_
  39. - `visibility_required <./../rules/class_notation/visibility_required.rst>`_ with config:
  40. ``['elements' => ['method', 'property']]``