Commit 52d1c55
committed
minor #16985 Adding that you cannot access a session inside a constructor (ThomasLandauer)
This PR was submitted for the 6.1 branch but it was squashed and merged into the 5.4 branch instead.
Discussion
----------
Adding that you cannot access a session inside a constructor
Please double-check!
The info is taken from PhpStorm's Symfony Plugin: https://espend.de/phpstorm/plugin/symfony#inspections:
> A Session must not be used inside a constructor
I think this should be explained here, since doing `$this->session = $requestStack->getSession();` right in the constructor looked like a nice idea...
Commits
-------
9f3b147 Adding that you cannot access a session inside a constructor1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
| |||
0 commit comments