Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Serializer/Normalizer/PhoneNumberNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public function supportsNormalization($data, $format = null)
*/
public function denormalize($data, $class, $format = null, array $context = array())
{
if ($data === null) {
return;
}
try {
return $this->phoneNumberUtil->parse($data, $this->region);
} catch (NumberParseException $e) {
Expand All @@ -99,4 +102,4 @@ public function supportsDenormalization($data, $type, $format = null)
{
return $type === 'libphonenumber\PhoneNumber';
}
}
}