Skip to content

Commit 7460623

Browse files
committed
Composer/Ruleset: include the PHPCompatibility standard
The PHPCompatibility standard can detect a large range of PHP cross-version incompatibilities and flag these, to prevent code being committed to the projects which is incompatible with the minimum supported PHP version of those projects. For optimal results, the projects using this standard should set a `testVersion` to inform PHPCompatibility which PHP versions the code should be compatible with. For more information, see the README of the project. Ref: https://github.com/PHPCompatibility/PHPCompatibility/
1 parent 5c14fbd commit 7460623

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

PHPParallelLint/ruleset.xml

+14
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@
3131
</rule>
3232

3333

34+
<!--
35+
#############################################################################
36+
SNIFF FOR PHP CROSS-VERSION COMPATIBILITY
37+
https://github.com/PHPCompatibility/PHPCompatibility/
38+
39+
It is STRONGLY recommended for individual projects to set a `testVersion`
40+
config indicating which PHP versions should be supported.
41+
https://github.com/PHPCompatibility/PHPCompatibility/#using-a-custom-ruleset
42+
#############################################################################
43+
-->
44+
45+
<rule ref="PHPCompatibility"/>
46+
47+
3448
<!--
3549
#############################################################################
3650
MISCELLANEOUS ADDITIONAL RULES

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"require": {
1717
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
18+
"phpcompatibility/php-compatibility": "^9.3",
1819
"squizlabs/php_codesniffer": "^3.6.1"
1920
}
2021
}

0 commit comments

Comments
 (0)