Bug Report
| Subject |
Details |
| Rector version |
2.3.7 |
This is the same issue type as #9639 .
AbstractUid instances such as UuidV4 can be injected in Controllers, therefor, they should not be moved to Constructors.
https://github.com/symfony/uid/blob/8.0/AbstractUid.php
Minimal PHP Code Causing Issue
https://getrector.com/demo/62c7fbd6-82fe-4186-8175-a9cce4cb9ae6
<?php
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Uid\UuidV4;
final class HelloController extends AbstractController
{
#[Route('/path/{uuid}', name: 'name')]
public function someAction(
UuidV4 $uuid,
) {
return $this->render('template.html.twig');
}
}
Expected Behaviour
Skip it.