mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 00:56:08 +02:00
Wrap up type-hint adding to all handlers
This commit is contained in:
@@ -25,14 +25,14 @@ class SyslogUdpHandler extends AbstractSyslogHandler
|
||||
protected $ident;
|
||||
|
||||
/**
|
||||
* @param string $host
|
||||
* @param int $port
|
||||
* @param mixed $facility
|
||||
* @param int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
* @param string $ident Program name or tag for each log message.
|
||||
* @param string $host
|
||||
* @param int $port
|
||||
* @param string|int $facility Either one of the names of the keys in $this->facilities, or a LOG_* facility constant
|
||||
* @param string|int $level The minimum logging level at which this handler will be triggered
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
||||
* @param string $ident Program name or tag for each log message.
|
||||
*/
|
||||
public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true, $ident = 'php')
|
||||
public function __construct(string $host, int $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, bool $bubble = true, string $ident = 'php')
|
||||
{
|
||||
parent::__construct($facility, $level, $bubble);
|
||||
|
||||
@@ -69,7 +69,7 @@ class SyslogUdpHandler extends AbstractSyslogHandler
|
||||
/**
|
||||
* Make common syslog header (see rfc5424)
|
||||
*/
|
||||
protected function makeCommonSyslogHeader($severity): string
|
||||
protected function makeCommonSyslogHeader(int $severity): string
|
||||
{
|
||||
$priority = $severity + $this->facility;
|
||||
|
||||
@@ -88,7 +88,7 @@ class SyslogUdpHandler extends AbstractSyslogHandler
|
||||
$pid . " - - ";
|
||||
}
|
||||
|
||||
protected function getDateTime()
|
||||
protected function getDateTime(): string
|
||||
{
|
||||
return date(\DateTime::RFC3339);
|
||||
}
|
||||
@@ -96,8 +96,10 @@ class SyslogUdpHandler extends AbstractSyslogHandler
|
||||
/**
|
||||
* Inject your own socket, mainly used for testing
|
||||
*/
|
||||
public function setSocket(UdpSocket $socket)
|
||||
public function setSocket(UdpSocket $socket): self
|
||||
{
|
||||
$this->socket = $socket;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user