Skip to content

Commit cda4ad8

Browse files
committed
More rules inspired by phpstan-src
1 parent d11083d commit cda4ad8

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

phpcs.xml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<exclude name="Squiz.Commenting.FunctionComment"/>
1717
<exclude name="Squiz.PHP.Heredoc.NotAllowed"/>
1818
<exclude name="Squiz.WhiteSpace.FunctionSpacing.Before"/>
19+
<exclude name="SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable"/>
1920
</rule>
2021
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
2122
<properties>
@@ -51,6 +52,8 @@
5152
</rule>
5253
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure.UnusedInheritedVariable"/>
5354
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly.ReferencedGeneralException"/>
55+
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
56+
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/>
5457
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable"/>
5558
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
5659
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit">
@@ -67,6 +70,17 @@
6770

6871
</properties>
6972
</rule>
73+
<rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing">
74+
<properties>
75+
<property name="linesCountBetweenMembers" value="1"/>
76+
</properties>
77+
</rule>
78+
<rule ref="SlevomatCodingStandard.Classes.MethodSpacing">
79+
<properties>
80+
<property name="minLinesCount" value="1"/>
81+
<property name="maxLinesCount" value="1"/>
82+
</properties>
83+
</rule>
7084
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
7185
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
7286
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
@@ -76,8 +90,12 @@
7690
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing"/>
7791
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/>
7892
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
79-
<!-- Disallow trailing comma in function calls, since this breaks on PHP < 7.3 -->
80-
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall"/>
93+
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall">
94+
<properties>
95+
<property name="onlySingleLine" value="true"/>
96+
</properties>
97+
</rule>
98+
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
8199
<!-- Disallow trailing comma in closure use and function declarations, since this breaks on PHP < 8.0 -->
82100
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse" />
83101
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration" />
@@ -119,11 +137,7 @@
119137
<property name="enable" value="true"/>
120138
</properties>
121139
</rule>
122-
<rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction">
123-
<properties>
124-
<property name="enable" value="true"/>
125-
</properties>
126-
</rule>
140+
<rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction"/>
127141
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration"/>
128142
<exclude-pattern>tests/*/data</exclude-pattern>
129143
<exclude-pattern>tests/*/data-attributes</exclude-pattern>

0 commit comments

Comments
 (0)