8000 [HttpKernel] Updated TraceableEventDispatcher.php by janschoenherr · Pull Request #7365 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] Updated TraceableEventDispatcher.php #7365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[HttpKernel] Updated TraceableEventDispatcher.php
Currently, if no listeners are registered for an dispatched event, the StopwatchEvent "$eventName.'.loading'" is never being stopped.
  • Loading branch information
janschoenherr committed Mar 13, 2013
commit 9c2fac1f7fc3179c1a71b52186c84e20721b03ff
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ public function dispatch($eventName, Event $event = null)

$this->firstCalledEvent[$eventName] = $this->stopwatch->start($eventName.'.loading', 'event_listener_loading');

if (!$this->dispatcher->getListeners($eventName)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use hasListeners instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated!

$this->firstCalledEvent[$eventName]->stop();
}

$this->dispatcher->dispatch($eventName, $event);

// reset the id as another event might have been dispatched during the dispatching of this event
Expand Down
0