mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-03 19:57:41 +02:00
CS fixes, refs #326
This commit is contained in:
@@ -39,15 +39,8 @@ class GelfHandler extends AbstractProcessingHandler
|
|||||||
{
|
{
|
||||||
parent::__construct($level, $bubble);
|
parent::__construct($level, $bubble);
|
||||||
|
|
||||||
$validPublisher = false;
|
if (!$publisher instanceof IMessagePublisher && !$publisher instanceof PublisherInterface) {
|
||||||
if (interface_exists('\Gelf\IMessagePublisher') && $publisher instanceof IMessagePublisher) {
|
throw new InvalidArgumentException("Invalid publisher, expected a Gelf\IMessagePublisher or Gelf\PublisherInterface instance");
|
||||||
$validPublisher = true;
|
|
||||||
} elseif (interface_exists('\Gelf\PublisherInterface') && $publisher instanceof PublisherInterface) {
|
|
||||||
$validPublisher = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$validPublisher) {
|
|
||||||
throw new InvalidArgumentException("Invalid publisher");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->publisher = $publisher;
|
$this->publisher = $publisher;
|
||||||
|
@@ -20,7 +20,7 @@ class GelfHandlerLegacyTest extends TestCase
|
|||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (!class_exists('\Gelf\MessagePublisher') || !class_exists('\Gelf\Message')) {
|
if (!class_exists('Gelf\MessagePublisher') || !class_exists('Gelf\Message')) {
|
||||||
$this->markTestSkipped("mlehner/gelf-php not installed");
|
$this->markTestSkipped("mlehner/gelf-php not installed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@ class GelfHandlerTest extends TestCase
|
|||||||
{
|
{
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (!class_exists('\Gelf\Publisher') || !class_exists('\Gelf\Message')) {
|
if (!class_exists('Gelf\Publisher') || !class_exists('Gelf\Message')) {
|
||||||
$this->markTestSkipped("graylog2/gelf-php not installed");
|
$this->markTestSkipped("graylog2/gelf-php not installed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ class GelfHandlerTest extends TestCase
|
|||||||
|
|
||||||
protected function getMessagePublisher()
|
protected function getMessagePublisher()
|
||||||
{
|
{
|
||||||
return $this->getMock('\Gelf\Publisher', array('publish'), array(), '', false);
|
return $this->getMock('Gelf\Publisher', array('publish'), array(), '', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDebug()
|
public function testDebug()
|
||||||
|
Reference in New Issue
Block a user