Skip to content

Releases: slevomat/coding-standard

4.3.1

22 Jan 07:51
4.3.1
823ba04
Compare
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
Compare
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
Compare
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
Compare
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

4.1.0

19 Dec 13:22
3992f96
Compare
Choose a tag to compare

⚠️ PHP 7.1 is now required.

Improvements:

  • FullyQualifiedExceptionsSniff: Sniff is now fixable (thanks to @VasekPurchart)
  • FullyQualifiedClassNameAfterKeywordSniff: Sniff is now fixable (thanks to @VasekPurchart)
  • FullyQualifiedClassNameInAnnotationSniff: Sniff is now fixable (thanks to @VasekPurchart)

Fixes:

  • UnusedPrivateElementsSniff: Check for unused private methods is case insensitive now
  • TypeHintDeclarationSniff: Fixed useless doccomment detection when parameters are aligned
  • AnnotationHelper: Fixed parsing of multiline annotations

4.0.0

15 Sep 18:30
Compare
Choose a tag to compare

⚠️ Using all sniffs from the standard is no longer a recommended way to use Slevomat Coding Standard, see How to run the sniffs.

BC breaks:

  • YodaComparisonSniff was renamed to DisallowYodaComparisonSniff

New sniffs:

  • RequireYodaComparisonSniff: If you prefer Yoda conditions, you can disable DisallowYodaComparison and use this sniff

Improvements:

  • Basic support of object type hint

Fixes:

  • TypeHintDeclarationSniff: {@ignoredoc} is case insensitive now
  • UnusedPrivateElementsSniff: Chained private methods should not be reported as unused
  • ReferencedNameHelper: Some references were not recognized

2.5.0

15 Sep 16:26
4f59b04
Compare
Choose a tag to compare

New checks:

  • TypeHintDeclarationSniff: Checks if closures use void type hint.

New settings:

  • ReferenceUsedNamesOnlySniff: allowFullyQualifiedGlobalFunctions - allows using fully qualified functions from global space (i.e. \phpversion())
  • ReferenceUsedNamesOnlySniff: allowFullyQualifiedGlobalConstants - allows using fully qualified constants from global space (i.e. \PHP_VERSION)

Fixes:

  • UseStatement: Constant name are not case insensitive
  • ReferencedNameHelper: Type hints of variadic parameters and parameters passed by reference wasn't recognized
  • TypeHintDeclarationSniff: Methods with {@ignoredoc} format wasn't ignored
  • TypeHintDeclarationSniff: {@ignoredoc} is case insensitive now
  • YodaComparisonSniff: Fixed bugs with logical and, or and xor
  • UnusedPrivateElementsSniff: Fixed false positive

3.3.0

25 Aug 15:27
3.3.0
84c2f64
Compare
Choose a tag to compare

New sniffs:

  • FullyQualifiedGlobalFunctionsSniff: All references to global functions must be referenced via a fully qualified name
  • FullyQualifiedGlobalConstantsSniff: All references to global constants must be referenced via a fully qualified name

Fixes:

  • UseStatement: Constant name are not case insensitive
  • ReferencedNameHelper: Type hints of variadic parameters and parameters passed by reference wasn't recognized

3.2.1

23 Aug 20:45
3.2.1
cb6986f
Compare
Choose a tag to compare

Fixes:

  • TypeHintDeclarationSniff: Methods with {@ignoredoc} format wasn't ignored
  • YodaComparisonSniff: Fixed bugs with logical and, or and xor

3.2.0

23 Aug 15:48
3.2.0
2f337b0
Compare
Choose a tag to compare

New checks:

  • TypeHintDeclarationSniff: Checks if closures use void type hint.