fix phpstan and phpcs

This commit is contained in:
Julien Fastré 2022-04-06 13:59:05 +02:00
parent 8edc68859e
commit 612d053892

View File

@ -45,12 +45,17 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
switch ($type) {
case DateTime::class:
$result = DateTime::createFromFormat(DateTimeInterface::ISO8601, $data['datetime']);
break;
case DateTimeInterface::class:
case DateTimeImmutable::class:
$result = DateTimeImmutable::createFromFormat(DateTimeInterface::ISO8601, $data['datetime']);
break;
default:
throw new UnexpectedValueException();
}
if (false === $result) {
@ -58,8 +63,6 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt
}
return $result;
throw new UnexpectedValueException();
}
public function normalize($date, $format = null, array $context = [])