original_string: protected function getRenderer($exception, $request)
      {
          if (!$this->exceptionRenderer) {
              $this->exceptionRenderer = $this->getConfig('exceptionRenderer') ?: ExceptionRenderer::class;
          }
  
          // For PHP5 backwards compatibility
          if ($exception instanceof Error) {
              $exception = new PHP7ErrorException($exception);
          }
  
          if (is_string($this->exceptionRenderer)) {
              $class = App::className($this->exceptionRenderer, 'Error');
              if (!$class) {
                  throw new Exception(sprintf(
                      "The '%s' renderer class could not be found.",
                      $this->exceptionRenderer
                  ));
              }
  
              return new $class($exception, $request);
          }
          $factory = $this->exceptionRenderer;
  
          return $factory($exception, $request);
      }
code: protected function getRenderer($exception, $request)
      {
          if (!$this->exceptionRenderer) {
              $this->exceptionRenderer = $this->getConfig('exceptionRenderer') ?: ExceptionRenderer::class;
          }
  
          // For PHP5 backwards compatibility
          if ($exception instanceof Error) {
              $exception = new PHP7ErrorException($exception);
          }
  
          if (is_string($this->exceptionRenderer)) {
              $class = App::className($this->exceptionRenderer, 'Error');
              if (!$class) {
                  throw new Exception(sprintf(
                      "The '%s' renderer class could not be found.",
                      $this->exceptionRenderer
                  ));
              }
  
              return new $class($exception, $request);
          }
          $factory = $this->exceptionRenderer;
  
          return $factory($exception, $request);
      }
code_tokens: protected function getRenderer ( $ exception , $ request ) { if ( ! $ this -> exceptionRenderer ) { $ this -> exceptionRenderer = $ this -> getConfig ( 'exceptionRenderer' ) ? : ExceptionRenderer :: class ; } // For PHP5 backwards compatibility if ( $ exception instanceof Error ) { $ exception = new PHP7ErrorException ( $ exception ) ; } if ( is_string ( $ this -> exceptionRenderer ) ) { $ class = App :: className ( $ this -> exceptionRenderer , 'Error' ) ; if ( ! $ class ) { throw new Exception ( sprintf ( "The '%s' renderer class could not be found." , $ this -> exceptionRenderer ) ) ; } return new $ class ( $ exception , $ request ) ; } $ factory = $ this -> exceptionRenderer ; return $ factory ( $ exception , $ request ) ; }
docstring: Get a renderer instance
  
  @param \Exception $exception The exception being rendered.
  @param \Psr\Http\Message\ServerRequestInterface $request The request.
  @return \Cake\Error\ExceptionRendererInterface The exception renderer.
  @throws \Exception When the renderer class cannot be found.
docstring_tokens: Get a renderer instance