From 2d93a341d73f8d20127f7063892123087c379f5e Mon Sep 17 00:00:00 2001 From: Santiago San Martin Date: Thu, 10 Jul 2025 19:07:28 -0300 Subject: [PATCH] [Serializer] type: align with interface signature for denormalize methods --- serializer/custom_context_builders.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serializer/custom_context_builders.rst b/serializer/custom_context_builders.rst index acb6a8b6ee3..9d7b925480e 100644 --- a/serializer/custom_context_builders.rst +++ b/serializer/custom_context_builders.rst @@ -31,7 +31,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; @@ -42,7 +42,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);