From 8f71b8baa78b2d37640d9f4cf8c9abb543ad5724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Marodon?= Date: Thu, 26 Aug 2021 14:53:12 +0200 Subject: [PATCH] [Messenger] Add example of handler autoconfiguration with attributes --- messenger/multiple_buses.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/messenger/multiple_buses.rst b/messenger/multiple_buses.rst index 5a1ffecf94c..ac5cc4541d7 100644 --- a/messenger/multiple_buses.rst +++ b/messenger/multiple_buses.rst @@ -154,6 +154,18 @@ you can determine the message bus based on an implemented interface: .. configuration-block:: + .. code-block:: php-attributes + + // src/MessageHandler/CommandHandlerInterface.php + namespace App\MessageHandler; + + use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; + + #[Autoconfigure(tags: [['name' => 'messenger.message_handler', 'bus' => 'command.bus']])] + interface CommandHandlerInterface + { + } + .. code-block:: yaml # config/services.yaml pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy