Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rule Description
Generic.Arrays.ArrayIndent Ensures that array are indented one tab stop.
Generic.Arrays.DisallowLongArraySyntax Bans the use of the PHP long array syntax.
Generic.Arrays.DisallowShortArraySyntax Bans the use of the PHP short array syntax.
Generic.Classes.DuplicateClassName Reports errors if the same class or interface name is used in multiple files.
Generic.Classes.OpeningBraceSameLine Checks that the opening brace of a class/interface/trait is on the same line as the class declaration.
Generic.CodeAnalysis.AssignmentInCondition Detects variable assignments being made within conditions.
Generic.CodeAnalysis.EmptyPHPStatement Checks against empty PHP statements.
Generic.CodeAnalysis.EmptyStatement This sniff class detected empty statement.
Generic.CodeAnalysis.ForLoopShouldBeWhileLoop Detects for-loops that can be simplified to a while-loop.
Generic.CodeAnalysis.ForLoopWithTestFunctionCall Detects for-loops that use a function call in the test expression.
Generic.CodeAnalysis.JumbledIncrementer Detects incrementer jumbling in for loops.
Generic.CodeAnalysis.UnconditionalIfStatement Detects unconditional if- and elseif-statements.
Generic.CodeAnalysis.UnnecessaryFinalModifier Detects unnecessary final modifiers inside of final classes.
Generic.CodeAnalysis.UnusedFunctionParameter Checks for unused function parameters.
Generic.CodeAnalysis.UselessOverridingMethod Detects unnecessary overridden methods that simply call their parent.
Generic.Commenting.DocComment Ensures doc blocks follow basic formatting.
Generic.Commenting.Fixme Warns about FIXME comments.
Generic.Commenting.Todo Warns about TODO comments.
Generic.ControlStructures.DisallowYodaConditions Ban the use of Yoda conditions.
Generic.ControlStructures.InlineControlStructure Verifies that inline control statements are not present.
Generic.Debug.CSSLint Runs csslint on the file.
Generic.Debug.ClosureLinter Runs gjslint on the file.
Generic.Debug.ESLint Runs eslint on the file.
Generic.Debug.JSHint Runs jshint.js on the file.
Generic.Files.ByteOrderMark A simple sniff for detecting BOMs that may corrupt application work.
Generic.Files.EndFileNewline Ensures the file ends with a newline character.
Generic.Files.EndFileNoNewline Ensures the file does not end with a newline character.
Generic.Files.InlineHTML Ensures the whole file is PHP only, with no whitespace or inline HTML.
Generic.Files.LineEndings Checks that end of line characters are correct.
Generic.Files.LineLength Checks the length of all lines in a file.
Generic.Files.LowercasedFilename Checks that all file names are lowercased.
Generic.Files.OneClassPerFile Checks that only one class is declared per file.
Generic.Files.OneInterfacePerFile Checks that only one interface is declared per file.
Generic.Files.OneObjectStructurePerFile Checks that only one object structure is declared per file.
Generic.Files.OneTraitPerFile Checks that only one trait is declared per file.
Generic.Formatting.DisallowMultipleStatements Ensures each statement is on a line by itself.
Generic.Formatting.MultipleStatementAlignment Checks alignment of assignments.
Generic.Formatting.NoSpaceAfterCast Ensures there is no space after cast tokens.
Generic.Formatting.SpaceAfterCast Ensures there is a single space after cast tokens.
Generic.Formatting.SpaceAfterNot Ensures there is a single space after a NOT operator.
Generic.Formatting.SpaceBeforeCast Ensures there is a single space before cast tokens.
Generic.Functions.CallTimePassByReference Ensures that variables are not passed by reference when calling a function.
Generic.Functions.FunctionCallArgumentSpacing Checks that calls to methods and functions are spaced correctly.
Generic.Functions.OpeningFunctionBraceBsdAllman Checks that the opening brace of a function is on the line after the function declaration.
Generic.Functions.OpeningFunctionBraceKernighanRitchie Checks that the opening brace of a function is on the same line as the function declaration.
Generic.Metrics.CyclomaticComplexity Checks the cyclomatic complexity (McCabe) for functions.
Generic.Metrics.NestingLevel Checks the nesting level for methods.
Generic.NamingConventions.CamelCapsFunctionName Ensures method and functions are named correctly.
Generic.NamingConventions.ConstructorName Bans PHP 4 style constructors.
Generic.NamingConventions.UpperCaseConstantName Ensures that constant names are all uppercase.
Generic.PHP.BacktickOperator Bans the use of the backtick execution operator.
Generic.PHP.CharacterBeforePHPOpeningTag Checks that the opening PHP tag is the first content in a file.
Generic.PHP.ClosingPHPTag Checks that open PHP tags are paired with closing tags.
Generic.PHP.DeprecatedFunctions Discourages the use of deprecated PHP functions.
Generic.PHP.DisallowAlternativePHPTags Verifies that no alternative PHP tags are used.
Generic.PHP.DisallowShortOpenTag Makes sure that shorthand PHP open tags are not used.
Generic.PHP.DiscourageGoto Discourage the use of the PHP goto language construct.
Generic.PHP.ForbiddenFunctions Discourages the use of alias functions.
Generic.PHP.LowerCaseConstant Checks that all uses of true, false and null are lowercase.
Generic.PHP.LowerCaseKeyword Checks that all PHP keywords are lowercase.
Generic.PHP.LowerCaseType Checks that all PHP types are lowercase.
Generic.PHP.NoSilencedErrors Throws an error or warning when any code prefixed with an asperand is encountered.
Generic.PHP.RequireStrictTypes Checks that the strict_types has been declared.
Generic.PHP.SAPIUsage Ensures the PHP_SAPI constant is used instead of php_sapi_name().
Generic.PHP.Syntax Ensures PHP believes the syntax is clean.
Generic.PHP.UpperCaseConstant Checks that all uses of TRUE, FALSE and NULL are uppercase.
Generic.Strings.UnnecessaryStringConcat Checks that two strings are not concatenated together; suggests using one string instead.
Generic.VersionControl.GitMergeConflict Check for merge conflict artifacts
Generic.VersionControl.SubversionProperties Tests that the correct Subversion properties are set.
Generic.WhiteSpace.ArbitraryParenthesesSpacing Check & fix whitespace on the inside of arbitrary parentheses.
Generic.WhiteSpace.DisallowSpaceIndent Throws errors if spaces are used for indentation other than precision indentation.
Generic.WhiteSpace.DisallowTabIndent Throws errors if tabs are used for indentation.
Generic.WhiteSpace.IncrementDecrementSpacing Verifies spacing between variables and increment/decrement operators.
Generic.WhiteSpace.LanguageConstructSpacing Ensures all language constructs contain a single space between themselves and their content.
Generic.WhiteSpace.ScopeIndent Checks that control structures are defined and indented correctly.
Generic.WhiteSpace.SpreadOperatorSpacingAfter Verifies spacing between the spread operator and the variable/function call it applies to.
MySource.CSS.BrowserSpecificStyles Ensure that browser-specific styles are not used.
MySource.Channels.DisallowSelfActions Ensures that self and static are not used to call public methods in action classes.
MySource.Channels.IncludeOwnSystem Ensures that a system does not include itself.
MySource.Channels.IncludeSystem Ensures that systems, asset types and libs are included before they are used.
MySource.Channels.UnusedSystem Ensures that systems and asset types are used if they are included.
MySource.Commenting.FunctionComment Parses and verifies the doc comments for functions.
MySource.Debug.DebugCode Warns about the use of debug code.
MySource.Debug.FirebugConsole Ensures that console is not used for function or var names.
MySource.Objects.AssignThis Ensures this is not assigned to any other var but self.
MySource.Objects.CreateWidgetTypeCallback Ensures the create() method of widget types properly uses callbacks.
MySource.Objects.DisallowNewWidget Ensures that widgets are not manually created.
MySource.PHP.AjaxNullComparison Ensures that values submitted via JS are not compared to NULL.
MySource.PHP.EvalObjectFactory Ensures that eval() is not used to create objects.
MySource.PHP.GetRequestData Ensures that getRequestData() is used to access super globals.
MySource.PHP.ReturnFunctionValue Warns when function values are returned directly.
MySource.Strings.JoinStrings Ensures that strings are not joined using array.join().
PEAR.Classes.ClassDeclaration Checks the declaration of the class is correct.
PEAR.Commenting.ClassComment Parses and verifies the doc comments for classes.
PEAR.Commenting.FileComment Parses and verifies the doc comments for files.
PEAR.Commenting.FunctionComment Parses and verifies the doc comments for functions.
PEAR.Commenting.InlineComment Checks that no Perl-style comments are used.
PEAR.ControlStructures.ControlSignature Verifies that control statements conform to their coding standards.
PEAR.ControlStructures.MultiLineCondition Ensure multi-line IF conditions are defined correctly.
PEAR.Files.IncludingFile Ensure include_once is used in conditional situations and require_once is used elsewhere.
PEAR.Formatting.MultiLineAssignment If an assignment goes over two lines, ensure the equal sign is indented.
PEAR.Functions.FunctionCallSignature Ensures function calls are formatted correctly.
PEAR.Functions.FunctionDeclaration Ensure single and multi-line function declarations are defined correctly.
PEAR.Functions.ValidDefaultValue Ensures function params with default values are at the end of the declaration.
PEAR.NamingConventions.ValidClassName Ensures class and interface names start with a capital letter and use _ separators.
PEAR.NamingConventions.ValidFunctionName Ensures method and function names are correct.
PEAR.NamingConventions.ValidVariableName Checks the naming of member variables.
PEAR.WhiteSpace.ObjectOperatorIndent Checks that object operators are indented correctly.
PEAR.WhiteSpace.ScopeClosingBrace Checks that the closing braces of scopes are aligned correctly.
PEAR.WhiteSpace.ScopeIndent Checks that control structures are structured and indented correctly.
PSR1.Classes.ClassDeclaration Checks the declaration of the class is correct.
PSR1.Files.SideEffects Ensures a file declares new symbols and causes no other side effects, or executes logic with side effects, but not both.
PSR1.Methods.CamelCapsMethodName Ensures method names are defined using camel case.
PSR12.Classes.AnonClassDeclaration Checks that the declaration of an anon class is correct.
PSR12.Classes.ClassInstantiation Verifies that classes are instantiated with parentheses.
PSR12.Classes.ClosingBrace Verifies that closing braces are the last content on a line.
PSR12.ControlStructures.BooleanOperatorPlacement Checks that control structures have boolean operators in the correct place.
PSR12.ControlStructures.ControlStructureSpacing Checks that control structures have the correct spacing.
PSR12.Files.DeclareStatement Checks the format of the declare statements.
PSR12.Files.FileHeader Checks the format of the file header.
PSR12.Files.ImportStatement Verifies that import statements are defined correctly.
PSR12.Files.OpenTag Checks that the open tag is defined correctly.
PSR12.Functions.NullableTypeDeclaration Verifies that nullable typehints are lacking superfluous whitespace, e.g. ?int
PSR12.Functions.ReturnTypeDeclaration Ensure return types are defined correctly for fucnctions and closures.
PSR12.Keywords.ShortFormTypeKeywords Verifies that the short form of type keywords is used (e.g., int, bool).
PSR12.Namespaces.CompoundNamespaceDepth Verifies that compound namespaces are not defined too deep.
PSR12.Operators.OperatorSpacing Verifies that operators have valid spacing surrounding them.
PSR12.Properties.ConstantVisibility Verifies that all class constants have their visibility set.
PSR12.Traits.UseDeclaration Verifies that trait import statements are defined correctly.
PSR2.Classes.ClassDeclaration Checks the declaration of the class and its inheritance is correct.
PSR2.Classes.PropertyDeclaration Verifies that properties are declared correctly.
PSR2.ControlStructures.ControlStructureSpacing Checks that control structures have the correct spacing around brackets.
PSR2.ControlStructures.ElseIfDeclaration Verifies that there are no else if statements (elseif should be used instead).
PSR2.ControlStructures.SwitchDeclaration Ensures all switch statements are defined correctly.
PSR2.Files.ClosingTag Checks that the file does not end with a closing tag.
PSR2.Files.EndFileNewline Ensures the file ends with a newline character.
PSR2.Methods.FunctionCallSignature Checks that the function call format is correct.
PSR2.Methods.FunctionClosingBrace Checks that the closing brace of a function goes directly after the body.
PSR2.Methods.MethodDeclaration Checks that the method declaration is correct.
PSR2.Namespaces.NamespaceDeclaration Ensures namespaces are declared correctly.
PSR2.Namespaces.UseDeclaration Ensures USE blocks are declared correctly.
Squiz.Arrays.ArrayBracketSpacing Ensure that there are no spaces around square brackets.
Squiz.Arrays.ArrayDeclaration Ensures that arrays conform to the array coding standard.
Squiz.CSS.ClassDefinitionClosingBraceSpace Ensure there is a single blank line after the closing brace of a class definition.
Squiz.CSS.ClassDefinitionNameSpacing Ensure there are no blank lines between the names of classes/IDs.
Squiz.CSS.ClassDefinitionOpeningBraceSpace Ensure a single space before, and a newline after, the class opening brace
Squiz.CSS.ColonSpacing Ensure there is no space before a colon and one space after it.
Squiz.CSS.ColourDefinition Ensure colours are defined in upper-case and use shortcuts where possible.
Squiz.CSS.DisallowMultipleStyleDefinitions Ensure that each style definition is on a line by itself.
Squiz.CSS.DuplicateClassDefinition Check for duplicate class definitions that can be merged into one.
Squiz.CSS.DuplicateStyleDefinition Check for duplicate style definitions in the same class.
Squiz.CSS.EmptyClassDefinition Ensure that class definitions are not empty.
Squiz.CSS.EmptyStyleDefinition Ensure that style definitions are not empty.
Squiz.CSS.ForbiddenStyles Bans the use of some styles, such as deprecated or browser-specific styles.
Squiz.CSS.Indentation Ensures styles are indented 4 spaces.
Squiz.CSS.LowercaseStyleDefinition Ensure that all style definitions are in lowercase.
Squiz.CSS.MissingColon Ensure that all style definitions have a colon.
Squiz.CSS.NamedColours Ensure colour names are not used.
Squiz.CSS.Opacity Ensure that opacity values start with a 0 if it is not a whole number.
Squiz.CSS.SemicolonSpacing Ensure each style definition has a semi-colon and it is spaced correctly.
Squiz.CSS.ShorthandSize Ensure sizes are defined using shorthand notation where possible.
Squiz.Classes.ClassDeclaration Checks the declaration of the class and its inheritance is correct.
Squiz.Classes.ClassFileName Tests that the file name and the name of the class contained within the file match.
Squiz.Classes.DuplicateProperty Ensures JS classes don't contain duplicate property names.
Squiz.Classes.LowercaseClassKeywords Ensures all class keywords are lowercase.
Squiz.Classes.SelfMemberReference Tests self member references.
Squiz.Classes.ValidClassName Ensures classes are in camel caps, and the first letter is capitalised.
Squiz.Commenting.BlockComment Verifies that block comments are used appropriately.
Squiz.Commenting.ClassComment Parses and verifies the class doc comment.
Squiz.Commenting.ClosingDeclarationComment Checks the //end ... comments on classes, interfaces and functions.
Squiz.Commenting.DocCommentAlignment Tests that the stars in a doc comment align correctly.
Squiz.Commenting.EmptyCatchComment Checks for empty catch clause without a comment.
Squiz.Commenting.FileComment Parses and verifies the file doc comment.
Squiz.Commenting.FunctionComment Parses and verifies the doc comments for functions.
Squiz.Commenting.FunctionCommentThrowTag Verifies that a @throws tag exists for each exception type a function throws.
Squiz.Commenting.InlineComment Checks that there is adequate spacing between comments.
Squiz.Commenting.LongConditionClosingComment Ensures long conditions have a comment at the end.
Squiz.Commenting.PostStatementComment Checks to ensure that there are no comments after statements.
Squiz.Commenting.VariableComment Parses and verifies the variable doc comment.
Squiz.ControlStructures.ControlSignature Verifies that control statements conform to their coding standards.
Squiz.ControlStructures.ElseIfDeclaration Ensures the use of else if over elseif.
Squiz.ControlStructures.ForEachLoopDeclaration Verifies that there is a space between each condition of foreach loops.
Squiz.ControlStructures.ForLoopDeclaration Verifies that there is a space between each condition of for loops.
Squiz.ControlStructures.InlineIfDeclaration Tests the spacing of shorthand IF statements.
Squiz.ControlStructures.LowercaseDeclaration Ensures all control structure keywords are lowercase.
Squiz.ControlStructures.SwitchDeclaration Enforces switch statement formatting.
Squiz.Debug.JSLint Runs jslint.js on the file.
Squiz.Debug.JavaScriptLint Runs JavaScript Lint on the file.
Squiz.Files.FileExtension Tests that classes and interfaces are not declared in .php files.
Squiz.Formatting.OperatorBracket Tests that all arithmetic operations are bracketed.
Squiz.Functions.FunctionDeclaration Checks the function declaration is correct.
Squiz.Functions.FunctionDeclarationArgumentSpacing Checks that arguments in function declarations are spaced correctly.
Squiz.Functions.FunctionDuplicateArgument Checks that duplicate arguments are not used in function declarations.
Squiz.Functions.GlobalFunction Tests for functions outside of classes.
Squiz.Functions.LowercaseFunctionKeywords Ensures all function keywords are lowercase.
Squiz.Functions.MultiLineFunctionDeclaration Ensure single and multi-line function declarations are defined correctly.
Squiz.NamingConventions.ValidFunctionName Ensures method names are correct.
Squiz.NamingConventions.ValidVariableName Checks the naming of variables and member variables.
Squiz.Objects.DisallowObjectStringIndex Ensures that object indexes are written in dot notation.
Squiz.Objects.ObjectInstantiation Ensures objects are assigned to a variable when instantiated.
Squiz.Objects.ObjectMemberComma Ensures the last member of an object is not followed by a comma.
Squiz.Operators.ComparisonOperatorUsage A Sniff to enforce the use of IDENTICAL type operators rather than EQUAL operators.
Squiz.Operators.IncrementDecrementUsage Ensures that the ++ operators are used when possible.
Squiz.Operators.ValidLogicalOperators Ensures logical operators 'and' and 'or' are not used.
Squiz.PHP.CommentedOutCode Warn about commented out code.
Squiz.PHP.DisallowBooleanStatement Ensures that boolean operators are only used inside control structure conditions.
Squiz.PHP.DisallowComparisonAssignment Ensures that the value of a comparison is not assigned to a variable.
Squiz.PHP.DisallowInlineIf Stops inline IF statements from being used.
Squiz.PHP.DisallowMultipleAssignments Ensures there is only one assignment on a line, and that it is the first thing on the line.
Squiz.PHP.DisallowSizeFunctionsInLoops Bans the use of size-based functions in loop conditions.
Squiz.PHP.DiscouragedFunctions Discourages the use of debug functions.
Squiz.PHP.EmbeddedPhp Checks the indentation of embedded PHP code segments.
Squiz.PHP.Eval The use of eval() is discouraged.
Squiz.PHP.GlobalKeyword Stops the usage of the "global" keyword.
Squiz.PHP.Heredoc Bans the use of heredocs and nowdocs.
Squiz.PHP.InnerFunctions Ensures that functions within functions are never used.
Squiz.PHP.LowercasePHPFunctions Ensures all calls to inbuilt PHP functions are lowercase.
Squiz.PHP.NonExecutableCode Warns about code that can never been executed.
Squiz.Scope.MemberVarScope Verifies that class members have scope modifiers.
Squiz.Scope.MethodScope Verifies that class methods have scope modifiers.
Squiz.Scope.StaticThisUsage Checks for usage of $this in static methods, which will cause runtime errors.
Squiz.Strings.ConcatenationSpacing Makes sure there are no spaces around the concatenation operator.
Squiz.Strings.DoubleQuoteUsage Makes sure that any use of double quotes strings are warranted.
Squiz.Strings.EchoedStrings Makes sure that any strings that are "echoed" are not enclosed in brackets.
Squiz.WhiteSpace.CastSpacing Ensure cast statements don't contain whitespace.
Squiz.WhiteSpace.ControlStructureSpacing Checks that control structures have the correct spacing around brackets.
Squiz.WhiteSpace.FunctionClosingBraceSpace Checks that there is one empty line before the closing brace of a function.
Squiz.WhiteSpace.FunctionOpeningBraceSpace Checks that there is no empty line after the opening brace of a function.
Squiz.WhiteSpace.FunctionSpacing Checks the separation between functions and methods.
Squiz.WhiteSpace.LanguageConstructSpacing Ensures all language constructs contain a single space between themselves and their content.
Squiz.WhiteSpace.LogicalOperatorSpacing Verifies that operators have valid spacing surrounding them.
Squiz.WhiteSpace.MemberVarSpacing Verifies that class members are spaced correctly.
Squiz.WhiteSpace.ObjectOperatorSpacing Ensure there is no whitespace before/after an object operator.
Squiz.WhiteSpace.OperatorSpacing Verifies that operators have valid spacing surrounding them.
Squiz.WhiteSpace.PropertyLabelSpacing Ensures that a property or label colon has a single space after it and no space before it.
Squiz.WhiteSpace.ScopeClosingBrace Checks that the closing braces of scopes are aligned correctly.
Squiz.WhiteSpace.ScopeKeywordSpacing Ensure there is a single space after scope keywords.
Squiz.WhiteSpace.SemicolonSpacing Ensure there is no whitespace before a semicolon.
Squiz.WhiteSpace.SuperfluousWhitespace Checks for unneeded whitespace.
Zend.Debug.CodeAnalyzer Runs the Zend Code Analyzer (from Zend Studio) on the file.
Zend.Files.ClosingTag Checks that the file does not end with a closing tag.
Zend.NamingConventions.ValidVariableName Checks the naming of variables and member variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.