YoastCS: add dependency on PHPCSUtils and start using it #322
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.
Composer: add dependency on PHPCSUtils
By starting to use PHPCSUtils, we make YoastCS less dependent on WordPressCS.
PHPCSUtils brings added benefits of more stable, thoroughly tested utility methods, which all support modern PHP.
Along those lines, the utility functions in PHPCSUtils which mirror PHPCS native utility functions are generally compatible with new PHP syntaxes well before there is a PHPCS release available with such support for these utility functions.
This commit adds the dependency and updates relevant documentation and CI.
Includes removing the explicit dependency on the Composer PHPCS Installer plugin. This dependency will now be inherited from PHPCSUtils.
Letting PHPCSUtils manage the supported versions prevents conflicts.
Closes #157
YoastCS: add PHPCSUtils requirement
PHPCSUtils does not contain any sniffs, so adding this rule isn't strictly necessary, but by having the rule in the ruleset anyway, if PHPCSUtils is missing, the user will get a descriptive error message during the loading of the ruleset instead of a fatal "class not found" error once the sniffs start running.
Sniffs: switch over to using utilities from PHPCSUtils [1]
Initial switch over replacing function calls to PHPCS native utility functions with calls to the improved versions of the same in PHPCSUtils.
Sniffs: switch over to using utilities from PHPCSUtils [2]
Switch over replacing function calls to WPCS utility functions with calls to the improved versions of the same in PHPCSUtils.
These WPCS native utility functions no longer exist in WPCS 3.0.0 as WPCS is now also using PHPCSUtils.