Symfony.rst 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. - `@PSR12 <./PSR12.rst>`_
  8. - `align_multiline_comment <./../rules/phpdoc/align_multiline_comment.rst>`_
  9. - `array_syntax <./../rules/array_notation/array_syntax.rst>`_
  10. - `backtick_to_shell_exec <./../rules/alias/backtick_to_shell_exec.rst>`_
  11. - `binary_operator_spaces <./../rules/operator/binary_operator_spaces.rst>`_
  12. - `blank_line_before_statement <./../rules/whitespace/blank_line_before_statement.rst>`_ with config:
  13. ``['statements' => ['return']]``
  14. - `cast_spaces <./../rules/cast_notation/cast_spaces.rst>`_
  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. - `curly_braces_position <./../rules/basic/curly_braces_position.rst>`_ with config:
  23. ``['allow_single_line_anonymous_functions' => true, 'allow_single_line_empty_anonymous_classes' => true]``
  24. - `declare_parentheses <./../rules/language_construct/declare_parentheses.rst>`_
  25. - `echo_tag_syntax <./../rules/php_tag/echo_tag_syntax.rst>`_
  26. - `empty_loop_body <./../rules/control_structure/empty_loop_body.rst>`_ with config:
  27. ``['style' => 'braces']``
  28. - `empty_loop_condition <./../rules/control_structure/empty_loop_condition.rst>`_
  29. - `fully_qualified_strict_types <./../rules/import/fully_qualified_strict_types.rst>`_
  30. - `general_phpdoc_tag_rename <./../rules/phpdoc/general_phpdoc_tag_rename.rst>`_ with config:
  31. ``['replacements' => ['inheritDocs' => 'inheritDoc']]``
  32. - `global_namespace_import <./../rules/import/global_namespace_import.rst>`_ with config:
  33. ``['import_classes' => false, 'import_constants' => false, 'import_functions' => false]``
  34. - `include <./../rules/control_structure/include.rst>`_
  35. - `increment_style <./../rules/operator/increment_style.rst>`_
  36. - `integer_literal_case <./../rules/casing/integer_literal_case.rst>`_
  37. - `lambda_not_used_import <./../rules/function_notation/lambda_not_used_import.rst>`_
  38. - `linebreak_after_opening_tag <./../rules/php_tag/linebreak_after_opening_tag.rst>`_
  39. - `long_to_shorthand_operator <./../rules/operator/long_to_shorthand_operator.rst>`_
  40. - `magic_constant_casing <./../rules/casing/magic_constant_casing.rst>`_
  41. - `magic_method_casing <./../rules/casing/magic_method_casing.rst>`_
  42. - `method_argument_space <./../rules/function_notation/method_argument_space.rst>`_ with config:
  43. ``['on_multiline' => 'ignore']``
  44. - `native_function_casing <./../rules/casing/native_function_casing.rst>`_
  45. - `native_function_type_declaration_casing <./../rules/casing/native_function_type_declaration_casing.rst>`_
  46. - `no_alias_language_construct_call <./../rules/alias/no_alias_language_construct_call.rst>`_
  47. - `no_alternative_syntax <./../rules/control_structure/no_alternative_syntax.rst>`_
  48. - `no_binary_string <./../rules/string_notation/no_binary_string.rst>`_
  49. - `no_blank_lines_after_phpdoc <./../rules/phpdoc/no_blank_lines_after_phpdoc.rst>`_
  50. - `no_empty_comment <./../rules/comment/no_empty_comment.rst>`_
  51. - `no_empty_phpdoc <./../rules/phpdoc/no_empty_phpdoc.rst>`_
  52. - `no_empty_statement <./../rules/semicolon/no_empty_statement.rst>`_
  53. - `no_extra_blank_lines <./../rules/whitespace/no_extra_blank_lines.rst>`_ with config:
  54. ``['tokens' => ['attribute', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use']]``
  55. - `no_leading_namespace_whitespace <./../rules/namespace_notation/no_leading_namespace_whitespace.rst>`_
  56. - `no_mixed_echo_print <./../rules/alias/no_mixed_echo_print.rst>`_
  57. - `no_multiline_whitespace_around_double_arrow <./../rules/array_notation/no_multiline_whitespace_around_double_arrow.rst>`_
  58. - `no_null_property_initialization <./../rules/class_notation/no_null_property_initialization.rst>`_
  59. - `no_short_bool_cast <./../rules/cast_notation/no_short_bool_cast.rst>`_
  60. - `no_singleline_whitespace_before_semicolons <./../rules/semicolon/no_singleline_whitespace_before_semicolons.rst>`_
  61. - `no_spaces_around_offset <./../rules/whitespace/no_spaces_around_offset.rst>`_
  62. - `no_superfluous_phpdoc_tags <./../rules/phpdoc/no_superfluous_phpdoc_tags.rst>`_ with config:
  63. ``['remove_inheritdoc' => true]``
  64. - `no_trailing_comma_in_singleline <./../rules/basic/no_trailing_comma_in_singleline.rst>`_
  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_curly_braces <./../rules/control_structure/no_unneeded_curly_braces.rst>`_ with config:
  68. ``['namespaces' => true]``
  69. - `no_unneeded_import_alias <./../rules/import/no_unneeded_import_alias.rst>`_
  70. - `no_unset_cast <./../rules/cast_notation/no_unset_cast.rst>`_
  71. - `no_unused_imports <./../rules/import/no_unused_imports.rst>`_
  72. - `no_useless_concat_operator <./../rules/operator/no_useless_concat_operator.rst>`_
  73. - `no_useless_nullsafe_operator <./../rules/operator/no_useless_nullsafe_operator.rst>`_
  74. - `no_whitespace_before_comma_in_array <./../rules/array_notation/no_whitespace_before_comma_in_array.rst>`_
  75. - `normalize_index_brace <./../rules/array_notation/normalize_index_brace.rst>`_
  76. - `nullable_type_declaration_for_default_null_value <./../rules/function_notation/nullable_type_declaration_for_default_null_value.rst>`_ with config:
  77. ``['use_nullable_type_declaration' => false]``
  78. - `object_operator_without_whitespace <./../rules/operator/object_operator_without_whitespace.rst>`_
  79. - `operator_linebreak <./../rules/operator/operator_linebreak.rst>`_ with config:
  80. ``['only_booleans' => true]``
  81. - `ordered_imports <./../rules/import/ordered_imports.rst>`_ with config:
  82. ``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha']``
  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>`_
  98. - `phpdoc_single_line_var_spacing <./../rules/phpdoc/phpdoc_single_line_var_spacing.rst>`_
  99. - `phpdoc_summary <./../rules/phpdoc/phpdoc_summary.rst>`_
  100. - `phpdoc_tag_type <./../rules/phpdoc/phpdoc_tag_type.rst>`_ with config:
  101. ``['tags' => ['inheritDoc' => 'inline']]``
  102. - `phpdoc_to_comment <./../rules/phpdoc/phpdoc_to_comment.rst>`_
  103. - `phpdoc_trim <./../rules/phpdoc/phpdoc_trim.rst>`_
  104. - `phpdoc_trim_consecutive_blank_line_separation <./../rules/phpdoc/phpdoc_trim_consecutive_blank_line_separation.rst>`_
  105. - `phpdoc_types <./../rules/phpdoc/phpdoc_types.rst>`_
  106. - `phpdoc_types_order <./../rules/phpdoc/phpdoc_types_order.rst>`_ with config:
  107. ``['null_adjustment' => 'always_last', 'sort_algorithm' => 'none']``
  108. - `phpdoc_var_without_name <./../rules/phpdoc/phpdoc_var_without_name.rst>`_
  109. - `semicolon_after_instruction <./../rules/semicolon/semicolon_after_instruction.rst>`_
  110. - `simple_to_complex_string_variable <./../rules/string_notation/simple_to_complex_string_variable.rst>`_
  111. - `single_class_element_per_statement <./../rules/class_notation/single_class_element_per_statement.rst>`_
  112. - `single_import_per_statement <./../rules/import/single_import_per_statement.rst>`_
  113. - `single_line_comment_spacing <./../rules/comment/single_line_comment_spacing.rst>`_
  114. - `single_line_comment_style <./../rules/comment/single_line_comment_style.rst>`_ with config:
  115. ``['comment_types' => ['hash']]``
  116. - `single_line_throw <./../rules/function_notation/single_line_throw.rst>`_
  117. - `single_quote <./../rules/string_notation/single_quote.rst>`_
  118. - `single_space_around_construct <./../rules/language_construct/single_space_around_construct.rst>`_
  119. - `space_after_semicolon <./../rules/semicolon/space_after_semicolon.rst>`_ with config:
  120. ``['remove_in_empty_for_expressions' => true]``
  121. - `standardize_increment <./../rules/operator/standardize_increment.rst>`_
  122. - `standardize_not_equals <./../rules/operator/standardize_not_equals.rst>`_
  123. - `switch_continue_to_break <./../rules/control_structure/switch_continue_to_break.rst>`_
  124. - `trailing_comma_in_multiline <./../rules/control_structure/trailing_comma_in_multiline.rst>`_
  125. - `trim_array_spaces <./../rules/array_notation/trim_array_spaces.rst>`_
  126. - `type_declaration_spaces <./../rules/whitespace/type_declaration_spaces.rst>`_
  127. - `types_spaces <./../rules/whitespace/types_spaces.rst>`_
  128. - `unary_operator_spaces <./../rules/operator/unary_operator_spaces.rst>`_
  129. - `whitespace_after_comma_in_array <./../rules/array_notation/whitespace_after_comma_in_array.rst>`_
  130. - `yoda_style <./../rules/control_structure/yoda_style.rst>`_