You are here

public function RouterDataCollector::collect in Zircon Profile 8.0

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

Collects data for the given Request and Response.

Parameters

Request $request A Request instance:

Response $response A Response instance:

\Exception $exception An Exception instance:

Overrides DataCollectorInterface::collect

File

vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php, line 42

Class

RouterDataCollector
RouterDataCollector.

Namespace

Symfony\Component\HttpKernel\DataCollector

Code

public function collect(Request $request, Response $response, \Exception $exception = null) {
  if ($response instanceof RedirectResponse) {
    $this->data['redirect'] = true;
    $this->data['url'] = $response
      ->getTargetUrl();
    if ($this->controllers
      ->contains($request)) {
      $this->data['route'] = $this
        ->guessRoute($request, $this->controllers[$request]);
    }
  }
  unset($this->controllers[$request]);
}