This doc explains what each PHP Code Rule does. The Code Rules are sorted alphabetically.
All Code Rules can have two default values that can be used:
- no_apply
- To not apply the Code Rule at all
- ''
- (empty) to use the global Code Rule if used.
Make sure all the array key/value elements are aligned with each other.
Default value: _none_
Possible values: space
, tab
Make sure all the DocBlock @param (and @return) tags are aligned.
Default value: _none_
Possible values: space
, double_space
, triple_space
, quadruple_space
, tab
Align array index => value pairs.
Default value: _none_
Possible values: space
, tab
Make sure the closing line of a PHP file is consistent.
Default value: _none_
Possible values: add
, remove
Make sure all PHP files have a closing PHP tag or force the removal of the file closing PHP tag (default).
Default value: remove
Possible values: remove
, add
Make sure all the control structures have consistent whitespace on the inside of the parentheses.
Default value: _none_
Possible values: no_space
, whitespace
Make sure all the whitespace between a DocBlock and a function is consistent.
Default value: _none_
Possible values: no_space
, newline
Make sure that the whitespace between any 'else'~'if' is consistent.
Default value: _none_
Possible values: no_space
, whitespace
Make sure all whitespace after a single exclamation mark is consistent
Default value: _none_
Possible values: whitespace
, no_space
Make sure all control structures ('if', 'while', 'foreach' etc) have braces.
Default value: _none_
Possible values: force
Make sure all the whitespace after a function argument separator is consistent.
Default value: _none_
Possible values: whitespace
, no_space
Make sure all whitespace in the function parentheses is consistent.
Default value: _none_
Possible values: whitespace
, no_space
Make sure all the code indentation whitespace is consistent.
Default value: _none_
Possible values: tab
, space
Make sure the opening DocBlock line has a double asterisk.
Default value: _none_
Possible values: double
Make sure all the PHP tags have the same casing.
Default value: _none_
Possible values: lower
, upper
Make sure all the PHP tags are consistent. Either full tags () or short tags ( ?>).
Default value: _none_
Possible values: full_php_tags
, short_php_tags
Make sure any double semicolons are removed when added unintentionally.
Default value: _none_
Possible values: remove
Make sure all empty DocBlock lines on the beginning and end are removed.
Default value: _none_
Possible values: remove
Make sure there is or is not a semicolon before a closing PHP tag when possible.
Default value: _none_
Possible values: add
, remove
Make sure the whitespace for a static array index is consistent.
Default value: _none_
Possible values: no_space
, whitespace
Make sure all the whitespace around a string operator is consistent.
Default value: _none_
Possible values: whitespace
, no_space
Make sure all trailing whitespace is removed from every line.
Default value: _none_
Possible values: remove
Make sure all true/false in the code are cased consistently.
Default value: _none_
Possible values: lower
, upper
Make sure all the type cast casing is consistent.
Default value: _none_
Possible values: lower
, upper
Make sure all whitespace inside a type cast is consistent.
Default value: _none_
Possible values: whitespace
, no_space
Make sure all the quotes that are used are consistent.
Default value: _none_
Possible values: single_quotes
, double_quotes
Make sure the whitespace for a variable array index is consistent.
Default value: _none_
Possible values: whitespace
, no_space
Make sure all DocBlock lines have the proper whitespace after the opening asterisk.
Default value: _none_
Possible values: single_space
, double_space
, tab
Make sure all whitespace after a 'else' is consistent (does not apply to 'elseif'.
Default value: _none_
Possible values: space
, newline
, no_space
Make sure all the whitespace after a opening a new function is consistent.
Default value: _none_
Possible values: newline
, no_space
Make sure the whitespace after a new function/method declaration is consistent.
Default value: _none_
Possible values: newline
, double_newline
Make sure the whitespace before a control structure brace is consistent.
Default value: _none_
Possible values: space
, newline
, no_space
Make sure the whitespace before the control structures parentheses is consistent (including but not limited to 'if, foreach, for, switch').
Default value: _none_
Possible values: no_space
, whitespace
Make sure all DocBlock lines have the proper whitespace indentation.
Default value: _none_
Possible values: space
Make sure all whitespace before a 'else' is consistent (does not apply to 'elseif'.
Default value: _none_
Possible values: space
, newline
, no_space
Make sure the whitespace before a function brace is consistent.
Default value: _none_
Possible values: space
, newline
, no_space
Make sure all the whitespace before a function is closed is consistent.
Default value: _none_
Possible values: newline
, no_space
Make sure all the whitespace before the function parentheses is consistent.
Default value: _none_
Possible values: no_space
, whitespace