Skip to content
Merged
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 service_container/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,20 @@ iterator, add the ``exclude`` option:
;
};

.. note::

In the case the referencing service is itself tagged with the tag being used in the tagged
iterator, it is automatically excluded from the injected iterable.

.. versionadded:: 6.1

The ``exclude`` option was introduced in Symfony 6.1.

.. versionadded:: 6.3
Copy link
Contributor

Choose a reason for hiding this comment

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

When tagging 7.0 all versionadded directives will be drop, so maybe it should be a note/tip + versionadded ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that would be better 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

That was my main concern about this PR. Updated it with a note+versionadded, thank you both!


The automatic exclusion of the referencing service in the injected iterable was
introduced in Symfony 6.3.

.. seealso::

See also :doc:`tagged locator services </service_container/service_subscribers_locators>`
Expand Down