public function onKernelRequest(GetResponseEvent $event)
 {
     if (HttpKernelInterface::SUB_REQUEST !== $event->getRequestType()) {
         return;
     }
     $request = $event->getRequest();
     $response = $this->manager->getResponseFromRequest($request);
     if (null != $response) {
         $event->setResponse($response);
     }
 }
 public function onCoreException(GetResponseForExceptionEvent $event)
 {
     $exception = $event->getException();
     if (!$exception instanceof NotFoundHttpException) {
         return;
     }
     $request = $event->getRequest();
     if (404 != $exception->getStatusCode() || 'GET' != $request->getMethod()) {
         return;
     }
     $response = $this->manager->getResponseFromRequest($request);
     if (null != $response) {
         $event->setResponse($response);
     }
 }