Closed
Description
Symfony version(s) affected: >3.4.31
Description
The session.attribute_bag
service is now broken because the previously magic Session::getAttributeBag
method was added, quote : "to help with IDE autocompletion".
(At least that's the most reasonable explaination to me)
How to reproduce
Simply require the session.attribute_bag
in any other service, it will throw the following error:
Call to private method Symfony\Component\HttpFoundation\Session\Session::getAttributeBag() from context ...'
Possible Solution
- Remove service because it seems that nobody is using it apart from me?
- Fix service definition with different method
- Make the method public
Additional context
# From src/Symfony/Bundle/FrameworkBundle/Resources/config/session.xml:43
<service id="session.attribute_bag" class="Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag">
<factory service="session" method="getAttributeBag"/>
</service>
// From src/Symfony/Component/HttpFoundation/Session/Session.php:271
/**
* Gets the attributebag interface.
*
* Note that this method was added to help with IDE autocompletion.
*
* @return AttributeBagInterface
*/
private function getAttributeBag()