Skip to content

Add PHP 8.0-8.5 support#36

Merged
rick-lam merged 1 commit into
masterfrom
feat/php-8-support
May 28, 2026
Merged

Add PHP 8.0-8.5 support#36
rick-lam merged 1 commit into
masterfrom
feat/php-8-support

Conversation

@rick-lam
Copy link
Copy Markdown
Contributor

@rick-lam rick-lam commented May 28, 2026

Summary

Widens runtime PHP support from ^7.4 to ^7.4 || ^8.0 (PHP 7.4 retained — primary consumers run on 7.4) and modernises the dev-dep stack so the suite actually runs on PHP 8.x.

Changes

Area Change
composer.json php ^7.4^7.4 || ^8.0
composer.json require-dev phpunit ^8.5.52^9.6; mockery ^1.3.1^1.6; graze/console-diff-renderer ^0.6.1^1.0 (v1.1.0 adds PHP 8 support and stops capping symfony/console); symfony/console ^4 | ^5^5; +dms/phpunit-arraysubset-asserts ^0.5 (polyfill)
composer.lock Regenerated against the new constraints
CI matrix ['7.4']['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] (highest), plus --prefer-lowest only on 7.4 — dep floors live at 7.4, so a lowest run on PHP 8 would install deps that don't actually run on 8.x
phpcs.xml.dist (new) Wraps graze/standards and excludes Squiz.Commenting.FunctionComment.TypeHintMissing — that message demands a native mixed type hint on PHP 8+, but mixed is invalid PHP 7.4 syntax. All other FunctionComment checks stay active
CI lint phpcs --standard=./phpcs.xml.dist runs on every PHP version (highest jobs); skipped only on the --prefer-lowest PHP 7.4 job
Actions actions/checkout@v5@v6 (cache@v6 doesn't exist yet; kept @v5)
PHPUnit 9 test migration assertRegExpassertMatchesRegularExpression (×8); @expectedException annotations → $this->expectException(...) (×7); PoolLoggerTest uses ArraySubsetAsserts trait for the removed assertArraySubset
.gitignore .phpunit.result.cache (PHPUnit 9 leaves this behind)

Verification

CI matrix — all green: PHP 7.4 (highest + lowest) + PHP 8.0, 8.1, 8.2, 8.3, 8.4, 8.5. 131 tests / 696 assertions OK on every version; phpcs clean on every PHP version; no Composer security advisories.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 28, 2026 10:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Widen PHP runtime compatibility and CI coverage to begin validating this library on PHP 8.x while retaining PHP 7.4 support.

Changes:

  • Broaden composer.json PHP requirement from ^7.4 to ^7.4 || ^8.0.
  • Expand the GitHub Actions CI matrix to run on PHP 7.4 and PHP 8.0–8.5 (with and without --prefer-lowest).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
composer.json Advertises support for PHP 8.x in the Composer runtime requirement.
.github/workflows/ci.yml Expands CI to exercise the test suite across PHP 7.4 and PHP 8.0–8.5.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
@rick-lam rick-lam force-pushed the feat/php-8-support branch 5 times, most recently from 84aa079 to 6ed54b0 Compare May 28, 2026 11:36
@rick-lam rick-lam requested a review from Copilot May 28, 2026 11:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.

Comment thread tests/unit/Monitor/PoolLoggerTest.php Outdated
… actions

- composer.json php: ^7.4 -> ^7.4 || ^8.0
- composer.json require-dev:
  - phpunit ^8.5.52 -> ^9.6
  - mockery ^1.3.1 -> ^1.6 (PHPUnit 9 + PHP 8 compatible)
  - graze/console-diff-renderer ^0.6.1 -> ^1.0 (just-tagged v1.1.0 supports PHP 8.0-8.5
    and allows symfony/console ^5)
  - symfony/console ^4 | ^5 -> ^5 (4.x cap was only there because the old
    console-diff-renderer required it)
  - add dms/phpunit-arraysubset-asserts ^0.5 (polyfill for the assertion PHPUnit 9 removed)
- CI matrix: ['7.4'] -> ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
- actions/checkout: @v5 -> @v6 (cache@v6 doesn't exist; kept @v5)
- PHPUnit 9 test migration:
  - assertRegExp -> assertMatchesRegularExpression (8 sites)
  - @ExpectedException annotations -> $this->expectException(...) (7 sites)
  - PoolLoggerTest uses ArraySubsetAsserts trait for assertArraySubset

PHP 7.4 validated locally: 131 tests, 696 assertions, OK; phpcs clean;
no Composer advisories. CI matrix will validate the actual PHP 8.x reach.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rick-lam rick-lam force-pushed the feat/php-8-support branch from 6ed54b0 to 630841e Compare May 28, 2026 11:47
@rick-lam rick-lam merged commit 5f9ef4e into master May 28, 2026
8 checks passed
@rick-lam rick-lam deleted the feat/php-8-support branch May 28, 2026 18:01
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