You extends the controller of FrameworkBundle of Symfony: you must know that you can access that method => https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php#L148

Use it, and don't forget to remove the use.