-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Make session-related services extra-lazy #25836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
nicolas-grekas
commented
Jan 18, 2018
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | yes |
Tests pass? | yes |
Fixed tickets | - |
License | MIT |
Doc PR | - |
5a9272e
to
fa4864a
Compare
{ | ||
$this->container = $container; | ||
} | ||
|
||
protected function getSession() | ||
{ | ||
if (!$this->container->has('session')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->container
can be null now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, fixed
f7ae524
to
8600644
Compare
8600644
to
5f53558
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closures could have some typehints/return types
@@ -22,8 +22,6 @@ | |||
*/ | |||
class SessionListener extends AbstractSessionListener | |||
{ | |||
private $container; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to the parent
Thank you @nicolas-grekas. |
…(nicolas-grekas) This PR was merged into the 4.1-dev branch. Discussion ---------- [HttpKernel] Make session-related services extra-lazy | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 5f53558 [HttpKernel] Make session-related services extra-lazy
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.