diff --git a/Normalizer/CustomNormalizer.php b/Normalizer/CustomNormalizer.php index 44ad1771b..ebe2f0f69 100644 --- a/Normalizer/CustomNormalizer.php +++ b/Normalizer/CustomNormalizer.php @@ -44,8 +44,8 @@ public function denormalize($data, string $type, string $format = null, array $c /** * Checks if the given class implements the NormalizableInterface. * - * @param mixed $data Data to normalize - * @param string $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 * * @return bool */ @@ -57,9 +57,9 @@ public function supportsNormalization($data, string $format = null) /** * Checks if the given class implements the DenormalizableInterface. * - * @param mixed $data Data to denormalize from - * @param string $type The class to which the data should be denormalized - * @param string $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 * * @return bool */ diff --git a/Normalizer/DenormalizerInterface.php b/Normalizer/DenormalizerInterface.php index 5b7d7f228..e3f7113b1 100644 --- a/Normalizer/DenormalizerInterface.php +++ b/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 $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 * * @return mixed * @@ -49,9 +49,9 @@ public function denormalize($data, string $type, string $format = null, array $c /** * 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 $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 * * @return bool */ diff --git a/Normalizer/NormalizerInterface.php b/Normalizer/NormalizerInterface.php index 653f94954..b282f1dd6 100644 --- a/Normalizer/NormalizerInterface.php +++ b/Normalizer/NormalizerInterface.php @@ -24,9 +24,9 @@ interface NormalizerInterface /** * Normalizes an object into a set of arrays/scalars. * - * @param mixed $object Object to normalize - * @param string $format Format the normalization result will be encoded as - * @param array $context Context options for the normalizer + * @param mixed $object Object 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,8 @@ public function normalize($object, 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 $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 * * @return bool */ diff --git a/Serializer.php b/Serializer.php index d5fda3b8c..c0a49a808 100644 --- a/Serializer.php +++ b/Serializer.php @@ -257,9 +257,9 @@ public function supportsDenormalization($data, string $type, string $format = nu /** * Returns a matching normalizer. * - * @param mixed $data Data to get the serializer for - * @param string $format Format name, present to give the option to normalizers to act differently based on formats - * @param array $context Options available to the normalizer + * @param mixed $data Data to get the serializer for + * @param string|null $format Format name, present to give the option to normalizers to act differently based on formats + * @param array $context Options available to the normalizer */ private function getNormalizer($data, ?string $format, array $context): ?NormalizerInterface { @@ -295,10 +295,10 @@ private function getNormalizer($data, ?string $format, array $context): ?Normali /** * Returns a matching denormalizer. * - * @param mixed $data Data to restore - * @param string $class The expected class to instantiate - * @param string $format Format name, present to give the option to normalizers to act differently based on formats - * @param array $context Options available to the denormalizer + * @param mixed $data Data to restore + * @param string $class The expected class to instantiate + * @param string|null $format Format name, present to give the option to normalizers to act differently based on formats + * @param array $context Options available to the denormalizer */ private function getDenormalizer($data, string $class, ?string $format, array $context): ?DenormalizerInterface {