Skip to content

Commit 245d163

Browse files
committed
Add DatabaseCollector::setDatabase method
1 parent 47cbddd commit 245d163

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/Database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ public function quote(float | bool | int | string | null $value) : float | int |
748748

749749
public function setDebugCollector(DatabaseCollector $collector) : static
750750
{
751-
$collector->setServerInfo($this->mysqli->server_info);
751+
$collector->setDatabase($this);
752752
$this->debugCollector = $collector;
753753
return $this;
754754
}

src/Debug/DatabaseCollector.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,20 @@
1919
*/
2020
class DatabaseCollector extends Collector
2121
{
22+
protected Database $database;
2223
/**
2324
* @var string
2425
*
2526
* @deprecated Use {@see Database::getConnection()}
2627
*/
2728
protected string $serverInfo;
2829

30+
public function setDatabase(Database $database) : static
31+
{
32+
$this->database = $database;
33+
return $this;
34+
}
35+
2936
/**
3037
* @param string $serverInfo
3138
*

0 commit comments

Comments
 (0)