From b9ca866bdd3c92f2990f2ce7ef9914020ded21d4 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 30 Oct 2020 14:31:03 +0100 Subject: [PATCH] Remove Symfony 3 compatibility code. --- src/Symfony/Component/HttpFoundation/Request.php | 2 +- .../HttpKernel/EventListener/AbstractSessionListener.php | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index faaa65f991..7387fce74b 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -179,7 +179,7 @@ class Request protected $format; /** - * @var SessionInterface + * @var SessionInterface|callable */ protected $session; diff --git a/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php b/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php index 0a6789d85a..3da47dd8d0 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php @@ -55,12 +55,8 @@ abstract class AbstractSessionListener implements EventSubscriberInterface $session = null; $request = $event->getRequest(); - if ($request->hasSession()) { - // no-op - } elseif (method_exists($request, 'setSessionFactory')) { + if (!$request->hasSession()) { $request->setSessionFactory(function () { return $this->getSession(); }); - } elseif ($session = $this->getSession()) { - $request->setSession($session); } $session = $session ?? ($this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null);