Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9ee869

Browse files
janschoenherrfabpot
authored andcommitted
[HttpKernel] Updated TraceableEventDispatcher.php
1 parent d32c1c0 commit d9ee869

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ public function dispatch($eventName, Event $event = null)
132132

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

135+
if (!$this->dispatcher->hasListeners($eventName)) {
136+
$this->firstCalledEvent[$eventName]->stop();
137+
}
138+
135139
$this->dispatcher->dispatch($eventName, $event);
136140

137141
// reset the id as another event might have been dispatched during the dispatching of this event

0 commit comments

Comments
 (0)