1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-16 21:08:34 +01:00

Make PDOCollector easy to extend (#582)

This commit is contained in:
parallels999 2024-02-10 05:01:40 -05:00 committed by GitHub
parent 912691590f
commit 958ac08897
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -204,7 +204,7 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
*/
public function getName()
{
return 'pdo';
return 'database';
}
/**
@ -212,15 +212,17 @@ class PDOCollector extends DataCollector implements Renderable, AssetProvider
*/
public function getWidgets()
{
$name = $this->getName();
return array(
"database" => array(
"$name" => array(
"icon" => "database",
"widget" => "PhpDebugBar.Widgets.SQLQueriesWidget",
"map" => "pdo",
"map" => "$name",
"default" => "[]"
),
"database:badge" => array(
"map" => "pdo.nb_statements",
"$name:badge" => array(
"map" => "$name.nb_statements",
"default" => 0
)
);