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"/> <exclude name="PSR12.Functions.NullableTypeDeclaration.WhitespaceFound"/>
<!-- checked by PSR12.ControlStructures.ControlStructureSpacing --> <!-- checked by PSR12.ControlStructures.ControlStructureSpacing -->
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/> <exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
<!-- checked by Zend.NamingConventions.ValidVariableName.NotCamelCaps --> <!-- Allow content before closing brace -->
<!-- <exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/> --> <exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostIncrementOperator"/>
</rule> </rule>
<!-- All SlevomatCodingStandard sniffs https://github.com/slevomat/coding-standard?tab=readme-ov-file#fixing-errors-automatically -->
<!-- All SlevomatCodingStandard snifs https://github.com/slevomat/coding-standard?tab=readme-ov-file#fixing-errors-automatically -->
<rule ref="SlevomatCodingStandard"> <rule ref="SlevomatCodingStandard">
<!-- sniffs to exclude -->
<exclude name="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys.IncorrectKeyOrder" /> <exclude name="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys.IncorrectKeyOrder" />
<exclude name="SlevomatCodingStandard.Attributes.AttributesOrder" /> <exclude name="SlevomatCodingStandard.Attributes.AttributesOrder" />
@@ -85,8 +81,10 @@
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName" /> <exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName" />
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces.NonFullyQualified" /> <exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces.NonFullyQualified" />
<exclude name="SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator.DisallowedNumericLiteralSeparator" />
<exclude name="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator.RequiredNumericLiteralSeparator" /> <exclude name="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator.RequiredNumericLiteralSeparator" />
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostIncrementOperator" />
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPreDecrementOperator" /> <exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPreDecrementOperator" />
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPreIncrementOperator" /> <exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPreIncrementOperator" />
@@ -98,14 +96,11 @@
<exclude name="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat" /> <exclude name="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat" />
<exclude name="SlevomatCodingStandard.Whitespaces.DuplicateSpaces.DuplicateSpaces" /> <exclude name="SlevomatCodingStandard.Whitespaces.DuplicateSpaces.DuplicateSpaces" />
<exclude name="SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator.DisallowedNumericLiteralSeparator" />
<!-- Отключил из-за--> <!-- Отключил из-за-->
<exclude name="SlevomatCodingStandard.Classes.ClassStructure.IncorrectGroupOrder" /> <exclude name="SlevomatCodingStandard.Classes.ClassStructure.IncorrectGroupOrder" />
</rule> </rule>
<!-- Force array element indentation with 4 spaces --> <!-- Force array element indentation with 4 spaces -->
<rule ref="Generic.Arrays.ArrayIndent"/> <rule ref="Generic.Arrays.ArrayIndent"/>
<!-- Forbid `array(...)` --> <!-- Forbid `array(...)` -->
@@ -391,22 +386,10 @@
<!-- Require presence of declare(strict_types=1) --> <!-- Require presence of declare(strict_types=1) -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties> <properties>
<property <property name="declareOnFirstLine" value="false"/>
name="declareOnFirstLine" <property name="linesCountBeforeDeclare" value="1"/>
value="false" <property name="spacesCountAroundEqualsSign" value="0"/>
/> <property name="linesCountAfterDeclare" value="1"/>
<property
name="linesCountBeforeDeclare"
value="1"
/>
<property
name="spacesCountAroundEqualsSign"
value="0"
/>
<property
name="linesCountAfterDeclare"
value="1"
/>
</properties> </properties>
</rule> </rule>
@@ -546,16 +529,8 @@
<exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/> <exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/>
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamType"/> <exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamType"/>
<exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamName"/> <exclude name="Squiz.Commenting.FunctionComment.SpacingAfterParamName"/>
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
<exclude name="PEAR.WhiteSpace.ScopeClosingBrace.Line"/>
<exclude name="Squiz.Commenting.FunctionComment.WrongStyle"/> <exclude name="Squiz.Commenting.FunctionComment.WrongStyle"/>
</rule> <exclude name="Squiz.Commenting.FunctionComment.MissingParamName"/>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamName">
<!-- Отключаем только эту конкретную ошибку, оставляя остальные проверки комментариев -->
<severity>0</severity>
</rule> </rule>
<!-- Forbid global functions --> <!-- Forbid global functions -->
@@ -628,5 +603,4 @@
<!-- turned off by PSR-12 -> turning back on --> <!-- turned off by PSR-12 -> turning back on -->
<severity>5</severity> <severity>5</severity>
</rule> </rule>
</ruleset> </ruleset>