Skip to content

Releases: slevomat/coding-standard

4.4.4

08 Feb 20:05
4.4.4
01b9e8f

Choose a tag to compare

Fixes:

  • ReferenceUsedNamesOnlySniff: Importing global functions and constants is not necessary in the global namespace
  • ReferenceUsedNamesOnlySniff: Some references were ignored because of bug in allowFullyQualifiedNameForCollidingClasses option
  • EarlyExitSniff: Fixed fixing of complex conditions
  • EarlyExitSniff: Improved fixing conditions with comments
  • EarlyExitSniff: Fixed fixing of two negative conditions
  • UnusedUsesSniff: Case mismatch should be reported in doccomments too
  • UnusedUsesSniff: All occurrences of case mismatch are reported now
  • UseStatementHelper: Anonymous function in function should not be detected as use statement (thanks to @grongor)

4.4.3

07 Feb 10:57
4.4.3
ea5fe67

Choose a tag to compare

Fixes:

  • EarlyExitSniff: Fixed fixing of negative logical conditions
  • EarlyExitSniff: Fixed fixing of binary AND condition
  • ReferenceUsedNamesOnlySniff: Fixed fixing of types in annotations at the end of line (thanks to @Majkl578)

4.4.2

06 Feb 21:23
4.4.2
9c4c42a

Choose a tag to compare

Fixes:

  • EarlyExitSniff: Fixed internal exception
  • EarlyExitSniff: Fixed fixer causing parse error

4.4.1

06 Feb 16:56
4.4.1
5a0a897

Choose a tag to compare

Fixes:

  • EarlyExitSniff: Fixed false positive

4.4.0

05 Feb 21:31
4.4.0
d91220b

Choose a tag to compare

New sniffs:

  • NewWithParenthesesSniff: Require new with parentheses
  • RequireNullCoalesceOperatorSniff: Require usage of null coalesce operator when possible
  • EarlyExitSniff: Require usage of early exit
  • ForbiddenCommentsSniff: Reports forbidden comments in descriptions (thanks to @Majkl578)

Improvements:

  • ReferenceUsedNamesOnlySniff: searchAnnotations - Enables searching for mentions in @var, @param, @return and @throws annotations

Fixes:

  • UnusedPrivateElementsSniff: Properties and methods used in HEREDOC should not be reported as unused

4.3.2

28 Jan 21:13
4.3.2
872ecd4

Choose a tag to compare

Fixes:

  • TypeHintDeclarationSniff: Reports more exact error line for @param and @return annotations errors
  • LongTypeHintsSniff: Reports more exact error line
  • AnnotationHelper: Improved annotations parsing

4.3.1

22 Jan 07:51
4.3.1
823ba04

Choose a tag to compare

Fixes:

  • TypeHintDeclarationSniff: Fixed object type variance
  • TypeHintDeclarationSniff: Fixed false positive when description contains variable
  • ReferenceUsedNamesOnlySniff: Fixed support for global functions and constants
  • DeclareStrictTypesSniff: Improved whitespace detection before declare()
  • ReferencedNameHelper: declare() directives should not be considered as referenced name

4.3.0

08 Jan 17:06
4.3.0
52f3c79

Choose a tag to compare

Improvements:

  • TypeHintDeclarationSniff: enableObjectTypeHint - It's possible to enable/disable object type hint support
  • ReferenceUsedNamesOnlySniff: Functions and constants support is hopefully complete, see new options in README

Fixes:

  • ReferenceThrowableOnlySniff: Fixed fixable
  • ReferencedNameHelper: Methods returning reference should not be considered as a referenced name

4.2.1

04 Jan 14:16
4.2.1
998b5e9

Choose a tag to compare

Fixes:

  • UnusedPrivateElementsSniff: Fixed false positive for write-only properties
  • AlphabeticallySortedUsesSniff: Fixed support for functions and constants
  • ReferenceUsedNamesOnlySniff: Fixed support for functions and constants

4.2.0

04 Jan 10:07
4.2.0
accf5e3

Choose a tag to compare

⚠️ PHPCS 3.0.2+ is now required.

Deprecated:

  • ClassConstantVisibilitySniff: enabled - Deprecated now
  • NullableTypeForNullDefaultValueSniff: enabled - Deprecated now
  • TypeHintDeclarationSniff: enableNullableTypeHints - Deprecated now
  • TypeHintDeclarationSniff: enableVoidTypeHint - Deprecated now

Improvements:

  • UseDoesNotStartWithBackslashSniff: Detects functions and constants now
  • UseDoesNotStartWithBackslashSniff: Sniff is now fixable
  • DeclareStrictTypesSniff: newlinesCountAfterDeclare - Allows to set 0 to N newlines to be between declare and next statement
  • FullyQualifiedGlobalFunctionsSniff: exclude - List of global functions that are allowed not to be referenced via FQN
  • FullyQualifiedGlobalConstantsSniff: exclude - List of global constants that are allowed not to be referenced via FQN
  • ClassConstantVisibilitySniff: Sniff is now fixable (thanks to @Majkl578)
  • ClassConstantVisibilitySniff: fixable - The sniff is not fixable by default because we think it's better to decide about each constant one by one however you can enable fixability with this option
  • LongTypeHintsSniff: Sniff is now fixable

Fixes:

  • RequireYodaComparisonSniff: Fixed short array support
  • DisallowYodaComparisonSniff: Fixed short array support
  • UnusedPrivateElementsSniff: Fixed false positive for static properties
  • UnusedPrivateElementsSniff: Fixed detection of write only properties
  • UnusedPrivateElementsSniff: Fixed false positive when calling private method on the same class
  • FullyQualifiedGlobalFunctionsSniff: Improved ignoring functions that are not global
  • FullyQualifiedGlobalConstantsSniff: Improved ignoring constants that are not global
  • ReferencedNameHelper: Methods imported from trait should not be detected as referenced names