@@ -34,13 +34,13 @@ an **event bus**. The event bus could have zero or more subscribers.
3434middleware :
3535 -validation
3636event.bus :
37- # the 'allow_no_handlers' middleware allows to have no handler
38- # configured for this bus without throwing an exception
39- # the 'allow_no_senders' middleware allows to have no sender
40- # configured for this bus without throwing an exception
4137default_middleware :
4238enabled :true
39+ # set "allow_no_handlers" to true (default is false) to allow having
40+ # no handler configured for this bus without throwing an exception
4341allow_no_handlers :false
42+ # set "allow_no_senders" to false (default is true) to throw an exception
43+ # if no sender is configured for this bus
4444allow_no_senders :true
4545middleware :
4646 -validation
@@ -67,12 +67,12 @@ an **event bus**. The event bus could have zero or more subscribers.
6767 <framework : bus name =" query.bus" >
6868 <framework : middleware id =" validation" />
6969 </framework : bus >
70- <!-- the 'allow_no_handlers' middleware allows to have no handler
71- configured for this bus without throwing an exception-->
72- <!-- the 'allow_no_senders' middleware allows to have no sender
73- configured for this bus without throwing an exception-->
7470 <framework : bus name =" event.bus" >
75- <framework : default-middleware enabled =" true" allow_no_handlers =" false" allow_no_senders =" true" />
71+ <!-- set "allow-no-handlers" to true (default is false) to allow having
72+ no handler configured for this bus without throwing an exception-->
73+ <!-- set "allow-no-senders" to false (default is true) to throw an exception
74+ if no sender is configured for this bus-->
75+ <framework : default-middleware enabled =" true" allow-no-handlers =" false" allow-no-senders =" true" />
7676 <framework : middleware id =" validation" />
7777 </framework : bus >
7878 </framework : messenger >
@@ -96,13 +96,13 @@ an **event bus**. The event bus could have zero or more subscribers.
9696 $queryBus->middleware()->id('validation');
9797
9898 $eventBus = $framework->messenger()->bus('event.bus');
99- // the 'allowNoHandlers' middleware allows to have no handler
100- // configured for this bus without throwing an exception
101- // the 'allowNoSenders' middleware allows to have no sender
102- // configured for this bus without throwing an exception
10399 $eventBus->defaultMiddleware()
104100 ->enabled(true)
101+ // set "allowNoHandlers" to true (default is false) to allow having
102+ // no handler configured for this bus without throwing an exception
105103 ->allowNoHandlers(false)
104+ // set "allowNoSenders" to false (default is true) to throw an exception
105+ // if no sender is configured for this bus
106106 ->allowNoSenders(true)
107107 ;
108108 $eventBus->middleware()->id('validation');