protected function finishRequest(Request $request, $type)
{
if ($this->eventDispatcher !== null) {
$event = new FinishRequestEvent($this, $request, $type);
$this->eventDispatcher->dispatch(KernelEvents::FINISH_REQUEST, $event);
}
$this->requests->pop();
}