8000 preserve dispatch order · symfony/symfony@c737944 · GitHub
[go: up one dir, main page]

Skip to content

Commit c737944

Browse files
committed
preserve dispatch order
1 parent 924be40 commit c737944

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
3636
private $orphanedEvents;
3737
private $requestStack;
3838
private $currentRequestHash = '';
39-
private $called;
4039

4140
public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null, RequestStack $requestStack = null)
4241
{
@@ -309,6 +308,7 @@ private function preProcess($eventName)
309308
$this->wrappedListeners[$eventName][] = $wrappedListener;
310309
$this->dispatcher->removeListener($eventName, $listener);
311310
$this->dispatcher->addListener($eventName, $wrappedListener, $priority);
311+
$this->callStack->attach($wrappedListener, array($eventName, $this->currentRequestHash));
312312
}
313313
}
314314

@@ -333,8 +333,8 @@ private function postProcess($eventName)
333333
if (null !== $this->logger) {
334334
$this->logger->debug('Notified event "{event}" to listener "{listener}".', $context);
335335
}
336-
337-
$this->callStack->attach($listener, array($eventName, $this->currentRequestHash));
336+
} else {
337+
$this->callStack->detach($listener);
338338
}
339339

340340
if (null !== $this->logger && $skipped) {

0 commit comments

Comments
 (0)
0