Skip to content

4.8.0

Choose a tag to compare

@kukulich kukulich released this 20 Sep 07:07
· 1504 commits to master since this release
4.8.0
7b33fb1

⚠️ PHPCS 3.3.0+ is now required.

New sniffs:

  • RequireOnlyStandaloneIncrementAndDecrementOperatorsSniff: Reports ++ and -- operators not used standalone
  • UselessParameterDefaultValueSniff: Looks for useless parameter default value
  • DisallowLateStaticBindingForContantsSniff: Disallows late static binding for constants
  • UselessLateStaticBindingSniff: Reports useless late static binding
  • ControlStructureSpacingSniff: Enforces configurable number of lines around control structures
  • UselessConditionWithReturnSniff: Reports useless conditions where both branches return true or false
  • RequireTernaryOperatorSniff: Requires ternary operator when possible
  • RequireMultiLineTernaryOperatorSniff: Ternary operator has to be reformatted to more lines when the line length exceeds the given limit
  • DisallowImplicitArrayCreationSniff: Disallows implicit array creation
  • DuplicateAssignmentToVariableSniff: Looks for duplicate assignments to a variable
  • DisallowContinueWithoutIntegerOperandInSwitchSniff: Disallows use of continue without integer operand in switch because it's emits warning in PHP 7.3 and higher
  • OptimizedFunctionsWithoutUnpackingSniff: Reports functions that should not be invoked with argument unpacking because of opcache optimizations (thanks to @Majkl578)

Improvements:

  • DocCommentSpacingSniff: New options linesCountBetweenAnnotationsGroups and annotationsGroups
  • UselessParenthesesSniff: New option ignoreComplexTernaryConditions
  • UnusedVariableSniff: New option ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach
  • EarlyExitSniff: New option ignoreStandaloneIfInScope
  • ShortListSniff: Improved fixer

Fixes:

  • EarlyExitSniff: Fixed false positive
  • UnusedVariableSniff: Fixed false positives
  • UselessParenthesesSniff: Fixed false positive
  • ModernClassNameReferenceSniff: Fixed fixer
  • RequireShortTernaryOperatorSniff: Infinite loop fix (thanks to @dg)
  • ReferenceUsedNamesOnlySniff: Possible fix of false positives
  • DisallowIncrementAndDecrementOperatorsSniff: Fixed error codes for post operators in some situations
  • IdentificatorHelper: A lot of fixes