@@ -36,7 +36,12 @@ an **event bus**. The event bus could have zero or more subscribers.
36
36
event.bus :
37
37
# the 'allow_no_handlers' middleware allows to have no handler
38
38
# configured for this bus without throwing an exception
39
- default_middleware : allow_no_handlers
39
+ # the 'allow_no_senders' middleware allows to have no sender
40
+ # configured for this bus without throwing an exception
41
+ default_middleware :
42
+ enabled : true
43
+ allow_no_handlers : false
44
+ allow_no_senders : true
40
45
middleware :
41
46
- validation
42
47
@@ -64,7 +69,10 @@ an **event bus**. The event bus could have zero or more subscribers.
64
69
</framework : bus >
65
70
<!-- the 'allow_no_handlers' middleware allows to have no handler
66
71
configured for this bus without throwing an exception -->
67
- <framework : bus name =" event.bus" default-middleware =" allow_no_handlers" >
72
+ <!-- the 'allow_no_senders' middleware allows to have no sender
73
+ configured for this bus without throwing an exception -->
74
+ <framework : bus name =" event.bus" >
75
+ <framework : default-middleware enabled =" true" allow_no_handlers =" false" allow_no_senders =" true" />
68
76
<framework : middleware id =" validation" />
69
77
</framework : bus >
70
78
</framework : messenger >
@@ -88,9 +96,15 @@ an **event bus**. The event bus could have zero or more subscribers.
88
96
$queryBus->middleware()->id('validation');
89
97
90
98
$eventBus = $framework->messenger()->bus('event.bus');
91
- // the 'allow_no_handlers' middleware allows to have no handler
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
92
102
// configured for this bus without throwing an exception
93
- $eventBus->defaultMiddleware('allow_no_handlers');
103
+ $eventBus->defaultMiddleware()
104
+ ->enabled(true)
105
+ ->allowNoHandlers(false)
106
+ ->allowNoSenders(true)
107
+ ;
94
108
$eventBus->middleware()->id('validation');
95
109
};
96
110
0 commit comments