-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[FrameworkBundle] Deprecate flashbag and attributebag services #13467
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
Comments
@warslett I've found a single occurrence of these deprecated services in the Symfony Docs. It's this example about "namespaced session attributes": .. code-block:: yaml
# config/services.yaml
session:
public: true
class: Symfony\Component\HttpFoundation\Session\Session
arguments: ['@session.storage', '@session.namespacedattributebag', '@session.flash_bag']
session.namespacedattributebag:
class: Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag How could we remove the |
@javiereguiluz I will test this to be sure but in theory you don't need to inject a flashbag. If you want to use the default flashbag, you just set the flashbag parameter to null. The deprecated flashbag service uses session as a factory so it will always be the flashbag contained in the session. I'd suggest this as the recommended approach for injecting NamespacedAttributeBag:
EDIT: Updated muddled wording |
or even just:
|
@warslett thanks a lot for double checking this! We've created a pull request to fix this. Thanks! |
The text was updated successfully, but these errors were encountered: