Skip to content

Adding warning about depending on concrete implementation of Session #13884

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

Closed
Changes from 1 commit
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
Prev Previous commit
fixing typo
  • Loading branch information
oleg-andreyev committed Jun 22, 2020
commit 0d22bbb92a7f74a57bafd6c47d53257424cfda77
2 changes: 1 addition & 1 deletion controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ you'll use this key to retrieve the message.

.. warning::

If you want avoid depending on concrete implementation of `Session` and relay on :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionInterface`:
If you want avoid depending on concrete implementation of `Session` and rely on :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionInterface`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you want avoid depending on concrete implementation of `Session` and rely on :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionInterface`:
If you want avoid depending on concrete implementation of ``Session`` and rely on :class:`Symfony\\Component\\HttpFoundation\\Session\\SessionInterface`:

you will find your self in a situation that `getFlashBag` is not declared in an interface.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
you will find your self in a situation that `getFlashBag` is not declared in an interface.
you will find your self in a situation that ``getFlashBag`` is not declared in an interface.

In order fix this "problem" you must inject `FlashBagInterface`/`session.flash_bag` and relay on `FlashBagInterface`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In order fix this "problem" you must inject `FlashBagInterface`/`session.flash_bag` and relay on `FlashBagInterface`
In order fix this "problem" you must inject ``FlashBagInterface``/``session.flash_bag`` and relay on ``FlashBagInterface``

instead of `Session` for access to "Flash Messages"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
instead of `Session` for access to "Flash Messages"
instead of ``Session`` for access to "Flash Messages"

Expand Down