1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-09-01 17:12:41 +02:00

Last phpstan fixes

This commit is contained in:
Jordi Boggiano
2021-07-05 13:24:06 +02:00
parent 172287ba93
commit a6eef7298c
5 changed files with 11 additions and 8 deletions

View File

@@ -172,11 +172,14 @@ class NormalizerFormatter implements FormatterInterface
}
if ($data instanceof \JsonSerializable) {
/** @var null|scalar|array<array|scalar|null> $value */
$value = $data->jsonSerialize();
} elseif (method_exists($data, '__toString')) {
/** @var string $value */
$value = $data->__toString();
} else {
// the rest is normalized by json encoding and decoding it
/** @var null|scalar|array<array|scalar|null> $value */
$value = json_decode($this->toJson($data, true), true);
}

View File

@@ -74,8 +74,6 @@ class FirePHPHandler extends AbstractProcessingHandler
{
$header = sprintf('%s-%s', static::HEADER_PREFIX, join('-', $meta));
// See https://github.com/phpstan/phpstan/issues/5219
// @phpstan-ignore-next-line
return [$header => $message];
}

View File

@@ -436,7 +436,6 @@ class Logger implements LoggerInterface, ResettableInterface
throw new InvalidArgumentException('Level "'.var_export($level, true).'" is not defined, use one of: '.implode(', ', array_keys(static::$levels) + static::$levels));
}
/** @phpstan-ignore-next-line */
return $level;
}