Skip to content

Commit 34e22d6

Browse files
committed
minor #4317 Remove horizontal scrollbar and change event name to follow conventions (ifdattic)
This PR was merged into the 2.3 branch. Discussion ---------- Remove horizontal scrollbar and change event name to follow conventions | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | In my opinion the event name should follow the naming conventions http://symfony.com/doc/current/components/event_dispatcher/introduction.html#naming-conventions Commits ------- 7fe8a36 Remove horizontal scrollbar and change event name to follow conventions
2 parents e6d7d8f + 7fe8a36 commit 34e22d6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/event_dispatcher/traceable_dispatcher.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ Pass the event dispatcher to be wrapped and an instance of the
1717
// the event dispatcher to debug
1818
$eventDispatcher = ...;
1919

20-
$traceableEventDispatcher = new TraceableEventDispatcher($eventDispatcher, new Stopwatch());
20+
$traceableEventDispatcher = new TraceableEventDispatcher(
21+
$eventDispatcher,
22+
new Stopwatch()
23+
);
2124

2225
Now, the ``TraceableEventDispatcher`` can be used like any other event dispatcher
2326
to register event listeners and dispatch events::
@@ -27,11 +30,11 @@ to register event listeners and dispatch events::
2730
// register an event listener
2831
$eventListener = ...;
2932
$priority = ...;
30-
$traceableEventDispatcher->addListener('the-event-name', $eventListener, $priority);
33+
$traceableEventDispatcher->addListener('event.the_name', $eventListener, $priority);
3134

3235
// dispatch an event
3336
$event = ...;
34-
$traceableEventDispatcher->dispatch('the-event-name', $event);
37+
$traceableEventDispatcher->dispatch('event.the_name', $event);
3538

3639
After your application has been processed, you can use the
3740
:method:`Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcherInterface::getCalledListeners`

0 commit comments

Comments
 (0)