Skip to content

Releases: slevomat/coding-standard

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

8.14.1

08 Oct 07:41
8.14.1
Compare
Choose a tag to compare

🐛 Fixes

8.14.0

07 Oct 10:34
8.14.0
Compare
Choose a tag to compare

🆕 New sniffs

  • SlevomatCodingStandard.Functions.NamedArgumentSpacing: Checks spacing in named argument (thanks to @mzk)

🔧 Improvements

  • SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses: If the file contains a group use then ignore the file completely (thanks to @jonathan1055)
  • SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation: New option ignoredAnnotationNames (thanks to @gemal)

🐛 Fixes

  • SlevomatCodingStandard.ControlStructures.AssignmentInCondition: Prevent error during live coding (thanks to @jrfnl)
  • SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition: Prevent error during live coding (thanks to @jrfnl)
  • SlevomatCodingStandard.PHP.UselessParentheses: Prevent error during live coding (thanks to @jrfnl)
  • SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation: Recognize global statements (thanks to @jrfnl)
  • SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants: Don't treat a group use as a constant (thanks to @asispts)
  • SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly: Fixed false positives
  • SlevomatCodingStandard.Classes.ConstantSpacing: Fixed internal error
  • SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration: Fixed false positive for final constant
  • SlevomatCodingStandard.Namespaces.UnusedUses: Ignores uses in annotations with multi lines string arguments (thanks to @mathroc)
  • NamespaceHelper::getAllNamespacesPointers(): Allow for namespace tokens used as operator (thanks to @jrfnl)

8.13.4

25 Jul 10:37
8.13.4
4b2af2f
Compare
Choose a tag to compare

🐛 Fixes

  • Fixed detection of {@inheritdoc}

8.13.3

24 Jul 15:30
8.13.3
daa7ae4
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.Commenting.DocCommentSpacing: Fixed internal error for invalid doccomment

8.13.2

24 Jul 10:22
8.13.2
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.Commenting.UselessFunctionDocComment: Fixed false positives
  • SlevomatCodingStandard.Commenting.DocCommentSpacing: Fixed false positives
  • SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing: Fix TypeError when return is on the first line of the file (thanks to @herndlm)

8.13.1

25 Jun 12:58
8.13.1
a13c15e
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.Commenting.DocCommentSpacing: Fixed fixer
  • SlevomatCodingStandard.Commenting.UselessFunctionDocComment: Fixed false positive
  • Don't parse invalid doccomments

8.13.0

23 Jun 09:57
8.13.0
4166003
Compare
Choose a tag to compare

🔧 Improvements

  • Refactored documentation comments parsing

🐛 Fixes

  • SlevomatCodingStandard.TypeHints.ParameterTypeHint: callable is not valid type for property promotion

8.12.1

15 May 21:50
8.12.1
f69e252
Compare
Choose a tag to compare

🐛 Fixes

  • SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly: Fixed false positive