PhpCsFixer.rst 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ========================
  2. Rule set ``@PhpCsFixer``
  3. ========================
  4. Rule set as used by the PHP-CS-Fixer development team, highly opinionated.
  5. Rules
  6. -----
  7. - `@PER <./PER.rst>`_
  8. - `@Symfony <./Symfony.rst>`_
  9. - `array_indentation <./../rules/whitespace/array_indentation.rst>`_
  10. - `blank_line_before_statement <./../rules/whitespace/blank_line_before_statement.rst>`_
  11. config:
  12. ``['statements' => ['break', 'case', 'continue', 'declare', 'default', 'exit', 'goto', 'include', 'include_once', 'phpdoc', 'require', 'require_once', 'return', 'switch', 'throw', 'try', 'yield', 'yield_from']]``
  13. - `combine_consecutive_issets <./../rules/language_construct/combine_consecutive_issets.rst>`_
  14. - `combine_consecutive_unsets <./../rules/language_construct/combine_consecutive_unsets.rst>`_
  15. - `empty_loop_body <./../rules/control_structure/empty_loop_body.rst>`_
  16. - `escape_implicit_backslashes <./../rules/string_notation/escape_implicit_backslashes.rst>`_
  17. - `explicit_indirect_variable <./../rules/language_construct/explicit_indirect_variable.rst>`_
  18. - `explicit_string_variable <./../rules/string_notation/explicit_string_variable.rst>`_
  19. - `heredoc_to_nowdoc <./../rules/string_notation/heredoc_to_nowdoc.rst>`_
  20. - `method_argument_space <./../rules/function_notation/method_argument_space.rst>`_
  21. config:
  22. ``['on_multiline' => 'ensure_fully_multiline']``
  23. - `method_chaining_indentation <./../rules/whitespace/method_chaining_indentation.rst>`_
  24. - `multiline_comment_opening_closing <./../rules/comment/multiline_comment_opening_closing.rst>`_
  25. - `multiline_whitespace_before_semicolons <./../rules/semicolon/multiline_whitespace_before_semicolons.rst>`_
  26. config:
  27. ``['strategy' => 'new_line_for_chained_calls']``
  28. - `no_extra_blank_lines <./../rules/whitespace/no_extra_blank_lines.rst>`_
  29. config:
  30. ``['tokens' => ['attribute', 'break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use']]``
  31. - `no_superfluous_elseif <./../rules/control_structure/no_superfluous_elseif.rst>`_
  32. - `no_superfluous_phpdoc_tags <./../rules/phpdoc/no_superfluous_phpdoc_tags.rst>`_
  33. config:
  34. ``['allow_mixed' => true, 'remove_inheritdoc' => true]``
  35. - `no_unneeded_control_parentheses <./../rules/control_structure/no_unneeded_control_parentheses.rst>`_
  36. config:
  37. ``['statements' => ['break', 'clone', 'continue', 'echo_print', 'negative_instanceof', 'others', 'return', 'switch_case', 'yield', 'yield_from']]``
  38. - `no_useless_else <./../rules/control_structure/no_useless_else.rst>`_
  39. - `no_useless_return <./../rules/return_notation/no_useless_return.rst>`_
  40. - `ordered_class_elements <./../rules/class_notation/ordered_class_elements.rst>`_
  41. - `php_unit_internal_class <./../rules/php_unit/php_unit_internal_class.rst>`_
  42. - `php_unit_test_class_requires_covers <./../rules/php_unit/php_unit_test_class_requires_covers.rst>`_
  43. - `phpdoc_add_missing_param_annotation <./../rules/phpdoc/phpdoc_add_missing_param_annotation.rst>`_
  44. - `phpdoc_no_empty_return <./../rules/phpdoc/phpdoc_no_empty_return.rst>`_
  45. - `phpdoc_order_by_value <./../rules/phpdoc/phpdoc_order_by_value.rst>`_
  46. - `phpdoc_types_order <./../rules/phpdoc/phpdoc_types_order.rst>`_
  47. - `phpdoc_var_annotation_correct_order <./../rules/phpdoc/phpdoc_var_annotation_correct_order.rst>`_
  48. - `protected_to_private <./../rules/class_notation/protected_to_private.rst>`_
  49. - `return_assignment <./../rules/return_notation/return_assignment.rst>`_
  50. - `self_static_accessor <./../rules/class_notation/self_static_accessor.rst>`_
  51. - `single_line_comment_style <./../rules/comment/single_line_comment_style.rst>`_
  52. - `whitespace_after_comma_in_array <./../rules/array_notation/whitespace_after_comma_in_array.rst>`_
  53. config:
  54. ``['ensure_single_space' => true]``
  55. - `yield_from_array_to_yields <./../rules/array_notation/yield_from_array_to_yields.rst>`_
  56. Disabled rules
  57. --------------
  58. - `nullable_type_declaration_for_default_null_value <./../rules/function_notation/nullable_type_declaration_for_default_null_value.rst>`_
  59. - `single_line_throw <./../rules/function_notation/single_line_throw.rst>`_