8000 Deprecate using the old DBAL logger system · symfony/symfony@48faa40 · GitHub
[go: up one dir, main page]

Skip to content

Commit 48faa40

Browse files
committed
Deprecate using the old DBAL logger system
1 parent 4ba0137 commit 48faa40

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

UPGRADE-6.4.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
UPGRADE FROM 6.3 to 6.4
22
=======================
33

4+
DoctrineBridge
5+
--------------
6+
7+
* Deprecate `DbalLogger`, use a middleware instead
8+
* Deprecate not constructing `DoctrineDataCollector` with an instance of `DebugDataHolder`
9+
* Deprecate `DoctrineDataCollector::addLogger()`, use a `DebugDataHolder` instead
10+
411
HttpFoundation
512
--------------
613

src/Symfony/Bridge/Doctrine/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGELOG
22
=========
33

4+
6.4
5+
---
6+
7+
* Deprecate `DbalLogger`, use a middleware instead
8+
* Deprecate not constructing `DoctrineDataCollector` with an instance of `DebugDataHolder`
9+
* Deprecate `DoctrineDataCollector::addLogger()`, use a `DebugDataHolder` instead
10+
411
6.3
512
---
613

src/Symfony/Bridge/Doctrine/DataCollector/DoctrineDataCollector.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,23 @@ public function __construct(
4343
) {
4444
$this->connections = $registry->getConnectionNames();
4545
$this->managers = $registry->getManagerNames();
46+
47+
if (null === $debugDataHolder) {
48+
trigger_deprecation('symfony/doctrine-bridge', '6.4', 'Not passing an instance of "%s" as "$debugDataHolder" to "%s()" is deprecated.', DebugDataHolder::class, __METHOD__);
49+
}
4650
}
4751

4852
/**
4953
* Adds the stack logger for a connection.
5054
*
5155
* @return void
56+
*
57+
* @deprecated since Symfony 6.4, use a DebugDataHolder instead.
5258
*/
5359
public function addLogger(string $name, DebugStack $logger)
5460
{
61+
trigger_deprecation('symfony/doctrine-bridge', '6.4', '"%s()" is deprecated. Pass an instance of "%s" to the constructor instead.', __METHOD__, DebugDataHolder::class);
62+
5563
$this->loggers[$name] = $logger;
5664
}
5765

src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
use Psr\Log\LoggerInterface;
1616
use Symfony\Component\Stopwatch\Stopwatch;
1717

18+
trigger_deprecation('symfony/doctrine-bridge', '6.4', '"%s" is deprecated, use a middleware instead.', DbalLogger::class);
19+
1820
/**
1921
* @author Fabien Potencier <fabien@symfony.com>
22+
*
23+
* @deprecated since Symfony 6.4, use a middleware instead.
2024
*/
2125
class DbalLogger implements SQLLogger
2226
{

0 commit comments

Comments
 (0)
0