Remove Symfony 3 compatibility code.

This commit is contained in:
Alexander M. Turek 2020-10-30 14:31:03 +01:00
parent 5cc4623aad
commit b9ca866bdd
2 changed files with 2 additions and 6 deletions

View File

@ -179,7 +179,7 @@ class Request
protected $format;
/**
* @var SessionInterface
* @var SessionInterface|callable
*/
protected $session;

View File

@ -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);