Skip to content

Releases: slevomat/coding-standard

3.0.1

20 Jun 13:50

Choose a tag to compare

Fixes:

  • TrailingArrayCommaSniff: Should not report errors for empty multiline arrays
  • UnusedUsesSniff: Fixed annotation parsing

3.0.0

14 Jun 09:57

Choose a tag to compare

Updated to PHP CodeSniffer 3

2.4.2

30 May 20:29

Choose a tag to compare

Fixes:

  • TypeHintDeclarationSniff: Missing traversable specification was not reported for type hints with partial use

2.4.1

22 May 21:30

Choose a tag to compare

Fixes:

  • TypeHintDeclarationSniff: Missing traversable specification was not reported for unqualified type hints

2.4.0

22 May 11:58

Choose a tag to compare

Updated to PHP CodeSniffer 2.9

2.3.0

04 May 14:25

Choose a tag to compare

New settings:

  • AlphabeticallySortedUsesSniff: caseSensitive - compare namespaces case sensitively (thanks to @VasekPurchart)

Fixes:

  • AlphabeticallySortedUsesSniff: more compatible with PHPStorm
  • Only PHP CodeSniffer 2.8.* is supported now because PHP CodeSniffer 2.9.0 has broken detection of nullability symbol

2.2.0

03 May 12:42

Choose a tag to compare

New sniffs:

  • InlineDocCommentDeclarationSniff - reports invalid format of inline phpDocs with @var

Fixes:

  • FullyQualifiedClassNameInAnnotationSniff supports more ways how to write inline phpDocs
  • Invalid @param annotation should be ignored in TypeHintDeclarationSniff

2.1.0

27 Apr 08:53

Choose a tag to compare

New settings:

  • TypeHintDeclarationSniff: enableEachParameterAndReturnInspection - enables inspection and fixing of @param and @return annotations separately. Useful when you only want to document parameters or return values that could not be expressed natively (i.e. member types of array or Traversable) (thanks to @Majkl578)
  • ReturnTypeHintSpacingSniff: spacesCountBeforeColon - the number of spaces expected between closing brace and colon (thanks to @Majkl578)
  • ReferenceUsedNamesOnlySniff: allowFullyQualifiedGlobalClasses - allows using fully qualified names from global space (i.e. \DateTimeImmutable) (thanks to @Majkl578)
  • EmptyLinesAroundTypeBracesSniff: linesCountAfterOpeningBrace: allows to configure the number of lines after opening brace (thanks to @Majkl578)
  • EmptyLinesAroundTypeBracesSniff: linesCountBeforeClosingBrace: allows to configure the number of lines before closing brace (thanks to @Majkl578)

Fixes:

  • TypeHintDeclarationSniff: Fix UselessDocComment detection when function has parameters/returns, but doesn't have corresponding annotation (thanks to @Majkl578)
  • UnusedUsesSniff: Fix detection of partially referenced functions and constants (thanks to @Majkl578)
  • UseStatementHelper: Fix isTraitUse() to work with anonymous class (thanks to @Majkl578)
  • TypeHintDeclarationSniff: Disabled enableNullableTypeHints does not work with optional parameters
  • FullyQualifiedClassNameAfterKeywordSniff: Improved support for checking T_USE

And a lot of cleanup (thanks to @VasekPurchart and @Majkl578 )

2.0.2

19 Apr 18:08

Choose a tag to compare

  • Fixed "TypeHintDeclarationSniff incorrectly reports about missing typehint when parameter docBlock contains union of two types, one is traversable and the second one does not specify the traversable type"
  • Fixed "UnusedPrivateElementsSniff incorrectly reports about methods returning references"

2.0.1

20 Mar 15:32

Choose a tag to compare

  • Fixed spacesCountAroundEqualsSign settings for DeclareStrictTypesSniff
  • TypeHintDeclaration.UselessDocComment was sometimes reported for generator functions