public function ProfilerSubscriber::onKernelResponse in Devel 8.2
Same name and namespace in other branches
- 8.3 webprofiler/src/EventSubscriber/ProfilerSubscriber.php \Drupal\webprofiler\EventSubscriber\ProfilerSubscriber::onKernelResponse()
- 8 webprofiler/src/EventSubscriber/ProfilerSubscriber.php \Drupal\webprofiler\EventSubscriber\ProfilerSubscriber::onKernelResponse()
- 4.x webprofiler/src/EventSubscriber/ProfilerSubscriber.php \Drupal\webprofiler\EventSubscriber\ProfilerSubscriber::onKernelResponse()
Handles the onKernelResponse event.
File
- webprofiler/
src/ EventSubscriber/ ProfilerSubscriber.php, line 65
Class
Namespace
Drupal\webprofiler\EventSubscriberCode
public function onKernelResponse(FilterResponseEvent $event) {
$master = $event
->isMasterRequest();
if ($this->onlyMasterRequests && !$master) {
return;
}
if ($this->onlyException && NULL === $this->exception) {
return;
}
$request = $event
->getRequest();
$exception = $this->exception;
$this->exception = NULL;
if (NULL !== $this->matcher && !$this->matcher
->matches($request)) {
return;
}
if (!($profile = $this->profiler
->collect($request, $event
->getResponse(), $exception))) {
return;
}
$this->profiles[$request] = $profile;
$this->parents[$request] = $this->requestStack
->getParentRequest();
}