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

 <?php
 
  use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
 
  final class HelloController extends AbstractController
  {
-     #[Route('/path/{uuid}', name: 'name')]
-     public function someAction(
-        UuidV4 $uuid,
-     ) {
-         return $this->render('template.html.twig');
+     public function __construct(private readonly \Symfony\Component\Uid\UuidV4 $uuid)
+     {
+     }
+     #[Route('/path/{uuid}', name: 'name')]
+     public function someAction()
+     {
+         return $this->render('template.html.twig');
      }
  }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: e30087 - released at 2026-04-23 17:48