From d344b8d6cbe37ebf0baa8a8ad89c86a697828f75 Mon Sep 17 00:00:00 2001 From: StefanoCappellini Date: Sat, 10 Apr 2021 16:16:03 +0200 Subject: [PATCH] Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest --- .../HttpKernel/EventListener/AbstractSessionListener.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php b/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php index 0e99ee55c2..76c2064d18 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php @@ -53,14 +53,13 @@ abstract class AbstractSessionListener implements EventSubscriberInterface return; } - $session = null; $request = $event->getRequest(); if (!$request->hasSession()) { $sess = null; $request->setSessionFactory(function () use (&$sess) { return $sess ?? $sess = $this->getSession(); }); } - $session = $session ?? ($this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null); + $session = $this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null; $this->sessionUsageStack[] = $session instanceof Session ? $session->getUsageIndex() : 0; }