Skip to content

Releases: slevomat/coding-standard

6.0.5

19 Dec 16:17
6.0.5
eaa0c35
Compare
Choose a tag to compare

Fixes

  • EarlyExitSniff: Fixed internal error

Improvements

  • Support of phpstan/phpdoc-parser 0.4.2 (thanks to @jeroennoten)

6.0.4

17 Dec 20:08
6.0.4
34ec0a4
Compare
Choose a tag to compare

Fixes

  • Fixed bugs caused by broken DocCommentHelper

6.0.3

16 Dec 12:01
6.0.3
Compare
Choose a tag to compare

Fixes

  • UselessParenthesesSniff: Fixed false positive
  • EarlyExitSniff: Improved internal errors reporting

6.0.2

11 Dec 13:50
6.0.2
beea16e
Compare
Choose a tag to compare

Fixes

  • UselessParenthesesSniff: Fixed false positive

6.0.1

09 Dec 14:15
6.0.1
263d3a9
Compare
Choose a tag to compare

Fixes

  • Fixed array shapes support
  • UselessVariableSniff: Variables with @phpstan-var or @psalm-var annotation are not reported as useless
  • UselessParenthesesSniff: Fixed false positive

6.0.0

05 Dec 07:01
6.0.0
85e3329
Compare
Choose a tag to compare

New sniffs

  • RequireArrowFunctionSniff: Requires arrow functions
  • DisallowArrowFunctionSniff: Disallows arrow functions
  • RequireNumericLiteralSeparatorSniff: Requires use of numeric literal separators
  • DisallowNumericLiteralSeparatorSniff: Disallows numeric literal separators
  • RequireNowdocSniff: Requires nowdoc syntax instead of heredoc when possible
  • ReferenceSpacingSniff: Enforces configurable number of spaces after reference
  • DisallowReferenceSniff: Disallows references
  • RequireExplicitAssertionSniff: Requires assertion via assert() instead of inline documentation comments.
  • ParameterTypeHintSniff: Previously part of TypeHintDeclarationSniff
  • PropertyTypeHintSniff: Previously part of TypeHintDeclarationSniff
  • ReturnTypeHintSniff: Previously part of TypeHintDeclarationSniff
  • UselessFunctionDocCommentSniff: Previously part of TypeHintDeclarationSniff
  • BlockControlStructureSpacingSniff: Previously part of ControlStructureSpacingSniff
  • JumpStatementsSpacingSniff: Previously part of ControlStructureSpacingSniff

Improvements

  • PHP 7.4 support
  • Arrow functions support
  • Array shapes in phpDocs support
  • PropertyTypeHintSniff: Support for native type hints
  • InlineDocCommentDeclarationSniff: Reports missing related variables or no assigment
  • InlineDocCommentDeclarationSniff: Added support for doccomments after variable definition
  • InlineDocCommentDeclarationSniff: Added support for list() and short list []
  • TrailingArrayCommaSniff: New option enableAfterHeredoc
  • DisallowMixedTypeHintSniff: Added suppress support
  • UselessParenthesesSniff: Reports more useless parentheses

Fixes

  • Fixed support of @method annotation
  • InlineDocCommentDeclarationSniff: Check really only inline doccomments
  • TrailingCommaInCallSniff: Some calls were not reported
  • UselessParenthesesSniff: Fixed false positive
  • NamespaceSpacingSniff: Fixed false positive
  • UselessSemicolonSniff: Fixed internal error
  • TypeNameMatchesFileNameSniff: Files without namespaces should be reported too
  • UseSpacingSniff: Don't report errors for use statements with comments right before or after
  • UselessVariableSniff: Fixed false positive
  • UselessParameterDefaultValueSniff: Fixed false positive
  • UnusedPrivateElementsSniff: Fixed false positive
  • UnusedUsesSniff: Better handle php open tags (thanks to @donatj)
  • RequireCombinedAssignmentOperatorSniff: Fixed false positive
  • UselessInheritDocCommentSniff: Fixed internal error
  • RequireShortTernaryOperatorSniff: Fix token overrun (thanks to @donatj)
  • Fix compatibility with non-Composer installs of PHPCS (thanks to @jrfnl)

⚠️BC breaks

  • TypeHintDeclarationSniff is dead, long live ParameterTypeHintSniff, PropertyTypeHintSniff, ReturnTypeHintSniff and UselessFunctionDocCommentSniff
  • ControlStructureSpacingSniff is dead, long live BlockControlStructureSpacingSniff and JumpStatementsSpacingSniff (thanks to @grongor)

5.0.4

22 Mar 19:34
5.0.4
287ac33
Compare
Choose a tag to compare

Fixes

  • EarlyExitSniff: Fixed false positive
  • ControlStructureSpacingSniff: Fixed false positive
  • UnusedVariableSniff: Fixed false positives

5.0.3

19 Mar 21:24
5.0.3
89877cc
Compare
Choose a tag to compare

Fixes

  • ControlStructureSpacingSniff: Fixed false positive

5.0.2

12 Mar 20:49
5.0.2
223f02b
Compare
Choose a tag to compare

Fixes

  • ControlStructureSpacingSniff: Fixed T_CASE and T_DEFAULT support
  • UselessParenthesesSniff: Fixed false positives
  • UnusedVariableSniff: Fixed false positive
  • ConditionHelper: Fixed getNegativeCondition()
  • TypeHintHelper: Added more unofficial type hints

5.0.1

27 Feb 14:05
5.0.1
777ab18
Compare
Choose a tag to compare

Fixes

  • DisallowArrayTypeHintSyntaxSniff: Follow type hint when converting to generics syntax (thanks to @thewilkybarkid)
  • UnusedVariableSniff: Fixed false positive
  • UselessVariableSniff: Fixed false positive
  • UselessParenthesesSniff: Fixed false positive
  • TypeHintDeclarationSniff: Invalid annotations should be ignored

Improvements

  • UseStatementHelper: Speedup
  • UseStatementHelper: Mark method getUseStatements() as deprecated