Allow PHP >= 8.1#25
Merged
Merged
Conversation
Lowers the minimum PHP requirement from 8.4 back to 8.1 while keeping cuyz/valinor ^2.0. - composer.json: php ">=8.1"; replace setono/code-quality-pack ^3.4 (which requires PHP >= 8.2 and pins phpunit 11) with its constituent tools at 8.1-spanning version ranges so the toolchain installs and runs on 8.1 through 8.4 (phpunit ^10.5 || ^11.5, phpstan ^2.1, rector ^2.0, etc.) - Revert PHP 8.2-8.4 syntax that Rector had introduced so the code parses on 8.1: class-level "readonly class" -> property-level readonly, typed class constants -> untyped, drop #[\Override] (8.3+), and re-parenthesize "new X()->method()" (8.4) call chains - rector.php: target php81 instead of php84 - CI: test matrix back to 8.1, 8.2, 8.3, 8.4 (lowest + highest deps)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #25 +/- ##
=========================================
Coverage 81.91% 81.91%
Complexity 86 86
=========================================
Files 29 29
Lines 293 293
=========================================
Hits 240 240
Misses 53 53 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lowers the minimum PHP requirement from
>=8.4back to>=8.1while keepingcuyz/valinor: ^2.0.The recent PHP 8.4 upgrade pulled in
setono/code-quality-pack ^3.4, which itself requires PHP >= 8.2 and pins phpunit 11 (8.2+) — so the dev toolchain could not install or run on 8.1. To genuinely support and test 8.1, the pack is replaced by its constituent tools at version ranges that span 8.1–8.4:^10.5 || ^11.5^2.0^2.1/^2.0^2.0Code reverted to 8.1-compatible syntax
The 8.4 upgrade let Rector modernize the code with constructs newer than 8.1. These are reverted (behavior unchanged):
final readonly class(8.2) →final classwith property-levelpublic readonly(ParserResult,File)const string(8.3) → untyped (ListBlock)#[\Override](8.3) → removed (4 renderers)new X()->method()(8.4) →(new X())->method()(3 renderers,RendererTest)rector.phpnow targetsphp81, and the CI matrix tests 8.1, 8.2, 8.3, 8.4 (lowest + highest deps).Test plan
Verified locally on real PHP 8.1.34 and 8.4.20:
php -lclean across allsrc/+tests/on 8.1 (no 8.2+ syntax remains)--prefer-lowest— resolves to valinor 2.0.0 / phpunit 10.5.0 / phpstan 2.1.0; phpunit + phpstan green (confirms the valinor 2.0.0 API floor —allowPermissiveTypes(),->messages()->errors()— is satisfied)composer validate --strict+composer normalizeclean