Skip to content

Commit 4b46a35

Browse files
committed
Add the PHPCompatibility PHPCS standard
The PHPCompatibility standard is a set of sniffs which can scan a code base for a lot of typical PHP cross-version incompatibilities. The standard works best when a [`testVersion` configuration variable](https://github.com/PHPCompatibility/PHPCompatibility/#sniffing-your-code-for-compatibility-with-specific-php-versions) is set for the package using the standard. As this standard is used by different repos with different requirements, this `testVersion` should be set in the repos _using_ this standard, not in the `ruleset.xml` for this standard. Now, there are several libraries available in the PHP world which offer polyfills for select PHP functionality. If any of these libraries are used, PHPCompatibility may throw false positives for polyfilled functionality. To prevent receiving these false positives, a number of PHPCompatibility rulesets are available which each take a specific polyfill into account. These rulesets are non-conflicting and can be used in combination. As some of the packages using this standard use these kind of polyfills, I'm adding the `PHPCompatibilityAll` package to ensure that all PHPCompatibility rulesets are available. Repos using this package can then pick and choose to add any of the polyfill exclusion rulesets at will. Refs: * https://github.com/PHPCompatibility/PHPCompatibility/ * https://github.com/PHPCompatibility/PHPCompatibilityAll
1 parent f8c5889 commit 4b46a35

File tree

3 files changed

+418
-2
lines changed

3 files changed

+418
-2
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
}
2222
},
2323
"require": {
24-
"doctrine/coding-standard": "^9.0"
24+
"doctrine/coding-standard": "^9.0",
25+
"phpcompatibility/phpcompatibility-all": "^1.1"
2526
},
2627
"config": {
2728
"sort-packages": true

0 commit comments

Comments
 (0)