feat!: require PHP >= 8.4 (4.0.0) - #67
Merged
Merged
Conversation
Drops PHP 7.4-8.2 from the matrix, collapses now-redundant version-conditional steps, and addresses Dependabot alert GHSA-5wxr-w449-57cm by pinning setup-php to a patched release.
GitHub Action tag for shivammathur/setup-php is published without a leading 'v'. CI was failing with 'Unable to resolve action ... unable to find version v2.37.1' on every job.
…low-fail canary The HelpersEscapeUnitTest fixture-1/-2/-3 expected error lists were stale (the sniff treats FQCN and shorthand Helpers\Helpers::* differently than the prior test snapshots assumed). Tests had been failing on every CI run since 3.1.0. Also restore the dev-master+dev-develop combination as an explicit allow-fail canary on each PHP version. Promoting it to baseline in 4.0.0 was wrong — upstream development branches are expected to break occasionally regardless of PHP version, and the previous workflow had them gated via include+allow_failure for exactly this reason.
Result: only HelpersEscapeSniff.php has meaningful candidates (9 strpos -> str_contains substitutions). The other two sniffs are already PHP 8-idiomatic per the plan's "smallest idiom" guideline; rewriting them would be drive-by. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace 9× \strpos(..., ...) !== false with \str_contains(...). Behaviour unchanged; modernization driven by 4.0.0 PHP 8.3 minimum. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Folds the modernization work into the 4.0.0 entry rather than a separate 4.1.0 (same PR, same release). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Branch drifted from the original 8.3 plan: actual minimum is PHP 8.4, and several toolchain changes (Rector integration, PHPStan level bump with WordPress extension, PHPUnit 9, dependency pins, composer script rename) were folded into the same release. Updates the 4.0.0 entry to match the diff against main rather than the original intent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR is a breaking-release update that raises the minimum supported PHP version to 8.4 and modernizes the project’s QA/tooling (CI, PHPUnit, PHPStan, Rector), while also updating ruleset/test fixtures to match current sniff behavior.
Changes:
- Bump minimum PHP requirement to
>=8.4, update PHPCompatibilitytestVersion, and refresh CI to a single PHP 8.4 runtime. - Modernize and pin tooling/dependencies (WPCS 3.3.0, PHPUnit 9.6, PHPStan level 6 + WP extension, Rector config + CI job).
- Fix/refresh long-failing unit test expectations and small internal modernizations (casts,
str_contains, match expression).
Reviewed changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
composer.json |
Raises PHP constraint to 8.4 and updates/pins tooling dependencies and scripts. |
Eightshift/ruleset.xml |
Updates compatibility target and ruleset exclusions; adjusts line-length limit. |
phpcs.xml.dist.sample |
Updates PHPCompatibility testVersion to match new minimum. |
.github/workflows/ci.yml |
Updates CI jobs/actions and aligns jobs with new scripts/tooling. |
phpunit.xml.dist |
Updates PHPUnit schema reference for PHPUnit 9.6. |
phpstan.neon.dist |
Raises level and adds WP extension include. |
rector.php |
Introduces Rector configuration for PHP 8.4 upgrade/tooling modernization. |
Tests/bootstrap.php |
Minor refactors for types/compatibility with updated tooling. |
Eightshift/Sniffs/Security/HelpersEscapeSniff.php |
Modernizes string checks and refactors control flow. |
Eightshift/Sniffs/Shortcodes/DisallowDoShortcodeSniff.php |
Tightens PHPStan types and adds explicit return type. |
Eightshift/Tests/Security/HelpersEscapeUnitTest.php |
Updates fixtures’ expected error lists and modernizes control flow. |
Eightshift/Tests/Shortcodes/DisallowDoShortcodeUnitTest.php |
Adds strict_types=1. |
Eightshift/Tests/Commenting/FunctionCommentUnitTest.php |
Adds strict_types=1. |
Eightshift/Docs/Security/HelpersEscapeStandard.xml |
Adds/renames documentation to match HelpersEscapeSniff. |
README.md |
Updates install version guidance and modernizes formatting/badges. |
CHANGELOG.md |
Adds 4.0.0 changelog entry documenting breaking/tooling changes. |
LICENSE |
Updates copyright year. |
SECURITY.md |
Removes repository security policy doc (handled via GitHub settings). |
.gitignore |
Ignores PHPUnit cache file and trims ignored entries. |
.phpunit.result.cache |
Removes committed PHPUnit cache artifact. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
goranalkovic-infinum
previously approved these changes
May 25, 2026
iobrado
previously approved these changes
May 25, 2026
dingo-d
reviewed
May 25, 2026
dingo-d
left a comment
Contributor
There was a problem hiding this comment.
Small comments I noticed
iruzevic
dismissed stale reviews from iobrado and goranalkovic-infinum
via
May 25, 2026 13:19
5a2d2d8
iobrado
approved these changes
May 25, 2026
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.
Summary
Breaking change: raises the minimum supported PHP version from 7.4 to 8.4, ships as 4.0.0. Also folds in toolchain modernization (Rector, PHPStan-WP, PHPUnit 9, dependency pins) and a fix for the long-broken
HelpersEscapeUnitTest.Core bump
>=7.4→>=8.4Eightshift/ruleset.xmlandphpcs.xml.dist.sampletestVersion→8.4-composer.json)wp-coding-standards/wpcspinned to stable3.3.0(was a dev branch)slevomat/coding-standard,phpcompatibility/phpcompatibility-wp,phpcsstandards/phpcsdevtools,phpunit/phpunit(^8.5 → ^9.6)[4.0.0]Toolchain additions
rector.phpconfig (PHP 8.4 level set + CODE_QUALITY, DEAD_CODE, TYPE_DECLARATION, EARLY_RETURN),composer test:rector/composer fix:rector, and a dedicatedrectorCI jobszepeviktor/phpstan-wordpressPHPStan extension; PHPStan analysis level raised5→6test:*/fix:*namespaces, plus an aggregatecomposer testthat runs the whole suite. Removedlint,lint:ci, and thephp-parallel-lint/*dev deps (PHPCS reports parse errors on PHP 8+, so the separate lint step was redundant)Bundled fixes
shivammathur/setup-php→2.37.1HelpersEscapeUnitTest: fixtures 1/2/3 expected error lists were stale (sniff treats FQCN vs shorthandHelpers\Helpers::*differently than the snapshots assumed). Tests had been failing every CI run since 3.1.0testsmatrixexclude:that referenced a non-existentphpcs_branch: '3.7.2'— moot now that the cross-matrix is removed, but documented for historyWordPress.PHP.POSIXFunctions(deprecated in WPCS 3.3.0, removed in WPCS 4.0.0; POSIX regex was removed in PHP 7)Eightshift/Docs/Security/ComponentsEscapeStandard.xml→HelpersEscapeStandard.xmlto match theHelpersEscapeSniffit documents (the sniff was renamed in 3.0.0 but the doc file was missed)DisallowDoShortcodeSniffandTests/bootstrap.php(theregister()return type,process_tokenvoid return, explicit(string)casts)HelpersEscapeSniffto PHP 8 idioms (str_containsin place ofstrpos(...) !== false). No behaviour change. The other two sniffs were inventoried and were already idiomaticactions/checkout@v4 → v6,ramsey/composer-install@v2 → 4.0.0phpunit.xml.distschema reference bumped to PHPUnit 9.6SECURITY.md(handled via GitHub repository settings now)Test plan
composer-validate,ruleset-validate,feature-completeness,lint,phpstan,rector,tests)composer validate --strictpassescomposer testclean locally (test:rector,test:standards,test:types,test:unit,test:unit-checkcs,test:check-complete,test:check-complete-strict)