Symfony.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. =====================
  2. Rule set ``@Symfony``
  3. =====================
  4. Rules that follow the official `Symfony Coding Standards <https://symfony.com/doc/current/contributing/code/standards.html>`_.
  5. Rules
  6. -----
  7. - `@PER-CS2.0 <./PER-CS2.0.rst>`_
  8. - `align_multiline_comment <./../rules/phpdoc/align_multiline_comment.rst>`_
  9. - `backtick_to_shell_exec <./../rules/alias/backtick_to_shell_exec.rst>`_
  10. - `binary_operator_spaces <./../rules/operator/binary_operator_spaces.rst>`_
  11. - `blank_line_before_statement <./../rules/whitespace/blank_line_before_statement.rst>`_ with config:
  12. ``['statements' => ['return']]``
  13. - `braces_position <./../rules/basic/braces_position.rst>`_ with config:
  14. ``['allow_single_line_anonymous_functions' => true, 'allow_single_line_empty_anonymous_classes' => true]``
  15. - `class_attributes_separation <./../rules/class_notation/class_attributes_separation.rst>`_ with config:
  16. ``['elements' => ['method' => 'one']]``
  17. - `class_definition <./../rules/class_notation/class_definition.rst>`_ with config:
  18. ``['single_line' => true]``
  19. - `class_reference_name_casing <./../rules/casing/class_reference_name_casing.rst>`_
  20. - `clean_namespace <./../rules/namespace_notation/clean_namespace.rst>`_
  21. - `concat_space <./../rules/operator/concat_space.rst>`_
  22. - `declare_parentheses <./../rules/language_construct/declare_parentheses.rst>`_
  23. - `echo_tag_syntax <./../rules/php_tag/echo_tag_syntax.rst>`_
  24. - `empty_loop_body <./../rules/control_structure/empty_loop_body.rst>`_ with config:
  25. ``['style' => 'braces']``
  26. - `empty_loop_condition <./../rules/control_structure/empty_loop_condition.rst>`_
  27. - `fully_qualified_strict_types <./../rules/import/fully_qualified_strict_types.rst>`_
  28. - `function_declaration <./../rules/function_notation/function_declaration.rst>`_
  29. - `general_phpdoc_tag_rename <./../rules/phpdoc/general_phpdoc_tag_rename.rst>`_ with config:
  30. ``['replacements' => ['inheritDocs' => 'inheritDoc']]``
  31. - `global_namespace_import <./../rules/import/global_namespace_import.rst>`_ with config:
  32. ``['import_classes' => false, 'import_constants' => false, 'import_functions' => false]``
  33. - `include <./../rules/control_structure/include.rst>`_
  34. - `increment_style <./../rules/operator/increment_style.rst>`_
  35. - `integer_literal_case <./../rules/casing/integer_literal_case.rst>`_
  36. - `lambda_not_used_import <./../rules/function_notation/lambda_not_used_import.rst>`_
  37. - `linebreak_after_opening_tag <./../rules/php_tag/linebreak_after_opening_tag.rst>`_
  38. - `magic_constant_casing <./../rules/casing/magic_constant_casing.rst>`_
  39. - `magic_method_casing <./../rules/casing/magic_method_casing.rst>`_
  40. - `method_argument_space <./../rules/function_notation/method_argument_space.rst>`_ with config:
  41. ``['on_multiline' => 'ignore']``
  42. - `native_function_casing <./../rules/casing/native_function_casing.rst>`_
  43. - `native_type_declaration_casing <./../rules/casing/native_type_declaration_casing.rst>`_
  44. - `no_alias_language_construct_call <./../rules/alias/no_alias_language_construct_call.rst>`_
  45. - `no_alternative_syntax <./../rules/control_structure/no_alternative_syntax.rst>`_
  46. - `no_binary_string <./../rules/string_notation/no_binary_string.rst>`_
  47. - `no_blank_lines_after_phpdoc <./../rules/phpdoc/no_blank_lines_after_phpdoc.rst>`_
  48. - `no_empty_comment <./../rules/comment/no_empty_comment.rst>`_
  49. - `no_empty_phpdoc <./../rules/phpdoc/no_empty_phpdoc.rst>`_
  50. - `no_empty_statement <./../rules/semicolon/no_empty_statement.rst>`_
  51. - `no_extra_blank_lines <./../rules/whitespace/no_extra_blank_lines.rst>`_ with config:
  52. ``['tokens' => ['attribute', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use']]``
  53. - `no_leading_namespace_whitespace <./../rules/namespace_notation/no_leading_namespace_whitespace.rst>`_
  54. - `no_mixed_echo_print <./../rules/alias/no_mixed_echo_print.rst>`_
  55. - `no_multiline_whitespace_around_double_arrow <./../rules/array_notation/no_multiline_whitespace_around_double_arrow.rst>`_
  56. - `no_null_property_initialization <./../rules/class_notation/no_null_property_initialization.rst>`_
  57. - `no_short_bool_cast <./../rules/cast_notation/no_short_bool_cast.rst>`_
  58. - `no_singleline_whitespace_before_semicolons <./../rules/semicolon/no_singleline_whitespace_before_semicolons.rst>`_
  59. - `no_spaces_around_offset <./../rules/whitespace/no_spaces_around_offset.rst>`_
  60. - `no_superfluous_phpdoc_tags <./../rules/phpdoc/no_superfluous_phpdoc_tags.rst>`_ with config:
  61. ``['allow_hidden_params' => true, 'remove_inheritdoc' => true]``
  62. - `no_trailing_comma_in_singleline <./../rules/basic/no_trailing_comma_in_singleline.rst>`_
  63. - `no_unneeded_braces <./../rules/control_structure/no_unneeded_braces.rst>`_ with config:
  64. ``['namespaces' => true]``
  65. - `no_unneeded_control_parentheses <./../rules/control_structure/no_unneeded_control_parentheses.rst>`_ with config:
  66. ``['statements' => ['break', 'clone', 'continue', 'echo_print', 'others', 'return', 'switch_case', 'yield', 'yield_from']]``
  67. - `no_unneeded_import_alias <./../rules/import/no_unneeded_import_alias.rst>`_
  68. - `no_unset_cast <./../rules/cast_notation/no_unset_cast.rst>`_
  69. - `no_unused_imports <./../rules/import/no_unused_imports.rst>`_
  70. - `no_useless_concat_operator <./../rules/operator/no_useless_concat_operator.rst>`_
  71. - `no_useless_nullsafe_operator <./../rules/operator/no_useless_nullsafe_operator.rst>`_
  72. - `no_whitespace_before_comma_in_array <./../rules/array_notation/no_whitespace_before_comma_in_array.rst>`_
  73. - `normalize_index_brace <./../rules/array_notation/normalize_index_brace.rst>`_
  74. - `nullable_type_declaration <./../rules/language_construct/nullable_type_declaration.rst>`_
  75. - `nullable_type_declaration_for_default_null_value <./../rules/function_notation/nullable_type_declaration_for_default_null_value.rst>`_
  76. - `object_operator_without_whitespace <./../rules/operator/object_operator_without_whitespace.rst>`_
  77. - `operator_linebreak <./../rules/operator/operator_linebreak.rst>`_ with config:
  78. ``['only_booleans' => true]``
  79. - `ordered_imports <./../rules/import/ordered_imports.rst>`_ with config:
  80. ``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha']``
  81. - `ordered_types <./../rules/class_notation/ordered_types.rst>`_ with config:
  82. ``['null_adjustment' => 'always_last', 'sort_algorithm' => 'none']``
  83. - `php_unit_fqcn_annotation <./../rules/php_unit/php_unit_fqcn_annotation.rst>`_
  84. - `php_unit_method_casing <./../rules/php_unit/php_unit_method_casing.rst>`_
  85. - `phpdoc_align <./../rules/phpdoc/phpdoc_align.rst>`_
  86. - `phpdoc_annotation_without_dot <./../rules/phpdoc/phpdoc_annotation_without_dot.rst>`_
  87. - `phpdoc_indent <./../rules/phpdoc/phpdoc_indent.rst>`_
  88. - `phpdoc_inline_tag_normalizer <./../rules/phpdoc/phpdoc_inline_tag_normalizer.rst>`_
  89. - `phpdoc_no_access <./../rules/phpdoc/phpdoc_no_access.rst>`_
  90. - `phpdoc_no_alias_tag <./../rules/phpdoc/phpdoc_no_alias_tag.rst>`_
  91. - `phpdoc_no_package <./../rules/phpdoc/phpdoc_no_package.rst>`_
  92. - `phpdoc_no_useless_inheritdoc <./../rules/phpdoc/phpdoc_no_useless_inheritdoc.rst>`_
  93. - `phpdoc_order <./../rules/phpdoc/phpdoc_order.rst>`_ with config:
  94. ``['order' => ['param', 'return', 'throws']]``
  95. - `phpdoc_return_self_reference <./../rules/phpdoc/phpdoc_return_self_reference.rst>`_
  96. - `phpdoc_scalar <./../rules/phpdoc/phpdoc_scalar.rst>`_
  97. - `phpdoc_separation <./../rules/phpdoc/phpdoc_separation.rst>`_ with config:
  98. ``['groups' => [['Annotation', 'NamedArgumentConstructor', 'Target'], ['author', 'copyright', 'license'], ['category', 'package', 'subpackage'], ['property', 'property-read', 'property-write'], ['deprecated', 'link', 'see', 'since']]]``
  99. - `phpdoc_single_line_var_spacing <./../rules/phpdoc/phpdoc_single_line_var_spacing.rst>`_
  100. - `phpdoc_summary <./../rules/phpdoc/phpdoc_summary.rst>`_
  101. - `phpdoc_tag_type <./../rules/phpdoc/phpdoc_tag_type.rst>`_ with config:
  102. ``['tags' => ['inheritDoc' => 'inline']]``
  103. - `phpdoc_to_comment <./../rules/phpdoc/phpdoc_to_comment.rst>`_
  104. - `phpdoc_trim <./../rules/phpdoc/phpdoc_trim.rst>`_
  105. - `phpdoc_trim_consecutive_blank_line_separation <./../rules/phpdoc/phpdoc_trim_consecutive_blank_line_separation.rst>`_
  106. - `phpdoc_types <./../rules/phpdoc/phpdoc_types.rst>`_
  107. - `phpdoc_types_order <./../rules/phpdoc/phpdoc_types_order.rst>`_ with config:
  108. ``['null_adjustment' => 'always_last', 'sort_algorithm' => 'none']``
  109. - `phpdoc_var_without_name <./../rules/phpdoc/phpdoc_var_without_name.rst>`_
  110. - `semicolon_after_instruction <./../rules/semicolon/semicolon_after_instruction.rst>`_
  111. - `simple_to_complex_string_variable <./../rules/string_notation/simple_to_complex_string_variable.rst>`_
  112. - `single_class_element_per_statement <./../rules/class_notation/single_class_element_per_statement.rst>`_
  113. - `single_import_per_statement <./../rules/import/single_import_per_statement.rst>`_
  114. - `single_line_comment_spacing <./../rules/comment/single_line_comment_spacing.rst>`_
  115. - `single_line_comment_style <./../rules/comment/single_line_comment_style.rst>`_ with config:
  116. ``['comment_types' => ['hash']]``
  117. - `single_line_throw <./../rules/function_notation/single_line_throw.rst>`_
  118. - `single_quote <./../rules/string_notation/single_quote.rst>`_
  119. - `single_space_around_construct <./../rules/language_construct/single_space_around_construct.rst>`_
  120. - `space_after_semicolon <./../rules/semicolon/space_after_semicolon.rst>`_ with config:
  121. ``['remove_in_empty_for_expressions' => true]``
  122. - `standardize_increment <./../rules/operator/standardize_increment.rst>`_
  123. - `standardize_not_equals <./../rules/operator/standardize_not_equals.rst>`_
  124. - `statement_indentation <./../rules/whitespace/statement_indentation.rst>`_ with config:
  125. ``['stick_comment_to_next_continuous_control_statement' => true]``
  126. - `switch_continue_to_break <./../rules/control_structure/switch_continue_to_break.rst>`_
  127. - `trailing_comma_in_multiline <./../rules/control_structure/trailing_comma_in_multiline.rst>`_ with config:
  128. ``['after_heredoc' => true, 'elements' => ['array_destructuring', 'arrays', 'match', 'parameters']]``
  129. - `trim_array_spaces <./../rules/array_notation/trim_array_spaces.rst>`_
  130. - `type_declaration_spaces <./../rules/whitespace/type_declaration_spaces.rst>`_
  131. - `types_spaces <./../rules/whitespace/types_spaces.rst>`_
  132. - `unary_operator_spaces <./../rules/operator/unary_operator_spaces.rst>`_
  133. - `whitespace_after_comma_in_array <./../rules/array_notation/whitespace_after_comma_in_array.rst>`_
  134. - `yoda_style <./../rules/control_structure/yoda_style.rst>`_
  135. Disabled rules
  136. --------------
  137. - `single_line_empty_body <./../rules/basic/single_line_empty_body.rst>`_