[HttpKernel] added extra information when collecting data from an object if that object implements a __toString().
This commit is contained in:
parent
e056480ab2
commit
0c1832450d
@ -41,7 +41,14 @@ class RequestDataCollector extends DataCollector
|
||||
|
||||
$attributes = array();
|
||||
foreach ($request->attributes->all() as $key => $value) {
|
||||
$attributes[$key] = is_object($value) ? sprintf('Object(%s)', get_class($value)) : $value;
|
||||
if (is_object($value)) {
|
||||
$attributes[$key] = sprintf('Object(%s)', get_class($value));
|
||||
if (is_callable(array($value, '__toString')) {
|
||||
$attributes[$key] .= sprintf(' = %s', (string) $value);
|
||||
}
|
||||
} else {
|
||||
$attributes[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$content = null;
|
||||
|
Reference in New Issue
Block a user