Skip to content

Commit

Permalink
Document the issue with checking isPossible only for default country
Browse files Browse the repository at this point in the history
  • Loading branch information
giggsey committed Jan 15, 2025
1 parent 0474ef7 commit 3b65044
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/PhoneNumberUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -3678,6 +3678,13 @@ public function isPossibleNumber($number, $regionDialingFrom = null)
* length (obviously includes the length of area codes for fixed line numbers), it will
* return false for the subscriber-number-only version.
* </ol>
*
* There is a known <a href="https://issuetracker.google.com/issues/335892662">issue</a> with this
* method: if a number is possible only in a certain region among several regions that share the
* same country calling code, this method will consider only the "main" region. For example,
* +1310xxxx are valid numbers in Canada. However, they are not possible in the US. As a result,
* this method will return IS_POSSIBLE_LOCAL_ONLY for +1310xxxx.
*
* @param PhoneNumber $number the number that needs to be checked
* @return int a ValidationResult object which indicates whether the number is possible
*/
Expand Down Expand Up @@ -3708,6 +3715,12 @@ public function isPossibleNumberWithReason(PhoneNumber $number)
* return false for the subscriber-number-only version.
* </ol>
*
* There is a known <a href="https://issuetracker.google.com/issues/335892662">issue</a> with this
* method: if a number is possible only in a certain region among several regions that share the
* same country calling code, this method will consider only the "main" region. For example,
* +1310xxxx are valid numbers in Canada. However, they are not possible in the US. As a result,
* this method will return IS_POSSIBLE_LOCAL_ONLY for +1310xxxx.
*
* @param PhoneNumber $number the number that needs to be checked
* @param int $type the PhoneNumberType we are interested in
* @return int a ValidationResult object which indicates whether the number is possible
Expand Down

0 comments on commit 3b65044

Please sign in to comment.