DX: remove call to deprecated method

This commit is contained in:
Julien Fastré 2022-10-06 23:16:50 +02:00
parent 7e1d07f1ff
commit 1a8f8efa23

View File

@ -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();
}
}