Add Laravel 10 upgrade rules #89
Merged
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.
Issue #88
Not much to upgrade for Laravel 10, aside from a few renames.
https://laravel.com/docs/10.x/upgrade#database-expressions
Not sure if we should introduce a rule for this. What do we put for the query grammar parameter?
https://laravel.com/docs/10.x/upgrade#redirect-home
If a rule is needed for this, would we redirect to '/'?
https://laravel.com/docs/10.x/upgrade#service-mocking
This seems difficult to be done properly, taking into account the methods are different on the facades.
https://github.com/laravel/framework/pull/41136/files
Notification::assertTimesSent()toNotification::assertSentTimes()with flipped arguments.This could be done with a custom rule, but there already exists a
MethodCallRenamerule that renames methods and has all the boilerplate. We need, however, to swap the arguments in an atomic action together with renaming.Not sure what's the best way to achieve this. Maybe introducing a new
MethodCallRenameWithArgumentSwappingrule in the core Rector repo, or just this repo?