Repository navigation
Issue/601 Adopt the PHP 8.1 syntax Rector proposes and remove its skips - #607
Merged
armanist merged 3 commits intoOct 23, 2026
Merged
Conversation
…and drop its Rector skip
…p its Rector skip
…ly and drop its Rector skip
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #601. Part of #595. The changelog entry is written in a final pull request, after the sub-issues.
What changed
FunctionFirstClassCallableRector:array_map('trim', $x)and the like becomearray_map(trim(...), $x)inBody,MailTrap,Route,RouteBuilderandUploadPolicy.ArrayToFirstClassCallableRector:TransformerandErrorHandleruse$this->handleError(...)and$transformer->transform(...)instead of array callables.ErrorHandlerTestnow checks the registered handlers by reflection: aClosurebound to theErrorHandlerinstance, namedhandleErrororhandleException.ReadOnlyPropertyRector: 84 private properties in 48 classes that are assigned only in the constructor becomeprivate readonly.MigrationManagerTest: two tests replaced the privatedbproperty by reflection, whichreadonlydoes not allow. They now buildMigrationManagerin a fresh app context that holds a mockedDatabase.rector.phphas no skip left for these three rules. The constructor promotion rule stays skipped as before.Why
#595 moved Rector to the PHP 8.1 level set and skipped three of its rules to keep
composer rector:checkgreen. This applies them, one commit per rule.Breaking changes
Testing
ErrorHandlerTest(the two registration tests) andMigrationManagerTest(the unsupported driver and wrong direction tests).Notes for reviewers
readonlycommit is large (50 files) but mechanical, produced byrector process.