1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-06 21:26:43 +02:00
Replaces is_null($var) expression with null === $var.
This commit is contained in:
Mathias Reker ⚡️
2022-06-21 22:21:02 +02:00
committed by GitHub
parent 3cba75ec09
commit 100d0f1625
2 changed files with 4 additions and 4 deletions

View File

@@ -71,11 +71,11 @@ class GelfMessageFormatter extends NormalizerFormatter
parent::__construct('U.u');
$this->systemName = (is_null($systemName) || $systemName === '') ? (string) gethostname() : $systemName;
$this->systemName = (null === $systemName || $systemName === '') ? (string) gethostname() : $systemName;
$this->extraPrefix = is_null($extraPrefix) ? '' : $extraPrefix;
$this->extraPrefix = null === $extraPrefix ? '' : $extraPrefix;
$this->contextPrefix = $contextPrefix;
$this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength;
$this->maxLength = null === $maxLength ? self::DEFAULT_MAX_LENGTH : $maxLength;
}
/**

View File

@@ -57,7 +57,7 @@ class PsrLogMessageProcessor implements ProcessorInterface
continue;
}
if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
if (null === $val || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
$replacements[$placeholder] = $val;
} elseif ($val instanceof \DateTimeInterface) {
if (null === $this->dateFormat && $val instanceof \Monolog\DateTimeImmutable) {