Releases: slevomat/coding-standard
Releases · slevomat/coding-standard
6.0.1
6.0.0
New sniffs
RequireArrowFunctionSniff: Requires arrow functionsDisallowArrowFunctionSniff: Disallows arrow functionsRequireNumericLiteralSeparatorSniff: Requires use of numeric literal separatorsDisallowNumericLiteralSeparatorSniff: Disallows numeric literal separatorsRequireNowdocSniff: Requires nowdoc syntax instead of heredoc when possibleReferenceSpacingSniff: Enforces configurable number of spaces after referenceDisallowReferenceSniff: Disallows referencesRequireExplicitAssertionSniff: Requires assertion viaassert()instead of inline documentation comments.ParameterTypeHintSniff: Previously part ofTypeHintDeclarationSniffPropertyTypeHintSniff: Previously part ofTypeHintDeclarationSniffReturnTypeHintSniff: Previously part ofTypeHintDeclarationSniffUselessFunctionDocCommentSniff: Previously part ofTypeHintDeclarationSniffBlockControlStructureSpacingSniff: Previously part ofControlStructureSpacingSniffJumpStatementsSpacingSniff: Previously part ofControlStructureSpacingSniff
Improvements
- PHP 7.4 support
- Arrow functions support
- Array shapes in phpDocs support
PropertyTypeHintSniff: Support for native type hintsInlineDocCommentDeclarationSniff: Reports missing related variables or no assigmentInlineDocCommentDeclarationSniff: Added support for doccomments after variable definitionInlineDocCommentDeclarationSniff: Added support forlist()and short list[]TrailingArrayCommaSniff: New optionenableAfterHeredocDisallowMixedTypeHintSniff: Added suppress supportUselessParenthesesSniff: Reports more useless parentheses
Fixes
- Fixed support of
@methodannotation InlineDocCommentDeclarationSniff: Check really only inline doccommentsTrailingCommaInCallSniff: Some calls were not reportedUselessParenthesesSniff: Fixed false positiveNamespaceSpacingSniff: Fixed false positiveUselessSemicolonSniff: Fixed internal errorTypeNameMatchesFileNameSniff: Files without namespaces should be reported tooUseSpacingSniff: Don't report errors for use statements with comments right before or afterUselessVariableSniff: Fixed false positiveUselessParameterDefaultValueSniff: Fixed false positiveUnusedPrivateElementsSniff: Fixed false positiveUnusedUsesSniff: Better handle php open tags (thanks to @donatj)RequireCombinedAssignmentOperatorSniff: Fixed false positiveUselessInheritDocCommentSniff: Fixed internal errorRequireShortTernaryOperatorSniff: Fix token overrun (thanks to @donatj)- Fix compatibility with non-Composer installs of PHPCS (thanks to @jrfnl)
⚠️ BC breaks
TypeHintDeclarationSniffis dead, long liveParameterTypeHintSniff,PropertyTypeHintSniff,ReturnTypeHintSniffandUselessFunctionDocCommentSniffControlStructureSpacingSniffis dead, long liveBlockControlStructureSpacingSniffandJumpStatementsSpacingSniff(thanks to @grongor)
5.0.4
5.0.3
5.0.2
5.0.1
Fixes
DisallowArrayTypeHintSyntaxSniff: Follow type hint when converting to generics syntax (thanks to @thewilkybarkid)UnusedVariableSniff: Fixed false positiveUselessVariableSniff: Fixed false positiveUselessParenthesesSniff: Fixed false positiveTypeHintDeclarationSniff: Invalid annotations should be ignored
Improvements
UseStatementHelper: SpeedupUseStatementHelper: Mark method getUseStatements() as deprecated
5.0.0
New sniffs
SpreadOperatorSpacingSniff: Enforces configurable number of spaces after the...operatorDisallowArrayTypeHintSyntaxSniff: Disallows usage of array type hint syntax (eg.int[],bool[][]) in phpDocs in favour of generic type hint syntax (eg.array<int>,array<array<bool>>)TrailingCommaInCallSniff: Enforces trailing commas in multi-line callsDisallowMixedTypeHintSniff: Disallows usage of "mixed" type hint in phpDocsSuperfluousTraitNamingSniff: Reports use of superfluous suffixTraitfor traits
Improvements
- Added support for generic and intersection types in PHP docs
- Improved support for more namespaces in a file
UselessIfConditionWithReturnSniff: New optionassumeAllConditionExpressionsAreAlreadyBooleanEarlyExitSniff: More uselesselseifandelseconditions are reportedNullTypeHintOnLastPositionSniff: Added support for@propertyand@methodannotationsFullyQualifiedClassNameInAnnotationSniff: Added support for@propertyand@methodannotationsLongTypeHintsSniff: Added support for@propertyand@methodannotationsLongTypeHintsSniff: Inline doccomments are checked nowReferenceUsedNamesOnlySniff: Added support for@methodannotations (thanks to @hranicka)UselessParenthesesSniff: Some useless parentheses were not reported
Fixes
OptimizedFunctionsWithoutUnpackingSniff: Fix for trailing commas in function callsUnusedVariableSniff: Fixed false positiveUselessVariableSniff: Fixed false positive
⚠️ BC breaks
EmptyLinesAroundTypeBracesSniff: Renamed toEmptyLinesAroundClassBracesSniffand moved to namespaceClassesDisallowEqualOperatorsSniff: Moved to namespaceOperatorsUselessConditionWithReturnSniff: Splitted toUselessIfConditionWithReturnSniffandUselessTernaryOperatorSniff- Removed support for
@varannotation in format/** @var $variable type */for most of the sniffs - Removed support for
@paramannotations without parameter name for most of the sniffs AlphabeticallySortedUsesSniff:psr12Compatibleoption is now enabled by defaultNullableTypeForNullDefaultValueSniff: Removed deprecatedenabledoptionClassConstantVisibilitySniff: Removed deprecatedenabledoptionTypeHintDeclarationSniff: MarkenableObjectTypeHintoption as deprecatedTypeHintDeclarationSniff: Removed deprecatedusefulAnnotationsoptionTypeHintDeclarationSniff: Removed deprecatedenableNullableTypeHintsoptionTypeHintDeclarationSniff: Removed deprecatedenableVoidTypeHintoption- Removed deprecated
DisallowLateStaticBindingForContantsSniff(alias forDisallowLateStaticBindingForConstantsSniff)
4.8.7
Fixes:
DeclareStrictTypesSniff: Fixed correct number of whitespaces in autofix and errormessage (thanks to @wietsewarendorff)RequireMultiLineTernaryOperatorSniff: Fixed close tag w/o prior semi (thanks to @donatj)UnusedPrivateElementsSniff: Fixed false positiveSuperfluousExceptionNamingSniff: Fixed false positiveControlStructureSpacingSniff: Fixed internal errorsDocCommentSpacingSniff: Fixed infinite loopDisallowYodaComparisonSniff: Don't fix assigment in conditionRequireOnlyStandaloneIncrementAndDecrementOperatorsSniff: Fixed false positiveUnusedVariableSniff: Fixed false positiveUselessParenthesesSniff: Fixed false positiveReferencedNameHelper: Fixed reference names with whitespace
4.8.6
Fixes:
UnusedVariableSniff: Fixed false positivesUnusedPrivateElementsSniff: Fixed false positivesUselessParenthesesSniff: Fixed false positivesTraitUseSpacingSniff: Fixer should not remove useful codeNamespaceDeclarationSniff: Fixed false positiveRequireOneNamespaceInFileSniff: Fixed false positiveControlStructureSpacingSniff: Fixed false positiveUnusedUsesSniff: Fixed false positiveRequireMultiLineTernaryOperatorSniff: Fixed false positiveOptimizedFunctionsWithoutUnpackingSniff: Fixed infinite loop
4.8.5
Fixes:
UnusedVariableSniff: Fixed false positiveDisallowImplicitArrayCreationSniff: Fixed false positiveDisallowImplicitArrayCreationSniff: Fixed missing reportingUselessParenthesesSniff: Fixed false positivesUselessParenthesesSniff: Fixed internal error