Repository navigation
Extend the CI matrix to PHP 8.1 to 8.5 - #33
Conversation
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.
|
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. |
5 similar comments
|
Review: mergeable. The change is one line in |
The CI workflow now tests the library on PHP 8.1 to 8.5 as well, so every PHP version that
composer.jsonallows is checked.Closes #30
What changed:
php-versionsin.github/workflows/php.ymlgrows from7.4,8.0to7.4and8.0to8.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 printtrim(): Passing nulldeprecations fromsrc/Definition/Color.phpandsrc/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.phpline 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 inManager::__construct, which the ticket lists as out of scope, so it is not fixed here and needs a ticket of its own. Likewise thetrim()deprecations and the PHPUnit upgrade are left for their own tickets.