6.2.0
📣 You can now sponsor Slevomat Coding Standard development
New sniffs
ArrowFunctionDeclaration
: Checksfn
declarationMethodSpacingSniff
: Checks that there is a certain number of blank lines between methodsDisallowMultiConstantDefinitionSniff
: Disallows multi constant definitionDisallowMultiPropertyDefinitionSniff
: Disallows multi property definitionDisallowDirectMagicInvokeCallSniff
: Disallows direct call of__invoke()
DisallowSuperGlobalVariableSniff
: Disallows use of super global variablesDisallowInlineCommentAfterCodeSniff
: Disallows comments after code at the same lineDuplicateSpacesSniff
: Checks duplicate spaces anywhere
Improvements
InlineDocCommentDeclarationSniff
: New optionallowDocCommentAboveReturn
EarlyExitSniff
: New optionignoreOneLineTrailingIf
FullyQualifiedGlobalConstantsSniff
: New optioninclude
(thanks to @bbatsche)FullyQualifiedGlobalFunctionsSniff
: New optioninclude
(thanks to @bbatsche)FullyQualifiedGlobalFunctionsSniff
: New optionincludeSpecialFunctions
RequireYodaComparisonSniff
: New optionalwaysVariableOnRight
JumpStatementsSpacingSniff
: New optionslinesCountBeforeWhenFirstInCaseOrDefault
,linesCountAfterWhenLastInCaseOrDefault
andlinesCountAfterWhenLastInLastCaseOrDefault
ClassStructureSniff
: New optionenableFinalMethods
to support final methods groupsRequireNullCoalesceEqualOperatorSniff
: New optionenable
(thanks to @carusogabriel)TrailingCommaInCallSniff
: New optionenable
(thanks to @carusogabriel)RequireArrowFunctionSniff
: New optionenable
(thanks to @carusogabriel)RequireNumericLiteralSeparatorSniff
: New optionenable
(thanks to @carusogabriel)RequireNumericLiteralSeparatorSniff
: New optionminDigitsBeforeDecimalPoint
RequireNumericLiteralSeparatorSniff
: New optionminDigitsAfterDecimalPoint
ClassStructureSniff
: Support for shortcut groupsReferenceThrowableOnlySniff
: Can be suppressed when\Exception
is used as parameterParameterTypeHintSniff
:@psalm-param
and@phpstan-param
are sufficient as type hintsReturnTypeHintSniff
:@psalm-return
and@phpstan-return
are sufficient as type hintsPropertyTypeHintSniff
:@psalm-var
and@phpstan-var
are sufficient as type hintsRequireNullCoalesceOperatorSniff
: Improved fixerPropertyTypeHintSniff
: Improved performancePropertyTypeHintSpacingSniff
: Improved performanceUnusedUsesSniff
: Improved performance (thanks to @nightlinus)UnusedVariableSniff
: Improved performance (thanks to @nightlinus)FullyQualifiedExceptionsSniff
: Improved performanceReferenceUsedNamesOnlySniff
: Improved performanceFullyQualifiedGlobalConstantsSniff
: Improved performanceFullyQualifiedGlobalFunctionsSniff
: Improved performance- Support for PHPCS configuration
php_version
in all possible sniffs NamespaceHelper
: Improved performance (thanks to @nightlinus)
Fixes
PropertySpacingSniff
: Fixed false positiveJumpStatementsSpacingSniff
: Fixed false positiveUselessParenthesesSniff
: Fixed false positiveUnusedVariableSniff
: Fixed false positivesEarlyExitSniff
: Fixed false positivesInlineDocCommentDeclarationSniff
: Fixed false positivesBlockControlStructureSpacingSniff
: Fixed false positiveNegationOperatorSpacingSniff
: Fixed internal errorReturnTypeHintSniff
: Fixed breaking syntax on removing useless@return
annotation in one-line doccomment (thanks to @nightlinus)ParameterTypeHintSniff
: Fixed breaking syntax on removing useless@param
annotation in one-line doccommentForbiddenAnnotationsSniff
: Fixed fixer for one-line doccommentsInlineDocCommentDeclarationSniff
: Added support for various spacings in callable typehint (thanks to @simPod)PropertySpacingSniff
: Fixed fixerUnusedUsesSniff
: Fix for duplicate errorsAlphabeticallySortedUsesSniff
: Fix for duplicate errorsReferenceThrowableOnlySniff
: Fix for duplicate errorsFullyQualifiedGlobalConstantsSniff
: Fix for duplicate errorsFullyQualifiedGlobalFunctionsSniff
: Fix for duplicate errorsFullyQualifiedExceptionsSniff
: Fix for duplicate errorsReferenceUsedNamesOnlySniff
: Fix for duplicate errorsUselessAliasSniff
: Fix for duplicate errorsUseSpacingSniff
: Fix for duplicate errorsUseStatementHelper
: Workaround for bug in PHPCS