PSR12.rst 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ===================
  2. Rule set ``@PSR12``
  3. ===================
  4. Rules that follow `PSR-12 <https://www.php-fig.org/psr/psr-12/>`_ standard.
  5. Rules
  6. -----
  7. - `@PSR2 <./PSR2.rst>`_
  8. - `binary_operator_spaces <./../rules/operator/binary_operator_spaces.rst>`_ with config:
  9. ``['default' => 'at_least_single_space']``
  10. - `blank_line_after_opening_tag <./../rules/php_tag/blank_line_after_opening_tag.rst>`_
  11. - `blank_line_between_import_groups <./../rules/whitespace/blank_line_between_import_groups.rst>`_
  12. - `blank_lines_before_namespace <./../rules/namespace_notation/blank_lines_before_namespace.rst>`_
  13. - `braces_position <./../rules/basic/braces_position.rst>`_ with config:
  14. ``['allow_single_line_empty_anonymous_classes' => true]``
  15. - `class_definition <./../rules/class_notation/class_definition.rst>`_ with config:
  16. ``['inline_constructor_arguments' => false, 'space_before_parenthesis' => true]``
  17. - `compact_nullable_type_declaration <./../rules/whitespace/compact_nullable_type_declaration.rst>`_
  18. - `declare_equal_normalize <./../rules/language_construct/declare_equal_normalize.rst>`_
  19. - `lowercase_cast <./../rules/cast_notation/lowercase_cast.rst>`_
  20. - `lowercase_static_reference <./../rules/casing/lowercase_static_reference.rst>`_
  21. - `new_with_parentheses <./../rules/operator/new_with_parentheses.rst>`_
  22. - `no_blank_lines_after_class_opening <./../rules/class_notation/no_blank_lines_after_class_opening.rst>`_
  23. - `no_extra_blank_lines <./../rules/whitespace/no_extra_blank_lines.rst>`_ with config:
  24. ``['tokens' => ['use']]``
  25. - `no_leading_import_slash <./../rules/import/no_leading_import_slash.rst>`_
  26. - `no_whitespace_in_blank_line <./../rules/whitespace/no_whitespace_in_blank_line.rst>`_
  27. - `ordered_class_elements <./../rules/class_notation/ordered_class_elements.rst>`_ with config:
  28. ``['order' => ['use_trait']]``
  29. - `ordered_imports <./../rules/import/ordered_imports.rst>`_ with config:
  30. ``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'none']``
  31. - `return_type_declaration <./../rules/function_notation/return_type_declaration.rst>`_
  32. - `short_scalar_cast <./../rules/cast_notation/short_scalar_cast.rst>`_
  33. - `single_import_per_statement <./../rules/import/single_import_per_statement.rst>`_ with config:
  34. ``['group_to_single_imports' => false]``
  35. - `single_space_around_construct <./../rules/language_construct/single_space_around_construct.rst>`_ with config:
  36. ``['constructs_followed_by_a_single_space' => ['abstract', 'as', 'case', 'catch', 'class', 'const_import', 'do', 'else', 'elseif', 'final', 'finally', 'for', 'foreach', 'function', 'function_import', 'if', 'insteadof', 'interface', 'namespace', 'new', 'private', 'protected', 'public', 'static', 'switch', 'trait', 'try', 'use', 'use_lambda', 'while'], 'constructs_preceded_by_a_single_space' => ['as', 'else', 'elseif', 'use_lambda']]``
  37. - `single_trait_insert_per_statement <./../rules/class_notation/single_trait_insert_per_statement.rst>`_
  38. - `ternary_operator_spaces <./../rules/operator/ternary_operator_spaces.rst>`_
  39. - `unary_operator_spaces <./../rules/operator/unary_operator_spaces.rst>`_ with config:
  40. ``['only_dec_inc' => true]``
  41. - `visibility_required <./../rules/class_notation/visibility_required.rst>`_