Skip to content

Commit 0b60280

Browse files
committed
[#17383] Small tweaks to code examples
1 parent df678e5 commit 0b60280

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

messenger/multiple_buses.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ 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
39-
# the 'allow_no_senders' middleware allows to have no sender
40-
# configured for this bus without throwing an exception
4137
default_middleware:
4238
enabled: 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
4341
allow_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
4444
allow_no_senders: true
4545
middleware:
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');

0 commit comments

Comments
 (0)