4.6.0
New sniffs:
NamespaceDeclarationSniff: Enforces one space afternamespace, disallows content between namespace name and semicolon and disallows use of bracketed syntaxNamespaceSpacingSniff: Enforces configurable number of lines before and afternamespaceRequireOneNamespaceInFileSniff: Requires only one namespace in a fileDisallowIncrementAndDecrementOperatorsSniff: Disallows using++and--operatorsRequireShortTernaryOperatorSniff: Requires short ternary operator?:when possibleDisallowShortTernaryOperatorSniff: Disallows short ternary operator?:DisallowEmptySniff: Disallows use ofempty()ShortListSniff: Enforces using short form of list syntax,[...]instead oflist(...)(thanks to @Majkl578)
Improvements:
InlineDocCommentDeclarationSniff: Reports empty@varannotationsInlineDocCommentDeclarationSniff: Reports invalid comment type used for inline documentation commentInlineDocCommentDeclarationSniff: Reports doccomment above foreach and while as wellUseSpacingSniff: Enforce zero number of lines between same types of use statementUnusedUsesSniff: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, optionusefulAnnotationsis deprecatedUnusedPrivateElementsSniff:alwaysUsedPropertiesAnnotationssupports prefixesUnusedUsesSniff: Improved@methodannotation parsing
Fixes:
EarlyExitSniff: Fixed noticesEarlyExitSniff: Fixed fixer for complicated logical conditionsUnusedUsesSniff: Fixed false positivesUnusedPrivateElementsSniff: Fixed false positive when property used innewReferencedNameHelper:gotolabel should not be resolved as constantTypeHelper: Fixed regexp