Skip to content

5.0.0

Compare
Choose a tag to compare
@kukulich kukulich released this 06 Feb 07:53
· 1252 commits to master since this release
5.0.0
fdab228

New sniffs

  • SpreadOperatorSpacingSniff: Enforces configurable number of spaces after the ... operator
  • DisallowArrayTypeHintSyntaxSniff: Disallows usage of array type hint syntax (eg. int[], bool[][]) in phpDocs in favour of generic type hint syntax (eg. array<int>, array<array<bool>>)
  • TrailingCommaInCallSniff: Enforces trailing commas in multi-line calls
  • DisallowMixedTypeHintSniff: Disallows usage of "mixed" type hint in phpDocs
  • SuperfluousTraitNamingSniff: Reports use of superfluous suffix Trait for traits

Improvements

  • Added support for generic and intersection types in PHP docs
  • Improved support for more namespaces in a file
  • UselessIfConditionWithReturnSniff: New option assumeAllConditionExpressionsAreAlreadyBoolean
  • EarlyExitSniff: More useless elseif and else conditions are reported
  • NullTypeHintOnLastPositionSniff: Added support for @property and @method annotations
  • FullyQualifiedClassNameInAnnotationSniff: Added support for @property and @method annotations
  • LongTypeHintsSniff: Added support for @property and @method annotations
  • LongTypeHintsSniff: Inline doccomments are checked now
  • ReferenceUsedNamesOnlySniff: Added support for @method annotations (thanks to @hranicka)
  • UselessParenthesesSniff: Some useless parentheses were not reported

Fixes

  • OptimizedFunctionsWithoutUnpackingSniff: Fix for trailing commas in function calls
  • UnusedVariableSniff: Fixed false positive
  • UselessVariableSniff: Fixed false positive

⚠️BC breaks

  • EmptyLinesAroundTypeBracesSniff: Renamed to EmptyLinesAroundClassBracesSniff and moved to namespace Classes
  • DisallowEqualOperatorsSniff: Moved to namespace Operators
  • UselessConditionWithReturnSniff: Splitted to UselessIfConditionWithReturnSniff and UselessTernaryOperatorSniff
  • Removed support for @var annotation in format /** @var $variable type */ for most of the sniffs
  • Removed support for @param annotations without parameter name for most of the sniffs
  • AlphabeticallySortedUsesSniff: psr12Compatible option is now enabled by default
  • NullableTypeForNullDefaultValueSniff: Removed deprecated enabled option
  • ClassConstantVisibilitySniff: Removed deprecated enabled option
  • TypeHintDeclarationSniff: Mark enableObjectTypeHint option as deprecated
  • TypeHintDeclarationSniff: Removed deprecated usefulAnnotations option
  • TypeHintDeclarationSniff: Removed deprecated enableNullableTypeHints option
  • TypeHintDeclarationSniff: Removed deprecated enableVoidTypeHint option
  • Removed deprecated DisallowLateStaticBindingForContantsSniff (alias for DisallowLateStaticBindingForConstantsSniff)