From 8c5ce2949c352ba09658a21e530e77c391923cad Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 7 Mar 2021 00:53:07 +0100 Subject: [PATCH] [GH-3572] Deprecation trigger for LoggerChain::addLogger --- lib/Doctrine/DBAL/Logging/LoggerChain.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Doctrine/DBAL/Logging/LoggerChain.php b/lib/Doctrine/DBAL/Logging/LoggerChain.php index 024afae283a..44d1db33665 100644 --- a/lib/Doctrine/DBAL/Logging/LoggerChain.php +++ b/lib/Doctrine/DBAL/Logging/LoggerChain.php @@ -2,6 +2,8 @@ namespace Doctrine\DBAL\Logging; +use Doctrine\Deprecations\Deprecation; + /** * Chains multiple SQLLogger. */ @@ -27,6 +29,12 @@ public function __construct(array $loggers = []) */ public function addLogger(SQLLogger $logger) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3572', + 'LoggerChain::addLogger() is deprecated, use LoggerChain constructor instead.' + ); + $this->loggers[] = $logger; }