Skip to content

4.6.0

Choose a tag to compare

@kukulich kukulich released this 15 May 21:36
· 1709 commits to master since this release
4.6.0
95436f1

New sniffs:

  • NamespaceDeclarationSniff: Enforces one space after namespace, disallows content between namespace name and semicolon and disallows use of bracketed syntax
  • NamespaceSpacingSniff: Enforces configurable number of lines before and after namespace
  • RequireOneNamespaceInFileSniff: Requires only one namespace in a file
  • DisallowIncrementAndDecrementOperatorsSniff: Disallows using ++ and -- operators
  • RequireShortTernaryOperatorSniff: Requires short ternary operator ?: when possible
  • DisallowShortTernaryOperatorSniff: Disallows short ternary operator ?:
  • DisallowEmptySniff: Disallows use of empty()
  • ShortListSniff: Enforces using short form of list syntax, [...] instead of list(...) (thanks to @Majkl578)

Improvements:

  • InlineDocCommentDeclarationSniff: Reports empty @var annotations
  • InlineDocCommentDeclarationSniff: Reports invalid comment type used for inline documentation comment
  • InlineDocCommentDeclarationSniff: Reports doccomment above foreach and while as well
  • UseSpacingSniff: Enforce zero number of lines between same types of use statement
  • UnusedUsesSniff: ignoredAnnotations - Case sensitive list of annotation names that the sniff ignore completely (both name and content are ignored)
  • TypeHintDeclarationSniff: allAnnotationsAreUseful - Doccomment is useful if it contain any annotation, option usefulAnnotations is deprecated
  • UnusedPrivateElementsSniff: alwaysUsedPropertiesAnnotations supports prefixes
  • UnusedUsesSniff: Improved @method annotation parsing

Fixes:

  • EarlyExitSniff: Fixed notices
  • EarlyExitSniff: Fixed fixer for complicated logical conditions
  • UnusedUsesSniff: Fixed false positives
  • UnusedPrivateElementsSniff: Fixed false positive when property used in new
  • ReferencedNameHelper: goto label should not be resolved as constant
  • TypeHelper: Fixed regexp