Refactor ruleset.xml

Group misplaced excludes, drop dead ones (unloaded PEAR/Zend sniffs),
merge MissingParamName severity rule into FunctionComment excludes,
normalize formatting. No behavior change.
This commit is contained in:
2026-09-22 14:44:51 +03:00
parent bebc698f83
commit b3f31b8096
+22 -48
View File
@@ -22,21 +22,17 @@
<exclude name="PSR12.Functions.NullableTypeDeclaration.WhitespaceFound"/>
<!-- checked by PSR12.ControlStructures.ControlStructureSpacing -->
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
<!-- checked by Zend.NamingConventions.ValidVariableName.NotCamelCaps -->
<!-- <exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/> -->
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostIncrementOperator"/>
<!-- Allow content before closing brace -->
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
</rule>
<!-- All SlevomatCodingStandard snifs https://github.com/slevomat/coding-standard?tab=readme-ov-file#fixing-errors-automatically -->
<!-- All SlevomatCodingStandard sniffs https://github.com/slevomat/coding-standard?tab=readme-ov-file#fixing-errors-automatically -->
<rule ref="SlevomatCodingStandard">
<!-- sniffs to exclude -->
<exclude name="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys.IncorrectKeyOrder" />
<exclude name="SlevomatCodingStandard.Attributes.AttributesOrder" />
<exclude name="SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment.AttributeBeforeDocComment" />
<exclude name="SlevomatCodingStandard.Classes.ClassLength.ClassTooLong" />
<exclude name="SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion.DisallowedConstructorPropertyPromotion" />
<exclude name="SlevomatCodingStandard.Classes.ForbiddenPublicProperty.ForbiddenPublicProperty" />
@@ -47,16 +43,16 @@
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix" />
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix" />
<exclude name="SlevomatCodingStandard.Classes.SuperfluousTraitNaming.SuperfluousSuffix" />
<exclude name="SlevomatCodingStandard.Commenting.DeprecatedAnnotationDeclaration.MissingDescription" />
<exclude name="SlevomatCodingStandard.Commenting.DisallowCommentAfterCode.DisallowedCommentAfterCode" />
<exclude name="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment.OneLinePropertyComment" />
<exclude name="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.InvalidFormat" />
<exclude name="SlevomatCodingStandard.Commenting.RequireOneLineDocComment.MultiLineDocComment" />
<exclude name="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment.MultiLinePropertyComment" />
<exclude name="SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh" />
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowNullSafeObjectOperator.DisallowedNullSafeObjectOperator" />
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison.DisallowedYodaComparison" />
<exclude name="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses.UselessParentheses" />
@@ -64,7 +60,7 @@
<exclude name="SlevomatCodingStandard.ControlStructures.NewWithParentheses.MissingParentheses" />
<exclude name="SlevomatCodingStandard.Exceptions.DisallowNonCapturingCatch.DisallowedNonCapturingCatch" />
<exclude name="SlevomatCodingStandard.Files.FileLength.FileTooLong" />
<exclude name="SlevomatCodingStandard.Files.LineLength.LineTooLong" />
<exclude name="SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName" />
@@ -75,9 +71,9 @@
<exclude name="SlevomatCodingStandard.Functions.FunctionLength.FunctionLength" />
<exclude name="SlevomatCodingStandard.Functions.RequireArrowFunction.RequiredArrowFunction" />
<exclude name="SlevomatCodingStandard.Functions.RequireMultiLineCall.RequiredMultiLineCall" />
<exclude name="SlevomatCodingStandard.Functions.RequireSingleLineCall.RequiredSingleLineCall" />
<exclude name="SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter" />
<exclude name="SlevomatCodingStandard.Functions.RequireSingleLineCall.RequiredSingleLineCall" />
<exclude name="SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter" />
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation.NonFullyQualifiedClassName" />
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions.NonFullyQualifiedException" />
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants.NonFullyQualified" />
@@ -85,27 +81,26 @@
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName" />
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces.NonFullyQualified" />
<exclude name="SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator.DisallowedNumericLiteralSeparator" />
<exclude name="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator.RequiredNumericLiteralSeparator" />
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostIncrementOperator" />
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPreDecrementOperator" />
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPreIncrementOperator" />
<exclude name="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint" />
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" />
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
<!-- This sniff has been deprecated since Slevomat Coding Standard 8.16.0 and will be removed in Slevomat Coding Standard 9.0.0. Use SlevomatCodingStandard.TypeHints.DNFTypeHintFormat instead. -->
<exclude name="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat" />
<exclude name="SlevomatCodingStandard.Whitespaces.DuplicateSpaces.DuplicateSpaces" />
<exclude name="SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator.DisallowedNumericLiteralSeparator" />
<!-- Отключил из-за-->
<exclude name="SlevomatCodingStandard.Classes.ClassStructure.IncorrectGroupOrder" />
</rule>
<!-- Force array element indentation with 4 spaces -->
<rule ref="Generic.Arrays.ArrayIndent"/>
<!-- Forbid `array(...)` -->
@@ -391,22 +386,10 @@
<!-- Require presence of declare(strict_types=1) -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property
name="declareOnFirstLine"
value="false"
/>
<property
name="linesCountBeforeDeclare"
value="1"
/>
<property
name="spacesCountAroundEqualsSign"
value="0"
/>
<property
name="linesCountAfterDeclare"
value="1"
/>
<property name="declareOnFirstLine" value="false"/>
<property name="linesCountBeforeDeclare" value="1"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
<property name="linesCountAfterDeclare" value="1"/>
</properties>
</rule>
@@ -546,16 +529,8 @@
<exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/>
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamType"/>
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamName"/>
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
<exclude name="PEAR.WhiteSpace.ScopeClosingBrace.Line"/>
<exclude name="Squiz.Commenting.FunctionComment.WrongStyle"/>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamName">
<!-- Отключаем только эту конкретную ошибку, оставляя остальные проверки комментариев -->
<severity>0</severity>
<exclude name="Squiz.Commenting.FunctionComment.MissingParamName"/>
</rule>
<!-- Forbid global functions -->
@@ -628,5 +603,4 @@
<!-- turned off by PSR-12 -> turning back on -->
<severity>5</severity>
</rule>
</ruleset>