🆕 New sniffs
SlevomatCodingStandard.Classes.EnumCaseSpacing
: Checks that there is a certain number of blank lines between enum casesSlevomatCodingStandard.Classes.RequireSelfReference
: Requiresself
for local referenceSlevomatCodingStandard.Variables.DisallowVariableVariable
: Disallows use of variable variablesSlevomatCodingStandard.ControlStructures.DisallowTrailingMultiLineTernaryOperator
: Ternary operator has to be reformatted when the operator is not leading the line (thanks to @esserj)SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys
: Enforces natural sorting of array definitions by key in multi-line arrays (thanks to @bkdotcom)
🔧 Improvements
- Support for
phpstan/phpdoc-parser
1.16 @phpcsSuppress
can be with comment- Support for
non-falsy-string
,list
andnon-empty-list
type hints SlevomatCodingStandard.Arrays.TrailingArrayComma
: Support for "legacy"array()
syntax (thanks to @bkdotcom)SlevomatCodingStandard.Complexity.Cognitive
: DeprecatemaxComplexity
and implementwarningThreshold
anderrorThreshold
options (thanks to @bkdotcom)SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing
: New optionallowOnSameLine
(thanks to @stlrnz)SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature
: New optionminParameterCount
(thanks to @janedbal)
🐛 Fixes
SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
: Fixer should not remove doc commentsSlevomatCodingStandard.ControlStructures.EarlyExit
: Fixed detection of useless elseSlevomatCodingStandard.Variables.UselessVariable
: Fixed false positiveSlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking
: Fixed false positive with first class callableSlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion
: Fixes using prefixed var phpdoc (thanks to @franmomu)