Skip to content

Drop PHP 7.4 support, require PHP 8.2+, upgrade PHPUnit to v11#3

Open
datengraben wants to merge 1 commit into
masterfrom
claude/drop-php74-require-82
Open

Drop PHP 7.4 support, require PHP 8.2+, upgrade PHPUnit to v11#3
datengraben wants to merge 1 commit into
masterfrom
claude/drop-php74-require-82

Conversation

@datengraben

Copy link
Copy Markdown
Owner

Summary

PHP 7.4 has been end-of-life since November 2022 (3+ years without security patches). 82%+ of WordPress sites already run PHP 8.x. This PR bumps the minimum to PHP 8.2 — the lowest currently-maintained PHP version — and upgrades the test toolchain accordingly.

Changes

composer.json

  • PHP constraint: >=7.3>=8.2
  • PHPUnit: ^8.5^11.0 (PHPUnit 8 is EOL; v11 requires PHP 8.2+)
  • Remove phpunit/php-code-coverage (now bundled inside PHPUnit 11)

phpunit.xml.dist

  • Schema updated to PHPUnit 11
  • <coverage><include> migrated to top-level <source> element (PHPUnit 10+ format)
  • Removed deprecated attributes: convertErrorsToExceptions, convertNoticesToExceptions, convertWarningsToExceptions
  • Replaced removed logging types (testdoxXml, testdoxHtml, text) with junit

.github/workflows/phpunit.yml

  • Matrix: [7.4, 8.2][8.2, 8.3]
  • Removed PHP 7.4 special-case install step (--ignore-platform-reqs no longer needed)
  • Use vendor/bin/phpunit instead of a downloaded phar
  • Runner bumped from ubuntu-20.04 to ubuntu-22.04

.github/workflows/compile.yml

  • PHP version updated from 7.4 to 8.2 in both jobs

Notes

  • No runtime code changes required — the codebase already uses PHP 7.4-style typed properties/return types with no 7.x-only patterns
  • PHPUnit 10/11 removed a few APIs (withConsecutive, getMockBuilder()->setMethods(), etc.) — if test runs surface failures, those test files will need small updates
  • yoast/phpunit-polyfills ^2.0 remains and handles cross-version polyfilling

Test plan

  • Run composer install and confirm PHPUnit 11 resolves cleanly
  • Run vendor/bin/phpunit locally against PHP 8.2 and confirm test suite passes
  • Confirm CI matrix runs on PHP 8.2 and 8.3 without the old PHP 7.4 job

https://claude.ai/code/session_01JA2idCjLjHr7dNGMs6CYiv

- composer.json: bump php constraint from >=7.3 to >=8.2
- composer.json: upgrade phpunit/phpunit from ^8.5 to ^11.0
- composer.json: remove phpunit/php-code-coverage (bundled in PHPUnit 11)
- phpunit.xml.dist: update schema to PHPUnit 11, migrate <coverage><include>
  to <source>, replace removed logging types with junit, drop deprecated
  convertErrorsToExceptions / convertNoticesToExceptions attributes
- phpunit.yml: replace 7.4/8.2 matrix with 8.2/8.3, drop PHP 7.4 special-case
  install step, use vendor/bin/phpunit instead of downloaded phar,
  bump runner to ubuntu-22.04
- compile.yml: update PHP version from 7.4 to 8.2

https://claude.ai/code/session_01JA2idCjLjHr7dNGMs6CYiv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants