Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs
use
FunctionLength
sniff in Files
namespaceSlevomatCodingStandard.Classes.ClassConstantVisibility
: Fixed error message for typed constantsSlevomatCodingStandard.Namespaces.UnusedUses
: Fixed false positive thanks to PHPCS upgradeSlevomatCodingStandard.Namespaces.UnusedUses
: Fix class detection in double-quoted strings and heredoc (thanks to @c01l)SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch
: Fixed false positivesSlevomatCodingStandard.Functions.RequireTrailingCommaInCall
: Fixed missing report for missing trailing comma after arrow functionSlevomatCodingStandard.Commenting.UselessFunctionDocComment
: It should report simple array
as uselessCommentHelper
SlevomatCodingStandard.Functions.NamedArgumentSpacing
: Checks spacing in named argument (thanks to @mzk)SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
: If the file contains a group use then ignore the file completely (thanks to @jonathan1055)SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation
: New option ignoredAnnotationNames
(thanks to @gemal)SlevomatCodingStandard.ControlStructures.AssignmentInCondition
: Prevent error during live coding (thanks to @jrfnl)SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition
: Prevent error during live coding (thanks to @jrfnl)SlevomatCodingStandard.PHP.UselessParentheses
: Prevent error during live coding (thanks to @jrfnl)SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation
: Recognize global statements (thanks to @jrfnl)SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants
: Don't treat a group use as a constant (thanks to @asispts)SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly
: Fixed false positivesSlevomatCodingStandard.Classes.ConstantSpacing
: Fixed internal errorSlevomatCodingStandard.Commenting.InlineDocCommentDeclaration
: Fixed false positive for final constantSlevomatCodingStandard.Namespaces.UnusedUses
: Ignores uses in annotations with multi lines string arguments (thanks to @mathroc)NamespaceHelper::getAllNamespacesPointers()
: Allow for namespace tokens used as operator (thanks to @jrfnl)SlevomatCodingStandard.Commenting.UselessFunctionDocComment
: Fixed false positivesSlevomatCodingStandard.Commenting.DocCommentSpacing
: Fixed false positivesSlevomatCodingStandard.ControlStructures.JumpStatementsSpacing
: Fix TypeError when return is on the first line of the file (thanks to @herndlm)SlevomatCodingStandard.Arrays.ArrayAccess
: Disallow whitespace between array access operator and the variable, or between array access operators (thanks to @kamil-zacek)SlevomatCodingStandard.Classes.ClassStructure
: Fixed fixerSlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator
: Fixed false positiveSlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly
: FixesSlevomatCodingStandard.Arrays.DisallowPartiallyKeyed
: Fixed false positive