Update ruleset.xml

This commit is contained in:
2025-09-25 23:32:04 +03:00
parent 44293eb056
commit 746670eb20

View File

@@ -187,34 +187,13 @@
<type>error</type> <type>error</type>
</rule> </rule>
<!-- Disallow multiple attributes inside one #[] -->
<rule ref="SlevomatCodingStandard.Attributes.DisallowAttributesJoining"/>
<!-- Require only one attribute per line -->
<rule ref="SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine"/>
<!-- Attributes should be adjoined to the PHP element they belong to -->
<rule ref="SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing"/>
<!-- Require PHPDoc always before attributes -->
<rule ref="SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment"/>
<!-- Require that single line arrays have the correct spacing: no space around brackets and one space after comma -->
<!-- <rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/> -->
<!-- Require comma after last element in multi-line array -->
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
<!-- Require no space before : and 1 space before Enum type -->
<rule ref="SlevomatCodingStandard.Classes.BackedEnumTypeSpacing"/>
<!-- Require presence of constant visibility --> <!-- Require presence of constant visibility -->
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"> <rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility">
<properties> <properties>
<property name="fixable" value="true"/> <property name="fixable" value="true"/>
</properties> </properties>
</rule> </rule>
<!-- Enforce consistent constant spacing -->
<rule ref="SlevomatCodingStandard.Classes.ConstantSpacing"/>
<!-- Forbid LSB for constants (static::FOO) -->
<rule ref="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants"/>
<!-- Forbid more than one constant declared per statement -->
<rule ref="SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition"/>
<!-- Forbid string expression property fetch ($foo->{'bar'}) -->
<rule ref="SlevomatCodingStandard.Classes.DisallowStringExpressionPropertyFetch"/>
<!-- Forbid empty lines around type declarations --> <!-- Forbid empty lines around type declarations -->
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces"> <rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces">
<properties> <properties>
@@ -222,18 +201,14 @@
<property name="linesCountBeforeClosingBrace" value="0"/> <property name="linesCountBeforeClosingBrace" value="0"/>
</properties> </properties>
</rule> </rule>
<!-- Enforce consistent enum case spacing -->
<rule ref="SlevomatCodingStandard.Classes.EnumCaseSpacing" />
<!-- Add one line around parent call in order to improve readability -->
<rule ref="SlevomatCodingStandard.Classes.ParentCallSpacing"/>
<!-- Ensure that there are consistent blank lines between properties. --> <!-- Ensure that there are consistent blank lines between properties. -->
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing"> <rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
<properties> <properties>
<property name="minLinesCountBeforeWithComment" value="0" /> <property name="minLinesCountBeforeWithComment" value="0" />
</properties> </properties>
</rule> </rule>
<!-- Require usage of ::class instead of __CLASS__, get_class(), get_class($this), get_called_class() and get_parent_class() -->
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
<!-- https://github.com/slevomat/coding-standard#slevomatcodingstandardclassespropertydeclaration- --> <!-- https://github.com/slevomat/coding-standard#slevomatcodingstandardclassespropertydeclaration- -->
<rule ref="SlevomatCodingStandard.Classes.PropertyDeclaration"> <rule ref="SlevomatCodingStandard.Classes.PropertyDeclaration">
<properties> <properties>
@@ -241,10 +216,7 @@
<property name="enableMultipleSpacesBetweenModifiersCheck" value="true"/> <property name="enableMultipleSpacesBetweenModifiersCheck" value="true"/>
</properties> </properties>
</rule> </rule>
<!-- Require usage of constructor property promotion -->
<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion"/>
<!-- Forbid uses of multiple traits separated by comma -->
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration"/>
<!-- Require no spaces before trait use, between trait uses and one space after trait uses --> <!-- Require no spaces before trait use, between trait uses and one space after trait uses -->
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing"> <rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing">
<properties> <properties>
@@ -254,16 +226,7 @@
<property name="linesCountBetweenUses" value="0"/> <property name="linesCountBetweenUses" value="0"/>
</properties> </properties>
</rule> </rule>
<!-- Forbid prefix and suffix "Abstract" for abstract classes -->
<!-- <rule ref="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming"/> -->
<!-- Forbid prefix and suffix "Exception" for exception classes -->
<!-- <rule ref="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming"/> -->
<!-- Forbid prefix and suffix "Interface" for interfaces -->
<!-- <rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/> -->
<!-- Forbid suffix "Trait" for traits -->
<!-- <rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/> -->
<!-- Forbid invalid annotation names in standard PHPDoc tags -->
<rule ref="SlevomatCodingStandard.Commenting.AnnotationName"/>
<!-- Require specific order of phpDoc annotations with empty newline between specific groups --> <!-- Require specific order of phpDoc annotations with empty newline between specific groups -->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing"> <rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties> <properties>
@@ -317,8 +280,6 @@
</property> </property>
</properties> </properties>
</rule> </rule>
<!-- Forbid empty comments -->
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/>
<!-- Forbid useless comments --> <!-- Forbid useless comments -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments"> <rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
<properties> <properties>
@@ -331,10 +292,7 @@
</property> </property>
</properties> </properties>
</rule> </rule>
<!-- Report invalid format of inline phpDocs with @var -->
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration"/>
<!-- Forbid assignments in conditions -->
<!-- <rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/> -->
<!-- Require consistent spacing for block structures --> <!-- Require consistent spacing for block structures -->
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing"> <rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing">
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeControlStructure" /> <exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeControlStructure" />
@@ -352,10 +310,7 @@
</property> </property>
</properties> </properties>
</rule> </rule>
<!-- Forbid fancy yoda conditions -->
<!-- <rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/> -->
<!-- Require usage of early exit -->
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit"/>
<!-- Require consistent spacing for jump statements --> <!-- Require consistent spacing for jump statements -->
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing"> <rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing">
<properties> <properties>
@@ -370,24 +325,7 @@
</property> </property>
</properties> </properties>
</rule> </rule>
<!-- Require language constructs without parentheses -->
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/>
<!-- Require usage of null coalesce operator equal operator when possible -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/>
<!-- Require usage of null coalesce operator when possible -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
<!-- Require usage of null safe operator when possible -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator"/>
<!-- Forbid usage of conditions when a simple return can be used -->
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn"/>
<!-- Forbid usage of boolean-only ternary operator usage (e.g. $foo ? true : false) -->
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator"/>
<!-- Forbid useless unreachable catch blocks -->
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/>
<!-- Require using Throwable instead of Exception -->
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"/>
<!-- Require non-capturing catch when the variable with exception is not used. -->
<rule ref="SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch" />
<!-- Ensure Arrow Functions declaration format --> <!-- Ensure Arrow Functions declaration format -->
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration"> <rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration">
<properties> <properties>
@@ -414,24 +352,7 @@
<property name="onlySingleLine" value="true" /> <property name="onlySingleLine" value="true" />
</properties> </properties>
</rule> </rule>
<!-- Require trailing commas in multiline function calls -->
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
<!-- Require trailing commas in multiline closure use -->
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse"/>
<!-- Require trailing commas in multiline function declarations -->
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
<!-- Require closures not referencing $this be static -->
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
<!-- Forbid unused variables passed to closures via `use` -->
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
<!-- Require use statements to be alphabetically sorted -->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<!-- Forbid fancy group uses -->
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
<!-- Forbid multiple use statements on same line -->
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
<!-- Require newlines around namespace declaration -->
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing"/>
<!-- Forbid using absolute class name references (except global ones) --> <!-- Forbid using absolute class name references (except global ones) -->
<!-- <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"> <!-- <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties> <properties>
@@ -452,10 +373,7 @@
<property name="searchAnnotations" value="true"/> <property name="searchAnnotations" value="true"/>
</properties> </properties>
</rule> </rule>
<!-- Forbid superfluous leading backslash in use statements -->
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
<!-- Forbid useless uses of the same namespace -->
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
<!-- Require empty newlines before and after uses --> <!-- Require empty newlines before and after uses -->
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"> <rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties> <properties>
@@ -464,24 +382,7 @@
<property name="linesCountBetweenUseTypes" value="1"/> <property name="linesCountBetweenUseTypes" value="1"/>
</properties> </properties>
</rule> </rule>
<!-- Forbid useless alias for classes, constants and functions -->
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
<!-- Forbid weak comparisons -->
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
<!-- Forbid spacing before the negative operator `-` -->
<rule ref="SlevomatCodingStandard.Operators.NegationOperatorSpacing"/>
<!-- Require the usage of assignment operators, eg `+=`, `.=` when possible -->
<rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/>
<!-- Require no spacing after spread operator -->
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing"/>
<!-- Forbid argument unpacking for functions specialized by PHP VM -->
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking"/>
<!-- Forbid `list(...)` syntax -->
<rule ref="SlevomatCodingStandard.PHP.ShortList"/>
<!-- Forbid use of longhand cast operators -->
<rule ref="SlevomatCodingStandard.PHP.TypeCast"/>
<!-- Check for missing typehints in case they can be declared natively. Report useless @var annotation (or whole documentation comment) because the type of constant is always clear. -->
<rule ref="SlevomatCodingStandard.TypeHints.ClassConstantTypeHint"/>
<!-- 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>
@@ -503,10 +404,7 @@
/> />
</properties> </properties>
</rule> </rule>
<!-- Forbid useless parentheses -->
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses"/>
<!-- Forbid useless semicolon `;` -->
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
<!-- Require /* @var type $foo */ and similar simple inline annotations to be replaced by assert() --> <!-- Require /* @var type $foo */ and similar simple inline annotations to be replaced by assert() -->
<rule ref="SlevomatCodingStandard.PHP.RequireExplicitAssertion"> <rule ref="SlevomatCodingStandard.PHP.RequireExplicitAssertion">
<properties> <properties>
@@ -514,14 +412,7 @@
<property name="enableIntegerRanges" value="true"/> <property name="enableIntegerRanges" value="true"/>
</properties> </properties>
</rule> </rule>
<!-- Require use of short versions of scalar types (i.e. int instead of integer) -->
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
<!-- Require the `null` type hint to be in the last position of annotations -->
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/>
<!-- Require ? when default value is null -->
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<!-- Require one space between typehint and variable, require no space between nullability sign and typehint -->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
<!-- Require space around colon in return types --> <!-- Require space around colon in return types -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"> <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing">
<properties> <properties>
@@ -569,10 +460,6 @@
<property name="nullPosition" value="last" /> <property name="nullPosition" value="last" />
</properties> </properties>
</rule> </rule>
<!-- Forbid useless @var for constants -->
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"/>
<!-- Require One Line Doc Comment where there's only 1 annotation present -->
<!-- <rule ref="SlevomatCodingStandard.Commenting.RequireOneLineDocComment"/> -->
<!-- Forbid useless phpDocs for functions --> <!-- Forbid useless phpDocs for functions -->
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment"> <rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment">
@@ -585,14 +472,7 @@
</property> </property>
</properties> </properties>
</rule> </rule>
<!-- Forbid useless inherit doc comment -->
<rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
<!-- Forbid duplicated variables assignments -->
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
<!-- Forbid useless variables -->
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<!-- Require nowdoc syntax instead of heredoc when possible -->
<rule ref="SlevomatCodingStandard.PHP.RequireNowdoc" />
<!-- Forbid spaces around square brackets --> <!-- Forbid spaces around square brackets -->
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/> <rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
<!-- Force array declaration structure --> <!-- Force array declaration structure -->