Skip to content

Commit

Permalink
Make LoggerChain use constructor to add loggers instead of adder method
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrolucky committed May 30, 2019
1 parent a2450fb commit c532471
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/Doctrine/DBAL/Logging/LoggerChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@
*/
class LoggerChain implements SQLLogger
{
/** @var SQLLogger[] */
/** @var iterable<SQLLogger> */
private $loggers = [];

/**
* @param SQLLogger[] $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)
Expand Down

0 comments on commit c532471

Please sign in to comment.