From 1a8f8efa23fc52c0d153d7ec8acc81fc570e7ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 6 Oct 2022 23:16:50 +0200 Subject: [PATCH] DX: remove call to deprecated method --- .../Doctrine/Type/NativeDateIntervalType.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php b/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php index 432c53aad..896ddb600 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php @@ -17,6 +17,7 @@ use Doctrine\DBAL\Types\ConversionException; use Doctrine\DBAL\Types\DateIntervalType; use Exception; +use LogicException; use function count; use function current; use function preg_match; @@ -40,7 +41,7 @@ class NativeDateIntervalType extends DateIntervalType return $value->format(self::FORMAT); } - throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'DateInterval']); + throw ConversionException::conversionFailedInvalidType($value, 'string', ['null', 'DateInterval']); } public function convertToPHPValue($value, AbstractPlatform $platform) @@ -80,7 +81,7 @@ class NativeDateIntervalType extends DateIntervalType protected function createConversionException($value, $exception = null) { - return ConversionException::conversionFailedFormat($value, $this->getName(), 'xx year xx mons xx days 01:02:03', $exception); + return ConversionException::conversionFailedFormat($value, 'string', 'xx year xx mons xx days 01:02:03', $exception); } private function convertEntry(&$strings) @@ -125,5 +126,7 @@ class NativeDateIntervalType extends DateIntervalType return $intervalSpec; } + + throw new LogicException(); } }