original_string: public function onKernelException(GetResponseForExceptionEvent $event)
      {
          $exception = $event->getException();
          $response  = null;
  
          switch (true) {
              case ($exception instanceof NotFoundHttpException):
                  $response = $this->createNotFoundResponse($event->getRequest(), $exception);
                  break;
              case ($exception instanceof AccessDeniedHttpException):
              case ($exception instanceof UnauthorizedHttpException):
              case ($exception instanceof BadRequestHttpException):
              case ($exception instanceof ServiceUnavailableHttpException):
              case ($exception instanceof NotAcceptableHttpException):
              case ($exception instanceof HttpException):
                  /** @var HttpException $exception */
                  $response = $this->createHttpExceptionResponse($exception);
                  break;
              case ($exception instanceof AuthenticationCredentialsNotFoundException):
                  $response = $this->createUnauthenticatedResponse($exception);
                  break;
              default:
          }
  
          if (null === $response) {
              $response = $this->createInternalServerError($exception);
          }
  
          $event->setResponse($response);
      }
code: public function onKernelException(GetResponseForExceptionEvent $event)
      {
          $exception = $event->getException();
          $response  = null;
  
          switch (true) {
              case ($exception instanceof NotFoundHttpException):
                  $response = $this->createNotFoundResponse($event->getRequest(), $exception);
                  break;
              case ($exception instanceof AccessDeniedHttpException):
              case ($exception instanceof UnauthorizedHttpException):
              case ($exception instanceof BadRequestHttpException):
              case ($exception instanceof ServiceUnavailableHttpException):
              case ($exception instanceof NotAcceptableHttpException):
              case ($exception instanceof HttpException):
                  /** @var HttpException $exception */
                  $response = $this->createHttpExceptionResponse($exception);
                  break;
              case ($exception instanceof AuthenticationCredentialsNotFoundException):
                  $response = $this->createUnauthenticatedResponse($exception);
                  break;
              default:
          }
  
          if (null === $response) {
              $response = $this->createInternalServerError($exception);
          }
  
          $event->setResponse($response);
      }
code_tokens: public function onKernelException ( GetResponseForExceptionEvent $ event ) { $ exception = $ event -> getException ( ) ; $ response = null ; switch ( true ) { case ( $ exception instanceof NotFoundHttpException ) : $ response = $ this -> createNotFoundResponse ( $ event -> getRequest ( ) , $ exception ) ; break ; case ( $ exception instanceof AccessDeniedHttpException ) : case ( $ exception instanceof UnauthorizedHttpException ) : case ( $ exception instanceof BadRequestHttpException ) : case ( $ exception instanceof ServiceUnavailableHttpException ) : case ( $ exception instanceof NotAcceptableHttpException ) : case ( $ exception instanceof HttpException ) : /** @var HttpException $exception */ $ response = $ this -> createHttpExceptionResponse ( $ exception ) ; break ; case ( $ exception instanceof AuthenticationCredentialsNotFoundException ) : $ response = $ this -> createUnauthenticatedResponse ( $ exception ) ; break ; default : } if ( null === $ response ) { $ response = $ this -> createInternalServerError ( $ exception ) ; } $ event -> setResponse ( $ response ) ; }
docstring: Maps known exceptions to HTTP exceptions.
  
  @param GetResponseForExceptionEvent $event The event object.
  
  @return void
  
  @SuppressWarnings(PHPMD.CyclomaticComplexity)
docstring_tokens: Maps known exceptions to HTTP exceptions .