1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-16 21:08:34 +01:00
This commit is contained in:
erikn69 2024-09-11 13:12:52 -05:00 committed by GitHub
parent bac734286d
commit 1bca59fe66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -60,7 +60,7 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
foreach ($this->debugStack->queries as $q) { foreach ($this->debugStack->queries as $q) {
$queries[] = array( $queries[] = array(
'sql' => $q['sql'], 'sql' => $q['sql'],
'params' => (object) $this->getParameters($q), 'params' => (object) $this->getParameters($q['params'] ?? []),
'duration' => $q['executionMS'], 'duration' => $q['executionMS'],
'duration_str' => $this->formatDuration($q['executionMS']) 'duration_str' => $this->formatDuration($q['executionMS'])
); );
@ -80,7 +80,7 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
* *
* @return array * @return array
*/ */
public function getParameters($query) : array public function getParameters($params) : array
{ {
return array_map(function ($param) { return array_map(function ($param) {
if (is_string($param)) { if (is_string($param)) {
@ -95,7 +95,7 @@ class DoctrineCollector extends DataCollector implements Renderable, AssetProvid
return json_encode($param); return json_encode($param);
} }
return $param ?: ''; return $param ?: '';
}, $query['params'] ?? []); }, $params);
} }
/** /**