From e26ff94f54c2c0c94d742714ed37b50835f2bc34 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Thu, 12 Jun 2025 09:41:32 +0200 Subject: [PATCH] [Serializer] improve phpdoc for normalizer --- .../Normalizer/DenormalizerInterface.php | 15 ++++++++------- .../Serializer/Normalizer/NormalizerInterface.php | 11 ++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php index 23ee3928a7c69..f46c2085677b7 100644 --- a/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/DenormalizerInterface.php @@ -29,10 +29,10 @@ interface DenormalizerInterface /** * Denormalizes data back into an object of the given class. * - * @param mixed $data Data to restore - * @param string $type The expected class to instantiate - * @param string|null $format Format the given data was extracted from - * @param array $context Options available to the denormalizer + * @param mixed $data Data to restore + * @param string $type The expected class to instantiate + * @param string|null $format Format the given data was extracted from + * @param array $context Options available to the denormalizer * * @throws BadMethodCallException Occurs when the normalizer is not called in an expected context * @throws InvalidArgumentException Occurs when the arguments are not coherent or not supported @@ -47,9 +47,10 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a /** * Checks whether the given class is supported for denormalization by this normalizer. * - * @param mixed $data Data to denormalize from - * @param string $type The class to which the data should be denormalized - * @param string|null $format The format being deserialized from + * @param mixed $data Data to denormalize from + * @param string $type The class to which the data should be denormalized + * @param string|null $format The format being deserialized from + * @param array $context Options available to the denormalizer */ public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool; diff --git a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php index bbc8a94e79da6..ea28b85818ae4 100644 --- a/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php +++ b/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php @@ -24,9 +24,9 @@ interface NormalizerInterface /** * Normalizes data into a set of arrays/scalars. * - * @param mixed $data Data to normalize - * @param string|null $format Format the normalization result will be encoded as - * @param array $context Context options for the normalizer + * @param mixed $data Data to normalize + * @param string|null $format Format the normalization result will be encoded as + * @param array $context Context options for the normalizer * * @return array|string|int|float|bool|\ArrayObject|null \ArrayObject is used to make sure an empty object is encoded as an object not an array * @@ -41,8 +41,9 @@ public function normalize(mixed $data, ?string $format = null, array $context = /** * Checks whether the given class is supported for normalization by this normalizer. * - * @param mixed $data Data to normalize - * @param string|null $format The format being (de-)serialized from or into + * @param mixed $data Data to normalize + * @param string|null $format The format being (de-)serialized from or into + * @param array $context Context options for the normalizer */ public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool;