From 7f777ae72fecc30c54e24a70110ce04279a35126 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; }