Added
- New dependency: PHPCSExtra.
- The following sniffs have been added to the ruleset:
Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedenceGeneric.Strings.UnnecessaryHeredocGeneric.WhiteSpace.HereNowdocIdentifierSpacingSquiz.Operators.ComparisonOperatorUsagewhile excluding theSquiz.Operators.ComparisonOperatorUsage.ImplicitTrueerror code.Modernize.FunctionCalls.Dirname(FileConstanterror code only)NormalizedArrays.Arrays.ArrayBraceSpacingNormalizedArrays.Arrays.CommaAfterLastUniversal.Arrays.DuplicateArrayKeyUniversal.Arrays.MixedArrayKeyTypesUniversal.Arrays.MixedKeyedUnkeyedArrayUniversal.Classes.ModifierKeywordOrderUniversal.Classes.RequireAnonClassParenthesesUniversal.Classes.RequireFinalClassUniversal.CodeAnalysis.ConstructorDestructorReturnUniversal.CodeAnalysis.ForeachUniqueAssignmentUniversal.CodeAnalysis.NoDoubleNegativeUniversal.CodeAnalysis.NoEchoSprintfUniversal.CodeAnalysis.StaticInFinalClassUniversal.Constants.LowercaseClassResolutionKeywordUniversal.Constants.ModifierKeywordOrderUniversal.Constants.UppercaseMagicConstantsUniversal.ControlStructures.DisallowAlternativeSyntaxUniversal.ControlStructures.DisallowLonelyIfUniversal.Files.SeparateFunctionsFromOOUniversal.FunctionDeclarations.NoLongClosuresUniversal.FunctionDeclarations.RequireFinalMethodsInTraitsUniversal.Namespaces.DisallowCurlyBraceSyntaxUniversal.Namespaces.OneDeclarationPerFileUniversal.NamingConventions.NoReservedKeywordParameterNamesUniversal.OOStructures.AlphabeticExtendsImplementsUniversal.Operators.ConcatPositionUniversal.Operators.DisallowLogicalAndOrUniversal.Operators.DisallowShortTernaryUniversal.Operators.DisallowStandalonePostIncrementDecrementUniversal.Operators.TypeSeparatorSpacingUniversal.PHP.LowercasePHPTagUniversal.PHP.NoFQNTrueFalseNullUniversal.PHP.OneStatementInShortEchoTagUniversal.UseStatements.DisallowMixedGroupUseUniversal.UseStatements.DisallowUseConstUniversal.UseStatements.DisallowUseFunctionUniversal.UseStatements.KeywordSpacingUniversal.UseStatements.LowercaseFunctionConstUniversal.UseStatements.NoLeadingBackslashUniversal.UseStatements.NoUselessAliasesUniversal.WhiteSpace.AnonClassKeywordSpacingUniversal.WhiteSpace.CommaSpacingUniversal.WhiteSpace.PrecisionAlignment
Note: some of these additions may lead to duplicate messages for certain issues. If you come across this, please report the duplication.
Changed
- Updated the version constraints for PHP_CodeSniffer to
^3.13.3 || ^4.0.0(was^3.6.2). - Updated the version constraints for PHPCompatibility to
^10.0.0@devto benefit from hugely improved issue detection.
Includes excluding a number of additional error codes from thePHPCompatibility.Constants.NewConstantssniff to allow for polyfilled PHP tokens. - The
PSR12.ControlStructures.BooleanOperatorPlacementwill now enforce that boolean operators between two conditions on different lines will always be at the start of the second line. - The
PPSR12.Files.FileHeader.SpacingAfterTagBlockerror code (PHPCS 4.0+) has been excluded to allow for file docblocks to directly follow a PHP open tag at the top of a file. - The
PEAR.Commenting.FileComment.DuplicateSinceTagerror code has been excluded to allow for@sincetags used as a changelog in file docblocks. - Various housekeeping, including a contribution from @fredden.