diff --git a/UPGRADE.md b/UPGRADE.md index ad366845ef7..a8e2b7f879e 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -42,6 +42,10 @@ The `Doctrine\DBAL\Driver\SQLSrv\SQLSrvStatement::LAST_INSERT_ID_SQL` constant The constants in `Doctrine\DBAL\SQLParserUtils` have been deprecated and will be made private in 3.0. +## Deprecated `LoggerChain::addLogger` method + +The `Doctrine\DBAL\Logging\LoggerChain::addLogger` method has been deprecated. Inject list of loggers via constructor instead. + # Upgrade to 2.9 ## Deprecated `Statement::fetchColumn()` with an invalid index diff --git a/lib/Doctrine/DBAL/Logging/LoggerChain.php b/lib/Doctrine/DBAL/Logging/LoggerChain.php index 2b5404b25c7..024afae283a 100644 --- a/lib/Doctrine/DBAL/Logging/LoggerChain.php +++ b/lib/Doctrine/DBAL/Logging/LoggerChain.php @@ -10,9 +10,19 @@ class LoggerChain implements SQLLogger /** @var SQLLogger[] */ private $loggers = []; + /** + * @param SQLLogger[] $loggers + */ + public function __construct(array $loggers = []) + { + $this->loggers = $loggers; + } + /** * Adds a logger in the chain. * + * @deprecated Inject list of loggers via constructor instead + * * @return void */ public function addLogger(SQLLogger $logger)