Unverified Commit 06dc97e0 authored by Gabriel Ostrolucký's avatar Gabriel Ostrolucký Committed by Sergei Morozov

Remove LoggerChain::addLogger

parent 23e8d5d7
......@@ -42,6 +42,7 @@ The `Doctrine\DBAL\Driver::getName()` has been removed.
* Removed `Table::addUnnamedForeignKeyConstraint()` and `Table::addNamedForeignKeyConstraint()`.
* Removed `Table::renameColumn()`.
* Removed `SQLParserUtils::getPlaceholderPositions()`.
* Removed `LoggerChain::addLogger`.
* Removed `AbstractSchemaManager::getFilterSchemaAssetsExpression()`, `Configuration::getFilterSchemaAssetsExpression()`
and `Configuration::getFilterSchemaAssetsExpression()`.
* `SQLParserUtils::*_TOKEN` constants made private.
......
......@@ -7,29 +7,17 @@ namespace Doctrine\DBAL\Logging;
*/
class LoggerChain implements SQLLogger
{
/** @var SQLLogger[] */
/** @var iterable<SQLLogger> */
private $loggers = [];
/**
* @param SQLLogger[] $loggers
* @param iterable<SQLLogger> $loggers
*/
public function __construct(array $loggers = [])
public function __construct(iterable $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)
{
$this->loggers[] = $logger;
}
/**
* {@inheritdoc}
*/
......
......@@ -32,13 +32,10 @@ class LoggerChainTest extends TestCase
*/
private function createChain(string $method, ...$args): LoggerChain
{
$chain = new LoggerChain([
return new LoggerChain([
$this->createLogger($method, ...$args),
$this->createLogger($method, ...$args),
]);
$chain->addLogger($this->createLogger($method, ...$args));
return $chain;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment