<?php
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
final class SomeController extends AbstractController
{
#[Route('/some-path/{from}/{to}', name: 'some_name')]
public function someAction(
\DateTimeImmutable $from,
\DateTimeImmutable $to,
) {
return $this->render('template.html.twig', ['from' => $from, 'to' => $to]);
}
}
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/6fb8fd61-f7c5-4af9-a1fd-4847ab26da4d
Responsible rules
ControllerMethodInjectionToConstructorRectorExpected Behavior