From dd613a884ba50123cfd0ebf84b9df30fa5b99523 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 10 Jan 2023 21:02:11 +0100 Subject: [PATCH] [DependencyInjection] Exclude referencing service (self) in `TaggedIterator` --- service_container/tags.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/service_container/tags.rst b/service_container/tags.rst index 24bb4784ce0..24fe85d4358 100644 --- a/service_container/tags.rst +++ b/service_container/tags.rst @@ -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 + + The automatic exclusion of the referencing service in the injected iterable was + introduced in Symfony 6.3. + .. seealso:: See also :doc:`tagged locator services `