Skip to content

Commit 2a1aba8

Browse files
committed
PHPCS ruleset: update ruleset for upstream changes
* Fix the name and description to prevent confusion between the project ruleset and the organisation ruleset. * Set the minimum PHP version for the PHPCompatibility standard. * Don't require property type declarations. * Ensure special characters used as literals in an exclude pattern are escaped.
1 parent dc7d72e commit 2a1aba8

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

phpcs.xml.dist

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
<?xml version="1.0"?>
2-
<ruleset name="phpDocumentor">
3-
<description>The coding standard for phpDocumentor.</description>
2+
<ruleset name="ReflectionDocBlock">
3+
<description>The coding standard for this library.</description>
44

55
<file>src</file>
66
<file>tests/unit</file>
7-
<exclude-pattern>*/tests/unit/Types/ContextFactoryTest.php</exclude-pattern>
7+
<exclude-pattern>*/tests/unit/Types/ContextFactoryTest\.php</exclude-pattern>
88
<exclude-pattern>*/tests/unit/Assets/*</exclude-pattern>
99
<arg value="p"/>
1010

11+
<!-- Set the minimum PHP version for PHPCompatibility.
12+
This should be kept in sync with the requirements in the composer.json file. -->
13+
<config name="testVersion" value="7.2-"/>
14+
1115
<rule ref="phpDocumentor">
1216
<exclude name="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly.ReferencedGeneralException" />
17+
18+
<!-- Property type declarations are a PHP 7.4 feature. -->
19+
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint"/>
1320
</rule>
1421

1522
<rule ref="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming.SuperfluousPrefix">
16-
<exclude-pattern>*/src/*/Abstract*.php</exclude-pattern>
23+
<exclude-pattern>*/src/*/Abstract*\.php</exclude-pattern>
1724
</rule>
1825

1926
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod">
20-
<exclude-pattern>*/src/DocBlock/Tags/InvalidTag.php</exclude-pattern>
27+
<exclude-pattern>*/src/DocBlock/Tags/InvalidTag\.php</exclude-pattern>
2128
</rule>
2229
</ruleset>

0 commit comments

Comments
 (0)