Skip to content

Commit 09d6556

Browse files
committed
Fixed deprecation issue from UTCDateTimeType Doctrine custom type
1 parent f40023b commit 09d6556

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Doctrine/DBAL/Types/UTCDateTimeType.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use DateTime;
1212
use DateTimeInterface;
1313
use DateTimeZone;
14+
use Doctrine\DBAL\Exception;
1415
use Doctrine\DBAL\Platforms\AbstractPlatform;
1516
use Doctrine\DBAL\Types\ConversionException;
1617
use Doctrine\DBAL\Types\DateTimeType;
@@ -47,6 +48,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform): stri
4748
* @template T
4849
*
4950
* @throws ConversionException
51+
* @throws Exception
5052
*/
5153
public function convertToPHPValue($value, AbstractPlatform $platform): DateTimeInterface|null
5254
{
@@ -77,6 +79,7 @@ private function getUtcDateTimeZone(): DateTimeZone
7779
* Method to check if conversion was successfully or not.
7880
*
7981
* @throws ConversionException
82+
* @throws Exception
8083
*/
8184
private function checkConvertedValue(string $value, AbstractPlatform $platform, ?DateTime $converted): DateTime
8285
{
@@ -86,7 +89,7 @@ private function checkConvertedValue(string $value, AbstractPlatform $platform,
8689

8790
throw ConversionException::conversionFailedFormat(
8891
$value,
89-
$this->getName(),
92+
self::lookupName($this),
9093
$platform->getDateTimeFormatString()
9194
);
9295
}

0 commit comments

Comments
 (0)