mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-23 17:46:09 +02:00
Improve build
This commit is contained in:
@@ -202,9 +202,14 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa
|
||||
*/
|
||||
public function setFormatter(FormatterInterface $formatter): HandlerInterface
|
||||
{
|
||||
$this->getHandler()->setFormatter($formatter);
|
||||
$handler = $this->getHandler();
|
||||
if ($handler instanceof FormattableHandlerInterface) {
|
||||
$handler->setFormatter($formatter);
|
||||
|
||||
return $this;
|
||||
return $this;
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,6 +217,11 @@ class FingersCrossedHandler extends Handler implements ProcessableHandlerInterfa
|
||||
*/
|
||||
public function getFormatter(): FormatterInterface
|
||||
{
|
||||
return $this->getHandler()->getFormatter();
|
||||
$handler = $this->getHandler();
|
||||
if ($handler instanceof FormattableHandlerInterface) {
|
||||
return $handler->getFormatter();
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException('The nested handler of type '.get_class($handler).' does not support formatters.');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user