another way to fix phonenumber and telephone in third party / OnTheFly

This commit is contained in:
2022-03-06 22:10:54 +01:00
parent d0772fc306
commit 44ed2e44e0
5 changed files with 13 additions and 7 deletions

View File

@@ -40,6 +40,10 @@ class PhonenumberNormalizer implements NormalizerInterface, DenormalizerInterfac
*/
public function denormalize($data, $type, $format = null, array $context = [])
{
if ('' === trim($data)) {
return null;
}
try {
return $this->phoneNumberUtil->parse($data, $this->defaultCarrierCode);
} catch (NumberParseException $e) {