Skip to content

Commit 7d9e6fe

Browse files
Update event_dispatcher.rst
1 parent 95b05f6 commit 7d9e6fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/event_dispatcher.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ of the event to dispatch::
348348
// creates the OrderPlacedEvent and dispatches it
349349
$event = new OrderPlacedEvent($order);
350350
$dispatcher->dispatch($event, OrderPlacedEvent::NAME);
351-
// note that ``OrderPlacedEvent::NAME`` is optional, read more below
351+
// note that the second argument ``OrderPlacedEvent::NAME`` is optional,
352+
// read more below in the subscriber code part
352353

353354
Notice that the special ``OrderPlacedEvent`` object is created and passed to
354355
the ``dispatch()`` method. Now, any listener to the ``order.placed``
@@ -393,7 +394,8 @@ Take the following example of a subscriber that subscribes to the
393394
],
394395
OrderPlacedEvent::NAME => 'onStoreOrder',
395396
// you can also subscribe this way if you pass only
396-
// the event object
397+
// the event object as first argument and omit the second
398+
// of the $dispatcher->dispatch method
397399
OrderPlacedEvent::class => 'onStoreOrder',
398400
];
399401
}

0 commit comments

Comments
 (0)