symfony-docs icon indicating copy to clipboard operation
symfony-docs copied to clipboard

Adding that you cannot access a session inside a constructor

Open ThomasLandauer opened this issue 3 years ago • 0 comments

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...

ThomasLandauer avatar Jul 15 '22 13:07 ThomasLandauer