Fixed wrong signature of UTCDateTimeType

This commit is contained in:
Jan Böhmer 2024-06-09 23:15:14 +02:00
parent 205d5f8f58
commit 43ca543651

View file

@ -64,11 +64,11 @@ class UTCDateTimeType extends DateTimeType
* *
* @param T $value * @param T $value
* *
* @return (T is null ? null : DateTimeInterface) * @return DateTime|(T is null ? null : DateTimeInterface)
* *
* @template T * @template T
*/ */
public function convertToPHPValue($value, AbstractPlatform $platform): ?\DateTimeInterface public function convertToPHPValue($value, AbstractPlatform $platform): ?DateTime
{ {
if (!self::$utc_timezone instanceof \DateTimeZone) { if (!self::$utc_timezone instanceof \DateTimeZone) {
self::$utc_timezone = new DateTimeZone('UTC'); self::$utc_timezone = new DateTimeZone('UTC');
@ -85,7 +85,7 @@ class UTCDateTimeType extends DateTimeType
); );
if (!$converted) { if (!$converted) {
throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeFormatString()); throw new ConversionException("Failed to convert PHP value to a DateTime object.");
} }
return $converted; return $converted;