Skip to content

6.2.0

Compare
Choose a tag to compare
@kukulich kukulich released this 30 Mar 07:58
· 832 commits to master since this release
6.2.0
c4bf9ca

📣 You can now sponsor Slevomat Coding Standard development

New sniffs

  • ArrowFunctionDeclaration: Checks fn declaration
  • MethodSpacingSniff: Checks that there is a certain number of blank lines between methods
  • DisallowMultiConstantDefinitionSniff: Disallows multi constant definition
  • DisallowMultiPropertyDefinitionSniff: Disallows multi property definition
  • DisallowDirectMagicInvokeCallSniff: Disallows direct call of __invoke()
  • DisallowSuperGlobalVariableSniff: Disallows use of super global variables
  • DisallowInlineCommentAfterCodeSniff: Disallows comments after code at the same line
  • DuplicateSpacesSniff: Checks duplicate spaces anywhere

Improvements

  • InlineDocCommentDeclarationSniff: New option allowDocCommentAboveReturn
  • EarlyExitSniff: New option ignoreOneLineTrailingIf
  • FullyQualifiedGlobalConstantsSniff: New option include (thanks to @bbatsche)
  • FullyQualifiedGlobalFunctionsSniff: New option include (thanks to @bbatsche)
  • FullyQualifiedGlobalFunctionsSniff: New option includeSpecialFunctions
  • RequireYodaComparisonSniff: New option alwaysVariableOnRight
  • JumpStatementsSpacingSniff: New options linesCountBeforeWhenFirstInCaseOrDefault, linesCountAfterWhenLastInCaseOrDefault and linesCountAfterWhenLastInLastCaseOrDefault
  • ClassStructureSniff: New option enableFinalMethods to support final methods groups
  • RequireNullCoalesceEqualOperatorSniff: New option enable (thanks to @carusogabriel)
  • TrailingCommaInCallSniff: New option enable (thanks to @carusogabriel)
  • RequireArrowFunctionSniff: New option enable (thanks to @carusogabriel)
  • RequireNumericLiteralSeparatorSniff: New option enable (thanks to @carusogabriel)
  • RequireNumericLiteralSeparatorSniff: New option minDigitsBeforeDecimalPoint
  • RequireNumericLiteralSeparatorSniff: New option minDigitsAfterDecimalPoint
  • ClassStructureSniff: Support for shortcut groups
  • ReferenceThrowableOnlySniff: Can be suppressed when \Exception is used as parameter
  • ParameterTypeHintSniff: @psalm-param and @phpstan-param are sufficient as type hints
  • ReturnTypeHintSniff: @psalm-return and @phpstan-return are sufficient as type hints
  • PropertyTypeHintSniff: @psalm-var and @phpstan-var are sufficient as type hints
  • RequireNullCoalesceOperatorSniff: Improved fixer
  • PropertyTypeHintSniff: Improved performance
  • PropertyTypeHintSpacingSniff: Improved performance
  • UnusedUsesSniff: Improved performance (thanks to @nightlinus)
  • UnusedVariableSniff: Improved performance (thanks to @nightlinus)
  • FullyQualifiedExceptionsSniff: Improved performance
  • ReferenceUsedNamesOnlySniff: Improved performance
  • FullyQualifiedGlobalConstantsSniff: Improved performance
  • FullyQualifiedGlobalFunctionsSniff: Improved performance
  • Support for PHPCS configuration php_version in all possible sniffs
  • NamespaceHelper: Improved performance (thanks to @nightlinus)

Fixes

  • PropertySpacingSniff: Fixed false positive
  • JumpStatementsSpacingSniff: Fixed false positive
  • UselessParenthesesSniff: Fixed false positive
  • UnusedVariableSniff: Fixed false positives
  • EarlyExitSniff: Fixed false positives
  • InlineDocCommentDeclarationSniff: Fixed false positives
  • BlockControlStructureSpacingSniff: Fixed false positive
  • NegationOperatorSpacingSniff: Fixed internal error
  • ReturnTypeHintSniff: 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 doccomment
  • ForbiddenAnnotationsSniff: Fixed fixer for one-line doccomments
  • InlineDocCommentDeclarationSniff: Added support for various spacings in callable typehint (thanks to @simPod)
  • PropertySpacingSniff: Fixed fixer
  • UnusedUsesSniff: Fix for duplicate errors
  • AlphabeticallySortedUsesSniff: Fix for duplicate errors
  • ReferenceThrowableOnlySniff: Fix for duplicate errors
  • FullyQualifiedGlobalConstantsSniff: Fix for duplicate errors
  • FullyQualifiedGlobalFunctionsSniff: Fix for duplicate errors
  • FullyQualifiedExceptionsSniff: Fix for duplicate errors
  • ReferenceUsedNamesOnlySniff: Fix for duplicate errors
  • UselessAliasSniff: Fix for duplicate errors
  • UseSpacingSniff: Fix for duplicate errors
  • UseStatementHelper: Workaround for bug in PHPCS