Use $session->getFlashBag() instead of deprcated FlashBag service.

This commit is contained in:
Jan Böhmer 2020-05-31 13:48:12 +02:00
parent cd2b3217e1
commit 7f263e9916
3 changed files with 9 additions and 7 deletions

View file

@ -45,6 +45,7 @@ namespace App\EventSubscriber\UserSystem;
use App\Entity\UserSystem\User;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Security\Core\Security;
@ -77,10 +78,10 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
private $flashBag;
private $httpUtils;
public function __construct(Security $security, FlashBagInterface $flashBag, HttpUtils $httpUtils)
public function __construct(Security $security, SessionInterface $session, HttpUtils $httpUtils)
{
$this->security = $security;
$this->flashBag = $flashBag;
$this->flashBag = $session->getFlashBag();
$this->httpUtils = $httpUtils;
}