Add the PHPCompatibility PHPCS standard #32
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 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 theruleset.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: