-
-
Notifications
You must be signed in to change notification settings - Fork 737
Closed
rectorphp/rector-src
#6911Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | 2.0.16 |
Minimal PHP Code Causing Issue
I can't reproduce it in the demo. I use Laravel 11 and https://github.com/driftingly/rector-laravel/. But if I use a minimal config without rector-laravel, I get the same issue.
Minimal config
return RectorConfig::configure()
->withPaths([
__DIR__ . '/app',
])
->withPhpSets(php84: true);
Code:
public static function getGlobalSearchEloquentQuery(): Builder
{
//...
return (new (static::getModel()))->newQuery()
->orderByDesc('received_at');
}
The change:
- return (new (static::getModel()))->newQuery()
+ return new (static::getModel())->newQuery()
But only if I use
->withPhpSets();
//or
->withPhpSets(php84: true);
But I have no problems with this code
->withPhpSets(php83: true);