This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Bundle/FrameworkBundle/DataCollector/RequestDataCollector.php

45 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace Symfony\Bundle\FrameworkBundle\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\RequestDataCollector as BaseRequestDataCollector;
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
/**
* RequestDataCollector.
*
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class RequestDataCollector extends BaseRequestDataCollector
{
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
{
parent::collect($request, $response, $exception);
$this->data['route'] = $request->attributes->get('_route');
}
/**
* Gets the route.
*
* @return string The route
*/
public function getRoute()
{
return $this->data['route'];
}
}