Skip to content

Extend the CI matrix to PHP 8.1 to 8.5 - #33

Merged
Art4 merged 2 commits into
masterfrom
refactor/30-ci-matrix-php-8-1-to-8-5
Nov 21, 2026
Merged

Art4 merged 2 commits into
masterfrom
refactor/30-ci-matrix-php-8-1-to-8-5

Conversation

@Art4

@Art4 Art4 commented Nov 21, 2026

Copy link
Copy Markdown
Member

The CI workflow now tests the library on PHP 8.1 to 8.5 as well, so every PHP version that composer.json allows is checked.

Closes #30

What changed: php-versions in .github/workflows/php.yml grows from 7.4, 8.0 to 7.4 and 8.0 to 8.5. Nothing else changed.

Checks run locally in the Docker dev container: all 182 tests pass on PHP 7.4, 8.1, 8.2, 8.3, 8.4 and 8.5 (make clean install phpunit PHP_VERSION=<version>). PHP 8.1 and later print trim(): Passing null deprecations from src/Definition/Color.php and src/Definition/Email.php; these do not fail the tests.

Expected red jobs: the "Run PHPStan" step of the workflow runs before the tests and reports an error on PHP 8.4 and 8.5: Manager.php line 50, "Deprecated in PHP 8.4: Parameter #1 $visitorCollection (VisitorCollectionInterface) is implicitly nullable via default value null". It fails the job, so the test step does not run on those two versions in CI. PHPStan is clean on PHP 8.3. The cause is the implicit nullable type in Manager::__construct, which the ticket lists as out of scope, so it is not fixed here and needs a ticket of its own. Likewise the trim() deprecations and the PHPUnit upgrade are left for their own tickets.

The test job now also runs on PHP 8.1, 8.2, 8.3, 8.4 and 8.5, matching the versions composer.json allows.
@Art4

Art4 commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Review: not ready, and the cause is not in this change.

The matrix change itself is correct: PHP 7.4 to 8.3 pass. PHP 8.4 and 8.5 fail in the `Run PHPStan` step, before the tests start, because `Manager::__construct(VisitorCollectionInterface $visitorCollection = null)` uses an implicit nullable type, which PHP 8.4 deprecates. Ticket #30 keeps that code out of scope, so a rework of this pull request cannot fix it.

Question for the maintainer: should the deprecation be fixed in a separate pull request that this one is stacked on? The signature would become `?VisitorCollectionInterface $visitorCollection = null`, which keeps the calls working on every supported PHP version. This pull request would then be rebased onto it, and its checks should turn green.

Until that is decided this pull request stays a draft.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.782%. remained the same — refactor/30-ci-matrix-php-8-1-to-8-5 into master

5 similar comments
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.782%. remained the same — refactor/30-ci-matrix-php-8-1-to-8-5 into master

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.782%. remained the same — refactor/30-ci-matrix-php-8-1-to-8-5 into master

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.782%. remained the same — refactor/30-ci-matrix-php-8-1-to-8-5 into master

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.782%. remained the same — refactor/30-ci-matrix-php-8-1-to-8-5 into master

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 97.782%. remained the same — refactor/30-ci-matrix-php-8-1-to-8-5 into master

@coveralls

coveralls commented Nov 21, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 97.782%. remained the same — refactor/30-ci-matrix-php-8-1-to-8-5 into master

@Art4
Art4 marked this pull request as ready for review November 21, 2026 17:41
@Art4

Art4 commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Review: mergeable. The change is one line in .github/workflows/php.yml (PHP 7.4 and 8.0 to 8.5). After master was merged into the branch, so that it contains the fix of #35, all seven test jobs pass. One risk remains that this change does not cause: the Coveralls upload can fail with 422 Can't add a job to a build that is already closed for whichever matrix job finishes last, and a re-run of that job cannot succeed. Leaving the merge to the maintainer.

This was referenced Nov 21, 2026
@Art4
Art4 merged commit 280bb5c into master Nov 21, 2026
7 checks passed
@Art4
Art4 deleted the refactor/30-ci-matrix-php-8-1-to-8-5 branch November 21, 2026 17:50
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.

Extend the CI matrix to PHP 8.1 to 8.5

2 participants