From dc2d0481cdfc652d0fc54f34311bc29c95e3be0f Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Wed, 24 May 2023 18:23:09 +0200 Subject: [PATCH] [DependencyInjection] Warns `instanceof` should be called before services registration --- service_container/tags.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service_container/tags.rst b/service_container/tags.rst index 6f85af4a945..0cb8974b8d1 100644 --- a/service_container/tags.rst +++ b/service_container/tags.rst @@ -113,6 +113,11 @@ If you want to apply tags automatically for your own services, use the ->tag('app.custom_tag'); }; +.. caution:: + + If you're using PHP, you need to call ``instanceof`` before any service + registration to make sure tags are correctly applied. + It is also possible to use the ``#[AutoconfigureTag]`` attribute directly on the base class or interface::