mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-16 21:08:34 +01:00
Fix parameter output if parameter is Datetime or array [v1.22.4] (#671)
* Fix parameter output if parameter is Datetime or array * use array_map for parsing parameters
This commit is contained in:
parent
ec4979077f
commit
02d26dbb2e
@ -82,11 +82,16 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
|
||||
*/
|
||||
public function getParameters($query) : array
|
||||
{
|
||||
$params = [];
|
||||
foreach ($query['params'] ?? [] as $name => $param) {
|
||||
$params[$name] = htmlentities($param?:"", ENT_QUOTES, 'UTF-8', false);
|
||||
}
|
||||
return $params;
|
||||
return array_map(function ($param) {
|
||||
if (is_string($param)) {
|
||||
return htmlentities($param, ENT_QUOTES, 'UTF-8', false);
|
||||
} elseif (is_array($param)) {
|
||||
return implode(', ', $param);
|
||||
} elseif ($param instanceof \DateTimeInterface) {
|
||||
return $param->format('Y-m-d H:i:s');
|
||||
}
|
||||
return $param ?: '';
|
||||
}, $query['params'] ?? []);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user