Skip to content

Commit

Permalink
Remove horizontal scrollbar and change event name to follow conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
ifdattic committed Oct 12, 2014
1 parent e6d7d8f commit 7fe8a36
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/event_dispatcher/traceable_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Pass the event dispatcher to be wrapped and an instance of the
// the event dispatcher to debug
$eventDispatcher = ...;

$traceableEventDispatcher = new TraceableEventDispatcher($eventDispatcher, new Stopwatch());
$traceableEventDispatcher = new TraceableEventDispatcher(
$eventDispatcher,
new Stopwatch()
);

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

// dispatch an event
$event = ...;
$traceableEventDispatcher->dispatch('the-event-name', $event);
$traceableEventDispatcher->dispatch('event.the_name', $event);

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

0 comments on commit 7fe8a36

Please sign in to comment.