45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
|
<?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'];
|
||
|
}
|
||
|
}
|