summaryrefslogtreecommitdiffstats
path: root/src/Monolog/DateTimeImmutable.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Monolog/DateTimeImmutable.php')
-rw-r--r--src/Monolog/DateTimeImmutable.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Monolog/DateTimeImmutable.php b/src/Monolog/DateTimeImmutable.php
index 6187c5a..f1536f4 100644
--- a/src/Monolog/DateTimeImmutable.php
+++ b/src/Monolog/DateTimeImmutable.php
@@ -34,10 +34,7 @@ class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
$this->useMicroseconds = $useMicroseconds;
}
- /**
- * @return string
- */
- public function jsonSerialize()
+ public function jsonSerialize(): string
{
if ($this->useMicroseconds) {
return $this->format('Y-m-d\TH:i:s.uP');
@@ -45,4 +42,9 @@ class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
return $this->format('Y-m-d\TH:i:sP');
}
+
+ public function __toString(): string
+ {
+ return $this->jsonSerialize();
+ }
}