1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 09:06:10 +02:00

Use fully-qualified name for native functions (#1887)

This commit is contained in:
Christoph Dreis
2024-06-28 10:45:25 +02:00
committed by GitHub
parent 4e03d25f6d
commit 3ba77d1d39
90 changed files with 246 additions and 245 deletions

View File

@@ -57,7 +57,7 @@ class PsrLogMessageProcessor implements ProcessorInterface
continue;
}
if (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) {
@@ -69,12 +69,12 @@ class PsrLogMessageProcessor implements ProcessorInterface
}
} elseif ($val instanceof \UnitEnum) {
$replacements[$placeholder] = $val instanceof \BackedEnum ? $val->value : $val->name;
} elseif (is_object($val)) {
} elseif (\is_object($val)) {
$replacements[$placeholder] = '[object '.Utils::getClass($val).']';
} elseif (is_array($val)) {
} elseif (\is_array($val)) {
$replacements[$placeholder] = 'array'.Utils::jsonEncode($val, null, true);
} else {
$replacements[$placeholder] = '['.gettype($val).']';
$replacements[$placeholder] = '['.\gettype($val).']';
}
if ($this->removeUsedContextFields) {