Releases: slevomat/coding-standard
Releases · slevomat/coding-standard
4.3.1
Fixes:
TypeHintDeclarationSniff
: Fixed object type varianceTypeHintDeclarationSniff
: Fixed false positive when description contains variableReferenceUsedNamesOnlySniff
: Fixed support for global functions and constantsDeclareStrictTypesSniff
: Improved whitespace detection before declare()ReferencedNameHelper
: declare() directives should not be considered as referenced name
4.3.0
Improvements:
TypeHintDeclarationSniff
:enableObjectTypeHint
- It's possible to enable/disableobject
type hint supportReferenceUsedNamesOnlySniff
: Functions and constants support is hopefully complete, see new options in README
Fixes:
ReferenceThrowableOnlySniff
: Fixed fixableReferencedNameHelper
: Methods returning reference should not be considered as a referenced name
4.2.1
4.2.0
Deprecated:
ClassConstantVisibilitySniff
:enabled
- Deprecated nowNullableTypeForNullDefaultValueSniff
:enabled
- Deprecated nowTypeHintDeclarationSniff
:enableNullableTypeHints
- Deprecated nowTypeHintDeclarationSniff
:enableVoidTypeHint
- Deprecated now
Improvements:
UseDoesNotStartWithBackslashSniff
: Detects functions and constants nowUseDoesNotStartWithBackslashSniff
: Sniff is now fixableDeclareStrictTypesSniff
:newlinesCountAfterDeclare
- Allows to set 0 to N newlines to be betweendeclare
and next statementFullyQualifiedGlobalFunctionsSniff
:exclude
- List of global functions that are allowed not to be referenced via FQNFullyQualifiedGlobalConstantsSniff
:exclude
- List of global constants that are allowed not to be referenced via FQNClassConstantVisibilitySniff
: 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 optionLongTypeHintsSniff
: Sniff is now fixable
Fixes:
RequireYodaComparisonSniff
: Fixed short array supportDisallowYodaComparisonSniff
: Fixed short array supportUnusedPrivateElementsSniff
: Fixed false positive for static propertiesUnusedPrivateElementsSniff
: Fixed detection of write only propertiesUnusedPrivateElementsSniff
: Fixed false positive when calling private method on the same classFullyQualifiedGlobalFunctionsSniff
: Improved ignoring functions that are not globalFullyQualifiedGlobalConstantsSniff
: Improved ignoring constants that are not globalReferencedNameHelper
: Methods imported from trait should not be detected as referenced names
4.1.0
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 nowTypeHintDeclarationSniff
: Fixed useless doccomment detection when parameters are alignedAnnotationHelper
: Fixed parsing of multiline annotations
4.0.0
BC breaks:
YodaComparisonSniff
was renamed toDisallowYodaComparisonSniff
New sniffs:
RequireYodaComparisonSniff
: If you prefer Yoda conditions, you can disableDisallowYodaComparison
and use this sniff
Improvements:
- Basic support of
object
type hint
Fixes:
TypeHintDeclarationSniff
:{@ignoredoc}
is case insensitive nowUnusedPrivateElementsSniff
: Chained private methods should not be reported as unusedReferencedNameHelper
: Some references were not recognized
2.5.0
New checks:
TypeHintDeclarationSniff
: Checks if closures usevoid
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 insensitiveReferencedNameHelper
: Type hints of variadic parameters and parameters passed by reference wasn't recognizedTypeHintDeclarationSniff
: Methods with{@ignoredoc}
format wasn't ignoredTypeHintDeclarationSniff
:{@ignoredoc}
is case insensitive nowYodaComparisonSniff
: Fixed bugs with logicaland
,or
andxor
UnusedPrivateElementsSniff
: Fixed false positive
3.3.0
New sniffs:
FullyQualifiedGlobalFunctionsSniff
: All references to global functions must be referenced via a fully qualified nameFullyQualifiedGlobalConstantsSniff
: All references to global constants must be referenced via a fully qualified name
Fixes:
UseStatement
: Constant name are not case insensitiveReferencedNameHelper
: Type hints of variadic parameters and parameters passed by reference wasn't recognized