Find the best Rector rule to solve your problem. Searching through 1039 rules.
Found 1 rule. That's the one:
Replace $this->getDoctrine() and $this->dispatchMessage() calls in AbstractController with direct service use
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Doctrine\Persistence\ManagerRegistry; final class SomeController extends AbstractController { + public function __construct( + private ManagerRegistry $managerRegistry + ) { + } + public function run() { - $productRepository = $this->getDoctrine()->getRepository(Product::class); + $productRepository = $this->managerRegistry->getRepository(Product::class); } }