-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: migrate code to php 8.2 #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe PR bumps minimum PHP version from 8.1 to 8.2 across workflows and project configuration, removes the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Pull Request Test Coverage Report for Build 19637145653Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
composer.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
.github/workflows/cgl.yml(1 hunks).github/workflows/tests.yml(1 hunks)composer.json(1 hunks)rector.php(1 hunks)src/Generators/DocBlockHeader.php(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CGL
composer.json
[error] 1-1: PHP 8.2.29 is not compatible with required PHP >=8.3 by phpunit/phpunit and sebastian/diff; consider upgrading PHP or relaxing package constraints (e.g., phpunit/phpunit to a version compatible with PHP 8.2).
🔇 Additional comments (6)
rector.php (1)
24-26: LGTM! Rector configuration correctly updated for PHP 8.2.The PHP version target and level set are properly aligned with the PHP 8.2 migration objective.
.github/workflows/cgl.yml (1)
10-11: LGTM! Workflow correctly configured for PHP 8.2.The explicit PHP version parameter ensures the CGL workflow runs on PHP 8.2.
composer.json (2)
24-24: LGTM! PHP version constraint correctly updated.The constraint properly enforces PHP 8.2 as the minimum version while allowing future PHP 8.x versions.
29-29: armin/editorconfig-cli ^2.0 is compatible with PHP 8.2.The package requires PHP 8.2, 8.3 or 8.4, confirming compatibility with the new minimum PHP version.
.github/workflows/tests.yml (1)
11-11: LGTM! Test matrix correctly updated.Removing PHP 8.1 from the test matrix aligns with the updated PHP version constraints in composer.json.
src/Generators/DocBlockHeader.php (1)
32-40: LGTM! Excellent use of PHP 8.2 readonly class feature.The refactor correctly leverages PHP 8.2's readonly class modifier. When a class is marked
readonly, all its properties implicitly become readonly, so removing the explicitreadonlymodifiers on individual properties is correct and cleaner. The immutability behavior remains unchanged.
| "phpstan/phpstan-phpunit": "^2.0", | ||
| "phpstan/phpstan-symfony": "^2.0", | ||
| "phpunit/phpunit": "^10.2 || ^11.0 || ^12.0", | ||
| "phpunit/phpunit": "^11.0 || ^12.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Critical: PHPUnit constraint incompatible with PHP 8.2.
The pipeline failure confirms that PHPUnit 12 requires PHP 8.3+. The constraint ^11.0 || ^12.0 allows Composer to install PHPUnit 12, which is incompatible with PHP 8.2.
Please verify the PHP version requirements for PHPUnit 11 and 12:
🌐 Web query:
What are the minimum PHP version requirements for PHPUnit 11 and PHPUnit 12?
💡 Result:
- PHPUnit 11: requires PHP 8.2 or later. [1]
- PHPUnit 12: requires PHP 8.3 or later. [2]
Sources: PHPUnit 11 announcement / docs and PHPUnit 12 announcement. [1] https://phpunit.de/announcements/phpunit-11.html [2] https://phpunit.de/announcements/phpunit-12.html
Critical: PHPUnit constraint breaks PHP 8.2 compatibility.
PHPUnit 11 requires PHP 8.2 or later, while PHPUnit 12 requires PHP 8.3 or later. The constraint ^11.0 || ^12.0 allows Composer to install PHPUnit 12, which is incompatible with PHP 8.2.
If PHP 8.2 support is intended, change the constraint to ^11.0 to prevent PHPUnit 12 installation. If the project is dropping PHP 8.2 support in favor of 8.3+, this constraint is acceptable but should be documented as a breaking change in the project's PHP version policy.
🤖 Prompt for AI Agents
In composer.json around line 35, the dev dependency constraint
"phpunit/phpunit": "^11.0 || ^12.0" can allow PHPUnit 12 which requires PHP 8.3
and thus breaks PHP 8.2 compatibility; if you must keep PHP 8.2 support, change
the constraint to "phpunit/phpunit": "^11.0" in composer.json, run composer
update --lock or composer update phpunit/phpunit to update the lockfile and CI,
and if instead you intend to drop PHP 8.2 support, leave the constraint but
update project documentation/CI to state PHP 8.3+ as a breaking change.
Summary by CodeRabbit
Chores
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.