mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 09:06:10 +02:00
Add phpstan strict rules and deprecation rules, fix all related issues
This commit is contained in:
@@ -60,12 +60,12 @@ class PsrLogMessageProcessor implements ProcessorInterface
|
||||
if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
|
||||
$replacements[$placeholder] = $val;
|
||||
} elseif ($val instanceof \DateTimeInterface) {
|
||||
if (!$this->dateFormat && $val instanceof \Monolog\DateTimeImmutable) {
|
||||
if (null === $this->dateFormat && $val instanceof \Monolog\DateTimeImmutable) {
|
||||
// handle monolog dates using __toString if no specific dateFormat was asked for
|
||||
// so that it follows the useMicroseconds flag
|
||||
$replacements[$placeholder] = (string) $val;
|
||||
} else {
|
||||
$replacements[$placeholder] = $val->format($this->dateFormat ?: static::SIMPLE_DATE);
|
||||
$replacements[$placeholder] = $val->format($this->dateFormat ?? static::SIMPLE_DATE);
|
||||
}
|
||||
} elseif (is_object($val)) {
|
||||
$replacements[$placeholder] = '[object '.Utils::getClass($val).']';
|
||||
|
Reference in New Issue
Block a user