do_something (); // Noncompliant; there should not be any space after the method name
foreach ($fruits as $fruit_key => $fruit) { // Noncompliant; in the foreach statement there should be one space before and after "as" keyword and "=>" operator
...
}
}
}
class ClassB
extends ParentClass // Noncompliant; the class name and the "extends" / "implements" keyword should be on the same line
{
...
}
class ClassC extends ParentClass implements \ArrayAccess, \Countable,
\Serializable // Noncompliant; the list of implemented interfaces should be correctly indented
{
public function aVeryLongMethodName(ClassTypeHint $arg1, // Noncompliant; the arguments in a method declaration should be correctly indented
&$arg2, array $arg3 = []) {
$noArgs_longVars = function () use ($longVar1, // Noncompliant; the arguments in a function declaration should be correctly indented
$longerVar2,
$muchLongerVar3
) {
...
};
$foo->bar($longArgument, // Noncompliant; the arguments in a method call should be correctly indented
$longerArgument,
$muchLongerArgument); // Noncompliant; the closing parenthesis should be placed on the next line
$closureWithArgsAndVars = function($arg1, $arg2)use ($var1, $var2) { // Noncompliant; the closure declaration should be correctly spaced - see (5)
* Add a blank line after this "namespace XXX" declaration.
* Move the use declarations after the namespace declarations.
* Add a blank line after this "use" declaration.
* Move this open curly brace to the end of the previous line.
* Move this open curly brace to the beginning of the next line.
* Put [only] one space between the closing parenthesis and the opening curly brace.
* Put [only] one space between this "XXXX" keyword and the opening [parenthesis|curly brace].
* Remove all space [after the opening parenthesis |& before the closing parenthesis].
* Put exactly one space after each ";" character in the ``++for++`` statement.
* [Remove any space before comma separated arguments] [Put exactly one space after comma separated arguments]
* Remove all space between the method name "XXXX" and the opening parenthesis.
* Put exactly one space after and before [``++as++``|``++=>++``] in ``++foreach++`` statement.
* Move this ["else"|"catch"|"finally"] to the same line as the previous closing curly brace.
* [Either split this list into multiple lines or move it on the same line.] [Align all interfaces in this list at column "XX".]
* [Either split this list into multiple lines, aligned at column "XX" or put all elements on line "YYY".] [Align all arguments in this list at column "XX".] [Move the closing parenthesis with the opening brace on the next line.]
* [Either split this list into multiple lines, aligned at column "xx" or put all arguments on line "yyy".] [Align all arguments in this list at column "XX".] [Move the closing parenthesis on the next line.]
* [Put exactly one space between the "function" keyword and the opening parenthesis.] [Put exactly one space before and after the "use" keyword.]
* Move ["extends"] [and] ["implements"] keyword[s] on line {0} to the same line as the declaration of its class name, "XX".