public function onKernelView(GetResponseForControllerResultEvent $event)
    {
        $request = $event->getRequest();

        try {
            $viewName = $this->viewNameDeducer->deduce($request);
        }
        catch (NotInBundleException $e) {
            return;
        }
        catch (NoControllerNameException $e) {
            return;
        }
        $viewParams = $event->getControllerResult();
        if (!is_array($viewParams) && !is_null($viewParams)) {
            return;
        }

        if ($this->templating->exists($viewName)) {
            $response = $this->templating->renderResponse($viewName, $viewParams ?: array());
            $event->setResponse($response);
            return;
        }

        $this->missingViewHandler->handleMissingView($event, $viewName, $viewParams ?: array());
    }