protected function filterResponse(Response $response, Request $request, $type)
    {
        $event = new FilterResponseEvent($this, $request, $type, $response);
        $this->getDispatcher()->dispatch(KernelEvents::RESPONSE, $event);

        return $event->getResponse();
    }