Drop support for PHP < 7.2 #2614
Merged
Merged
Conversation
Member
Author
|
Mind: branch protection will need to be updated to be able to merge this PR. I also think this should be in a minor, not a patch version, so I've milestoned this PR for WPCS 3.3.0 and we may need to re-milestone whatever is in the |
This commit is a plain version drop. This commit does **not** include: * Removing any work-arounds which _may_ exist in the codebase, to support PHP < 7.2. * Modernizing the codebase. These things can be addressed at will in follow up PRs. Fixes 2606
As support for PHPUnit < 8.0 will now be dropped, we no longer need to use the `@before`/`@after`[Class] annotations for fixture methods and can revert back to using the standard PHPUnit `setUp|tearDown[BeforeClass]()` fixture methods (with a `void` return type).
4813ef8 to
8bcff6b
Compare
There was a special build included which is supposed disable Mbstring and record code coverage, but the `extensions` key was missing from the `setup-php` action runner, so Mbstring was never disabled.... Another thing to know about this build is that Mbstring is a required extension for PHPUnit, but it is only really needed when PHPUnit is run with the `--testdox` CLI flag. In later PHPUnit versions, this requirement is enforced across the board (Composer + PHAR), but that's not yet the case for the PHPUnit 8 PHAR file. However, as we run the tests via a Composer install, that install will still fail on the PHPUnit `mbstring` requirement. All in all, this build adds nothing and can be removed.
8bcff6b to
781bb22
Compare
GaryJones
approved these changes
Sep 16, 2025
dingo-d
approved these changes
Sep 16, 2025
Member
Author
|
Seeing as there are two approvals, I'll update the branch protection and will merge the PR after. I will also re-milestone everything in the "3.2 next" milestone to the 3.3.0 one. |
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.
Description
Drop support for PHP < 7.2
This commit is a plain version drop.
This commit does not include:
These things can be addressed at will in follow up PRs.
Fixes #2606
Tests: use standardized fixture methods
As support for PHPUnit < 8.0 will now be dropped, we no longer need to use the
@before/@after[Class] annotations for fixture methods and can revert back to using the standard PHPUnitsetUp|tearDown[BeforeClass]()fixture methods (with avoidreturn type).GH Actions: remove build with special set of extensions
There was a special build included which is supposed disable Mbstring and record code coverage, but the
extensionskey was missing from thesetup-phpaction runner, so Mbstring was never disabled....Another thing to know about this build is that Mbstring is a required extension for PHPUnit, but it is only really needed when PHPUnit is run with the
--testdoxCLI flag.In later PHPUnit versions, this requirement is enforced across the board (Composer + PHAR), but that's not yet the case for the PHPUnit 8 PHAR file. However, as we run the tests via a Composer install, that install will still fail on the PHPUnit
mbstringrequirement.All in all, this build adds nothing and can be removed.
Suggested changelog entry
The minimum supported PHP version is now PHP 7.2 (was PHP 5.4).