@@ -34,6 +34,8 @@ an **event bus**. The event bus could have zero or more subscribers.
3434 middleware :
3535 - validation
3636 event.bus :
37+ # the 'allow_no_handlers' middleware allows to have no handler
38+ # configured for this bus without throwing an exception
3739 default_middleware : allow_no_handlers
3840 middleware :
3941 - validation
@@ -60,6 +62,8 @@ an **event bus**. The event bus could have zero or more subscribers.
6062 <framework : bus name =" query.bus" >
6163 <framework : middleware id =" validation" />
6264 </framework : bus >
65+ <!-- the 'allow_no_handlers' middleware allows to have no handler
66+ configured for this bus without throwing an exception -->
6367 <framework : bus name =" event.bus" default-middleware =" allow_no_handlers" >
6468 <framework : middleware id =" validation" />
6569 </framework : bus >
@@ -87,6 +91,8 @@ an **event bus**. The event bus could have zero or more subscribers.
8791 ],
8892 ],
8993 'event.bus' => [
94+ // the 'allow_no_handlers' middleware allows to have no handler
95+ // configured for this bus without throwing an exception
9096 'default_middleware' => 'allow_no_handlers',
9197 'middleware' => [
9298 'validation',
@@ -105,11 +111,6 @@ This will create three new services:
105111
106112* ``event.bus ``: autowireable with ``MessageBusInterface $eventBus ``.
107113
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-
113114Restrict Handlers per Bus
114115-------------------------
115116
0 commit comments