Skip to content

[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

Merged
merged 1 commit into from
Jan 23, 2018

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

{
$this->container = $container;
}

protected function getSession()
{
if (!$this->container->has('session')) {
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, fixed

@nicolas-grekas nicolas-grekas force-pushed the extra-lazy-session branch 2 times, most recently from f7ae524 to 8600644 Compare January 18, 2018 14:12
Copy link
Member

@chalasr chalasr left a 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;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to the parent

@fabpot
Copy link
Member

fabpot commented Jan 23, 2018

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 5f53558 into symfony:master Jan 23, 2018
fabpot added a commit that referenced this pull request Jan 23, 2018
…(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
@nicolas-grekas nicolas-grekas deleted the extra-lazy-session branch January 28, 2018 13:17
@fabpot fabpot mentioned this pull request May 7, 2018
Nyholm added a commit that referenced this pull request Oct 30, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants