Repository navigation
Closed
Copy link
Labels
breaking changeIntroduces or coordinates a breaking changeIntroduces or coordinates a breaking changetech debtTechnical debt reductionTechnical debt reduction
Milestone
Description
Summary
Raise the minimum supported PHP version from 8.0 to 8.1 and run CI on the PHP branches people actually use.
Why
PHP 8.0 no longer receives security fixes from the PHP project, and CI tests only 8.0, 8.1 and 8.2, so 8.3 is never exercised. 8.1 is a step up from 8.0 (enums, readonly properties, and the newer Symfony 6.4 line). PHP 8.1 is also end-of-life, so the minimum is expected to move again.
Proposed change
composer.json:"php": "^8.1".- Declare the return types PHP 8.1 expects on
ResponseHeaders(offsetGet,current,key) andDatabaseHandler(gc). On PHP 8.1 and newer each raises a deprecation when the class loads, which Quantum's error handler turns into a fatal error. The tests missed it becausephpunit.xmlhides deprecations. - CI matrix: 8.1, 8.2 and 8.3 (8.0 is dropped). Newer branches can be added later.
DatabaseHandler::gc()returns the number of deleted sessions, asSessionHandlerInterface::gc()documents. It returned0after any successful delete.- PHPStan
phpVersionand Rector's level set move to 8.1. Three Rector rules are skipped until Adopt the PHP 8.1 syntax Rector proposes and remove its skips #601:readonlyproperties and the two first-class callable rules, which would change 52 files and break four tests. - Changelog: a BREAKING entry for 3.1.0.
Sub-issues
The other things the update touches are tracked separately: moving the Symfony packages to 6.4 (#596), the OpenAPI templates and doctrine/annotations (#597), the Idiorm deprecation on PHP 8.1+ (#598) allowing psr/log 3 (#599), and adopting the PHP 8.1 syntax Rector proposes (#601).
Out of scope
- Using 8.1 features in the code, such as turning
AppTypeandLoggerTypeinto enums. - A minimum of 8.2 or higher.
Breaking changes
- PHP 8.0 can no longer install the framework. Applications on 8.0 stay on 3.0.x.
Follow-ups in other repos
quantum-php/project:composer.json, CI and requirements.quantum-php/docs: the PHP requirement.
Acceptance criteria
composer test,composer cs:check,composer phpstanandcomposer rector:checkpass on every PHP version in the matrix.
Notes
Relevant code:
composer.json,phpstan.neon.distsrc/HttpClient/ResponseHeaders.php,src/Session/Adapters/Database/DatabaseHandler.php.github/workflows/
Metadata
Metadata
Assignees
Labels
breaking changeIntroduces or coordinates a breaking changeIntroduces or coordinates a breaking changetech debtTechnical debt reductionTechnical debt reduction
Activity
[quantum-php#595] Test DatabaseHandler::gc()
[quantum-php#595] Return the number of deleted sessions from Database…
[quantum-php#595] Move Rector to the PHP 8.1 level set
[#595] Declare the return types PHP 8.1 expects on ResponseHeaders an…
[#595] Require PHP 8.1
[#595] Test PHP 8.1, 8.2 and 8.3 in CI
[quantum-php#595] Correct the Logger override guidance in the 3.1.0 c…
[#595] Add the PHP 8.1 update to the 3.1.0 changelog