[HttpKernel] changed the value of route to the pattern when it is a Route object in the data collector

This allows to have a meaningful information in the WDT when the route
in the Request is not the route name but the route object (like in
Drupal for instance).
This commit is contained in:
Fabien Potencier 2012-12-26 09:59:40 +01:00
parent 5096292111
commit 761429e551

View File

@ -50,6 +50,10 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
$attributes = array();
foreach ($request->attributes->all() as $key => $value) {
if ('_route' == $key && is_object($value)) {
$value = $value->getPattern();
}
$attributes[$key] = $this->varToString($value);
}