From 0c1052e2eb97c66467084cf646227799c7720f1e Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Tue, 15 Jun 2021 16:03:56 +0200 Subject: [PATCH 1/2] Fix DateTimeImmutable::createFromFormat for PHP 8 --- lib/DateTimeImmutable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DateTimeImmutable.php b/lib/DateTimeImmutable.php index 114ec3a3..3ce8b103 100644 --- a/lib/DateTimeImmutable.php +++ b/lib/DateTimeImmutable.php @@ -57,7 +57,7 @@ public function getInnerDateTime(): \DateTimeImmutable */ public static function createFromFormat($format, $time, $timezone = null): self { - $datetime = parent::createFromFormat($format, $time, $timezone); + $datetime = \DateTimeImmutable::createFromFormat($format, $time, $timezone); if ($datetime === false) { throw DatetimeException::createFromPhpError(); } From 98cb134fbbdde154711b22b28115b960cccf1ac7 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Tue, 15 Jun 2021 16:08:03 +0200 Subject: [PATCH 2/2] @Jean85 Fix DateTime::createFromFormat for PHP 8 --- lib/DateTime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DateTime.php b/lib/DateTime.php index 581ef35c..56eb809f 100644 --- a/lib/DateTime.php +++ b/lib/DateTime.php @@ -24,7 +24,7 @@ private static function createFromRegular(\DateTime $datetime): self */ public static function createFromFormat($format, $time, $timezone = null): self { - $datetime = parent::createFromFormat($format, $time, $timezone); + $datetime = \DateTime::createFromFormat($format, $time, $timezone); if ($datetime === false) { throw DatetimeException::createFromPhpError(); }