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
+10 -36
View File
@@ -22,16 +22,12 @@
<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" />
@@ -85,8 +81,10 @@
<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" />
@@ -98,14 +96,11 @@
<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>