From 51dc255be5f583c8dbc30867561ccc3b0b323ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 31 Mar 2022 12:45:52 +0200 Subject: [PATCH] fix phonenumber denormalization when null value is given --- .../Serializer/Normalizer/PhonenumberNormalizer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php index 7eb323754..f76b1e5c8 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php @@ -32,7 +32,7 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal } /** - * @param mixed $data + * @param string|null $data * @param mixed $type * @param null|mixed $format * @@ -40,7 +40,7 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal */ public function denormalize($data, $type, $format = null, array $context = []) { - if ('' === trim($data)) { + if ('' === trim((string) $data)) { return null; }