You are here

protected function ExceptionListener::duplicateRequest in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/EventListener/ExceptionListener.php \Symfony\Component\HttpKernel\EventListener\ExceptionListener::duplicateRequest()

Clones the request for the exception.

Parameters

\Exception $exception The thrown exception.:

Request $request The original request.:

Return value

Request $request The cloned request.

1 call to ExceptionListener::duplicateRequest()
ExceptionListener::onKernelException in vendor/symfony/http-kernel/EventListener/ExceptionListener.php

File

vendor/symfony/http-kernel/EventListener/ExceptionListener.php, line 104

Class

ExceptionListener
ExceptionListener.

Namespace

Symfony\Component\HttpKernel\EventListener

Code

protected function duplicateRequest(\Exception $exception, Request $request) {
  $attributes = array(
    '_controller' => $this->controller,
    'exception' => FlattenException::create($exception),
    'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
    // keep for BC -- as $format can be an argument of the controller callable
    // see src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php
    // @deprecated since version 2.4, to be removed in 3.0
    'format' => $request
      ->getRequestFormat(),
  );
  $request = $request
    ->duplicate(null, null, $attributes);
  $request
    ->setMethod('GET');
  return $request;
}