Turns redirect to route to short helper method in Controller in Symfony
-$this->redirect($this->generateUrl("homepage"));
+$this->redirectToRoute("homepage");
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony26\Rector\MethodCall\RedirectToRouteRector;
return RectorConfig::configure()
->withRules([
RedirectToRouteRector::class,
]);