mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-20 08:06:19 +02:00
Coding style fixes
This commit is contained in:
@@ -29,7 +29,6 @@ use Monolog\Logger;
|
|||||||
*/
|
*/
|
||||||
class SyslogHandler extends AbstractHandler
|
class SyslogHandler extends AbstractHandler
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translate Monolog log levels to syslog log priorities.
|
* Translate Monolog log levels to syslog log priorities.
|
||||||
*/
|
*/
|
||||||
@@ -73,11 +72,11 @@ class SyslogHandler extends AbstractHandler
|
|||||||
if (array_key_exists(strtolower($facility), $this->facilities)) {
|
if (array_key_exists(strtolower($facility), $this->facilities)) {
|
||||||
$facility = $this->facilities[strtolower($facility)];
|
$facility = $this->facilities[strtolower($facility)];
|
||||||
} else if (!in_array($facility, array_values($this->facilities), true)) {
|
} else if (!in_array($facility, array_values($this->facilities), true)) {
|
||||||
throw new \UnexpectedValueException('unknown facility value "'.$facility.'" given');
|
throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!openlog($ident, LOG_PID, $facility)) {
|
if (!openlog($ident, LOG_PID, $facility)) {
|
||||||
throw new \LogicException('can\'t open syslog for ident "'.$ident.'" and facility "'.$facility.'"');
|
throw new \LogicException('Can\'t open syslog for ident "'.$ident.'" and facility "'.$facility.'"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,7 +25,6 @@ class SyslogHandlerTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$handler = new SyslogHandler('test', 'local1');
|
$handler = new SyslogHandler('test', 'local1');
|
||||||
$this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
|
$this->assertInstanceOf('Monolog\Handler\SyslogHandler', $handler);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testConstructInvalidFacility()
|
public function testConstructInvalidFacility()
|
||||||
@@ -33,5 +32,4 @@ class SyslogHandlerTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->setExpectedException('UnexpectedValueException');
|
$this->setExpectedException('UnexpectedValueException');
|
||||||
$handler = new SyslogHandler('test', 'unknown');
|
$handler = new SyslogHandler('test', 'unknown');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user