Skip to content

Commit 7b49ddc

Browse files
committed
Specify minimum supported PHP version for CS config
This ensures consistent reporting regardless of the PHP version used to execute phpcs. It also allows removing excludes for sniffs that apply to newer syntax.
1 parent cb42ac4 commit 7b49ddc

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

phpcs.xml.dist

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,13 @@
1414
<file>tests</file>
1515
<file>tools</file>
1616

17+
<!-- Target minimum supported PHP version -->
18+
<config name="php_version" value="70200"/>
19+
1720
<!-- ****************************************** -->
1821
<!-- Import rules from doctrine/coding-standard -->
1922
<!-- ****************************************** -->
2023
<rule ref="Doctrine">
21-
<!-- ********************************************** -->
22-
<!-- Exclude sniffs that require newer PHP versions -->
23-
<!-- ********************************************** -->
24-
25-
<!-- Requires PHP 7.3 -->
26-
<exclude name="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall.MissingTrailingComma" />
27-
28-
<!-- Requires PHP 7.4 -->
29-
<exclude name="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator" />
30-
31-
<!-- Requires PHP 8.0 -->
32-
<exclude name="SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall" />
33-
<exclude name="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion.RequiredConstructorPropertyPromotion" />
34-
<exclude name="SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch.NonCapturingCatchRequired" />
35-
<exclude name="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat.DisallowedShortNullable" />
36-
37-
3824
<!-- *********************************** -->
3925
<!-- Exclude sniffs that cause BC breaks -->
4026
<!-- *********************************** -->

0 commit comments

Comments
 (0)