index.rst 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966
  1. =======================
  2. List of Available Rules
  3. =======================
  4. Alias
  5. -----
  6. - `array_push <./alias/array_push.rst>`_ *(risky)*
  7. Converts simple usages of ``array_push($x, $y);`` to ``$x[] = $y;``.
  8. - `backtick_to_shell_exec <./alias/backtick_to_shell_exec.rst>`_
  9. Converts backtick operators to ``shell_exec`` calls.
  10. - `ereg_to_preg <./alias/ereg_to_preg.rst>`_ *(risky)*
  11. Replace deprecated ``ereg`` regular expression functions with ``preg``.
  12. - `mb_str_functions <./alias/mb_str_functions.rst>`_ *(risky)*
  13. Replace non multibyte-safe functions with corresponding mb function.
  14. - `modernize_strpos <./alias/modernize_strpos.rst>`_ *(risky)*
  15. Replace ``strpos()`` calls with ``str_starts_with()`` or ``str_contains()`` if possible.
  16. - `no_alias_functions <./alias/no_alias_functions.rst>`_ *(risky)*
  17. Master functions shall be used instead of aliases.
  18. - `no_alias_language_construct_call <./alias/no_alias_language_construct_call.rst>`_
  19. Master language constructs shall be used instead of aliases.
  20. - `no_mixed_echo_print <./alias/no_mixed_echo_print.rst>`_
  21. Either language construct ``print`` or ``echo`` should be used.
  22. - `pow_to_exponentiation <./alias/pow_to_exponentiation.rst>`_ *(risky)*
  23. Converts ``pow`` to the ``**`` operator.
  24. - `random_api_migration <./alias/random_api_migration.rst>`_ *(risky)*
  25. Replaces ``rand``, ``srand``, ``getrandmax`` functions calls with their ``mt_*`` analogs or ``random_int``.
  26. - `set_type_to_cast <./alias/set_type_to_cast.rst>`_ *(risky)*
  27. Cast shall be used, not ``settype``.
  28. Array Notation
  29. --------------
  30. - `array_syntax <./array_notation/array_syntax.rst>`_
  31. PHP arrays should be declared using the configured syntax.
  32. - `no_multiline_whitespace_around_double_arrow <./array_notation/no_multiline_whitespace_around_double_arrow.rst>`_
  33. Operator ``=>`` should not be surrounded by multi-line whitespaces.
  34. - `no_trailing_comma_in_singleline_array <./array_notation/no_trailing_comma_in_singleline_array.rst>`_ *(deprecated)*
  35. PHP single-line arrays should not have trailing comma.
  36. - `no_whitespace_before_comma_in_array <./array_notation/no_whitespace_before_comma_in_array.rst>`_
  37. In array declaration, there MUST NOT be a whitespace before each comma.
  38. - `normalize_index_brace <./array_notation/normalize_index_brace.rst>`_
  39. Array index should always be written by using square braces.
  40. - `return_to_yield_from <./array_notation/return_to_yield_from.rst>`_
  41. If the function explicitly returns an array, and has the return type ``iterable``, then ``yield from`` must be used instead of ``return``.
  42. - `trim_array_spaces <./array_notation/trim_array_spaces.rst>`_
  43. Arrays should be formatted like function/method arguments, without leading or trailing single line space.
  44. - `whitespace_after_comma_in_array <./array_notation/whitespace_after_comma_in_array.rst>`_
  45. In array declaration, there MUST be a whitespace after each comma.
  46. - `yield_from_array_to_yields <./array_notation/yield_from_array_to_yields.rst>`_ *(risky)*
  47. Yield from array must be unpacked to series of yields.
  48. Attribute Notation
  49. ------------------
  50. - `attribute_empty_parentheses <./attribute_notation/attribute_empty_parentheses.rst>`_
  51. PHP attributes declared without arguments must (not) be followed by empty parentheses.
  52. - `ordered_attributes <./attribute_notation/ordered_attributes.rst>`_
  53. Sorts attributes using the configured sort algorithm.
  54. Basic
  55. -----
  56. - `braces <./basic/braces.rst>`_ *(deprecated)*
  57. The body of each structure MUST be enclosed by braces. Braces should be properly placed. Body of braces should be properly indented.
  58. - `braces_position <./basic/braces_position.rst>`_
  59. Braces must be placed as configured.
  60. - `curly_braces_position <./basic/curly_braces_position.rst>`_ *(deprecated)*
  61. Curly braces must be placed as configured.
  62. - `encoding <./basic/encoding.rst>`_
  63. PHP code MUST use only UTF-8 without BOM (remove BOM).
  64. - `no_multiple_statements_per_line <./basic/no_multiple_statements_per_line.rst>`_
  65. There must not be more than one statement per line.
  66. - `no_trailing_comma_in_singleline <./basic/no_trailing_comma_in_singleline.rst>`_
  67. If a list of values separated by a comma is contained on a single line, then the last item MUST NOT have a trailing comma.
  68. - `non_printable_character <./basic/non_printable_character.rst>`_ *(risky)*
  69. Remove Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible unicode symbols.
  70. - `numeric_literal_separator <./basic/numeric_literal_separator.rst>`_
  71. Adds separators to numeric literals of any kind.
  72. - `octal_notation <./basic/octal_notation.rst>`_
  73. Literal octal must be in ``0o`` notation.
  74. - `psr_autoloading <./basic/psr_autoloading.rst>`_ *(risky)*
  75. Classes must be in a path that matches their namespace, be at least one namespace deep and the class name should match the file name.
  76. - `single_line_empty_body <./basic/single_line_empty_body.rst>`_
  77. Empty body of class, interface, trait, enum or function must be abbreviated as ``{}`` and placed on the same line as the previous symbol, separated by a single space.
  78. Casing
  79. ------
  80. - `class_reference_name_casing <./casing/class_reference_name_casing.rst>`_
  81. When referencing an internal class it must be written using the correct casing.
  82. - `constant_case <./casing/constant_case.rst>`_
  83. The PHP constants ``true``, ``false``, and ``null`` MUST be written using the correct casing.
  84. - `integer_literal_case <./casing/integer_literal_case.rst>`_
  85. Integer literals must be in correct case.
  86. - `lowercase_keywords <./casing/lowercase_keywords.rst>`_
  87. PHP keywords MUST be in lower case.
  88. - `lowercase_static_reference <./casing/lowercase_static_reference.rst>`_
  89. Class static references ``self``, ``static`` and ``parent`` MUST be in lower case.
  90. - `magic_constant_casing <./casing/magic_constant_casing.rst>`_
  91. Magic constants should be referred to using the correct casing.
  92. - `magic_method_casing <./casing/magic_method_casing.rst>`_
  93. Magic method definitions and calls must be using the correct casing.
  94. - `native_function_casing <./casing/native_function_casing.rst>`_
  95. Function defined by PHP should be called using the correct casing.
  96. - `native_function_type_declaration_casing <./casing/native_function_type_declaration_casing.rst>`_ *(deprecated)*
  97. Native type declarations for functions should use the correct case.
  98. - `native_type_declaration_casing <./casing/native_type_declaration_casing.rst>`_
  99. Native type declarations should be used in the correct case.
  100. Cast Notation
  101. -------------
  102. - `cast_spaces <./cast_notation/cast_spaces.rst>`_
  103. A single space or none should be between cast and variable.
  104. - `lowercase_cast <./cast_notation/lowercase_cast.rst>`_
  105. Cast should be written in lower case.
  106. - `modernize_types_casting <./cast_notation/modernize_types_casting.rst>`_ *(risky)*
  107. Replaces ``intval``, ``floatval``, ``doubleval``, ``strval`` and ``boolval`` function calls with according type casting operator.
  108. - `no_short_bool_cast <./cast_notation/no_short_bool_cast.rst>`_
  109. Short cast ``bool`` using double exclamation mark should not be used.
  110. - `no_unset_cast <./cast_notation/no_unset_cast.rst>`_
  111. Variables must be set ``null`` instead of using ``(unset)`` casting.
  112. - `short_scalar_cast <./cast_notation/short_scalar_cast.rst>`_
  113. Cast ``(boolean)`` and ``(integer)`` should be written as ``(bool)`` and ``(int)``, ``(double)`` and ``(real)`` as ``(float)``, ``(binary)`` as ``(string)``.
  114. Class Notation
  115. --------------
  116. - `class_attributes_separation <./class_notation/class_attributes_separation.rst>`_
  117. Class, trait and interface elements must be separated with one or none blank line.
  118. - `class_definition <./class_notation/class_definition.rst>`_
  119. Whitespace around the keywords of a class, trait, enum or interfaces definition should be one space.
  120. - `final_class <./class_notation/final_class.rst>`_ *(risky)*
  121. All classes must be final, except abstract ones and Doctrine entities.
  122. - `final_internal_class <./class_notation/final_internal_class.rst>`_ *(risky)*
  123. Internal classes should be ``final``.
  124. - `final_public_method_for_abstract_class <./class_notation/final_public_method_for_abstract_class.rst>`_ *(risky)*
  125. All ``public`` methods of ``abstract`` classes should be ``final``.
  126. - `no_blank_lines_after_class_opening <./class_notation/no_blank_lines_after_class_opening.rst>`_
  127. There should be no empty lines after class opening brace.
  128. - `no_null_property_initialization <./class_notation/no_null_property_initialization.rst>`_
  129. Properties MUST not be explicitly initialized with ``null`` except when they have a type declaration (PHP 7.4).
  130. - `no_php4_constructor <./class_notation/no_php4_constructor.rst>`_ *(risky)*
  131. Convert PHP4-style constructors to ``__construct``.
  132. - `no_unneeded_final_method <./class_notation/no_unneeded_final_method.rst>`_ *(risky)*
  133. Removes ``final`` from methods where possible.
  134. - `ordered_class_elements <./class_notation/ordered_class_elements.rst>`_
  135. Orders the elements of classes/interfaces/traits/enums.
  136. - `ordered_interfaces <./class_notation/ordered_interfaces.rst>`_
  137. Orders the interfaces in an ``implements`` or ``interface extends`` clause.
  138. - `ordered_traits <./class_notation/ordered_traits.rst>`_ *(risky)*
  139. Trait ``use`` statements must be sorted alphabetically.
  140. - `ordered_types <./class_notation/ordered_types.rst>`_
  141. Sort union types and intersection types using configured order.
  142. - `phpdoc_readonly_class_comment_to_keyword <./class_notation/phpdoc_readonly_class_comment_to_keyword.rst>`_ *(risky)*
  143. Converts readonly comment on classes to the readonly keyword.
  144. - `protected_to_private <./class_notation/protected_to_private.rst>`_
  145. Converts ``protected`` variables and methods to ``private`` where possible.
  146. - `self_accessor <./class_notation/self_accessor.rst>`_ *(risky)*
  147. Inside class or interface element ``self`` should be preferred to the class name itself.
  148. - `self_static_accessor <./class_notation/self_static_accessor.rst>`_
  149. Inside an enum or ``final``/anonymous class, ``self`` should be preferred over ``static``.
  150. - `single_class_element_per_statement <./class_notation/single_class_element_per_statement.rst>`_
  151. There MUST NOT be more than one property or constant declared per statement.
  152. - `single_trait_insert_per_statement <./class_notation/single_trait_insert_per_statement.rst>`_
  153. Each trait ``use`` must be done as single statement.
  154. - `visibility_required <./class_notation/visibility_required.rst>`_
  155. Visibility MUST be declared on all properties and methods; ``abstract`` and ``final`` MUST be declared before the visibility; ``static`` MUST be declared after the visibility.
  156. Class Usage
  157. -----------
  158. - `date_time_immutable <./class_usage/date_time_immutable.rst>`_ *(risky)*
  159. Class ``DateTimeImmutable`` should be used instead of ``DateTime``.
  160. Comment
  161. -------
  162. - `comment_to_phpdoc <./comment/comment_to_phpdoc.rst>`_ *(risky)*
  163. Comments with annotation should be docblock when used on structural elements.
  164. - `header_comment <./comment/header_comment.rst>`_
  165. Add, replace or remove header comment.
  166. - `multiline_comment_opening_closing <./comment/multiline_comment_opening_closing.rst>`_
  167. DocBlocks must start with two asterisks, multiline comments must start with a single asterisk, after the opening slash. Both must end with a single asterisk before the closing slash.
  168. - `no_empty_comment <./comment/no_empty_comment.rst>`_
  169. There should not be any empty comments.
  170. - `no_trailing_whitespace_in_comment <./comment/no_trailing_whitespace_in_comment.rst>`_
  171. There MUST be no trailing spaces inside comment or PHPDoc.
  172. - `single_line_comment_spacing <./comment/single_line_comment_spacing.rst>`_
  173. Single-line comments must have proper spacing.
  174. - `single_line_comment_style <./comment/single_line_comment_style.rst>`_
  175. Single-line comments and multi-line comments with only one line of actual content should use the ``//`` syntax.
  176. Constant Notation
  177. -----------------
  178. - `native_constant_invocation <./constant_notation/native_constant_invocation.rst>`_ *(risky)*
  179. Add leading ``\`` before constant invocation of internal constant to speed up resolving. Constant name match is case-sensitive, except for ``null``, ``false`` and ``true``.
  180. Control Structure
  181. -----------------
  182. - `control_structure_braces <./control_structure/control_structure_braces.rst>`_
  183. The body of each control structure MUST be enclosed within braces.
  184. - `control_structure_continuation_position <./control_structure/control_structure_continuation_position.rst>`_
  185. Control structure continuation keyword must be on the configured line.
  186. - `elseif <./control_structure/elseif.rst>`_
  187. The keyword ``elseif`` should be used instead of ``else if`` so that all control keywords look like single words.
  188. - `empty_loop_body <./control_structure/empty_loop_body.rst>`_
  189. Empty loop-body must be in configured style.
  190. - `empty_loop_condition <./control_structure/empty_loop_condition.rst>`_
  191. Empty loop-condition must be in configured style.
  192. - `include <./control_structure/include.rst>`_
  193. Include/Require and file path should be divided with a single space. File path should not be placed within parentheses.
  194. - `no_alternative_syntax <./control_structure/no_alternative_syntax.rst>`_
  195. Replace control structure alternative syntax to use braces.
  196. - `no_break_comment <./control_structure/no_break_comment.rst>`_
  197. There must be a comment when fall-through is intentional in a non-empty case body.
  198. - `no_superfluous_elseif <./control_structure/no_superfluous_elseif.rst>`_
  199. Replaces superfluous ``elseif`` with ``if``.
  200. - `no_trailing_comma_in_list_call <./control_structure/no_trailing_comma_in_list_call.rst>`_ *(deprecated)*
  201. Remove trailing commas in list function calls.
  202. - `no_unneeded_braces <./control_structure/no_unneeded_braces.rst>`_
  203. Removes unneeded braces that are superfluous and aren't part of a control structure's body.
  204. - `no_unneeded_control_parentheses <./control_structure/no_unneeded_control_parentheses.rst>`_
  205. Removes unneeded parentheses around control statements.
  206. - `no_unneeded_curly_braces <./control_structure/no_unneeded_curly_braces.rst>`_ *(deprecated)*
  207. Removes unneeded curly braces that are superfluous and aren't part of a control structure's body.
  208. - `no_useless_else <./control_structure/no_useless_else.rst>`_
  209. There should not be useless ``else`` cases.
  210. - `simplified_if_return <./control_structure/simplified_if_return.rst>`_
  211. Simplify ``if`` control structures that return the boolean result of their condition.
  212. - `switch_case_semicolon_to_colon <./control_structure/switch_case_semicolon_to_colon.rst>`_
  213. A case should be followed by a colon and not a semicolon.
  214. - `switch_case_space <./control_structure/switch_case_space.rst>`_
  215. Removes extra spaces between colon and case value.
  216. - `switch_continue_to_break <./control_structure/switch_continue_to_break.rst>`_
  217. Switch case must not be ended with ``continue`` but with ``break``.
  218. - `trailing_comma_in_multiline <./control_structure/trailing_comma_in_multiline.rst>`_
  219. Arguments lists, array destructuring lists, arrays that are multi-line, ``match``-lines and parameters lists must have a trailing comma.
  220. - `yoda_style <./control_structure/yoda_style.rst>`_
  221. Write conditions in Yoda style (``true``), non-Yoda style (``['equal' => false, 'identical' => false, 'less_and_greater' => false]``) or ignore those conditions (``null``) based on configuration.
  222. Doctrine Annotation
  223. -------------------
  224. - `doctrine_annotation_array_assignment <./doctrine_annotation/doctrine_annotation_array_assignment.rst>`_
  225. Doctrine annotations must use configured operator for assignment in arrays.
  226. - `doctrine_annotation_braces <./doctrine_annotation/doctrine_annotation_braces.rst>`_
  227. Doctrine annotations without arguments must use the configured syntax.
  228. - `doctrine_annotation_indentation <./doctrine_annotation/doctrine_annotation_indentation.rst>`_
  229. Doctrine annotations must be indented with four spaces.
  230. - `doctrine_annotation_spaces <./doctrine_annotation/doctrine_annotation_spaces.rst>`_
  231. Fixes spaces in Doctrine annotations.
  232. Function Notation
  233. -----------------
  234. - `combine_nested_dirname <./function_notation/combine_nested_dirname.rst>`_ *(risky)*
  235. Replace multiple nested calls of ``dirname`` by only one call with second ``$level`` parameter.
  236. - `date_time_create_from_format_call <./function_notation/date_time_create_from_format_call.rst>`_ *(risky)*
  237. The first argument of ``DateTime::createFromFormat`` method must start with ``!``.
  238. - `fopen_flag_order <./function_notation/fopen_flag_order.rst>`_ *(risky)*
  239. Order the flags in ``fopen`` calls, ``b`` and ``t`` must be last.
  240. - `fopen_flags <./function_notation/fopen_flags.rst>`_ *(risky)*
  241. The flags in ``fopen`` calls must omit ``t``, and ``b`` must be omitted or included consistently.
  242. - `function_declaration <./function_notation/function_declaration.rst>`_
  243. Spaces should be properly placed in a function declaration.
  244. - `function_typehint_space <./function_notation/function_typehint_space.rst>`_ *(deprecated)*
  245. Ensure single space between function's argument and its typehint.
  246. - `implode_call <./function_notation/implode_call.rst>`_ *(risky)*
  247. Function ``implode`` must be called with 2 arguments in the documented order.
  248. - `lambda_not_used_import <./function_notation/lambda_not_used_import.rst>`_
  249. Lambda must not import variables it doesn't use.
  250. - `method_argument_space <./function_notation/method_argument_space.rst>`_
  251. In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after each comma. Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.
  252. - `native_function_invocation <./function_notation/native_function_invocation.rst>`_ *(risky)*
  253. Add leading ``\`` before function invocation to speed up resolving.
  254. - `no_spaces_after_function_name <./function_notation/no_spaces_after_function_name.rst>`_
  255. When making a method or function call, there MUST NOT be a space between the method or function name and the opening parenthesis.
  256. - `no_trailing_comma_in_singleline_function_call <./function_notation/no_trailing_comma_in_singleline_function_call.rst>`_ *(deprecated)*
  257. When making a method or function call on a single line there MUST NOT be a trailing comma after the last argument.
  258. - `no_unreachable_default_argument_value <./function_notation/no_unreachable_default_argument_value.rst>`_ *(risky)*
  259. In function arguments there must not be arguments with default values before non-default ones.
  260. - `no_useless_sprintf <./function_notation/no_useless_sprintf.rst>`_ *(risky)*
  261. There must be no ``sprintf`` calls with only the first argument.
  262. - `nullable_type_declaration_for_default_null_value <./function_notation/nullable_type_declaration_for_default_null_value.rst>`_
  263. Adds or removes ``?`` before single type declarations or ``|null`` at the end of union types when parameters have a default ``null`` value.
  264. - `phpdoc_to_param_type <./function_notation/phpdoc_to_param_type.rst>`_ *(experimental, risky)*
  265. Takes ``@param`` annotations of non-mixed types and adjusts accordingly the function signature.
  266. - `phpdoc_to_property_type <./function_notation/phpdoc_to_property_type.rst>`_ *(experimental, risky)*
  267. Takes ``@var`` annotation of non-mixed types and adjusts accordingly the property signature..
  268. - `phpdoc_to_return_type <./function_notation/phpdoc_to_return_type.rst>`_ *(experimental, risky)*
  269. Takes ``@return`` annotation of non-mixed types and adjusts accordingly the function signature.
  270. - `regular_callable_call <./function_notation/regular_callable_call.rst>`_ *(risky)*
  271. Callables must be called without using ``call_user_func*`` when possible.
  272. - `return_type_declaration <./function_notation/return_type_declaration.rst>`_
  273. Adjust spacing around colon in return type declarations and backed enum types.
  274. - `single_line_throw <./function_notation/single_line_throw.rst>`_
  275. Throwing exception must be done in single line.
  276. - `static_lambda <./function_notation/static_lambda.rst>`_ *(risky)*
  277. Lambdas not (indirectly) referencing ``$this`` must be declared ``static``.
  278. - `use_arrow_functions <./function_notation/use_arrow_functions.rst>`_ *(risky)*
  279. Anonymous functions with one-liner return statement must use arrow functions.
  280. - `void_return <./function_notation/void_return.rst>`_ *(risky)*
  281. Add ``void`` return type to functions with missing or empty return statements, but priority is given to ``@return`` annotations.
  282. Import
  283. ------
  284. - `fully_qualified_strict_types <./import/fully_qualified_strict_types.rst>`_
  285. Removes the leading part of fully qualified symbol references if a given symbol is imported or belongs to the current namespace.
  286. - `global_namespace_import <./import/global_namespace_import.rst>`_
  287. Imports or fully qualifies global classes/functions/constants.
  288. - `group_import <./import/group_import.rst>`_
  289. There MUST be group use for the same namespaces.
  290. - `no_leading_import_slash <./import/no_leading_import_slash.rst>`_
  291. Remove leading slashes in ``use`` clauses.
  292. - `no_unneeded_import_alias <./import/no_unneeded_import_alias.rst>`_
  293. Imports should not be aliased as the same name.
  294. - `no_unused_imports <./import/no_unused_imports.rst>`_
  295. Unused ``use`` statements must be removed.
  296. - `ordered_imports <./import/ordered_imports.rst>`_
  297. Ordering ``use`` statements.
  298. - `single_import_per_statement <./import/single_import_per_statement.rst>`_
  299. There MUST be one use keyword per declaration.
  300. - `single_line_after_imports <./import/single_line_after_imports.rst>`_
  301. Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block.
  302. Language Construct
  303. ------------------
  304. - `class_keyword <./language_construct/class_keyword.rst>`_ *(experimental, risky)*
  305. Converts FQCN strings to ``*::class`` keywords.
  306. - `class_keyword_remove <./language_construct/class_keyword_remove.rst>`_ *(deprecated)*
  307. Converts ``::class`` keywords to FQCN strings.
  308. - `combine_consecutive_issets <./language_construct/combine_consecutive_issets.rst>`_
  309. Using ``isset($var) &&`` multiple times should be done in one call.
  310. - `combine_consecutive_unsets <./language_construct/combine_consecutive_unsets.rst>`_
  311. Calling ``unset`` on multiple items should be done in one call.
  312. - `declare_equal_normalize <./language_construct/declare_equal_normalize.rst>`_
  313. Equal sign in declare statement should be surrounded by spaces or not following configuration.
  314. - `declare_parentheses <./language_construct/declare_parentheses.rst>`_
  315. There must not be spaces around ``declare`` statement parentheses.
  316. - `dir_constant <./language_construct/dir_constant.rst>`_ *(risky)*
  317. Replaces ``dirname(__FILE__)`` expression with equivalent ``__DIR__`` constant.
  318. - `error_suppression <./language_construct/error_suppression.rst>`_ *(risky)*
  319. Error control operator should be added to deprecation notices and/or removed from other cases.
  320. - `explicit_indirect_variable <./language_construct/explicit_indirect_variable.rst>`_
  321. Add curly braces to indirect variables to make them clear to understand.
  322. - `function_to_constant <./language_construct/function_to_constant.rst>`_ *(risky)*
  323. Replace core functions calls returning constants with the constants.
  324. - `get_class_to_class_keyword <./language_construct/get_class_to_class_keyword.rst>`_ *(risky)*
  325. Replace ``get_class`` calls on object variables with class keyword syntax.
  326. - `is_null <./language_construct/is_null.rst>`_ *(risky)*
  327. Replaces ``is_null($var)`` expression with ``null === $var``.
  328. - `no_unset_on_property <./language_construct/no_unset_on_property.rst>`_ *(risky)*
  329. Properties should be set to ``null`` instead of using ``unset``.
  330. - `nullable_type_declaration <./language_construct/nullable_type_declaration.rst>`_
  331. Nullable single type declaration should be standardised using configured syntax.
  332. - `single_space_after_construct <./language_construct/single_space_after_construct.rst>`_ *(deprecated)*
  333. Ensures a single space after language constructs.
  334. - `single_space_around_construct <./language_construct/single_space_around_construct.rst>`_
  335. Ensures a single space after language constructs.
  336. List Notation
  337. -------------
  338. - `list_syntax <./list_notation/list_syntax.rst>`_
  339. List (``array`` destructuring) assignment should be declared using the configured syntax.
  340. Namespace Notation
  341. ------------------
  342. - `blank_line_after_namespace <./namespace_notation/blank_line_after_namespace.rst>`_
  343. There MUST be one blank line after the namespace declaration.
  344. - `blank_lines_before_namespace <./namespace_notation/blank_lines_before_namespace.rst>`_
  345. Controls blank lines before a namespace declaration.
  346. - `clean_namespace <./namespace_notation/clean_namespace.rst>`_
  347. Namespace must not contain spacing, comments or PHPDoc.
  348. - `no_blank_lines_before_namespace <./namespace_notation/no_blank_lines_before_namespace.rst>`_ *(deprecated)*
  349. There should be no blank lines before a namespace declaration.
  350. - `no_leading_namespace_whitespace <./namespace_notation/no_leading_namespace_whitespace.rst>`_
  351. The namespace declaration line shouldn't contain leading whitespace.
  352. - `single_blank_line_before_namespace <./namespace_notation/single_blank_line_before_namespace.rst>`_ *(deprecated)*
  353. There should be exactly one blank line before a namespace declaration.
  354. Naming
  355. ------
  356. - `no_homoglyph_names <./naming/no_homoglyph_names.rst>`_ *(risky)*
  357. Replace accidental usage of homoglyphs (non ascii characters) in names.
  358. Operator
  359. --------
  360. - `assign_null_coalescing_to_coalesce_equal <./operator/assign_null_coalescing_to_coalesce_equal.rst>`_
  361. Use the null coalescing assignment operator ``??=`` where possible.
  362. - `binary_operator_spaces <./operator/binary_operator_spaces.rst>`_
  363. Binary operators should be surrounded by space as configured.
  364. - `concat_space <./operator/concat_space.rst>`_
  365. Concatenation should be spaced according to configuration.
  366. - `increment_style <./operator/increment_style.rst>`_
  367. Pre- or post-increment and decrement operators should be used if possible.
  368. - `logical_operators <./operator/logical_operators.rst>`_ *(risky)*
  369. Use ``&&`` and ``||`` logical operators instead of ``and`` and ``or``.
  370. - `long_to_shorthand_operator <./operator/long_to_shorthand_operator.rst>`_ *(risky)*
  371. Shorthand notation for operators should be used if possible.
  372. - `new_with_braces <./operator/new_with_braces.rst>`_ *(deprecated)*
  373. All instances created with ``new`` keyword must (not) be followed by braces.
  374. - `new_with_parentheses <./operator/new_with_parentheses.rst>`_
  375. All instances created with ``new`` keyword must (not) be followed by parentheses.
  376. - `no_space_around_double_colon <./operator/no_space_around_double_colon.rst>`_
  377. There must be no space around double colons (also called Scope Resolution Operator or Paamayim Nekudotayim).
  378. - `no_useless_concat_operator <./operator/no_useless_concat_operator.rst>`_
  379. There should not be useless concat operations.
  380. - `no_useless_nullsafe_operator <./operator/no_useless_nullsafe_operator.rst>`_
  381. There should not be useless Null-safe operator ``?->`` used.
  382. - `not_operator_with_space <./operator/not_operator_with_space.rst>`_
  383. Logical NOT operators (``!``) should have leading and trailing whitespaces.
  384. - `not_operator_with_successor_space <./operator/not_operator_with_successor_space.rst>`_
  385. Logical NOT operators (``!``) should have one trailing whitespace.
  386. - `object_operator_without_whitespace <./operator/object_operator_without_whitespace.rst>`_
  387. There should not be space before or after object operators ``->`` and ``?->``.
  388. - `operator_linebreak <./operator/operator_linebreak.rst>`_
  389. Operators - when multiline - must always be at the beginning or at the end of the line.
  390. - `standardize_increment <./operator/standardize_increment.rst>`_
  391. Increment and decrement operators should be used if possible.
  392. - `standardize_not_equals <./operator/standardize_not_equals.rst>`_
  393. Replace all ``<>`` with ``!=``.
  394. - `ternary_operator_spaces <./operator/ternary_operator_spaces.rst>`_
  395. Standardize spaces around ternary operator.
  396. - `ternary_to_elvis_operator <./operator/ternary_to_elvis_operator.rst>`_ *(risky)*
  397. Use the Elvis operator ``?:`` where possible.
  398. - `ternary_to_null_coalescing <./operator/ternary_to_null_coalescing.rst>`_
  399. Use ``null`` coalescing operator ``??`` where possible.
  400. - `unary_operator_spaces <./operator/unary_operator_spaces.rst>`_
  401. Unary operators should be placed adjacent to their operands.
  402. PHP Tag
  403. -------
  404. - `blank_line_after_opening_tag <./php_tag/blank_line_after_opening_tag.rst>`_
  405. Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line.
  406. - `echo_tag_syntax <./php_tag/echo_tag_syntax.rst>`_
  407. Replaces short-echo ``<?=`` with long format ``<?php echo``/``<?php print`` syntax, or vice-versa.
  408. - `full_opening_tag <./php_tag/full_opening_tag.rst>`_
  409. PHP code must use the long ``<?php`` tags or short-echo ``<?=`` tags and not other tag variations.
  410. - `linebreak_after_opening_tag <./php_tag/linebreak_after_opening_tag.rst>`_
  411. Ensure there is no code on the same line as the PHP open tag.
  412. - `no_closing_tag <./php_tag/no_closing_tag.rst>`_
  413. The closing ``?>`` tag MUST be omitted from files containing only PHP.
  414. PHPUnit
  415. -------
  416. - `php_unit_assert_new_names <./php_unit/php_unit_assert_new_names.rst>`_ *(risky)*
  417. Rename deprecated PHPUnit assertions like ``assertFileNotExists`` to new methods like ``assertFileDoesNotExist``.
  418. - `php_unit_attributes <./php_unit/php_unit_attributes.rst>`_
  419. PHPUnit attributes must be used over their respective PHPDoc-based annotations.
  420. - `php_unit_construct <./php_unit/php_unit_construct.rst>`_ *(risky)*
  421. PHPUnit assertion method calls like ``->assertSame(true, $foo)`` should be written with dedicated method like ``->assertTrue($foo)``.
  422. - `php_unit_data_provider_name <./php_unit/php_unit_data_provider_name.rst>`_ *(risky)*
  423. Data provider names must match the name of the test.
  424. - `php_unit_data_provider_return_type <./php_unit/php_unit_data_provider_return_type.rst>`_ *(risky)*
  425. The return type of PHPUnit data provider must be ``iterable``.
  426. - `php_unit_data_provider_static <./php_unit/php_unit_data_provider_static.rst>`_ *(risky)*
  427. Data providers must be static.
  428. - `php_unit_dedicate_assert <./php_unit/php_unit_dedicate_assert.rst>`_ *(risky)*
  429. PHPUnit assertions like ``assertInternalType``, ``assertFileExists``, should be used over ``assertTrue``.
  430. - `php_unit_dedicate_assert_internal_type <./php_unit/php_unit_dedicate_assert_internal_type.rst>`_ *(risky)*
  431. PHPUnit assertions like ``assertIsArray`` should be used over ``assertInternalType``.
  432. - `php_unit_expectation <./php_unit/php_unit_expectation.rst>`_ *(risky)*
  433. Usages of ``->setExpectedException*`` methods MUST be replaced by ``->expectException*`` methods.
  434. - `php_unit_fqcn_annotation <./php_unit/php_unit_fqcn_annotation.rst>`_
  435. PHPUnit annotations should be a FQCNs including a root namespace.
  436. - `php_unit_internal_class <./php_unit/php_unit_internal_class.rst>`_
  437. All PHPUnit test classes should be marked as internal.
  438. - `php_unit_method_casing <./php_unit/php_unit_method_casing.rst>`_
  439. Enforce camel (or snake) case for PHPUnit test methods, following configuration.
  440. - `php_unit_mock <./php_unit/php_unit_mock.rst>`_ *(risky)*
  441. Usages of ``->getMock`` and ``->getMockWithoutInvokingTheOriginalConstructor`` methods MUST be replaced by ``->createMock`` or ``->createPartialMock`` methods.
  442. - `php_unit_mock_short_will_return <./php_unit/php_unit_mock_short_will_return.rst>`_ *(risky)*
  443. Usage of PHPUnit's mock e.g. ``->will($this->returnValue(..))`` must be replaced by its shorter equivalent such as ``->willReturn(...)``.
  444. - `php_unit_namespaced <./php_unit/php_unit_namespaced.rst>`_ *(risky)*
  445. PHPUnit classes MUST be used in namespaced version, e.g. ``\PHPUnit\Framework\TestCase`` instead of ``\PHPUnit_Framework_TestCase``.
  446. - `php_unit_no_expectation_annotation <./php_unit/php_unit_no_expectation_annotation.rst>`_ *(risky)*
  447. Usages of ``@expectedException*`` annotations MUST be replaced by ``->setExpectedException*`` methods.
  448. - `php_unit_set_up_tear_down_visibility <./php_unit/php_unit_set_up_tear_down_visibility.rst>`_ *(risky)*
  449. Changes the visibility of the ``setUp()`` and ``tearDown()`` functions of PHPUnit to ``protected``, to match the PHPUnit TestCase.
  450. - `php_unit_size_class <./php_unit/php_unit_size_class.rst>`_
  451. All PHPUnit test cases should have ``@small``, ``@medium`` or ``@large`` annotation to enable run time limits.
  452. - `php_unit_strict <./php_unit/php_unit_strict.rst>`_ *(risky)*
  453. PHPUnit methods like ``assertSame`` should be used instead of ``assertEquals``.
  454. - `php_unit_test_annotation <./php_unit/php_unit_test_annotation.rst>`_ *(risky)*
  455. Adds or removes @test annotations from tests, following configuration.
  456. - `php_unit_test_case_static_method_calls <./php_unit/php_unit_test_case_static_method_calls.rst>`_ *(risky)*
  457. Calls to ``PHPUnit\Framework\TestCase`` static methods must all be of the same type, either ``$this->``, ``self::`` or ``static::``.
  458. - `php_unit_test_class_requires_covers <./php_unit/php_unit_test_class_requires_covers.rst>`_
  459. Adds a default ``@coversNothing`` annotation to PHPUnit test classes that have no ``@covers*`` annotation.
  460. PHPDoc
  461. ------
  462. - `align_multiline_comment <./phpdoc/align_multiline_comment.rst>`_
  463. Each line of multi-line DocComments must have an asterisk [PSR-5] and must be aligned with the first one.
  464. - `general_phpdoc_annotation_remove <./phpdoc/general_phpdoc_annotation_remove.rst>`_
  465. Configured annotations should be omitted from PHPDoc.
  466. - `general_phpdoc_tag_rename <./phpdoc/general_phpdoc_tag_rename.rst>`_
  467. Renames PHPDoc tags.
  468. - `no_blank_lines_after_phpdoc <./phpdoc/no_blank_lines_after_phpdoc.rst>`_
  469. There should not be blank lines between docblock and the documented element.
  470. - `no_empty_phpdoc <./phpdoc/no_empty_phpdoc.rst>`_
  471. There should not be empty PHPDoc blocks.
  472. - `no_superfluous_phpdoc_tags <./phpdoc/no_superfluous_phpdoc_tags.rst>`_
  473. Removes ``@param``, ``@return`` and ``@var`` tags that don't provide any useful information.
  474. - `phpdoc_add_missing_param_annotation <./phpdoc/phpdoc_add_missing_param_annotation.rst>`_
  475. PHPDoc should contain ``@param`` for all params.
  476. - `phpdoc_align <./phpdoc/phpdoc_align.rst>`_
  477. All items of the given PHPDoc tags must be either left-aligned or (by default) aligned vertically.
  478. - `phpdoc_annotation_without_dot <./phpdoc/phpdoc_annotation_without_dot.rst>`_
  479. PHPDoc annotation descriptions should not be a sentence.
  480. - `phpdoc_array_type <./phpdoc/phpdoc_array_type.rst>`_ *(risky)*
  481. PHPDoc ``array<T>`` type must be used instead of ``T[]``.
  482. - `phpdoc_indent <./phpdoc/phpdoc_indent.rst>`_
  483. Docblocks should have the same indentation as the documented subject.
  484. - `phpdoc_inline_tag_normalizer <./phpdoc/phpdoc_inline_tag_normalizer.rst>`_
  485. Fixes PHPDoc inline tags.
  486. - `phpdoc_line_span <./phpdoc/phpdoc_line_span.rst>`_
  487. Changes doc blocks from single to multi line, or reversed. Works for class constants, properties and methods only.
  488. - `phpdoc_list_type <./phpdoc/phpdoc_list_type.rst>`_ *(risky)*
  489. PHPDoc ``list`` type must be used instead of ``array`` without a key.
  490. - `phpdoc_no_access <./phpdoc/phpdoc_no_access.rst>`_
  491. ``@access`` annotations should be omitted from PHPDoc.
  492. - `phpdoc_no_alias_tag <./phpdoc/phpdoc_no_alias_tag.rst>`_
  493. No alias PHPDoc tags should be used.
  494. - `phpdoc_no_empty_return <./phpdoc/phpdoc_no_empty_return.rst>`_
  495. ``@return void`` and ``@return null`` annotations should be omitted from PHPDoc.
  496. - `phpdoc_no_package <./phpdoc/phpdoc_no_package.rst>`_
  497. ``@package`` and ``@subpackage`` annotations should be omitted from PHPDoc.
  498. - `phpdoc_no_useless_inheritdoc <./phpdoc/phpdoc_no_useless_inheritdoc.rst>`_
  499. Classy that does not inherit must not have ``@inheritdoc`` tags.
  500. - `phpdoc_order_by_value <./phpdoc/phpdoc_order_by_value.rst>`_
  501. Order PHPDoc tags by value.
  502. - `phpdoc_order <./phpdoc/phpdoc_order.rst>`_
  503. Annotations in PHPDoc should be ordered in defined sequence.
  504. - `phpdoc_param_order <./phpdoc/phpdoc_param_order.rst>`_
  505. Orders all ``@param`` annotations in DocBlocks according to method signature.
  506. - `phpdoc_return_self_reference <./phpdoc/phpdoc_return_self_reference.rst>`_
  507. The type of ``@return`` annotations of methods returning a reference to itself must the configured one.
  508. - `phpdoc_scalar <./phpdoc/phpdoc_scalar.rst>`_
  509. Scalar types should always be written in the same form. ``int`` not ``integer``, ``bool`` not ``boolean``, ``float`` not ``real`` or ``double``.
  510. - `phpdoc_separation <./phpdoc/phpdoc_separation.rst>`_
  511. Annotations in PHPDoc should be grouped together so that annotations of the same type immediately follow each other. Annotations of a different type are separated by a single blank line.
  512. - `phpdoc_single_line_var_spacing <./phpdoc/phpdoc_single_line_var_spacing.rst>`_
  513. Single line ``@var`` PHPDoc should have proper spacing.
  514. - `phpdoc_summary <./phpdoc/phpdoc_summary.rst>`_
  515. PHPDoc summary should end in either a full stop, exclamation mark, or question mark.
  516. - `phpdoc_tag_casing <./phpdoc/phpdoc_tag_casing.rst>`_
  517. Fixes casing of PHPDoc tags.
  518. - `phpdoc_tag_type <./phpdoc/phpdoc_tag_type.rst>`_
  519. Forces PHPDoc tags to be either regular annotations or inline.
  520. - `phpdoc_to_comment <./phpdoc/phpdoc_to_comment.rst>`_
  521. Docblocks should only be used on structural elements.
  522. - `phpdoc_trim_consecutive_blank_line_separation <./phpdoc/phpdoc_trim_consecutive_blank_line_separation.rst>`_
  523. Removes extra blank lines after summary and after description in PHPDoc.
  524. - `phpdoc_trim <./phpdoc/phpdoc_trim.rst>`_
  525. PHPDoc should start and end with content, excluding the very first and last line of the docblocks.
  526. - `phpdoc_types <./phpdoc/phpdoc_types.rst>`_
  527. The correct case must be used for standard PHP types in PHPDoc.
  528. - `phpdoc_types_order <./phpdoc/phpdoc_types_order.rst>`_
  529. Sorts PHPDoc types.
  530. - `phpdoc_var_annotation_correct_order <./phpdoc/phpdoc_var_annotation_correct_order.rst>`_
  531. ``@var`` and ``@type`` annotations must have type and name in the correct order.
  532. - `phpdoc_var_without_name <./phpdoc/phpdoc_var_without_name.rst>`_
  533. ``@var`` and ``@type`` annotations of classy properties should not contain the name.
  534. Return Notation
  535. ---------------
  536. - `no_useless_return <./return_notation/no_useless_return.rst>`_
  537. There should not be an empty ``return`` statement at the end of a function.
  538. - `return_assignment <./return_notation/return_assignment.rst>`_
  539. Local, dynamic and directly referenced variables should not be assigned and directly returned by a function or method.
  540. - `simplified_null_return <./return_notation/simplified_null_return.rst>`_
  541. A return statement wishing to return ``void`` should not return ``null``.
  542. Semicolon
  543. ---------
  544. - `multiline_whitespace_before_semicolons <./semicolon/multiline_whitespace_before_semicolons.rst>`_
  545. Forbid multi-line whitespace before the closing semicolon or move the semicolon to the new line for chained calls.
  546. - `no_empty_statement <./semicolon/no_empty_statement.rst>`_
  547. Remove useless (semicolon) statements.
  548. - `no_singleline_whitespace_before_semicolons <./semicolon/no_singleline_whitespace_before_semicolons.rst>`_
  549. Single-line whitespace before closing semicolon are prohibited.
  550. - `semicolon_after_instruction <./semicolon/semicolon_after_instruction.rst>`_
  551. Instructions must be terminated with a semicolon.
  552. - `space_after_semicolon <./semicolon/space_after_semicolon.rst>`_
  553. Fix whitespace after a semicolon.
  554. Strict
  555. ------
  556. - `declare_strict_types <./strict/declare_strict_types.rst>`_ *(risky)*
  557. Force strict types declaration in all files.
  558. - `strict_comparison <./strict/strict_comparison.rst>`_ *(risky)*
  559. Comparisons should be strict.
  560. - `strict_param <./strict/strict_param.rst>`_ *(risky)*
  561. Functions should be used with ``$strict`` param set to ``true``.
  562. String Notation
  563. ---------------
  564. - `escape_implicit_backslashes <./string_notation/escape_implicit_backslashes.rst>`_ *(deprecated)*
  565. Escape implicit backslashes in strings and heredocs to ease the understanding of which are special chars interpreted by PHP and which not.
  566. - `explicit_string_variable <./string_notation/explicit_string_variable.rst>`_
  567. Converts implicit variables into explicit ones in double-quoted strings or heredoc syntax.
  568. - `heredoc_closing_marker <./string_notation/heredoc_closing_marker.rst>`_
  569. Unify ``heredoc`` or ``nowdoc`` closing marker.
  570. - `heredoc_to_nowdoc <./string_notation/heredoc_to_nowdoc.rst>`_
  571. Convert ``heredoc`` to ``nowdoc`` where possible.
  572. - `multiline_string_to_heredoc <./string_notation/multiline_string_to_heredoc.rst>`_
  573. Convert multiline string to ``heredoc`` or ``nowdoc``.
  574. - `no_binary_string <./string_notation/no_binary_string.rst>`_
  575. There should not be a binary flag before strings.
  576. - `no_trailing_whitespace_in_string <./string_notation/no_trailing_whitespace_in_string.rst>`_ *(risky)*
  577. There must be no trailing whitespace in strings.
  578. - `simple_to_complex_string_variable <./string_notation/simple_to_complex_string_variable.rst>`_
  579. Converts explicit variables in double-quoted strings and heredoc syntax from simple to complex format (``${`` to ``{$``).
  580. - `single_quote <./string_notation/single_quote.rst>`_
  581. Convert double quotes to single quotes for simple strings.
  582. - `string_implicit_backslashes <./string_notation/string_implicit_backslashes.rst>`_
  583. Handles implicit backslashes in strings and heredocs. Depending on the chosen strategy, it can escape implicit backslashes to ease the understanding of which are special chars interpreted by PHP and which not (``escape``), or it can remove these additional backslashes if you find them superfluous (``unescape``). You can also leave them as-is using ``ignore`` strategy.
  584. - `string_length_to_empty <./string_notation/string_length_to_empty.rst>`_ *(risky)*
  585. String tests for empty must be done against ``''``, not with ``strlen``.
  586. - `string_line_ending <./string_notation/string_line_ending.rst>`_ *(risky)*
  587. All multi-line strings must use correct line ending.
  588. Whitespace
  589. ----------
  590. - `array_indentation <./whitespace/array_indentation.rst>`_
  591. Each element of an array must be indented exactly once.
  592. - `blank_line_before_statement <./whitespace/blank_line_before_statement.rst>`_
  593. An empty line feed must precede any configured statement.
  594. - `blank_line_between_import_groups <./whitespace/blank_line_between_import_groups.rst>`_
  595. Putting blank lines between ``use`` statement groups.
  596. - `compact_nullable_type_declaration <./whitespace/compact_nullable_type_declaration.rst>`_
  597. Remove extra spaces in a nullable type declaration.
  598. - `compact_nullable_typehint <./whitespace/compact_nullable_typehint.rst>`_ *(deprecated)*
  599. Remove extra spaces in a nullable typehint.
  600. - `heredoc_indentation <./whitespace/heredoc_indentation.rst>`_
  601. Heredoc/nowdoc content must be properly indented.
  602. - `indentation_type <./whitespace/indentation_type.rst>`_
  603. Code MUST use configured indentation type.
  604. - `line_ending <./whitespace/line_ending.rst>`_
  605. All PHP files must use same line ending.
  606. - `method_chaining_indentation <./whitespace/method_chaining_indentation.rst>`_
  607. Method chaining MUST be properly indented. Method chaining with different levels of indentation is not supported.
  608. - `no_extra_blank_lines <./whitespace/no_extra_blank_lines.rst>`_
  609. Removes extra blank lines and/or blank lines following configuration.
  610. - `no_spaces_around_offset <./whitespace/no_spaces_around_offset.rst>`_
  611. There MUST NOT be spaces around offset braces.
  612. - `no_spaces_inside_parenthesis <./whitespace/no_spaces_inside_parenthesis.rst>`_ *(deprecated)*
  613. There MUST NOT be a space after the opening parenthesis. There MUST NOT be a space before the closing parenthesis.
  614. - `no_trailing_whitespace <./whitespace/no_trailing_whitespace.rst>`_
  615. Remove trailing whitespace at the end of non-blank lines.
  616. - `no_whitespace_in_blank_line <./whitespace/no_whitespace_in_blank_line.rst>`_
  617. Remove trailing whitespace at the end of blank lines.
  618. - `single_blank_line_at_eof <./whitespace/single_blank_line_at_eof.rst>`_
  619. A PHP file without end tag must always end with a single empty line feed.
  620. - `spaces_inside_parentheses <./whitespace/spaces_inside_parentheses.rst>`_
  621. Parentheses must be declared using the configured whitespace.
  622. - `statement_indentation <./whitespace/statement_indentation.rst>`_
  623. Each statement must be indented.
  624. - `type_declaration_spaces <./whitespace/type_declaration_spaces.rst>`_
  625. Ensure single space between a variable and its type declaration in function arguments and properties.
  626. - `types_spaces <./whitespace/types_spaces.rst>`_
  627. A single space or none should be around union type and intersection type operators.