function TraceableEventDispatcher::afterDispatch
Same name in this branch
- 11.1.x vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php \Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher::afterDispatch()
Overrides TraceableEventDispatcher::afterDispatch
File
-
vendor/
symfony/ http-kernel/ Debug/ TraceableEventDispatcher.php, line 58
Class
- TraceableEventDispatcher
- Collects some data about event listeners.
Namespace
Symfony\Component\HttpKernel\DebugCode
protected function afterDispatch(string $eventName, object $event) : void {
switch ($eventName) {
case KernelEvents::CONTROLLER_ARGUMENTS:
$this->stopwatch
->start('controller', 'section');
break;
case KernelEvents::RESPONSE:
$sectionId = $event->getRequest()->attributes
->get('_stopwatch_token');
if (null === $sectionId) {
break;
}
$this->stopwatch
->stopSection($sectionId);
break;
case KernelEvents::TERMINATE:
// In the special case described in the `preDispatch` method above, the `$token` section
// does not exist, then closing it throws an exception which must be caught.
$sectionId = $event->getRequest()->attributes
->get('_stopwatch_token');
if (null === $sectionId) {
break;
}
try {
$this->stopwatch
->stopSection($sectionId);
} catch (\LogicException) {
}
break;
}
}