Skip to content

Commit b99b8ce

Browse files
StefanoCappellininicolas-grekas
authored andcommitted
Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest
1 parent 31f3944 commit b99b8ce

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

EventListener/AbstractSessionListener.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,13 @@ public function onKernelRequest(GetResponseEvent $event)
5353
return;
5454
}
5555

56-
$session = null;
5756
$request = $event->getRequest();
5857
if (!$request->hasSession()) {
5958
$sess = null;
6059
$request->setSessionFactory(function () use (&$sess) { return $sess ?? $sess = $this->getSession(); });
6160
}
6261

63-
$session = $session ?? ($this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null);
62+
$session = $this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null;
6463
$this->sessionUsageStack[] = $session instanceof Session ? $session->getUsageIndex() : 0;
6564
}
6665

0 commit comments

Comments
 (0)