Skip to content

Releases: slevomat/coding-standard

6.3.5

13 May 15:05
6.3.5
2999540

Choose a tag to compare

📣 You can now sponsor Slevomat Coding Standard development

Fixes

  • EarlyExitSniff: yield does not do early exit
  • EarlyExitSniff: Fixed false positive
  • BlockControlStructureSpacingSniff: Fixed false positives
  • JumpStatementsSpacingSniff: Improved fixer
  • RequireTernaryOperatorSniff: Fixer should not remove comments

6.3.4

12 May 14:23
6.3.4
51d4580

Choose a tag to compare

📣 You can now sponsor Slevomat Coding Standard development

Fixes

  • EarlyExitSniff: Fixed internal error
  • BlockControlStructureSpacingSniff: Fixed false positive
  • UselessFunctionDocCommentSniff: Fixed internal error
  • Fixed parsing really strange WordPress documentation
  • TypeNameMatchesFileNameSniff: Exclude provided base path (thanks to @rmikalkenas)

6.3.3

28 Apr 07:29
6.3.3
b905a82

Choose a tag to compare

📣 You can now sponsor Slevomat Coding Standard development

Improvements

  • ClassMemberSpacingSniff: Improved for invalid comments
  • UselessVariableSniff: Improved fixer

Fixes

  • StrictCallSniff: Fixed false positive

6.3.2

20 Apr 12:37
6.3.2
6de1e23

Choose a tag to compare

📣 You can now sponsor Slevomat Coding Standard development

Fixes

  • Hotfix for autoload, broken in #969

6.3.1

20 Apr 11:04
6.3.1
e4f74a9

Choose a tag to compare

📣 You can now sponsor Slevomat Coding Standard development

Fixes

  • ClassStructureSniff: Fixed internal error
  • ClassMemberSpacingSniff: Fixed false positive
  • StaticClosureSniff: Workaround for bug in PHPCS

6.3.0

20 Apr 08:29
6.3.0
d7a4988

Choose a tag to compare

📣 You can now sponsor Slevomat Coding Standard development

New sniffs

  • ClassMemberSpacingSniff: Checks lines count between different class members, eg. between last property and first method
  • StrictCallSniff: Some functions have $strict parameter. This sniff reports calls to these functions without the parameter or with $strict = false
  • ForbiddenClassesSniff: Reports usage of forbidden classes, interfaces, parent classes and traits (thanks to @arxeiss)

Improvements

  • Support for parsing and checking @template etc annotations
  • Support for more prefixed annotations (@psalm- or @phpstan- prefixes)
  • EarlyExitSniff: New option ignoreTrailingIfWithOneInstruction
  • AssignmentInConditionSniff: New option ignoreAssignmentsInsideFunctionCalls (thanks to @nightlinus)
  • DuplicateSpacesSniff: New option ignoreSpacesInComment
  • LineLengthSniff: Speedup (thanks to @nightlinus)

Fixes

  • FullyQualifiedClassNameInAnnotationSniff: Does not report @template
  • ParentCallSpacingSniff: Fixed false positive
  • ReturnTypeHintSniff: Fixed false positive
  • ParameterTypeHintSniff: Fixed false positive
  • PropertyTypeHintSniff: Fixed false positive
  • MethodSpacingSniff: Fixed false positive
  • EarlyExitSniff: Fixed missing report
  • ConstantSpacingSniff: Fixed internal error

6.2.0

30 Mar 07:58
6.2.0
c4bf9ca

Choose a tag to compare

📣 You can now sponsor Slevomat Coding Standard development

New sniffs

  • ArrowFunctionDeclaration: Checks fn declaration
  • MethodSpacingSniff: Checks that there is a certain number of blank lines between methods
  • DisallowMultiConstantDefinitionSniff: Disallows multi constant definition
  • DisallowMultiPropertyDefinitionSniff: Disallows multi property definition
  • DisallowDirectMagicInvokeCallSniff: Disallows direct call of __invoke()
  • DisallowSuperGlobalVariableSniff: Disallows use of super global variables
  • DisallowInlineCommentAfterCodeSniff: Disallows comments after code at the same line
  • DuplicateSpacesSniff: Checks duplicate spaces anywhere

Improvements

  • InlineDocCommentDeclarationSniff: New option allowDocCommentAboveReturn
  • EarlyExitSniff: New option ignoreOneLineTrailingIf
  • FullyQualifiedGlobalConstantsSniff: New option include (thanks to @bbatsche)
  • FullyQualifiedGlobalFunctionsSniff: New option include (thanks to @bbatsche)
  • FullyQualifiedGlobalFunctionsSniff: New option includeSpecialFunctions
  • RequireYodaComparisonSniff: New option alwaysVariableOnRight
  • JumpStatementsSpacingSniff: New options linesCountBeforeWhenFirstInCaseOrDefault, linesCountAfterWhenLastInCaseOrDefault and linesCountAfterWhenLastInLastCaseOrDefault
  • ClassStructureSniff: New option enableFinalMethods to support final methods groups
  • RequireNullCoalesceEqualOperatorSniff: New option enable (thanks to @carusogabriel)
  • TrailingCommaInCallSniff: New option enable (thanks to @carusogabriel)
  • RequireArrowFunctionSniff: New option enable (thanks to @carusogabriel)
  • RequireNumericLiteralSeparatorSniff: New option enable (thanks to @carusogabriel)
  • RequireNumericLiteralSeparatorSniff: New option minDigitsBeforeDecimalPoint
  • RequireNumericLiteralSeparatorSniff: New option minDigitsAfterDecimalPoint
  • ClassStructureSniff: Support for shortcut groups
  • ReferenceThrowableOnlySniff: Can be suppressed when \Exception is used as parameter
  • ParameterTypeHintSniff: @psalm-param and @phpstan-param are sufficient as type hints
  • ReturnTypeHintSniff: @psalm-return and @phpstan-return are sufficient as type hints
  • PropertyTypeHintSniff: @psalm-var and @phpstan-var are sufficient as type hints
  • RequireNullCoalesceOperatorSniff: Improved fixer
  • PropertyTypeHintSniff: Improved performance
  • PropertyTypeHintSpacingSniff: Improved performance
  • UnusedUsesSniff: Improved performance (thanks to @nightlinus)
  • UnusedVariableSniff: Improved performance (thanks to @nightlinus)
  • FullyQualifiedExceptionsSniff: Improved performance
  • ReferenceUsedNamesOnlySniff: Improved performance
  • FullyQualifiedGlobalConstantsSniff: Improved performance
  • FullyQualifiedGlobalFunctionsSniff: Improved performance
  • Support for PHPCS configuration php_version in all possible sniffs
  • NamespaceHelper: Improved performance (thanks to @nightlinus)

Fixes

  • PropertySpacingSniff: Fixed false positive
  • JumpStatementsSpacingSniff: Fixed false positive
  • UselessParenthesesSniff: Fixed false positive
  • UnusedVariableSniff: Fixed false positives
  • EarlyExitSniff: Fixed false positives
  • InlineDocCommentDeclarationSniff: Fixed false positives
  • BlockControlStructureSpacingSniff: Fixed false positive
  • NegationOperatorSpacingSniff: Fixed internal error
  • ReturnTypeHintSniff: Fixed breaking syntax on removing useless @return annotation in one-line doccomment (thanks to @nightlinus)
  • ParameterTypeHintSniff: Fixed breaking syntax on removing useless @param annotation in one-line doccomment
  • ForbiddenAnnotationsSniff: Fixed fixer for one-line doccomments
  • InlineDocCommentDeclarationSniff: Added support for various spacings in callable typehint (thanks to @simPod)
  • PropertySpacingSniff: Fixed fixer
  • UnusedUsesSniff: Fix for duplicate errors
  • AlphabeticallySortedUsesSniff: Fix for duplicate errors
  • ReferenceThrowableOnlySniff: Fix for duplicate errors
  • FullyQualifiedGlobalConstantsSniff: Fix for duplicate errors
  • FullyQualifiedGlobalFunctionsSniff: Fix for duplicate errors
  • FullyQualifiedExceptionsSniff: Fix for duplicate errors
  • ReferenceUsedNamesOnlySniff: Fix for duplicate errors
  • UselessAliasSniff: Fix for duplicate errors
  • UseSpacingSniff: Fix for duplicate errors
  • UseStatementHelper: Workaround for bug in PHPCS

6.1.5

06 Feb 11:28
6.1.5
d767b5e

Choose a tag to compare

You can now sponsor Slevomat Coding Standard development

Fixes

  • EarlyExitSniff: Improved fixer
  • ClassStructureSniff: Fixed detection of some magic methods
  • ClassStructureSniff: Require all groups to be set (thanks to @grongor)
  • ClassStructureSniff: Improve violation message (thanks to @grongor)
  • Fixes for typed properties

6.1.4

03 Feb 21:54
6.1.4
49e6021

Choose a tag to compare

You can now sponsor Slevomat Coding Standard development

Fixes

  • PropertySpacingSniff: Fixed support for typed properties
  • ParameterTypeHintSniff: Fixed false positives
  • PropertyTypeHintSniff: Fixed false positives
  • ReturnTypeHintSniff: Fixed false positives
  • EarlyExitSniff: Fixed fixer for heredoc/nowdoc

6.1.3

01 Feb 17:59
6.1.3
c8f2e2b

Choose a tag to compare

You can now sponsor Slevomat Coding Standard development

Fixes

  • ParameterTypeHintSniff: Fixed false positives
  • ReturnTypeHintSniff: Fixed false positives
  • PropertyTypeHintSniff: Fixed false positives