Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03ef116

Browse files
minor #40760 Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest (StefanoCappellini)
This PR was submitted for the 5.x branch but it was merged into the 4.4 branch instead. Discussion ---------- Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | None | License | MIT This PR simplifies a condition and removes unused code (AFAIK coming from #38894)). Commits ------- d344b8d Simplified condition and removed unused code from AbstractSessionListener::onKernelRequest
2 parents ed576b2 + d344b8d commit 03ef116

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Component/HttpKernel/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)