Skip to content

Releases: slevomat/coding-standard

8.19.1

09 Jun 18:11
8.19.1
458d665
Compare
Choose a tag to compare

🐛 Fixes

  • Fix properties detection in some sniffs
  • Improved indentation processing

8.19.0

07 Jun 15:24
8.19.0
9cc5050
Compare
Choose a tag to compare

🔧 Improvements

  • Support of PHP 8.4 properties
    • Asymetric visibility supported
    • final/abstract properties supported
    • Property hooks should not break any sniff

🐛 Fixes

  • SlevomatCodingStandard.Arrays.DisallowPartiallyKeyed: Fixed false positive
  • SlevomatCodingStandard.Classes.ClassMemberSpacing: Prevent deleting unexpected code/comments (thanks to @maryo)
  • SlevomatCodingStandard.Complexity.Cognitive: do...while loop should only increment once (not for both the T_DO and T_WHILE) (thanks to @bkdotcom)
  • SlevomatCodingStandard.TypeHints.ClassConstantTypeHint: New option fixableNativeTypeHint - it's possible to fix only private constants (thanks to @maryo)
  • SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion: Properly autofixing when argument name has an attribute (thanks to @maryo)

8.18.1

22 May 14:35
8.18.1
06b18b3
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration: Fix error when no code is found after @var (thanks to @AegirLeet)
  • SlevomatCodingStandard.PHP.UselessParentheses: Fixed false positive for bitwise not operator

8.18.0

01 May 09:55
8.18.0
f3b23cb
Compare
Choose a tag to compare

🔧 Improvements

  • SlevomatCodingStandard.Classes.ClassStructure: Support for custom method groups based on method name prefix (thanks to @maryo)

🐛 Fixes

  • SlevomatCodingStandard.Functions.RequireMultiLineCall: Fix reporting multiline call which exactly fits into line length limit (thanks to @maryo)

8.17.1

25 Apr 18:41
8.17.1
9bad414
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.TypeHints.PropertyTypeHint: Fix

8.17.0

10 Apr 06:08
8.17.0
ace04a4
Compare
Choose a tag to compare

🔧 Improvements

  • SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator: New option checkIfConditions

🐛 Fixes

  • SlevomatCodingStandard.Classes.MethodSpacing: Fixed check for methods with more attributes

8.16.2

27 Mar 19:46
8.16.2
8bf0408
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.TypeHints.ReturnTypeHint: Fixed false positive
  • SlevomatCodingStandard.Variables.UnusedVariable: Fixed false positive
  • SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint: Fix logic error (thanks to @jrfnl)

8.16.1

23 Mar 16:35
8.16.1
490023f
Compare
Choose a tag to compare

🐛 Fixes

  • Fixed BC break

8.16.0

23 Feb 18:16
8.16.0
7748a42
Compare
Choose a tag to compare

⚠️

  • Drop PHP 7.2 and 7.3 support
  • Tested on PHP 8.4 but no support for PHP 8.4 features
  • Update to phpstan/phpdoc-parser 2.0 (thanks to @ondrejmirtes)

🆕 New sniffs

  • SlevomatCodingStandard.TypeHints.ClassConstantTypeHint: Checks type hint of class constants (thanks to @DaDeather)
  • SlevomatCodingStandard.TypeHints.DNFTypeHintFormat: Checks format of DNF type hints

🔧 Improvements

  • SlevomatCodingStandard.Classes.ClassStructure: Support for invoke method group
  • SlevomatCodingStandard.Classes.ClassStructure: Support for definition of custom groups (thanks to @maryo)
  • SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly: New option allowWhenNoNamespace
  • SlevomatCodingStandard.Classes.ForbiddenPublicProperty: New option allowReadonly - Add support for allowing public readonly properties (thanks to @tfrommen)
  • SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint: Does not report error when attribute #[Override] is presented (thanks to @kamil-zacek)
  • SlevomatCodingStandard.PHP.UselessParentheses: Checks useless parentheses in (new Foo());
  • Remove use of deprecated T_ARRAY_HINT (thanks to @jrfnl)

🐛 Fixes

  • SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly: Some references were not detected
  • SlevomatCodingStandard.TypeHints.DeclareStrictTypes: Fixing number of empty lines when previous effective token before declare is line comment (thanks to @maryo)
  • SlevomatCodingStandard.Classes.MethodSpacing: Fix check for method with attributes
  • SlevomatCodingStandard.Classes.PropertyDeclaration: Fixed false positives where there's function with static return type hint before property
  • SlevomatCodingStandard.ClassesEnumCaseSpacing: Fixed internal error (thanks to @v.fateev)
  • SlevomatCodingStandard.ClassesConstantSpacing: Fixed internal error (thanks to @v.fateev)
  • SlevomatCodingStandard.TypeHints.PropertyTypeHint: Fixed false positive for object shape as item in travesable type
  • SlevomatCodingStandard.ControlStructures.NewWithParentheses: Fixed false positive for readonly anonymous class
  • SlevomatCodingStandard.ControlStructures.DisallowYodaComparison: Fixed fixer
  • SlevomatCodingStandard.PHPUselessParentheses: Fixed false positive
  • SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking: sprintf() is optimized too
  • Documentation fixes (thanks to @edpittol and @tfrommen)

🗑️ Deprecated

  • SlevomatCodingStandard.TypeHints.UnionTypeHintFormat: Use SlevomatCodingStandard.TypeHints.DNFTypeHintFormat instead

8.15.0

09 Mar 15:27
8.15.0
7d1d957
Compare
Choose a tag to compare

🔧 Improvements

  • Speedup of sniffs working with use
  • Removed for a long time deprecated FunctionLength sniff in Files namespace

🐛 Fixes

  • SlevomatCodingStandard.Classes.ClassConstantVisibility: Fixed error message for typed constants
  • SlevomatCodingStandard.Namespaces.UnusedUses: Fixed false positive thanks to PHPCS upgrade
  • SlevomatCodingStandard.Namespaces.UnusedUses: Fix class detection in double-quoted strings and heredoc (thanks to @c01l)
  • SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch: Fixed false positives
  • SlevomatCodingStandard.Functions.RequireTrailingCommaInCall: Fixed missing report for missing trailing comma after arrow function
  • SlevomatCodingStandard.Commenting.UselessFunctionDocComment: It should report simple array as useless
  • Fixed internal error in CommentHelper