Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YoastCS: add dependency on PHPCSUtils and start using it #322

Merged
merged 4 commits into from
Nov 3, 2023

Commits on Nov 3, 2023

  1. 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
    jrfnl committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    9d9ee4f View commit details
    Browse the repository at this point in the history
  2. 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.
    jrfnl committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    b680180 View commit details
    Browse the repository at this point in the history
  3. 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.
    jrfnl committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    f6fbe7b View commit details
    Browse the repository at this point in the history
  4. 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.
    jrfnl committed Nov 3, 2023
    Configuration menu
    Copy the full SHA
    d1d6dc6 View commit details
    Browse the repository at this point in the history