From 15666fc92d1814cd48aaebd5f35ca57775b18883 Mon Sep 17 00:00:00 2001 From: thisfro Date: Tue, 1 Jun 2021 14:05:04 +0200 Subject: [PATCH] force use of RouterInterface --- src/Controller/TradeController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Controller/TradeController.php b/src/Controller/TradeController.php index 5ae91db..effc2cc 100644 --- a/src/Controller/TradeController.php +++ b/src/Controller/TradeController.php @@ -15,15 +15,17 @@ use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mime\Email; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Symfony\Component\Routing\RouterInterface; class TradeController extends AbstractController { #[Route('/trade/{id}', name: 'trade')] - public function sendEmail(MailerInterface $mailer, Offering $offer, OfferingRepository $offeringRepository, WishRepository $wishRepository): Response + public function sendEmail(MailerInterface $mailer, Offering $offer, OfferingRepository $offeringRepository, WishRepository $wishRepository, RouterInterface $router): Response { $user = $this->getUser(); - $mail_url = $this->generateUrl('user_public', [ + $this->router = $router; + $mail_url = $this->router->generate('user_public', [ 'id' => $offer->getByUser()->getId(), ], UrlGeneratorInterface::ABSOLUTE_URL);