mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 00:56:08 +02:00
Add a bunch of return types and fix type inconsistencies reports from phan
This commit is contained in:
@@ -42,17 +42,17 @@ class LogstashFormatter extends NormalizerFormatter
|
||||
protected $contextKey;
|
||||
|
||||
/**
|
||||
* @param string $applicationName the application that sends the data, used as the "type" field of logstash
|
||||
* @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine
|
||||
* @param string $extraKey the key for extra keys inside logstash "fields", defaults to extra
|
||||
* @param string $contextKey the key for context keys inside logstash "fields", defaults to context
|
||||
* @param string $applicationName the application that sends the data, used as the "type" field of logstash
|
||||
* @param ?string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine
|
||||
* @param string $extraKey the key for extra keys inside logstash "fields", defaults to extra
|
||||
* @param string $contextKey the key for context keys inside logstash "fields", defaults to context
|
||||
*/
|
||||
public function __construct(string $applicationName, string $systemName = null, string $extraKey = 'extra', string $contextKey = 'context')
|
||||
public function __construct(string $applicationName, ?string $systemName = null, string $extraKey = 'extra', string $contextKey = 'context')
|
||||
{
|
||||
// logstash requires a ISO 8601 format date with optional millisecond precision.
|
||||
parent::__construct('Y-m-d\TH:i:s.uP');
|
||||
|
||||
$this->systemName = $systemName ?: gethostname();
|
||||
$this->systemName = $systemName === null ? gethostname() : $systemName;
|
||||
$this->applicationName = $applicationName;
|
||||
$this->extraKey = $extraKey;
|
||||
$this->contextKey = $contextKey;
|
||||
|
Reference in New Issue
Block a user