mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-24 01:56:18 +02:00
Switch to DateTimeImmutable everywhere
This commit is contained in:
@@ -37,7 +37,7 @@ class LogglyFormatter extends JsonFormatter
|
||||
*/
|
||||
public function format(array $record)
|
||||
{
|
||||
if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) {
|
||||
if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTimeInterface)) {
|
||||
$record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
|
||||
unset($record["datetime"]);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class NormalizerFormatter implements FormatterInterface
|
||||
return $normalized;
|
||||
}
|
||||
|
||||
if ($data instanceof \DateTime) {
|
||||
if ($data instanceof \DateTimeInterface) {
|
||||
return $data->format($this->dateFormat);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ class WildfireFormatter extends NormalizerFormatter
|
||||
|
||||
protected function normalize($data)
|
||||
{
|
||||
if (is_object($data) && !$data instanceof \DateTime) {
|
||||
if (is_object($data) && !$data instanceof \DateTimeInterface) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user