Merge branch '6.4' into 7.2

* 6.4:
  [Serializer] type: align with interface signature for denormalize methods
This commit is contained in:
Javier Eguiluz
2025-07-11 17:22:09 +02:00

View File

@@ -27,7 +27,7 @@ value is ``0000-00-00``. To do that you'll first have to create your normalizer:
{
use DenormalizerAwareTrait;
public function denormalize($data, string $type, ?string $format = null, array $context = []): mixed
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
{
if ('0000-00-00' === $data) {
return null;
@@ -38,7 +38,7 @@ value is ``0000-00-00``. To do that you'll first have to create your normalizer:
return $this->denormalizer->denormalize($data, $type, $format, $context);
}
public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
return true === ($context['zero_datetime_to_null'] ?? false)
&& is_a($type, \DateTimeInterface::class, true);