Skip to content

[HttpFoundation] deprecate the NamespacedAttributeBag class #14845

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 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions components/http_foundation/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ and "Remember Me" login settings or other user based state information.
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag`
This implementation allows for attributes to be stored in a structured namespace.

.. deprecated:: 5.3

The ``NamespacedAttributeBag`` class is deprecated since Symfony 5.3.
If you need this feature, you will have to implement the class yourself.

:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface`
has the API

Expand Down Expand Up @@ -237,6 +242,11 @@ So any processing of this might quickly get ugly, even adding a token to the arr
$tokens['c'] = $value;
$session->set('tokens', $tokens);

.. deprecated:: 5.3

The ``NamespacedAttributeBag`` class is deprecated since Symfony 5.3.
If you need this feature, you will have to implement the class yourself.

With structured namespacing, the key can be translated to the array
structure like this using a namespace character (which defaults to ``/``)::

Expand Down
5 changes: 5 additions & 0 deletions session.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ By default, session attributes are key-value pairs managed with the
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBag`
class.

.. deprecated:: 5.3

The ``NamespacedAttributeBag`` class is deprecated since Symfony 5.3.
If you need this feature, you will have to implement the class yourself.

If your application needs are complex, you may prefer to use
:ref:`namespaced session attributes <namespaced-attributes>` which are managed with the
:class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag`
Expand Down