Releases: slevomat/coding-standard
Releases · slevomat/coding-standard
6.2.0
📣 You can now sponsor Slevomat Coding Standard development
New sniffs
ArrowFunctionDeclaration
: Checksfn
declarationMethodSpacingSniff
: Checks that there is a certain number of blank lines between methodsDisallowMultiConstantDefinitionSniff
: Disallows multi constant definitionDisallowMultiPropertyDefinitionSniff
: Disallows multi property definitionDisallowDirectMagicInvokeCallSniff
: Disallows direct call of__invoke()
DisallowSuperGlobalVariableSniff
: Disallows use of super global variablesDisallowInlineCommentAfterCodeSniff
: Disallows comments after code at the same lineDuplicateSpacesSniff
: Checks duplicate spaces anywhere
Improvements
InlineDocCommentDeclarationSniff
: New optionallowDocCommentAboveReturn
EarlyExitSniff
: New optionignoreOneLineTrailingIf
FullyQualifiedGlobalConstantsSniff
: New optioninclude
(thanks to @bbatsche)FullyQualifiedGlobalFunctionsSniff
: New optioninclude
(thanks to @bbatsche)FullyQualifiedGlobalFunctionsSniff
: New optionincludeSpecialFunctions
RequireYodaComparisonSniff
: New optionalwaysVariableOnRight
JumpStatementsSpacingSniff
: New optionslinesCountBeforeWhenFirstInCaseOrDefault
,linesCountAfterWhenLastInCaseOrDefault
andlinesCountAfterWhenLastInLastCaseOrDefault
ClassStructureSniff
: New optionenableFinalMethods
to support final methods groupsRequireNullCoalesceEqualOperatorSniff
: New optionenable
(thanks to @carusogabriel)TrailingCommaInCallSniff
: New optionenable
(thanks to @carusogabriel)RequireArrowFunctionSniff
: New optionenable
(thanks to @carusogabriel)RequireNumericLiteralSeparatorSniff
: New optionenable
(thanks to @carusogabriel)RequireNumericLiteralSeparatorSniff
: New optionminDigitsBeforeDecimalPoint
RequireNumericLiteralSeparatorSniff
: New optionminDigitsAfterDecimalPoint
ClassStructureSniff
: Support for shortcut groupsReferenceThrowableOnlySniff
: Can be suppressed when\Exception
is used as parameterParameterTypeHintSniff
:@psalm-param
and@phpstan-param
are sufficient as type hintsReturnTypeHintSniff
:@psalm-return
and@phpstan-return
are sufficient as type hintsPropertyTypeHintSniff
:@psalm-var
and@phpstan-var
are sufficient as type hintsRequireNullCoalesceOperatorSniff
: Improved fixerPropertyTypeHintSniff
: Improved performancePropertyTypeHintSpacingSniff
: Improved performanceUnusedUsesSniff
: Improved performance (thanks to @nightlinus)UnusedVariableSniff
: Improved performance (thanks to @nightlinus)FullyQualifiedExceptionsSniff
: Improved performanceReferenceUsedNamesOnlySniff
: Improved performanceFullyQualifiedGlobalConstantsSniff
: Improved performanceFullyQualifiedGlobalFunctionsSniff
: Improved performance- Support for PHPCS configuration
php_version
in all possible sniffs NamespaceHelper
: Improved performance (thanks to @nightlinus)
Fixes
PropertySpacingSniff
: Fixed false positiveJumpStatementsSpacingSniff
: Fixed false positiveUselessParenthesesSniff
: Fixed false positiveUnusedVariableSniff
: Fixed false positivesEarlyExitSniff
: Fixed false positivesInlineDocCommentDeclarationSniff
: Fixed false positivesBlockControlStructureSpacingSniff
: Fixed false positiveNegationOperatorSpacingSniff
: Fixed internal errorReturnTypeHintSniff
: 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 doccommentForbiddenAnnotationsSniff
: Fixed fixer for one-line doccommentsInlineDocCommentDeclarationSniff
: Added support for various spacings in callable typehint (thanks to @simPod)PropertySpacingSniff
: Fixed fixerUnusedUsesSniff
: Fix for duplicate errorsAlphabeticallySortedUsesSniff
: Fix for duplicate errorsReferenceThrowableOnlySniff
: Fix for duplicate errorsFullyQualifiedGlobalConstantsSniff
: Fix for duplicate errorsFullyQualifiedGlobalFunctionsSniff
: Fix for duplicate errorsFullyQualifiedExceptionsSniff
: Fix for duplicate errorsReferenceUsedNamesOnlySniff
: Fix for duplicate errorsUselessAliasSniff
: Fix for duplicate errorsUseSpacingSniff
: Fix for duplicate errorsUseStatementHelper
: Workaround for bug in PHPCS
6.1.5
6.1.4
You can now sponsor Slevomat Coding Standard development
Fixes
PropertySpacingSniff
: Fixed support for typed propertiesParameterTypeHintSniff
: Fixed false positivesPropertyTypeHintSniff
: Fixed false positivesReturnTypeHintSniff
: Fixed false positivesEarlyExitSniff
: Fixed fixer for heredoc/nowdoc
6.1.3
You can now sponsor Slevomat Coding Standard development
Fixes
ParameterTypeHintSniff
: Fixed false positivesReturnTypeHintSniff
: Fixed false positivesPropertyTypeHintSniff
: Fixed false positives
6.1.2
You can now sponsor Slevomat Coding Standard development
Fixes
SingleLineArrayWhitespaceSniff
: Fixed settings by XML configuration (thanks to @mcaskill)UselessParenthesesSniff
: Fixed false positiveParentCallSpacingSniff
: Fixed false positivePropertySpacingSniff
: Fixed settings by XML configuration (thanks to @paxal)ConstantSpacingSniff
: Fixed settings by XML configuration (thanks to @paxal)PropertySpacingSniff
: Fixed false positiveConstantSpacingSniff
: Fixed false positiveUnusedPrivateElementsSniff
: Fixed support for private typed properties (thanks to @paxal)ParameterTypeHintSniff
: Fixed support for union and nullable typesReturnTypeHintSniff
: Fixed support for union and nullable typesPropertyTypeHintSniff
: Fixed support for union and nullable types
Improvements
SingleLineArrayWhitespaceSniff
: Add empty array support (can be enabled with new optionenableEmptyArrayCheck
) (thanks to @mcaskill)TraitUseSpacingSniff
: Added additional settinglinesCountBeforeFirstUseWhenFirstInClass
(thanks to @thled)RequireSingleLineMethodSignatureSniff
: New optionincludedMethodPatterns
(thanks to @RiKap)RequireSingleLineMethodSignatureSniff
: New optionexcludedMethodPatterns
(thanks to @RiKap)RequireMultiLineMethodSignatureSniff
: New optionincludedMethodPatterns
(thanks to @RiKap)RequireMultiLineMethodSignatureSniff
: New optionexcludedMethodPatterns
(thanks to @RiKap)
6.1.1
You can now sponsor Slevomat Coding Standard development
Fixes
ParentCallSpacingSniff
: Fixed false positive (thanks to @grongor)RequireSingleLineMethodSignatureSniff
: Fix for semicolons (thanks to @grongor)PropertyTypeHintSniff
: Improved support for union typesReturnTypeHintSniff
: Improved support for union typesParameterTypeHintSniff
: Improved support for union typesClassStructureSniff
: Fix missing support for static abstract methods (thanks to @grongor)
Improvements
NullableTypeForNullDefaultValueSniff
: Allow suppress (thanks to @simPod)
6.1.0
You can now sponsor Slevomat Coding Standard development
New sniffs
RequireNullCoalesceEqualOperatorSniff
: Requires use of null coalesce equal operator when possibleRequireMultiLineMethodSignatureSniff
: Enforces method signature to be splitted to more lines so each parameter is on its own lineRequireSingleLineMethodSignatureSniff
: Enforces method signature to be on a single line (thanks to @grongor)PropertySpacingSniff
: Checks that there is a certain number of blank lines between properties (thanks to @grongor)ConstantSpacingSniff
: Checks that there is a certain number of blank lines between constants (thanks to @grongor)ParentCallSpacingSniff
: Enforces configurable number of lines around parent method call (thanks to @grongor)ClassStructureSniff
: Checks that class/trait/interface members are in the correct order (thanks to @grongor)RequireOneLineDocCommentSniff
: Requires comments with single-line content to be written as one-liners (thanks to @grongor)MultiLineArrayEndBracketPlacementSniff
: Enforces reasonable end bracket placement for multiline arrays (thanks to @grongor)SingleLineArrayWhitespaceSniff
: Checks whitespace in single line array declarations (thanks to @grongor)NegationOperatorSpacingSniff
: Checks if there is the same number of spaces after negation operator as expected (thanks to @grongor)LineLengthSniff
: Enforces maximum length of a single line of code (thanks to @grongor)DisallowEmptyFunctionSniff
: Reports empty functions body and require at least a comment inside (thanks to @arxeiss)
Improvements
UnusedPrivateElementsSniff
: New optionalwaysUsedMethodsAnnotations
(thanks to @simPod)- Don't break the complete PHPCS run for unsupported syntaxes (thanks to @jrfnl)
Fixes
FullyQualifiedGlobalConstantsSniff
: Fixed false positivesFullyQualifiedGlobalFunctionsSniff
: Fixed false positivesUnusedVariableSniff
: Fixed false positiveUselessVariableSniff
: Fixed false positivesRequireTernaryOperatorSniff
: Fixed false positives (thanks to @grongor)JumpStatementsSpacingSniff
: Fixed false positives (thanks to @grongor)NullableTypeForNullDefaultValueSniff
: Workaround for bug in PHPCS