Skip to content

Releases: slevomat/coding-standard

8.1.0

24 Jun 11:43
8.1.0
bf55f29
Compare
Choose a tag to compare

🔧 Improvements

  • SlevomatCodingStandard.Classes.PropertyDeclaration: New option checkPromoted to enable check of promoted properties
  • SlevomatCodingStandard.Classes.PropertyDeclaration: New option enableMultipleSpacesBetweenModifiersCheck to enable check of spaces between property modifiers
  • SlevomatCodingStandard.Classes.PropertyDeclaration: Improved error messages
  • SlevomatCodingStandard.Classes.ForbiddenPublicProperty: New option checkPromoted to enable check of promoted properties

🐛 Fixes

  • SlevomatCodingStandard.TypeHints.PropertyTypeHint: Fix inconsistent enableIntersectionTypeHint (thanks to @schlndh)

8.0.1

22 Jun 06:59
8.0.1
c5cf9b5
Compare
Choose a tag to compare

🐛 Fixes

  • Group use statements are ignored - we don't support them
  • SlevomatCodingStandard.PHP.UselessParentheses: Fixed false positive
  • SlevomatCodingStandard.TypeHints.ParameterTypeHint: Fixed internal error (thanks to @schlndh)

8.0.0

17 Jun 13:24
8.0.0
84cc169
Compare
Choose a tag to compare

🔧 Improvements

  • Support for intersection types
  • Support for readonly properties
  • Support for enums
  • Support for never type hint
  • Support for more unofficial type hints
  • SlevomatCodingStandard.Classes.PropertyDeclaration: Checks also order of modifiers
  • SlevomatCodingStandard.Classes.ClassStructure: Support for enum cases and readonly properties

🐛 Fixes

  • SlevomatCodingStandard.Classes.PropertyDeclaration: Fixed missing support for only static property
  • SlevomatCodingStandard.TypeHints.PropertyTypeHint: Fixed missing support for only static property
  • SlevomatCodingStandard.Commenting.EmptyComment: Fixed internal error
  • SlevomatCodingStandard.Classes.ForbiddenPublicProperty: Fixed internal error
  • SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation: Fixed false positives for @psalm-import-type in @psalm-var
  • SlevomatCodingStandard.PHP.RequireExplicitAssertion: Ignore unsupported unofficial type hints

⚠️BC breaks

  • SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing renamed to SlevomatCodingStandard.Classes.PropertyDeclaration
  • SlevomatCodingStandard.Classes.ClassStructure: Removed option enableFinalMethods
  • Removed error SlevomatCodingStandard.Namespaces.UnusedUses.MismatchingCaseSensitivity

7.2.1

25 May 11:05
7.2.1
aff06ae
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly: Fixed false positives for colliding functions and constants
  • SlevomatCodingStandard.Commenting.DisallowCommentAfterCode: Don't break multi-line string during auto-fix (thanks to @schlndh)
  • Fixed detection of function object

7.2.0

06 May 11:46
7.2.0
b4f96a8
Compare
Choose a tag to compare

🆕 New sniffs

  • Added SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse
  • Added SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse

🔧 Improvements

  • Support for offset access type syntax in annotations
  • Support for @phpstan-assert/@psalm-assert annotations
  • SlevomatCodingStandard.Whitespaces.DuplicateSpacesSniff: New option ignoreSpacesInMatch
  • SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall: New option onlySingleLine
  • SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration: New option onlySingleLine

🐛 Fixes

  • SlevomatCodingStandard.TypeHints.ReturnTypeHint: Fixed internal error
  • SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn: Fixed internal error
  • SlevomatCodingStandard.Functions.RequireSingleLineCall: Fixed false positive
  • SlevomatCodingStandard.Variables.UnusedVariable: Resolve false positives with increment/decrement operators (thanks to @aadmathijssen)
  • SlevomatCodingStandard.Variables.UnusedVariable: allow increment/decrement operators after yield (thanks to @aadmathijssen)

7.1.0

29 Mar 13:06
7.1.0
b521bd3
Compare
Choose a tag to compare

⚠️ Removed support for PHP 7.1

🆕 New sniffs

  • Added SlevomatCodingStandard.Classes.RequireAbstractOrFinal (thanks to @roslov)
  • Added SlevomatCodingStandard.Exceptions.DisallowNonCapturingCatch (thanks to @olsavmic)

🔧 Improvements

  • Support for conditional types in annotations
  • SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator: Added option ignoreOctalNumbers
  • SlevomatCodingStandard.Functions.FunctionLength: New options includeComments and includeWhitespace (thanks to @bkdotcom)

7.0.20

25 Mar 09:54
7.0.20
cbfadfe
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.TypeHints.ReturnTypeHint: Improved - Type alias should not be reported as "missing traversable type hint specification"
  • SlevomatCodingStandard.TypeHints.ParameterTypeHint: Improved - Type alias should not be reported as "missing traversable type hint specification"
  • SlevomatCodingStandard.TypeHints.PropertyTypeHint: Improved - Type alias should not be reported as "missing traversable type hint specification"
  • SlevomatCodingStandard.TypeHints.ReturnTypeHint: It was not possible to suppress some errors
  • SlevomatCodingStandard.Classes.ParentCallSpacing: Fixed false positive

7.0.19

01 Mar 18:21
7.0.19
bef66a4
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.TypeHints.PropertyTypeHint: Type alias should not be reported as "missing traversable type hint specification"
  • SlevomatCodingStandard.TypeHints.ParameterTypeHint: Type alias should not be reported as "missing traversable type hint specification"
  • SlevomatCodingStandard.TypeHints.ReturnTypeHint: Type alias should not be reported as "missing traversable type hint specification"
  • SlevomatCodingStandard.ControlStructures.RequireYodaComparison: Fixed false positives with match
  • SlevomatCodingStandard.ControlStructures.DisallowYodaComparison: Fixed false positives with match
  • SlevomatCodingStandard.Commenting.DocCommentSpacing: Fixed internal error
  • SlevomatCodingStandard.Variables.UnusedVariable: Fixed false positive
  • SlevomatCodingStandard.Variables.UnusedVariable: Fixed missing report when option ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach is enabled
  • SlevomatCodingStandard.Functions.RequireTrailingCommaInCall: Fixed false positive
  • ReferencedNameHelper: Fixed searching of class references in heredoc
  • Ignore invalid @template and @type annotations

7.0.18

07 Dec 17:21
7.0.18
b81ac84
Compare
Choose a tag to compare

🐛 Fixes

  • Improved AnnotationTypeHelper::export() for callable in array

7.0.17

06 Dec 22:16
7.0.17
b574727
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.Namespaces.UnusedUses: Improved detection of relative name in generic annotation
  • SlevomatCodingStandard.Classes.ClassConstantVisibility: Added support for final constants
  • SlevomatCodingStandard.Functions.RequireTrailingCommaInCall: Skip instances on same line as closing parenthesis (thanks to @donatj)