Run Rector on your code to see what it can do for you:

 <?php
 
 use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
 
 class ChildController extends ParentController
 {
-    public function example(Foo $foo): Response
-    {
-        dump($foo);
+    public function example(): Response
+    {
+        dump($this->foo);
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 3a3942 - released at 2026-03-17 17:46