getCountryCodeForRegion($regionCode); return $countryCode === 0 ? null : $countryCode; } /** * {@inheritDoc} */ public function convertToStandardFormat(string $input, ?string $defaultRegion = null): ?string { $phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance(); try { $phoneNumber = $phoneUtil->parse($input, $defaultRegion); if ($phoneUtil->isValidNumber($phoneNumber)) { return $phoneUtil->format($phoneNumber, PhoneNumberFormat::E164); } } catch (NumberParseException) { } return null; } }