@@ -34,6 +34,8 @@ an **event bus**. The event bus could have zero or more subscribers.
34
34
middleware :
35
35
- validation
36
36
event.bus :
37
+ # the 'allow_no_handlers' middleware allows to have no handler
38
+ # configured for this bus without throwing an exception
37
39
default_middleware : allow_no_handlers
38
40
middleware :
39
41
- validation
@@ -60,6 +62,8 @@ an **event bus**. The event bus could have zero or more subscribers.
60
62
<framework : bus name =" query.bus" >
61
63
<framework : middleware id =" validation" />
62
64
</framework : bus >
65
+ <!-- the 'allow_no_handlers' middleware allows to have no handler
66
+ configured for this bus without throwing an exception -->
63
67
<framework : bus name =" event.bus" default-middleware =" allow_no_handlers" >
64
68
<framework : middleware id =" validation" />
65
69
</framework : bus >
@@ -87,6 +91,8 @@ an **event bus**. The event bus could have zero or more subscribers.
87
91
],
88
92
],
89
93
'event.bus' => [
94
+ // the 'allow_no_handlers' middleware allows to have no handler
95
+ // configured for this bus without throwing an exception
90
96
'default_middleware' => 'allow_no_handlers',
91
97
'middleware' => [
92
98
'validation',
@@ -105,11 +111,6 @@ This will create three new services:
105
111
106
112
* ``event.bus ``: autowireable with ``MessageBusInterface $eventBus ``.
107
113
108
- .. note ::
109
-
110
- The ``allow_no_handlers `` option allows ``event.bus `` to have no handler configured
111
- and as a result, it will not end up with error if you define no handler for this bus.
112
-
113
114
Restrict Handlers per Bus
114
115
-------------------------
115
116
0 commit comments