@@ -2776,6 +2776,9 @@ public function formatOutOfCountryKeepingAlphaChars(PhoneNumber $number, $region
27762776 $ regionCode = $ this ->getRegionCodeForCountryCode ($ countryCode );
27772777 // Metadata cannot be null because the country calling code is valid.
27782778 $ metadataForRegion = $ this ->getMetadataForRegionOrCallingCode ($ countryCode , $ regionCode );
2779+ // Strip any extension
2780+ $ this ->maybeStripExtension ($ formattedNumber );
2781+ // Append the formatted extension
27792782 $ this ->maybeAppendFormattedExtension (
27802783 $ number ,
27812784 $ metadataForRegion ,
@@ -3675,6 +3678,13 @@ public function isPossibleNumber($number, $regionDialingFrom = null)
36753678 * length (obviously includes the length of area codes for fixed line numbers), it will
36763679 * return false for the subscriber-number-only version.
36773680 * </ol>
3681+ *
3682+ * There is a known <a href="https://issuetracker.google.com/issues/335892662">issue</a> with this
3683+ * method: if a number is possible only in a certain region among several regions that share the
3684+ * same country calling code, this method will consider only the "main" region. For example,
3685+ * +1310xxxx are valid numbers in Canada. However, they are not possible in the US. As a result,
3686+ * this method will return IS_POSSIBLE_LOCAL_ONLY for +1310xxxx.
3687+ *
36783688 * @param PhoneNumber $number the number that needs to be checked
36793689 * @return int a ValidationResult object which indicates whether the number is possible
36803690 */
@@ -3705,6 +3715,12 @@ public function isPossibleNumberWithReason(PhoneNumber $number)
37053715 * return false for the subscriber-number-only version.
37063716 * </ol>
37073717 *
3718+ * There is a known <a href="https://issuetracker.google.com/issues/335892662">issue</a> with this
3719+ * method: if a number is possible only in a certain region among several regions that share the
3720+ * same country calling code, this method will consider only the "main" region. For example,
3721+ * +1310xxxx are valid numbers in Canada. However, they are not possible in the US. As a result,
3722+ * this method will return IS_POSSIBLE_LOCAL_ONLY for +1310xxxx.
3723+ *
37083724 * @param PhoneNumber $number the number that needs to be checked
37093725 * @param int $type the PhoneNumberType we are interested in
37103726 * @return int a ValidationResult object which indicates whether the number is possible
0 commit comments