Skip to content

Commit 3f4ef4b

Browse files
committed
minor #21201 [Serializer] type: align with interface signature for denormalize methods (santysisi)
This PR was merged into the 6.4 branch. Discussion ---------- [Serializer] type: align with interface signature for denormalize methods ### Minor Updated method signatures in ZeroDateTimeDenormalizer to use mixed type for $data, aligning with the [DenormalizerInterface](https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php) definition in Symfony. No functional changes. Commits ------- 2d93a34 [Serializer] type: align with interface signature for denormalize methods
2 parents f537ade + 2d93a34 commit 3f4ef4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

serializer/custom_context_builders.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ value is ``0000-00-00``. To do that you'll first have to create your normalizer:
3131
{
3232
use DenormalizerAwareTrait;
3333

34-
public function denormalize($data, string $type, ?string $format = null, array $context = []): mixed
34+
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
3535
{
3636
if ('0000-00-00' === $data) {
3737
return null;
@@ -42,7 +42,7 @@ value is ``0000-00-00``. To do that you'll first have to create your normalizer:
4242
return $this->denormalizer->denormalize($data, $type, $format, $context);
4343
}
4444

45-
public function supportsDenormalization($data, string $type, ?string $format = null, array $context = []): bool
45+
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
4646
{
4747
return true === ($context['zero_datetime_to_null'] ?? false)
4848
&& is_a($type, \DateTimeInterface::class, true);

0 commit comments

Comments
 (0)