Skip to content

Commit

Permalink
Merge pull request doctrine#3584 from ostrolucky/rem-addlogger
Browse files Browse the repository at this point in the history
Remove LoggerChain::addLogger
  • Loading branch information
morozov committed Aug 26, 2019
2 parents 7becd18 + 4ed5309 commit 3f0a0df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
1 change: 1 addition & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,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.
Expand Down
16 changes: 3 additions & 13 deletions lib/Doctrine/DBAL/Logging/LoggerChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,17 @@
*/
final 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
*/
public function addLogger(SQLLogger $logger) : void
{
$this->loggers[] = $logger;
}

/**
* {@inheritdoc}
*/
Expand Down
7 changes: 2 additions & 5 deletions tests/Doctrine/Tests/DBAL/Logging/LoggerChainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@ public function testStopQuery() : void
*/
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;
}

/**
Expand Down

0 comments on commit 3f0a0df

Please sign in to comment.