From 9d8e6f677e114d44e9371dfc259e100a0cb91ed0 Mon Sep 17 00:00:00 2001 From: Arnout Boks Date: Sat, 23 Jul 2011 10:49:25 +0200 Subject: [PATCH] [FrameworkBundle] Changed TraceableEventDispatcher to log calls to event listeners _before_ actually calling them --- .../Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php b/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php index 1bc508db2b..e36fba9475 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php +++ b/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php @@ -71,8 +71,6 @@ class TraceableEventDispatcher extends ContainerAwareEventDispatcher implements protected function doDispatch($listeners, $eventName, Event $event) { foreach ($listeners as $listener) { - call_user_func($listener, $event); - $info = $this->getListenerInfo($listener, $eventName); if (null !== $this->logger) { @@ -81,6 +79,8 @@ class TraceableEventDispatcher extends ContainerAwareEventDispatcher implements $this->called[$eventName.'.'.$info['pretty']] = $info; + call_user_func($listener, $event); + if ($event->isPropagationStopped()) { if (null !== $this->logger) { $this->logger->debug(sprintf('Listener "%s" stopped propagation of the event "%s".', $info['pretty'], $eventName));