Initial (minimal) implementation of PHPCSUtils by jrfnl · Pull Request #979 · PHPCompatibility/PHPCompatibility

and others added 30 commits

March 26, 2020 19:46
For now, until PHPCSUtils 1.0.0 is tagged, we'll allow installation of alpha/beta/RC tags from PHPCSUtils.

This also changes the minimum PHPCS 3 requirement from `3.0.2` to `3.1.0`.

Includes:
* Removing DealerDirect Composer plugin suggestion.
    This dependency will now automatically be installed via PHPCSUtils.
* Removing the `post-install/update-cmd` scripts.
    The DealerDirect Composer plugin will now automatically take care of that.
* Try and find & load the PHPCSUtils `autoload.php` file.

Note: not removing the PHPUnit class alias setting for the `TestCase` class yet. While PHPCSUtils provided this as well, we also need it for test files which are independent of PHPCSUtils, so we should not rely on PHPCSUtils for this indiscriminately.
As everything here is now contained within PHPCSUtils, including updated and/or improved versions of some of these.
These will be removed in a later commit. Doing this staged will allow for easier testing during the transition.
All of the methods contained herein are now provided via PHPCSUtils and all code has been switched over to use the PHPCSUtils versions of the methods instead.

@jrfnl

@jrfnl

…version

This change is slightly more involved than the others, so committing separately to allow for easier review.

@jrfnl

@jrfnl

@jrfnl

@jrfnl

@jrfnl

@jrfnl

@jrfnl

@jrfnl

@jrfnl

@jrfnl

@jrfnl

…stCase base class

This should give significantly faster results.

For a test run on my local machine, these are the results:
* Command: `phpunit --group utilityFunctions`
* Run with the previous commit checked-out: 2.57 min
* Run with this commit checked-out: 7.07 _seconds_.

A requirement for the `UtilityMethodTestCase::getTargetToken()` helper method is that the test markers in test case files for utility methods start with `/* test` - to allow to distinguish between test marker comments and comments which are part of the actual test case -.

To this end, the test markers in the remaining utility method test case files have been renamed.

wimg

wimg previously approved these changes Mar 26, 2020

wimg

wimg

wimg approved these changes Mar 26, 2020

@wimg wimg deleted the feature/use-phpcsutils branch

March 26, 2020 22:34