Skip to content

6.0.0

Compare
Choose a tag to compare
@kukulich kukulich released this 05 Dec 07:01
· 1105 commits to master since this release
6.0.0
85e3329

New sniffs

  • RequireArrowFunctionSniff: Requires arrow functions
  • DisallowArrowFunctionSniff: Disallows arrow functions
  • RequireNumericLiteralSeparatorSniff: Requires use of numeric literal separators
  • DisallowNumericLiteralSeparatorSniff: Disallows numeric literal separators
  • RequireNowdocSniff: Requires nowdoc syntax instead of heredoc when possible
  • ReferenceSpacingSniff: Enforces configurable number of spaces after reference
  • DisallowReferenceSniff: Disallows references
  • RequireExplicitAssertionSniff: Requires assertion via assert() instead of inline documentation comments.
  • ParameterTypeHintSniff: Previously part of TypeHintDeclarationSniff
  • PropertyTypeHintSniff: Previously part of TypeHintDeclarationSniff
  • ReturnTypeHintSniff: Previously part of TypeHintDeclarationSniff
  • UselessFunctionDocCommentSniff: Previously part of TypeHintDeclarationSniff
  • BlockControlStructureSpacingSniff: Previously part of ControlStructureSpacingSniff
  • JumpStatementsSpacingSniff: Previously part of ControlStructureSpacingSniff

Improvements

  • PHP 7.4 support
  • Arrow functions support
  • Array shapes in phpDocs support
  • PropertyTypeHintSniff: Support for native type hints
  • InlineDocCommentDeclarationSniff: Reports missing related variables or no assigment
  • InlineDocCommentDeclarationSniff: Added support for doccomments after variable definition
  • InlineDocCommentDeclarationSniff: Added support for list() and short list []
  • TrailingArrayCommaSniff: New option enableAfterHeredoc
  • DisallowMixedTypeHintSniff: Added suppress support
  • UselessParenthesesSniff: Reports more useless parentheses

Fixes

  • Fixed support of @method annotation
  • InlineDocCommentDeclarationSniff: Check really only inline doccomments
  • TrailingCommaInCallSniff: Some calls were not reported
  • UselessParenthesesSniff: Fixed false positive
  • NamespaceSpacingSniff: Fixed false positive
  • UselessSemicolonSniff: Fixed internal error
  • TypeNameMatchesFileNameSniff: Files without namespaces should be reported too
  • UseSpacingSniff: Don't report errors for use statements with comments right before or after
  • UselessVariableSniff: Fixed false positive
  • UselessParameterDefaultValueSniff: Fixed false positive
  • UnusedPrivateElementsSniff: Fixed false positive
  • UnusedUsesSniff: Better handle php open tags (thanks to @donatj)
  • RequireCombinedAssignmentOperatorSniff: Fixed false positive
  • UselessInheritDocCommentSniff: Fixed internal error
  • RequireShortTernaryOperatorSniff: Fix token overrun (thanks to @donatj)
  • Fix compatibility with non-Composer installs of PHPCS (thanks to @jrfnl)

⚠️BC breaks

  • TypeHintDeclarationSniff is dead, long live ParameterTypeHintSniff, PropertyTypeHintSniff, ReturnTypeHintSniff and UselessFunctionDocCommentSniff
  • ControlStructureSpacingSniff is dead, long live BlockControlStructureSpacingSniff and JumpStatementsSpacingSniff (thanks to @grongor)