Closed phily245 closed 1 year ago
Probably not something I'll fix until Laravel is proven to support/use this syntax.
As a note for anyone else experiencing this, I fixed this by adding the following to my rector.php
file:
$rectorConfig->skip([
FirstClassCallableRector::class => [
__DIR__ . '/routes',
],
]);
I came across this when using rector with the
LevetSetList::UPTO_PHP_82
rule to upgrade my code from PHP 8.1 to 8.2.Rector converted my routes from this format:
To use a first-class callable:
My pest test then failed:
Upon closer inspection, inside
assertRouteUsesFormRequest
it looks for the controller action at https://github.com/jasonmccreary/laravel-test-assertions/blob/master/src/Traits/AdditionalAssertions.php#L14-L16, which is not set when using a first class callable, so the test then failed.