Initial (minimal) implementation of PHPCSUtils#979
Merged
Conversation
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.
…oreMethodTestFrame
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.
…associated unit tests
…ssociated unit tests
…sociated unit tests
…version This change is slightly more involved than the others, so committing separately to allow for easier review.
…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
previously approved these changes
Mar 26, 2020
wimg
reviewed
Mar 26, 2020
wimg
approved these changes
Mar 26, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds PHPCSUtils as a dependency for PHPCompatibility.
PHPCSUtils functions as an external standard for PHPCS, but doesn't have any sniffs. Instead it offers a wide-range of utility methods for PHPCS sniff developers to use. A number of these utility methods are inspired by and/or originally created for PHPCompatibility and have been moved.
All features in PHPCSUtils are cross-version compatible with PHP 5.4 - latest release and PHPCS 2.6.0 - latest release.
For more information about PHPCSUtils:
Now, as for this PR:
For every utility method in PHPCompatibility which has been moved to and/or moved & improved in PHPCSUtils, this PR does the following:
I have verified at each of these stages that the build still passes.
Additionally, this PR switches over the remaining unit tests for utility functions in PHPCompatibility to the
PHPCSUtils\TestUtils\UtilityMethodTestCasewhich significantly reduces the run time of the tests.See the individual commits/commit messages for more detailed information.
Note: the current implementation is based on PHPCSUtils
1.0.0-alpha2. Additional removals can be expected oncealpha-3has been released.What this PR does NOT do (but what should still be done before the next release):
READMEandCONTRIBUTINGinformation.Again, this will be addressed in a separate PR.
Note: this change will not impact users installing PHPCompatibility via Composer. In that case, everything will still work as expected. The install instructions for users installing PHPCompatibility via a git clone or as a stand-alone project will change.