Unverified Commit d04026ff authored by Sergei Morozov's avatar Sergei Morozov

Merge pull request #3584 from ostrolucky/rem-addlogger

Remove LoggerChain::addLogger
parents 72a5e9ff c244c4e3
...@@ -53,6 +53,7 @@ The `Doctrine\DBAL\Driver::getName()` has been removed. ...@@ -53,6 +53,7 @@ The `Doctrine\DBAL\Driver::getName()` has been removed.
* Removed `Table::addUnnamedForeignKeyConstraint()` and `Table::addNamedForeignKeyConstraint()`. * Removed `Table::addUnnamedForeignKeyConstraint()` and `Table::addNamedForeignKeyConstraint()`.
* Removed `Table::renameColumn()`. * Removed `Table::renameColumn()`.
* Removed `SQLParserUtils::getPlaceholderPositions()`. * Removed `SQLParserUtils::getPlaceholderPositions()`.
* Removed `LoggerChain::addLogger`.
* Removed `AbstractSchemaManager::getFilterSchemaAssetsExpression()`, `Configuration::getFilterSchemaAssetsExpression()` * Removed `AbstractSchemaManager::getFilterSchemaAssetsExpression()`, `Configuration::getFilterSchemaAssetsExpression()`
and `Configuration::getFilterSchemaAssetsExpression()`. and `Configuration::getFilterSchemaAssetsExpression()`.
* `SQLParserUtils::*_TOKEN` constants made private. * `SQLParserUtils::*_TOKEN` constants made private.
......
...@@ -9,27 +9,17 @@ namespace Doctrine\DBAL\Logging; ...@@ -9,27 +9,17 @@ namespace Doctrine\DBAL\Logging;
*/ */
final class LoggerChain implements SQLLogger final class LoggerChain implements SQLLogger
{ {
/** @var SQLLogger[] */ /** @var iterable<SQLLogger> */
private $loggers = []; private $loggers = [];
/** /**
* @param SQLLogger[] $loggers * @param iterable<SQLLogger> $loggers
*/ */
public function __construct(array $loggers = []) public function __construct(iterable $loggers = [])
{ {
$this->loggers = $loggers; $this->loggers = $loggers;
} }
/**
* Adds a logger in the chain.
*
* @deprecated Inject list of loggers via constructor instead
*/
public function addLogger(SQLLogger $logger) : void
{
$this->loggers[] = $logger;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
......
...@@ -32,13 +32,10 @@ class LoggerChainTest extends TestCase ...@@ -32,13 +32,10 @@ class LoggerChainTest extends TestCase
*/ */
private function createChain(string $method, ...$args) : LoggerChain private function createChain(string $method, ...$args) : LoggerChain
{ {
$chain = new LoggerChain([ return new LoggerChain([
$this->createLogger($method, ...$args),
$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