Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8f71b8b

Browse filesBrowse files
committed
[Messenger] Add example of handler autoconfiguration with attributes
1 parent 8f83b9e commit 8f71b8b
Copy full SHA for 8f71b8b

File tree

1 file changed

+12
-0
lines changed
Filter options

1 file changed

+12
-0
lines changed

‎messenger/multiple_buses.rst

Copy file name to clipboardExpand all lines: messenger/multiple_buses.rst
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ you can determine the message bus based on an implemented interface:
154154

155155
.. configuration-block::
156156

157+
.. code-block:: php-attributes
158+
159+
// src/MessageHandler/CommandHandlerInterface.php
160+
namespace App\MessageHandler;
161+
162+
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
163+
164+
#[Autoconfigure(tags: [['name' => 'messenger.message_handler', 'bus' => 'command.bus']])]
165+
interface CommandHandlerInterface
166+
{
167+
}
168+
157169
.. code-block:: yaml
158170
159171
# config/services.yaml

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.