TemplateAnnotationToThisRenderRector

Turns @Template annotation to explicit method call in Controller of FrameworkExtraBundle in Symfony

 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

 final class SomeController
 {
-    /**
-     * @Template()
-     */
     public function indexAction()
     {
+        return $this->render('index.html.twig');
     }
 }

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Symfony\CodeQuality\Rector\ClassMethod\TemplateAnnotationToThisRenderRector;

return RectorConfig::configure()
    ->withRules([
        TemplateAnnotationToThisRenderRector::class,
    ]);