Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2d511de

Browse filesBrowse files
committed
bug #38894 [HttpKernel] Remove Symfony 3 compatibility code (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel] Remove Symfony 3 compatibility code | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #38892 | License | MIT | Doc PR | N/A This PR removes dead code that checks for the presence of the `Request::setSessionFactory()` method. That method was added with #25836 in HttpFoundation 4.1. Since HttpKernel requires at least HttpFoundation 4.4, we can assume that the method is always present and thus simplify some code here. Additionally, I also fix the doc block as described in #38892. 😉 Commits ------- b9ca866 Remove Symfony 3 compatibility code.
2 parents 1afb1bc + b9ca866 commit 2d511de
Copy full SHA for 2d511de

File tree

2 files changed

+2
-6
lines changed
Filter options

2 files changed

+2
-6
lines changed

‎src/Symfony/Component/HttpFoundation/Request.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Request.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class Request
179179
protected $format;
180180

181181
/**
182-
* @var SessionInterface
182+
* @var SessionInterface|callable
183183
*/
184184
protected $session;
185185

‎src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/EventListener/AbstractSessionListener.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,8 @@ public function onKernelRequest(GetResponseEvent $event)
5555

5656
$session = null;
5757
$request = $event->getRequest();
58-
if ($request->hasSession()) {
59-
// no-op
60-
} elseif (method_exists($request, 'setSessionFactory')) {
58+
if (!$request->hasSession()) {
6159
$request->setSessionFactory(function () { return $this->getSession(); });
62-
} elseif ($session = $this->getSession()) {
63-
$request->setSession($session);
6460
}
6561

6662
$session = $session ?? ($this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : null);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.