driftingly / rector-laravel

Rector upgrades rules for Laravel
http://getrector.org
MIT License
469 stars 48 forks source link

Error introduced by JsonCallToExplicitJsonCallRector #217

Closed jeff1326 closed 1 week ago

jeff1326 commented 2 months ago

My code in my tests here

$response = $this->json('GET', route('brands.index'), $payload);

Has been converted to

$response = $this->getJson(route('brands.index'), $payload);

But should be converted to this to keep argument in get

$response = $this->getJson(route('brands.index', $payload));
GeniJaho commented 2 months ago

@jeff1326 the json() GET requests with more than 2 parameters are left unchanged since 1.1.1. I will try to make it work with the route() helper, which is quite common, but it's a bit tricky and will take some time since the third variable is not always the data argument, since there can be named arguments.