Skip to content

Releases: slevomat/coding-standard

4.6.2

12 Jun 21:38
4.6.2
d43b9a6

Choose a tag to compare

Fixes:

  • EarlyExitSniff: Added missing yield from support
  • LanguageConstructWithParenthesesSniff: Added missing yield from check
  • FunctionHelper: Added missing yield from detection if function returns value

4.6.1

11 Jun 19:29
4.6.1
de4a6fe

Choose a tag to compare

Compatibility with PHPCS 3.3

Fixes:

  • ReferenceUsedNamesOnlySniff: Fixed fixer for classes in doccomments
  • DisallowEqualOperatorsSniff: Fixed message when operator is <> (thanks to @carusogabriel)

4.6.0

15 May 21:36
4.6.0
95436f1

Choose a tag to compare

New sniffs:

  • NamespaceDeclarationSniff: Enforces one space after namespace, disallows content between namespace name and semicolon and disallows use of bracketed syntax
  • NamespaceSpacingSniff: Enforces configurable number of lines before and after namespace
  • RequireOneNamespaceInFileSniff: Requires only one namespace in a file
  • DisallowIncrementAndDecrementOperatorsSniff: Disallows using ++ and -- operators
  • RequireShortTernaryOperatorSniff: Requires short ternary operator ?: when possible
  • DisallowShortTernaryOperatorSniff: Disallows short ternary operator ?:
  • DisallowEmptySniff: Disallows use of empty()
  • ShortListSniff: Enforces using short form of list syntax, [...] instead of list(...) (thanks to @Majkl578)

Improvements:

  • InlineDocCommentDeclarationSniff: Reports empty @var annotations
  • InlineDocCommentDeclarationSniff: Reports invalid comment type used for inline documentation comment
  • InlineDocCommentDeclarationSniff: Reports doccomment above foreach and while as well
  • UseSpacingSniff: Enforce zero number of lines between same types of use statement
  • UnusedUsesSniff: ignoredAnnotations - Case sensitive list of annotation names that the sniff ignore completely (both name and content are ignored)
  • TypeHintDeclarationSniff: allAnnotationsAreUseful - Doccomment is useful if it contain any annotation, option usefulAnnotations is deprecated
  • UnusedPrivateElementsSniff: alwaysUsedPropertiesAnnotations supports prefixes
  • UnusedUsesSniff: Improved @method annotation parsing

Fixes:

  • EarlyExitSniff: Fixed notices
  • EarlyExitSniff: Fixed fixer for complicated logical conditions
  • UnusedUsesSniff: Fixed false positives
  • UnusedPrivateElementsSniff: Fixed false positive when property used in new
  • ReferencedNameHelper: goto label should not be resolved as constant
  • TypeHelper: Fixed regexp

4.5.2

08 Mar 08:16
4.5.2
1e60915

Choose a tag to compare

Fixes:

  • TypeHintDeclarationSniff: Return annotation is not useless when return type hint is missing

4.5.1

06 Mar 08:12
4.5.1
1741355

Choose a tag to compare

Fixes:

  • EmptyCommentSniff: Empty comments in multiline commented code are not reported
  • ReferencedNameHelper: Global constant used in class constant definition was not detected

4.5.0

02 Mar 15:42
4.5.0
3957603

Choose a tag to compare

⚠️ PHPCS 3.2.3+ is now required.

New sniffs:

  • SuperfluousExceptionNamingSniff: Reports usage of superfluous suffix Exception for exceptions
  • SuperfluousAbstractClassNamingSniff: Reports usage of superfluous prefix or suffix Abstract for abstract classes
  • SuperfluousInterfaceNamingSniff: Reports usage of superfluous prefix or suffix Interface for interfaces
  • UseSpacingSniff: Enforces configurable number of lines before first use, after last use and between two different types of use (eg. between use function and use const)
  • EmptyCommentSniff: Reports empty comments
  • DocCommentSpacing: Enforces configurable number of lines before first content (description or annotation), after last content (description or annotation), between description and annotations, between two different annotations types
  • DisallowOneLinePropertyDocCommentSniff: Require comments with single-line content to be written as multi-liners (thanks to @Majkl578)
  • RequireOneLinePropertyDocCommentSniff: Require comments with single-line content to be written as one-liners (thanks to @Majkl578)
  • TypeCastSniff: Enforces using shorthand cast operators, forbids use of unset and binary cast operators (thanks to @Majkl578)

Improvements:

  • EarlyExitSniff: New check "Remove useless elseif to reduce code nesting"
  • UnusedUsesSniff: ignoredAnnotationNames - To ignore specified annotation names (thanks to @xificurk)
  • ReferenceUsedNamesOnlySniff: Improved annotations parsing
  • FullyQualifiedClassNameInAnnotationSniff: Improved annotations parsing
  • ForbiddenAnnotationsSniff: Improved annotations parsing
  • AlphaneticallySortedUsesSniff: Make error message more clear (thanks to @brettdorrans)

Fixes:

  • EarlyExitSniff: Report else when all conditions contain early exit

4.4.8

28 Feb 23:35
4.4.8
8107d17

Choose a tag to compare

Fixes:

  • UnusedUsesSniff: Fixed false positives for mismatch case

4.4.7

27 Feb 22:50
4.4.7
43a8563

Choose a tag to compare

Fixes:

  • UnusedUsesSniff: Fixed false positives
  • ReferenceUsedNamesOnlySniff: Fixed fixer for code without namespace
  • AnnotationHelper: Fixed parsing of annotations with dash
  • ReferencedNameHelper: Fixed false positive

4.4.6

15 Feb 17:19
4.4.6
861e7b5

Choose a tag to compare

Fixes:

  • UnusedUsesSniff: Fixed false positives

4.4.5

09 Feb 21:21
4.4.5
2a24b1b

Choose a tag to compare

Fixes:

  • UnusedUsesSniff: Fixed false positives of case mismatch in doccomments
  • ForbiddenAnnotationsSniff: fixed empty lines when fixer removes annotations