mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-21 16:46:11 +02:00
Refactored the AbstractHandler to avoid having some dummy write() methods
This commit is contained in:
@@ -23,7 +23,7 @@ class GroupHandler extends AbstractHandler
|
||||
protected $handlers;
|
||||
|
||||
/**
|
||||
* @param Array $handlers Array of Handlers or factory callbacks($record, $fingersCrossedHandler).
|
||||
* @param array $handlers Array of Handlers.
|
||||
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
*/
|
||||
public function __construct(array $handlers, $bubble = false)
|
||||
@@ -31,7 +31,15 @@ class GroupHandler extends AbstractHandler
|
||||
$this->handlers = $handlers;
|
||||
$this->bubble = $bubble;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isHandling(array $record)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -52,12 +60,4 @@ class GroupHandler extends AbstractHandler
|
||||
$handler->handleBatch($records);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implemented to comply with the AbstractHandler requirements. Can not be called.
|
||||
*/
|
||||
protected function write(array $record)
|
||||
{
|
||||
throw new \BadMethodCallException('This method should not be called directly on the GroupHandler.');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user