Skip to content

Commit

Permalink
minor #4317 Remove horizontal scrollbar and change event name to foll…
Browse files Browse the repository at this point in the history
…ow 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
  • Loading branch information
wouterj committed Oct 12, 2014
2 parents e6d7d8f + 7fe8a36 commit 34e22d6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/event_dispatcher/traceable_dispatcher.rst
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 34e22d6

Please sign in to comment.