mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-11-02 19:37:27 +00:00
* Add locale and libphonenumber libraries. * Update country code information Updated existing country codes, fixed incorrect NANP codes for member countries (as well as several UK based ones). Also added in Country Name to ISO country code mapping array for use with libphonenumber. * Convert phone number formatting to use libphonenumber libphonenumber parses phone number more consistantly than the old regex's that mismatched number on a regular basis.
26 lines
618 B
PHP
26 lines
618 B
PHP
<?php
|
|
|
|
namespace libphonenumber\Leniency;
|
|
|
|
use libphonenumber\PhoneNumber;
|
|
use libphonenumber\PhoneNumberUtil;
|
|
|
|
class Possible extends AbstractLeniency
|
|
{
|
|
protected static $level = 1;
|
|
|
|
/**
|
|
* Phone numbers accepted are PhoneNumberUtil::isPossibleNumber(), but not necessarily
|
|
* PhoneNumberUtil::isValidNumber().
|
|
*
|
|
* @param PhoneNumber $number
|
|
* @param string $candidate
|
|
* @param PhoneNumberUtil $util
|
|
* @return bool
|
|
*/
|
|
public static function verify(PhoneNumber $number, $candidate, PhoneNumberUtil $util)
|
|
{
|
|
return $util->isPossibleNumber($number);
|
|
}
|
|
}
|