ForceMultipleLinesSniff
Warn if phpdoc is single line (unless its on variable)
Disallowed:
/** @property-read $bar */
class Foo
{
/** @var Bar */
public $bar;
}
Allowed:
/**
* @property-read $bar
*/
class Foo
{
/**
* @var Bar
*/
public $bar;
}
NullFirstSniff
Disallowed:
/** @property-read Foo|NULL $bar */
Allowed:
/** @property-read NULL|Foo $bar */
SeparateInjectSniff
@inject
must not be on same line as @var
.
SeparateBracketsSniff
force newline before opening curly bracket of if
, else
, elseif
, foreach
and for
blocks:
if (...)
{
return TRUE;
}
ClassDebuggerCallSniff
Warn if methods dump
, barDump
, firelog
or timer
are called on Debugger
class.
DebugFunctionCallSniff
Warn if function d
, dd
, de
, dump
, var_dump
, error_log
, or print_r
is called.
UseInAlphabeticalOrderSniff
UseWithoutStartingSeparator
Warn on use \Foo\Bar;
, suggest use Foo\Bar
instead.
AbstractOrFinalPresenterSniff
Nette Presenter classes must be either abstract or final.
UseDeclarationSniff
Use declarations must be right after namespace declaration, separated by exactly one empty line. There must be exactly one use per declaration. There must be exactly two empty lines after last use declaration.
NamespaceNewlinesSniff
Namespace declaration must be directly under php opening tag, separated by exactly one empty line. There must be exactly one empty line between namespace declaration and first use declaration. If no use declaration follows, there must be two lines after namespace declaration.
<?php
namespace Foo;
use Bar;
class Quaz {}
UseNewlinesSniff
Use declarations must have no empty newlines in between.
KeywordCaseSniff
Checks that all constructs but logical operators are lowercase.
(e.g.: foreach
instead of ForEach
)
UpperCaseBooleanConstantSniff UpperCaseNullConstantSniff
TRUE && FALSE && NULL;
ConcatenationSpacingSniff
Concatenation operator (.
) must be separated by exacly one
space on both sides.
VariableNameSniff
Enforce camelCase and deny leading underscore.
CommaSpacingSniff
Ensures there is no whitespaces before and exactly one space after each comma.
ListSpacingSniff
Disallows:
list ($a, $b);
Allows
list($a, $b);