1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 12:47:39 +02:00

Make sure flowdock handler is configured correctly, fixes #597

This commit is contained in:
Jordi Boggiano
2015-07-12 11:20:49 +01:00
parent 43affa31c3
commit d17cf064af

View File

@@ -12,6 +12,7 @@
namespace Monolog\Handler;
use Monolog\Logger;
use Monolog\Formatter\FlowdockFormatter;
/**
* Sends notifications through the Flowdock push API
@@ -48,6 +49,28 @@ class FlowdockHandler extends SocketHandler
$this->apiToken = $apiToken;
}
/**
* {@inheritdoc}
*/
public function setFormatter(FormatterInterface $formatter)
{
if (!$formatter instanceof FlowdockFormatter) {
throw new \InvalidArgumentException('The FlowdockHandler requires an instance of Monolog\Formatter\FlowdockFormatter to function correctly');
}
return parent::setFormatter($formatter);
}
/**
* Gets the default formatter.
*
* @return FormatterInterface
*/
protected function getDefaultFormatter()
{
throw new \InvalidArgumentException('The FlowdockHandler must be configured (via setFormatter) with an instance of Monolog\Formatter\FlowdockFormatter to function correctly');
}
/**
* {@inheritdoc}
*