| @@ -1,45 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
| use libphonenumber\geocoding\PhoneNumberOfflineGeocoder; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class CodeCoverageTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testNullException() | ||||
|     { | ||||
|         try { | ||||
|             $this->phoneUtil->parse(null, null); | ||||
|         } catch (\Exception $e) { | ||||
|             $this->assertEquals("libphonenumber\\NumberParseException", get_class($e)); | ||||
|             $this->assertEquals("The phone number supplied was null.", $e->getMessage()); | ||||
|  | ||||
|             $this->assertEquals("Error type: 1. The phone number supplied was null.", (string)$e); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public function testTooShortNumber() | ||||
|     { | ||||
|         try { | ||||
|             $this->phoneUtil->parse("+441", "GB"); | ||||
|         } catch (\Exception $e) { | ||||
|             $this->assertEquals("libphonenumber\\NumberParseException", get_class($e)); | ||||
|             $this->assertEquals("The string supplied is too short to be a phone number.", $e->getMessage()); | ||||
|             $this->assertEquals(3, $e->getCode()); | ||||
|  | ||||
|             $this->assertEquals("Error type: 3. The string supplied is too short to be a phone number.", (string)$e); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,30 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\PhoneNumberType; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class Issue14Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testKWMobileNumber() | ||||
|     { | ||||
|         $number = "51440519"; | ||||
|         $phoneNumber = $this->phoneUtil->parse($number, "KW"); | ||||
|  | ||||
|         $this->assertTrue($this->phoneUtil->isValidNumber($phoneNumber)); | ||||
|         $this->assertEquals(PhoneNumberType::MOBILE, $this->phoneUtil->getNumberType($phoneNumber)); | ||||
|     } | ||||
| } | ||||
| @@ -1,41 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\geocoding\PhoneNumberOfflineGeocoder; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class Issue17Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberOfflineGeocoder | ||||
|      */ | ||||
|     private $geocoder; | ||||
|  | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         if(!extension_loaded('intl')) { | ||||
|             $this->markTestSkipped('The intl extension must be installed'); | ||||
|         } | ||||
|  | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         PhoneNumberOfflineGeocoder::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|         $this->geocoder = PhoneNumberOfflineGeocoder::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testIsleOfManLocale() | ||||
|     { | ||||
|         $number = "447624806000"; | ||||
|  | ||||
|         $phoneNumber = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $this->assertEquals("Isle of Man", $this->geocoder->getDescriptionForNumber($phoneNumber, 'en')); | ||||
|     } | ||||
| } | ||||
| @@ -1,50 +0,0 @@ | ||||
| <?php | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\PhoneNumberFormat; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class Issue21Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testFloatNumber() | ||||
|     { | ||||
|         $number = "0358112345678987"; | ||||
|         $phoneNumber = $this->phoneUtil->parse($number, "DE"); | ||||
|  | ||||
|         $this->assertTrue($this->phoneUtil->isValidNumber($phoneNumber)); | ||||
|  | ||||
|         $this->assertEquals('+49358112345678987', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::E164)); | ||||
|         $this->assertEquals('+49 3581 12345678987', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::INTERNATIONAL)); | ||||
|         $this->assertEquals('03581 12345678987', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::NATIONAL)); | ||||
|  | ||||
|  | ||||
|         $this->assertEquals('011 49 3581 12345678987', $this->phoneUtil->formatOutOfCountryCallingNumber($phoneNumber, 'US')); | ||||
|         $this->assertEquals('00 49 3581 12345678987', $this->phoneUtil->formatOutOfCountryCallingNumber($phoneNumber, 'CH')); | ||||
|     } | ||||
|  | ||||
|     public function testLongerNumber() | ||||
|     { | ||||
|         $number = "12345678901234567"; | ||||
|         $phoneNumber = $this->phoneUtil->parse($number, "DE"); | ||||
|  | ||||
|         $this->assertEquals('+4912345678901234567', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::E164)); | ||||
|         $this->assertEquals('+49 12345678901234567', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::INTERNATIONAL)); | ||||
|         $this->assertEquals('12345678901234567', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::NATIONAL)); | ||||
|  | ||||
|  | ||||
|         $this->assertEquals('011 49 12345678901234567', $this->phoneUtil->formatOutOfCountryCallingNumber($phoneNumber, 'US')); | ||||
|         $this->assertEquals('00 49 12345678901234567', $this->phoneUtil->formatOutOfCountryCallingNumber($phoneNumber, 'CH')); | ||||
|     } | ||||
| } | ||||
| @@ -1,43 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\geocoding\PhoneNumberOfflineGeocoder; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
| use libphonenumber\RegionCode; | ||||
|  | ||||
| class Issue23Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|     /** | ||||
|      * @var PhoneNumberOfflineGeocoder|null | ||||
|      */ | ||||
|     private $geocoder; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|  | ||||
|         if(extension_loaded('intl')) { | ||||
|             $this->geocoder = PhoneNumberOfflineGeocoder::getInstance(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public function testTKGeoLocation() | ||||
|     { | ||||
|         $number = '+6903010'; | ||||
|  | ||||
|         $phoneNumber = $this->phoneUtil->parse($number, RegionCode::ZZ); | ||||
|  | ||||
|         $this->assertEquals('TK', $this->phoneUtil->getRegionCodeForNumber($phoneNumber)); | ||||
|  | ||||
|         if($this->geocoder instanceof PhoneNumberOfflineGeocoder) { | ||||
|             $this->assertEquals('Tokelau', $this->geocoder->getDescriptionForNumber($phoneNumber, 'en')); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,28 +0,0 @@ | ||||
| <?php | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class Issue34Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testIsValidNumberForRegion() | ||||
|     { | ||||
|         $number = "+33 6 76 83 51 85"; | ||||
|         $region = "DE"; | ||||
|         $phoneNumber = $this->phoneUtil->parse($number, $region); | ||||
|  | ||||
|         $this->assertFalse($this->phoneUtil->isValidNumberForRegion($phoneNumber, "DE")); | ||||
|     } | ||||
| } | ||||
| @@ -1,51 +0,0 @@ | ||||
| <?php | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\PhoneNumber; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class Issue35Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testSerializingPhoneNumber() | ||||
|     { | ||||
|         $number = "+441174900000"; | ||||
|         $region = "GB"; | ||||
|         $phoneNumber = $this->phoneUtil->parse($number, $region); | ||||
|  | ||||
|         $serializedString = serialize($phoneNumber); | ||||
|  | ||||
|         $phoneObject2 = unserialize($serializedString); | ||||
|  | ||||
|         $this->assertTrue($phoneObject2->equals($phoneNumber)); | ||||
|     } | ||||
|  | ||||
|     public function testSerializingPhoneNumber2() | ||||
|     { | ||||
|         $phoneNumber = new PhoneNumber(); | ||||
|         $phoneNumber->setCountryCode(1); | ||||
|         $phoneNumber->setNationalNumber(1); | ||||
|         $phoneNumber->setExtension(1); | ||||
|         $phoneNumber->setItalianLeadingZero(1); | ||||
|         $phoneNumber->setNumberOfLeadingZeros(1); | ||||
|         $phoneNumber->setRawInput(1); | ||||
|         $phoneNumber->setCountryCodeSource(1); | ||||
|         $phoneNumber->setPreferredDomesticCarrierCode(1); | ||||
|  | ||||
|         $serializedString = serialize($phoneNumber); | ||||
|         $phoneObject2 = unserialize($serializedString); | ||||
|  | ||||
|         $this->assertTrue($phoneObject2->equals($phoneNumber)); | ||||
|     } | ||||
| } | ||||
| @@ -1,41 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\geocoding\PhoneNumberOfflineGeocoder; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class Issue36Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberOfflineGeocoder | ||||
|      */ | ||||
|     private $geocoder; | ||||
|  | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         if(!extension_loaded('intl')) { | ||||
|             $this->markTestSkipped('The intl extension must be installed'); | ||||
|         } | ||||
|  | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         PhoneNumberOfflineGeocoder::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|         $this->geocoder = PhoneNumberOfflineGeocoder::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testIsleOfManLocale() | ||||
|     { | ||||
|         $number = "447797752305"; | ||||
|  | ||||
|         $phoneNumber = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $this->assertEquals("Jersey", $this->geocoder->getDescriptionForNumber($phoneNumber, 'en')); | ||||
|     } | ||||
| } | ||||
| @@ -1,30 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\PhoneNumberFormat; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class Issue3Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|  | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     public $phoneNumberUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testParseUSNumber() | ||||
|     { | ||||
|         $number = $this->phoneNumberUtil->parse('011543549480042', 'US'); | ||||
|  | ||||
|         $this->assertEquals("+543549480042", $this->phoneNumberUtil->format($number, PhoneNumberFormat::E164)); | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -1,82 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
| use libphonenumber\geocoding\PhoneNumberOfflineGeocoder; | ||||
| use libphonenumber\PhoneNumberToCarrierMapper; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class Issue44Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|  | ||||
|     /** | ||||
|      * @var PhoneNumberOfflineGeocoder | ||||
|      */ | ||||
|     private $geocoder; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         if(!extension_loaded('intl')) { | ||||
|             $this->markTestSkipped('The intl extension must be installed'); | ||||
|         } | ||||
|  | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|  | ||||
|         $this->geocoder = PhoneNumberOfflineGeocoder::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testMemoryUsageOfGeoLocationWithNoResult() | ||||
|     { | ||||
|         $number = $this->phoneUtil->parse("86-157-9662-1289", "CN"); | ||||
|  | ||||
|         $startMemory = memory_get_usage(); | ||||
|         $location = $this->geocoder->getDescriptionForNumber($number, "en"); | ||||
|         $endMemory = memory_get_usage(); | ||||
|  | ||||
|         $this->assertEquals("China", $location); | ||||
|  | ||||
|         $memoryUsed = $endMemory - $startMemory; | ||||
|  | ||||
|         $this->assertLessThan(5000000, $memoryUsed, "Memory usage should be below 5MB"); | ||||
|     } | ||||
|  | ||||
|     public function testMemoryUsageOfGeoLocationWithResult() | ||||
|     { | ||||
|         $number = $this->phoneUtil->parse("86-131-2270-1411", "CN"); | ||||
|  | ||||
|         $startMemory = memory_get_usage(); | ||||
|         $location = $this->geocoder->getDescriptionForNumber($number, "en"); | ||||
|         $endMemory = memory_get_usage(); | ||||
|  | ||||
|         $this->assertEquals("Shanghai", $location); | ||||
|  | ||||
|         $memoryUsed = $endMemory - $startMemory; | ||||
|  | ||||
|         $this->assertLessThan(5000000, $memoryUsed, "Memory usage should be below 5MB"); | ||||
|     } | ||||
|  | ||||
|     public function testChineseGeolocation() | ||||
|     { | ||||
|         $number = $this->phoneUtil->parse("+86 150 3657 7264", "CN"); | ||||
|         $location = $this->geocoder->getDescriptionForNumber($number, "en"); | ||||
|  | ||||
|         $this->assertEquals("Luoyang, Henan", $location); | ||||
|     } | ||||
|  | ||||
|     public function testChineseCarrierLookup() | ||||
|     { | ||||
|         $number = $this->phoneUtil->parse("+86 150 3657 7264", "CN"); | ||||
|  | ||||
|         $carrier = PhoneNumberToCarrierMapper::getInstance(); | ||||
|  | ||||
|         $location = $carrier->getNameForNumber($number, "en"); | ||||
|  | ||||
|         $this->assertEquals("China Mobile", $location); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @@ -1,30 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\PhoneNumberFormat; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class Issue4Test extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|  | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     public $phoneNumberUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testParseUSNumber() | ||||
|     { | ||||
|         $number = $this->phoneNumberUtil->parse('0351-152-303-473', 'AR'); | ||||
|  | ||||
|         $this->assertEquals("+5493512303473", $this->phoneNumberUtil->format($number, PhoneNumberFormat::E164)); | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -1,323 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * | ||||
|  * | ||||
|  * @author joshuag | ||||
|  * @created: 14/08/2014 12:35 | ||||
|  * @project libphonenumber-for-php | ||||
|  */ | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
|  | ||||
| use libphonenumber\CountryCodeToRegionCodeMap; | ||||
| use libphonenumber\geocoding\PhoneNumberOfflineGeocoder; | ||||
| use libphonenumber\PhoneNumberType; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class LocaleTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     /** | ||||
|      * @var PhoneNumberOfflineGeocoder | ||||
|      */ | ||||
|     private $geocoder; | ||||
|  | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         if(!extension_loaded('intl')) { | ||||
|             $this->markTestSkipped('The intl extension must be installed'); | ||||
|         } | ||||
|  | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         PhoneNumberOfflineGeocoder::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|         $this->geocoder = PhoneNumberOfflineGeocoder::getInstance(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider localeList | ||||
|      * @param string $regionCode | ||||
|      * @param string $countryName | ||||
|      */ | ||||
|     public function testLocales($regionCode, $countryName) | ||||
|     { | ||||
|         if (!in_array($regionCode, $this->phoneUtil->getSupportedRegions())) { | ||||
|             $this->markTestSkipped("{$regionCode} is not supported"); | ||||
|         } | ||||
|  | ||||
|         $number = $this->phoneUtil->getExampleNumberForType($regionCode, PhoneNumberType::FIXED_LINE_OR_MOBILE); | ||||
|         $phoneNumber = $this->phoneUtil->parse($number, 'ZZ'); | ||||
|  | ||||
|         $this->assertContains($regionCode, CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap[$phoneNumber->getCountryCode()]); | ||||
|  | ||||
|         $this->assertEquals($regionCode, $this->phoneUtil->getRegionCodeForNumber($number)); | ||||
|  | ||||
|         $this->assertEquals($countryName, $this->geocoder->getDescriptionForValidNumber($phoneNumber, 'en', 'ZZ'), "Checking {$number} is part of {$countryName}"); | ||||
|     } | ||||
|  | ||||
|     public function localeList() | ||||
|     { | ||||
|         $codes = $this->getCountryCodes(); | ||||
|  | ||||
|         $return = array(); | ||||
|         foreach ($codes as $code => $country) { | ||||
|             $return[] = array($code, $country); | ||||
|         } | ||||
|  | ||||
|         return $return; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * This list was got from the Internet, and altered slightly to make the tests pass | ||||
|      * | ||||
|      * Bad country codes were removed, and names updated to match my Windows 7 Locale settings (these might be different | ||||
|      * on different operating systems and other Locales). | ||||
|      * | ||||
|      * @see https://gist.github.com/vxnick/380904 | ||||
|      * @return array | ||||
|      */ | ||||
|     private function getCountryCodes() | ||||
|     { | ||||
|         return array( | ||||
|             'AF' => 'Afghanistan', | ||||
|             'AX' => 'Åland Islands', | ||||
|             'AL' => 'Albania', | ||||
|             'DZ' => 'Algeria', | ||||
|             'AS' => 'American Samoa', | ||||
|             'AD' => 'Andorra', | ||||
|             'AO' => 'Angola', | ||||
|             'AI' => 'Anguilla', | ||||
|             'AG' => 'Antigua and Barbuda', | ||||
|             'AR' => 'Argentina', | ||||
|             'AU' => 'Australia', | ||||
|             'AT' => 'Austria', | ||||
|             'AZ' => 'Azerbaijan', | ||||
|             'BS' => 'Bahamas', | ||||
|             'BH' => 'Bahrain', | ||||
|             'BD' => 'Bangladesh', | ||||
|             'BB' => 'Barbados', | ||||
|             'BY' => 'Belarus', | ||||
|             'BE' => 'Belgium', | ||||
|             'BZ' => 'Belize', | ||||
|             'BJ' => 'Benin', | ||||
|             'BM' => 'Bermuda', | ||||
|             'BT' => 'Bhutan', | ||||
|             'BO' => 'Bolivia', | ||||
|             'BA' => 'Bosnia and Herzegovina', | ||||
|             'BW' => 'Botswana', | ||||
|             'BR' => 'Brazil', | ||||
|             'IO' => 'British Indian Ocean Territory', | ||||
|             'BN' => 'Brunei', | ||||
|             'BG' => 'Bulgaria', | ||||
|             'BF' => 'Burkina Faso', | ||||
|             'BI' => 'Burundi', | ||||
|             'KH' => 'Cambodia', | ||||
|             'CM' => 'Cameroon', | ||||
|             'CA' => 'Canada', | ||||
|             'CV' => 'Cape Verde', | ||||
|             'KY' => 'Cayman Islands', | ||||
|             'CF' => 'Central African Republic', | ||||
|             'TD' => 'Chad', | ||||
|             'CL' => 'Chile', | ||||
|             'CN' => 'China', | ||||
|             'CX' => 'Christmas Island', | ||||
|             'CC' => 'Cocos [Keeling] Islands', | ||||
|             'CO' => 'Colombia', | ||||
|             'KM' => 'Comoros', | ||||
|             'CG' => 'Congo - Brazzaville', | ||||
|             'CD' => 'Congo - Kinshasa', | ||||
|             'CK' => 'Cook Islands', | ||||
|             'CR' => 'Costa Rica', | ||||
|             'CI' => 'Côte d’Ivoire', | ||||
|             'HR' => 'Croatia', | ||||
|             'CU' => 'Cuba', | ||||
|             'CY' => 'Cyprus', | ||||
|             'CZ' => 'Czech Republic', | ||||
|             'DK' => 'Denmark', | ||||
|             'DJ' => 'Djibouti', | ||||
|             'DM' => 'Dominica', | ||||
|             'DO' => 'Dominican Republic', | ||||
|             'EC' => 'Ecuador', | ||||
|             'EG' => 'Egypt', | ||||
|             'SV' => 'El Salvador', | ||||
|             'GQ' => 'Equatorial Guinea', | ||||
|             'ER' => 'Eritrea', | ||||
|             'EE' => 'Estonia', | ||||
|             'ET' => 'Ethiopia', | ||||
|             'FK' => 'Falkland Islands', | ||||
|             'FO' => 'Faroe Islands', | ||||
|             'FJ' => 'Fiji', | ||||
|             'FI' => 'Finland', | ||||
|             'FR' => 'France', | ||||
|             'GF' => 'French Guiana', | ||||
|             'PF' => 'French Polynesia', | ||||
|             'GA' => 'Gabon', | ||||
|             'GM' => 'Gambia', | ||||
|             'GE' => 'Georgia', | ||||
|             'DE' => 'Germany', | ||||
|             'GH' => 'Ghana', | ||||
|             'GI' => 'Gibraltar', | ||||
|             'GR' => 'Greece', | ||||
|             'GL' => 'Greenland', | ||||
|             'GD' => 'Grenada', | ||||
|             'GP' => 'Guadeloupe', | ||||
|             'GU' => 'Guam', | ||||
|             'GT' => 'Guatemala', | ||||
|             'GG' => 'Guernsey', | ||||
|             'GN' => 'Guinea', | ||||
|             'GW' => 'Guinea-Bissau', | ||||
|             'GY' => 'Guyana', | ||||
|             'HT' => 'Haiti', | ||||
|             'VA' => 'Vatican City', | ||||
|             'HN' => 'Honduras', | ||||
|             'HK' => 'Hong Kong SAR China', | ||||
|             'HU' => 'Hungary', | ||||
|             'IS' => 'Iceland', | ||||
|             'IN' => 'India', | ||||
|             'ID' => 'Indonesia', | ||||
|             'IR' => 'Iran', | ||||
|             'IQ' => 'Iraq', | ||||
|             'IE' => 'Ireland', | ||||
|             'IM' => 'Isle of Man', | ||||
|             'IL' => 'Israel', | ||||
|             'IT' => 'Italy', | ||||
|             'JM' => 'Jamaica', | ||||
|             'JP' => 'Japan', | ||||
|             'JE' => 'Jersey', | ||||
|             'JO' => 'Jordan', | ||||
|             'KZ' => 'Kazakhstan', | ||||
|             'KE' => 'Kenya', | ||||
|             'KI' => 'Kiribati', | ||||
|             'KP' => 'North Korea', | ||||
|             'KR' => 'South Korea', | ||||
|             'KW' => 'Kuwait', | ||||
|             'KG' => 'Kyrgyzstan', | ||||
|             'LA' => 'Laos', | ||||
|             'LV' => 'Latvia', | ||||
|             'LB' => 'Lebanon', | ||||
|             'LS' => 'Lesotho', | ||||
|             'LR' => 'Liberia', | ||||
|             'LY' => 'Libya', | ||||
|             'LI' => 'Liechtenstein', | ||||
|             'LT' => 'Lithuania', | ||||
|             'LU' => 'Luxembourg', | ||||
|             'MO' => 'Macau SAR China', | ||||
|             'MK' => 'Macedonia', | ||||
|             'MG' => 'Madagascar', | ||||
|             'MW' => 'Malawi', | ||||
|             'MY' => 'Malaysia', | ||||
|             'MV' => 'Maldives', | ||||
|             'ML' => 'Mali', | ||||
|             'MT' => 'Malta', | ||||
|             'MH' => 'Marshall Islands', | ||||
|             'MQ' => 'Martinique', | ||||
|             'MR' => 'Mauritania', | ||||
|             'MU' => 'Mauritius', | ||||
|             'YT' => 'Mayotte', | ||||
|             'MX' => 'Mexico', | ||||
|             'FM' => 'Micronesia', | ||||
|             'MD' => 'Moldova', | ||||
|             'MC' => 'Monaco', | ||||
|             'MN' => 'Mongolia', | ||||
|             'ME' => 'Montenegro', | ||||
|             'MS' => 'Montserrat', | ||||
|             'MA' => 'Morocco', | ||||
|             'MZ' => 'Mozambique', | ||||
|             'MM' => 'Myanmar [Burma]', | ||||
|             'NA' => 'Namibia', | ||||
|             'NR' => 'Nauru', | ||||
|             'NP' => 'Nepal', | ||||
|             'NL' => 'Netherlands', | ||||
|             'NC' => 'New Caledonia', | ||||
|             'NZ' => 'New Zealand', | ||||
|             'NI' => 'Nicaragua', | ||||
|             'NE' => 'Niger', | ||||
|             'NG' => 'Nigeria', | ||||
|             'NU' => 'Niue', | ||||
|             'NF' => 'Norfolk Island', | ||||
|             'MP' => 'Northern Mariana Islands', | ||||
|             'NO' => 'Norway', | ||||
|             'OM' => 'Oman', | ||||
|             'PK' => 'Pakistan', | ||||
|             'PW' => 'Palau', | ||||
|             'PS' => 'Palestinian Territories', | ||||
|             'PA' => 'Panama', | ||||
|             'PG' => 'Papua New Guinea', | ||||
|             'PY' => 'Paraguay', | ||||
|             'PE' => 'Peru', | ||||
|             'PH' => 'Philippines', | ||||
|             'PL' => 'Poland', | ||||
|             'PT' => 'Portugal', | ||||
|             'PR' => 'Puerto Rico', | ||||
|             'QA' => 'Qatar', | ||||
|             'RE' => 'Réunion', | ||||
|             'RO' => 'Romania', | ||||
|             'RU' => 'Russia', | ||||
|             'RW' => 'Rwanda', | ||||
|             'SH' => 'Saint Helena', | ||||
|             'KN' => 'Saint Kitts and Nevis', | ||||
|             'LC' => 'Saint Lucia', | ||||
|             'PM' => 'Saint Pierre and Miquelon', | ||||
|             'VC' => 'Saint Vincent and the Grenadines', | ||||
|             'WS' => 'Samoa', | ||||
|             'SM' => 'San Marino', | ||||
|             'ST' => 'São Tomé and Príncipe', | ||||
|             'SA' => 'Saudi Arabia', | ||||
|             'SN' => 'Senegal', | ||||
|             'RS' => 'Serbia', | ||||
|             'SC' => 'Seychelles', | ||||
|             'SL' => 'Sierra Leone', | ||||
|             'SG' => 'Singapore', | ||||
|             'SK' => 'Slovakia', | ||||
|             'SI' => 'Slovenia', | ||||
|             'SB' => 'Solomon Islands', | ||||
|             'SO' => 'Somalia', | ||||
|             'ZA' => 'South Africa', | ||||
|             'ES' => 'Spain', | ||||
|             'LK' => 'Sri Lanka', | ||||
|             'SD' => 'Sudan', | ||||
|             'SR' => 'Suriname', | ||||
|             'SJ' => 'Svalbard and Jan Mayen', | ||||
|             'SZ' => 'Swaziland', | ||||
|             'SE' => 'Sweden', | ||||
|             'CH' => 'Switzerland', | ||||
|             'SY' => 'Syria', | ||||
|             'TW' => 'Taiwan', | ||||
|             'TJ' => 'Tajikistan', | ||||
|             'TZ' => 'Tanzania', | ||||
|             'TH' => 'Thailand', | ||||
|             'TL' => 'Timor-Leste', | ||||
|             'TG' => 'Togo', | ||||
|             'TK' => 'Tokelau', | ||||
|             'TO' => 'Tonga', | ||||
|             'TT' => 'Trinidad and Tobago', | ||||
|             'TN' => 'Tunisia', | ||||
|             'TR' => 'Turkey', | ||||
|             'TM' => 'Turkmenistan', | ||||
|             'TC' => 'Turks and Caicos Islands', | ||||
|             'TV' => 'Tuvalu', | ||||
|             'UG' => 'Uganda', | ||||
|             'UA' => 'Ukraine', | ||||
|             'AE' => 'United Arab Emirates', | ||||
|             'GB' => 'United Kingdom', | ||||
|             'US' => 'United States', | ||||
|             'UY' => 'Uruguay', | ||||
|             'UZ' => 'Uzbekistan', | ||||
|             'VU' => 'Vanuatu', | ||||
|             'VE' => 'Venezuela', | ||||
|             'VN' => 'Vietnam', | ||||
|             'VG' => 'British Virgin Islands', | ||||
|             'VI' => 'U.S. Virgin Islands', | ||||
|             'WF' => 'Wallis and Futuna', | ||||
|             'EH' => 'Western Sahara', | ||||
|             'YE' => 'Yemen', | ||||
|             'ZM' => 'Zambia', | ||||
|             'ZW' => 'Zimbabwe', | ||||
|         ); | ||||
|     } | ||||
| } | ||||
| @@ -1,188 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\Issues; | ||||
|  | ||||
| use libphonenumber\CountryCodeToRegionCodeMap; | ||||
| use libphonenumber\PhoneNumberFormat; | ||||
| use libphonenumber\PhoneNumberType; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
|  | ||||
| class UKNumbersTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     const META_DATA_FILE_PREFIX = 'PhoneNumberMetadata'; | ||||
|     /** | ||||
|      * @var \libphonenumber\PhoneNumberUtil | ||||
|      */ | ||||
|     protected $phoneUtil; | ||||
|  | ||||
|     public function __construct() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance( | ||||
|             self::META_DATA_FILE_PREFIX, | ||||
|             CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap | ||||
|         );; | ||||
|     } | ||||
|  | ||||
|     public function testMobileNumber() | ||||
|     { | ||||
|         $number = '07987458147'; | ||||
|         $phoneObject = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $valid = $this->phoneUtil->isValidNumber($phoneObject); | ||||
|         $this->assertTrue($valid, "Checking phone number is valid"); | ||||
|  | ||||
|         $type = $this->phoneUtil->getNumberType($phoneObject); | ||||
|         $this->assertEquals(PhoneNumberType::MOBILE, $type, "Checking phone number is detected as mobile"); | ||||
|  | ||||
|         $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164); | ||||
|         $this->assertEquals("+447987458147", $formattedE164, "Checking E164 format is correct"); | ||||
|  | ||||
|         $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL); | ||||
|         $this->assertEquals("07987 458147", $formattedNational, "Checking National format is correct"); | ||||
|     } | ||||
|  | ||||
|     public function testFixedLine() | ||||
|     { | ||||
|         $number = '01234512345'; | ||||
|         $phoneObject = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $valid = $this->phoneUtil->isValidNumber($phoneObject); | ||||
|         $this->assertTrue($valid, "Checking phone number is valid"); | ||||
|  | ||||
|         $type = $this->phoneUtil->getNumberType($phoneObject); | ||||
|         $this->assertEquals(PhoneNumberType::FIXED_LINE, $type, "Checking phone number is detected as fixed line"); | ||||
|  | ||||
|         $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164); | ||||
|         $this->assertEquals("+441234512345", $formattedE164, "Checking E164 format is correct"); | ||||
|  | ||||
|         $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL); | ||||
|         $this->assertEquals("01234 512345", $formattedNational, "Checking National format is correct"); | ||||
|     } | ||||
|  | ||||
|     public function testSharedCost() | ||||
|     { | ||||
|         $number = '08451234568'; | ||||
|         $phoneObject = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $valid = $this->phoneUtil->isValidNumber($phoneObject); | ||||
|         $this->assertTrue($valid, "Checking phone number is valid"); | ||||
|  | ||||
|         $type = $this->phoneUtil->getNumberType($phoneObject); | ||||
|         $this->assertEquals(PhoneNumberType::SHARED_COST, $type, "Checking phone number is detected as shared cost"); | ||||
|  | ||||
|         $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164); | ||||
|         $this->assertEquals("+448451234568", $formattedE164, "Checking E164 format is correct"); | ||||
|  | ||||
|         $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL); | ||||
|         $this->assertEquals("0845 123 4568", $formattedNational, "Checking National format is correct"); | ||||
|     } | ||||
|  | ||||
|     public function testPersonalNumber() | ||||
|     { | ||||
|         $number = '07010020249'; | ||||
|         $phoneObject = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $valid = $this->phoneUtil->isValidNumber($phoneObject); | ||||
|         $this->assertTrue($valid, "Checking phone number is valid"); | ||||
|  | ||||
|         $type = $this->phoneUtil->getNumberType($phoneObject); | ||||
|         $this->assertEquals( | ||||
|             PhoneNumberType::PERSONAL_NUMBER, | ||||
|             $type, | ||||
|             "Checking phone number is detected as a personal number" | ||||
|         ); | ||||
|  | ||||
|         $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164); | ||||
|         $this->assertEquals("+447010020249", $formattedE164, "Checking E164 format is correct"); | ||||
|  | ||||
|         $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL); | ||||
|         $this->assertEquals("070 1002 0249", $formattedNational, "Checking National format is correct"); | ||||
|     } | ||||
|  | ||||
|     public function testUAN() | ||||
|     { | ||||
|         $number = '03335555555'; | ||||
|         $phoneObject = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $valid = $this->phoneUtil->isValidNumber($phoneObject); | ||||
|         $this->assertTrue($valid, "Checking phone number is valid"); | ||||
|  | ||||
|         $type = $this->phoneUtil->getNumberType($phoneObject); | ||||
|         $this->assertEquals(PhoneNumberType::UAN, $type, "Checking phone number is detected as UAN"); | ||||
|  | ||||
|         $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164); | ||||
|         $this->assertEquals("+443335555555", $formattedE164, "Checking E164 format is correct"); | ||||
|  | ||||
|         $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL); | ||||
|         $this->assertEquals("0333 555 5555", $formattedNational, "Checking National format is correct"); | ||||
|     } | ||||
|  | ||||
|     public function testTollFree() | ||||
|     { | ||||
|         $number = '0800800150'; | ||||
|         $phoneObject = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $valid = $this->phoneUtil->isValidNumber($phoneObject); | ||||
|         $this->assertTrue($valid, "Checking phone number is valid"); | ||||
|  | ||||
|         $type = $this->phoneUtil->getNumberType($phoneObject); | ||||
|         $this->assertEquals(PhoneNumberType::TOLL_FREE, $type, "Checking phone number is detected as TOLL FREE"); | ||||
|  | ||||
|         $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164); | ||||
|         $this->assertEquals("+44800800150", $formattedE164, "Checking E164 format is correct"); | ||||
|  | ||||
|         $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL); | ||||
|         $this->assertEquals("0800 800150", $formattedNational, "Checking National format is correct"); | ||||
|     } | ||||
|  | ||||
|     public function testPremium() | ||||
|     { | ||||
|         $number = '09063020288'; | ||||
|         $phoneObject = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $valid = $this->phoneUtil->isValidNumber($phoneObject); | ||||
|         $this->assertTrue($valid, "Checking phone number is valid"); | ||||
|  | ||||
|         $type = $this->phoneUtil->getNumberType($phoneObject); | ||||
|         $this->assertEquals(PhoneNumberType::PREMIUM_RATE, $type, "Checking phone number is detected as PREMIUM RATE"); | ||||
|  | ||||
|         $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164); | ||||
|         $this->assertEquals("+449063020288", $formattedE164, "Checking E164 format is correct"); | ||||
|  | ||||
|         $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL); | ||||
|         $this->assertEquals("0906 302 0288", $formattedNational, "Checking National format is correct"); | ||||
|     } | ||||
|  | ||||
|     public function testChildLine() | ||||
|     { | ||||
|         $number = '08001111'; | ||||
|         $phoneObject = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $valid = $this->phoneUtil->isValidNumber($phoneObject); | ||||
|         $this->assertTrue($valid, "Checking phone number is valid"); | ||||
|  | ||||
|         $type = $this->phoneUtil->getNumberType($phoneObject); | ||||
|         $this->assertEquals( | ||||
|             PhoneNumberType::TOLL_FREE, | ||||
|             $type, | ||||
|             "Checking phone number is detected as TOLL FREE" | ||||
|         ); | ||||
|  | ||||
|         $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164); | ||||
|         $this->assertEquals("+448001111", $formattedE164, "Checking E164 format is correct"); | ||||
|  | ||||
|         $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL); | ||||
|         $this->assertEquals("0800 1111", $formattedNational, "Checking National format is correct"); | ||||
|     } | ||||
|  | ||||
|     public function testInvalidNumber() | ||||
|     { | ||||
|         $number = '123401234512345'; | ||||
|         $phoneObject = $this->phoneUtil->parse($number, 'GB'); | ||||
|  | ||||
|         $valid = $this->phoneUtil->isValidNumber($phoneObject); | ||||
|         $this->assertFalse($valid, "Checking phone number is invalid"); | ||||
|     } | ||||
| } | ||||
| @@ -1,56 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\buildtools; | ||||
|  | ||||
|  | ||||
| use libphonenumber\buildtools\GeneratePhonePrefixData; | ||||
|  | ||||
| class GeneratePhonePrefixDataTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     private static $available_data_files; | ||||
|  | ||||
|     public static function setUpBeforeClass() | ||||
|     { | ||||
|         $temporaryMap = array(); | ||||
|  | ||||
|         $phonePrefixData = new GeneratePhonePrefixData(); | ||||
|  | ||||
|  | ||||
|         // Languages for US. | ||||
|         $phonePrefixData->addConfigurationMapping($temporaryMap, "1", "en"); | ||||
|         $phonePrefixData->addConfigurationMapping($temporaryMap, "1", "en_US"); | ||||
|         $phonePrefixData->addConfigurationMapping($temporaryMap, "1", "es"); | ||||
|  | ||||
|         // Languages for France. | ||||
|         $phonePrefixData->addConfigurationMapping($temporaryMap, "33", "fr"); | ||||
|         $phonePrefixData->addConfigurationMapping($temporaryMap, "33", "en"); | ||||
|  | ||||
|         // Languages for China. | ||||
|         $phonePrefixData->addConfigurationMapping($temporaryMap, "86", "zh_Hans"); | ||||
|  | ||||
|         self::$available_data_files = $temporaryMap; | ||||
|     } | ||||
|  | ||||
|     public function testAddConfigurationMapping() | ||||
|     { | ||||
|         $this->assertCount(3, self::$available_data_files); | ||||
|  | ||||
|         $languagesForUS = self::$available_data_files[1]; | ||||
|  | ||||
|         $this->assertContains("en", $languagesForUS); | ||||
|         $this->assertContains("en_US", $languagesForUS); | ||||
|         $this->assertContains("es", $languagesForUS); | ||||
|  | ||||
|         $languagesForFR = self::$available_data_files[33]; | ||||
|  | ||||
|         $this->assertContains("fr", $languagesForFR); | ||||
|         $this->assertContains("en", $languagesForFR); | ||||
|  | ||||
|         $languagesForCN = self::$available_data_files[86]; | ||||
|         $this->assertCount(1, $languagesForCN); | ||||
|  | ||||
|         $this->assertContains("zh_Hans", $languagesForCN); | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
| @@ -1,143 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\carrier; | ||||
|  | ||||
| use libphonenumber\PhoneNumber; | ||||
| use libphonenumber\PhoneNumberToCarrierMapper; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
|  | ||||
| class PhoneNumberToCarrierMapperTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     const TEST_META_DATA_FILE_PREFIX = "/../../Tests/libphonenumber/Tests/carrier/data/"; | ||||
|     private static $AO_MOBILE1; | ||||
|     private static $AO_MOBILE2; | ||||
|     private static $AO_FIXED1; | ||||
|     private static $AO_FIXED2; | ||||
|     private static $AO_INVALID_NUMBER; | ||||
|     private static $UK_MOBILE1; | ||||
|     private static $UK_MOBILE2; | ||||
|     private static $UK_FIXED1; | ||||
|     private static $UK_FIXED2; | ||||
|     private static $UK_INVALID_NUMBER; | ||||
|     private static $UK_PAGER; | ||||
|     private static $US_FIXED_OR_MOBILE; | ||||
|     private static $NUMBER_WITH_INVALID_COUNTRY_CODE; | ||||
|     private static $INTERNATIONAL_TOLL_FREE; | ||||
|     /** | ||||
|      * @var PhoneNumberToCarrierMapper | ||||
|      */ | ||||
|     protected $carrierMapper; | ||||
|  | ||||
|     public static function setUpBeforeClass() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|  | ||||
|         self::$AO_MOBILE1 = new PhoneNumber(); | ||||
|         self::$AO_MOBILE1->setCountryCode(244)->setNationalNumber(917654321); | ||||
|  | ||||
|         self::$AO_MOBILE2 = new PhoneNumber(); | ||||
|         self::$AO_MOBILE2->setCountryCode(244)->setNationalNumber(927654321); | ||||
|  | ||||
|         self::$AO_FIXED1 = new PhoneNumber(); | ||||
|         self::$AO_FIXED1->setCountryCode(244)->setNationalNumber(22254321); | ||||
|  | ||||
|         self::$AO_FIXED2 = new PhoneNumber(); | ||||
|         self::$AO_FIXED2->setCountryCode(244)->setNationalNumber(26254321); | ||||
|  | ||||
|         self::$AO_INVALID_NUMBER = new PhoneNumber(); | ||||
|         self::$AO_INVALID_NUMBER->setCountryCode(244)->setNationalNumber(101234); | ||||
|  | ||||
|         self::$UK_MOBILE1 = new PhoneNumber(); | ||||
|         self::$UK_MOBILE1->setCountryCode(44)->setNationalNumber(7387654321); | ||||
|  | ||||
|         self::$UK_MOBILE2 = new PhoneNumber(); | ||||
|         self::$UK_MOBILE2->setCountryCode(44)->setNationalNumber(7487654321); | ||||
|  | ||||
|         self::$UK_FIXED1 = new PhoneNumber(); | ||||
|         self::$UK_FIXED1->setCountryCode(44)->setNationalNumber(1123456789); | ||||
|  | ||||
|         self::$UK_FIXED2 = new PhoneNumber(); | ||||
|         self::$UK_FIXED2->setCountryCode(44)->setNationalNumber(2987654321); | ||||
|  | ||||
|         self::$UK_INVALID_NUMBER = new PhoneNumber(); | ||||
|         self::$UK_INVALID_NUMBER->setCountryCode(44)->setNationalNumber(7301234); | ||||
|  | ||||
|         self::$UK_PAGER = new PhoneNumber(); | ||||
|         self::$UK_PAGER->setCountryCode(44)->setNationalNumber(7601234567); | ||||
|  | ||||
|         self::$US_FIXED_OR_MOBILE = new PhoneNumber(); | ||||
|         self::$US_FIXED_OR_MOBILE->setCountryCode(1)->setNationalNumber(6502123456); | ||||
|  | ||||
|         self::$NUMBER_WITH_INVALID_COUNTRY_CODE = new PhoneNumber(); | ||||
|         self::$NUMBER_WITH_INVALID_COUNTRY_CODE->setCountryCode(999)->setNationalNumber(2423651234); | ||||
|  | ||||
|         self::$INTERNATIONAL_TOLL_FREE = new PhoneNumber(); | ||||
|         self::$INTERNATIONAL_TOLL_FREE->setCountryCode(800)->setNationalNumber(12345678); | ||||
|     } | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         if(!extension_loaded('intl')) { | ||||
|             $this->markTestSkipped('The intl extension must be installed'); | ||||
|         } | ||||
|  | ||||
|         $this->carrierMapper = PhoneNumberToCarrierMapper::getInstance(self::TEST_META_DATA_FILE_PREFIX); | ||||
|     } | ||||
|  | ||||
|     public function testGetNameForMobilePortableRegion() | ||||
|     { | ||||
|         $this->assertEquals("British carrier", $this->carrierMapper->getNameForNumber(self::$UK_MOBILE1, "en")); | ||||
|         $this->assertEquals("Brittisk operat" . pack('H*', 'c3b6') . "r", $this->carrierMapper->getNameForNumber(self::$UK_MOBILE1, "sv_SE")); | ||||
|         $this->assertEquals("British carrier", $this->carrierMapper->getNameForNumber(self::$UK_MOBILE1, "fr")); | ||||
|         // Returns an empty string because the UK implements mobile number portability. | ||||
|         $this->assertEquals("", $this->carrierMapper->getSafeDisplayName(self::$UK_MOBILE1, "en")); | ||||
|     } | ||||
|  | ||||
|     public function testGetNameForNonMobilePortableRegion() | ||||
|     { | ||||
|         $this->assertEquals("Angolan carrier", $this->carrierMapper->getNameForNumber(self::$AO_MOBILE1, "en")); | ||||
|         $this->assertEquals("Angolan carrier", $this->carrierMapper->getSafeDisplayName(self::$AO_MOBILE1, "en")); | ||||
|     } | ||||
|  | ||||
|     public function testGetNameForFixedLineNumber() | ||||
|     { | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$AO_FIXED1, "en")); | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$UK_FIXED1, "en")); | ||||
|         // If the carrier information is present in the files and the method that assumes a valid | ||||
|         // number is used, a carrier is returned | ||||
|         $this->assertEquals("Angolan fixed line carrier", $this->carrierMapper->getNameForValidNumber(self::$AO_FIXED2, "en")); | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForValidNumber(self::$UK_FIXED2, "en")); | ||||
|     } | ||||
|  | ||||
|     public function testGetNameForFixedOrMobileNumber() | ||||
|     { | ||||
|         $this->assertEquals("US carrier", $this->carrierMapper->getNameForNumber(self::$US_FIXED_OR_MOBILE, "en")); | ||||
|     } | ||||
|  | ||||
|     public function testGetNameForPagerNumber() | ||||
|     { | ||||
|         $this->assertEquals("British pager", $this->carrierMapper->getNameForNumber(self::$UK_PAGER, "en")); | ||||
|     } | ||||
|  | ||||
|     public function testGetNameForNumberWithNoDataFile() | ||||
|     { | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$NUMBER_WITH_INVALID_COUNTRY_CODE, "en")); | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$INTERNATIONAL_TOLL_FREE, "en")); | ||||
|  | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForValidNumber(self::$NUMBER_WITH_INVALID_COUNTRY_CODE, "en")); | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForValidNumber(self::$INTERNATIONAL_TOLL_FREE, "en")); | ||||
|     } | ||||
|  | ||||
|     public function testGetNameForNumberWithMissingPrefix() | ||||
|     { | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$UK_MOBILE2, "en")); | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$AO_MOBILE2, "en")); | ||||
|     } | ||||
|  | ||||
|     public function testGetNameForInvalidNumber() | ||||
|     { | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$UK_INVALID_NUMBER, "en")); | ||||
|         $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$AO_INVALID_NUMBER, "en")); | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -1,18 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   'en' =>  | ||||
|   array ( | ||||
|     0 => 1650, | ||||
|     1 => 244, | ||||
|     2 => 44, | ||||
|   ), | ||||
|   'sv' =>  | ||||
|   array ( | ||||
|     0 => 44, | ||||
|   ), | ||||
| ); | ||||
| @@ -1,10 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   1650212 => 'US carrier', | ||||
|   1650213 => 'US carrier2', | ||||
| ); | ||||
| @@ -1,10 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   244262 => 'Angolan fixed line carrier', | ||||
|   244917 => 'Angolan carrier', | ||||
| ); | ||||
| @@ -1,11 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   4411 => 'British fixed line carrier', | ||||
|   4473 => 'British carrier', | ||||
|   44760 => 'British pager', | ||||
| ); | ||||
| @@ -1,9 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   4473 => 'Brittisk operatör', | ||||
| ); | ||||
| @@ -1,305 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\core; | ||||
|  | ||||
| use libphonenumber\Matcher; | ||||
| use libphonenumber\NumberParseException; | ||||
| use libphonenumber\PhoneNumberType; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
| use libphonenumber\ShortNumberCost; | ||||
| use libphonenumber\ShortNumberInfo; | ||||
|  | ||||
| /** | ||||
|  * Verifies all of the example numbers in the metadata are valid and of the correct type. If no | ||||
|  * example number exists for a particular type, the test still passes. | ||||
|  */ | ||||
| class ExampleNumbersTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|  | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     private $phoneNumberUtil; | ||||
|     /** | ||||
|      * @var ShortNumberInfo | ||||
|      */ | ||||
|     private $shortNumberInfo; | ||||
|  | ||||
|     public static function setUpBeforeClass() | ||||
|     { | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         PhoneNumberUtil::getInstance(); | ||||
|         ShortNumberInfo::resetInstance(); | ||||
|     } | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); | ||||
|         $this->shortNumberInfo = ShortNumberInfo::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function regionList() | ||||
|     { | ||||
|         $returnList = array(); | ||||
|  | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|         foreach ($phoneUtil->getSupportedRegions() as $regionCode) { | ||||
|             $returnList[] = array($regionCode); | ||||
|         } | ||||
|  | ||||
|         return $returnList; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testFixedLine($region) | ||||
|     { | ||||
|         $fixedLineTypes = array(PhoneNumberType::FIXED_LINE, PhoneNumberType::FIXED_LINE_OR_MOBILE); | ||||
|         $this->checkNumbersValidAndCorrectType(PhoneNumberType::FIXED_LINE, $fixedLineTypes, $region); | ||||
|     } | ||||
|  | ||||
|     private function checkNumbersValidAndCorrectType($exampleNumberRequestedType, $possibleExpectedTypes, $regionCode) | ||||
|     { | ||||
|         $exampleNumber = $this->phoneNumberUtil->getExampleNumberForType($regionCode, $exampleNumberRequestedType); | ||||
|         if ($exampleNumber !== null) { | ||||
|             $this->assertTrue( | ||||
|                 $this->phoneNumberUtil->isValidNumber($exampleNumber), | ||||
|                 "Failed validation for {$exampleNumber}" | ||||
|             ); | ||||
|  | ||||
|             // We know the number is valid, now we check the type. | ||||
|             $exampleNumberType = $this->phoneNumberUtil->getNumberType($exampleNumber); | ||||
|             $this->assertContains($exampleNumberType, $possibleExpectedTypes, "Wrong type for {$exampleNumber}"); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testMobile($region) | ||||
|     { | ||||
|         $mobileTypes = array(PhoneNumberType::MOBILE, PhoneNumberType::FIXED_LINE_OR_MOBILE); | ||||
|         $this->checkNumbersValidAndCorrectType(PhoneNumberType::MOBILE, $mobileTypes, $region); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testTollFree($region) | ||||
|     { | ||||
|         $tollFreeTypes = array(PhoneNumberType::TOLL_FREE); | ||||
|         $this->checkNumbersValidAndCorrectType(PhoneNumberType::TOLL_FREE, $tollFreeTypes, $region); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testPremiumRate($region) | ||||
|     { | ||||
|         $premiumRateTypes = array(PhoneNumberType::PREMIUM_RATE); | ||||
|         $this->checkNumbersValidAndCorrectType(PhoneNumberType::PREMIUM_RATE, $premiumRateTypes, $region); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testVoip($region) | ||||
|     { | ||||
|         $voipTypes = array(PhoneNumberType::VOIP); | ||||
|         $this->checkNumbersValidAndCorrectType(PhoneNumberType::VOIP, $voipTypes, $region); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testPager($region) | ||||
|     { | ||||
|         $pagerTypes = array(PhoneNumberType::PAGER); | ||||
|         $this->checkNumbersValidAndCorrectType(PhoneNumberType::PAGER, $pagerTypes, $region); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testUan($region) | ||||
|     { | ||||
|         $uanTypes = array(PhoneNumberType::UAN); | ||||
|         $this->checkNumbersValidAndCorrectType(PhoneNumberType::UAN, $uanTypes, $region); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testVoicemail($region) | ||||
|     { | ||||
|         $voicemailTypes = array(PhoneNumberType::VOICEMAIL); | ||||
|         $this->checkNumbersValidAndCorrectType(PhoneNumberType::VOICEMAIL, $voicemailTypes, $region); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testSharedCost($region) | ||||
|     { | ||||
|         $sharedCostTypes = array(PhoneNumberType::SHARED_COST); | ||||
|         $this->checkNumbersValidAndCorrectType(PhoneNumberType::SHARED_COST, $sharedCostTypes, $region); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function testCanBeInternationallyDialled($regionCode) | ||||
|     { | ||||
|  | ||||
|         $exampleNumber = null; | ||||
|         /** @var \libphonenumber\PhoneNumberDesc $desc */ | ||||
|         $desc = $this->phoneNumberUtil->getMetadataForRegion($regionCode)->getNoInternationalDialling(); | ||||
|         try { | ||||
|             if ($desc->hasExampleNumber()) { | ||||
|                 $exampleNumber = $this->phoneNumberUtil->parse($desc->getExampleNumber(), $regionCode); | ||||
|             } | ||||
|         } catch (NumberParseException $e) { | ||||
|  | ||||
|         } | ||||
|  | ||||
|         if ($exampleNumber !== null && $this->phoneNumberUtil->canBeInternationallyDialled($exampleNumber)) { | ||||
|             $this->fail("Number {$exampleNumber} should not be internationally diallable"); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public function shortNumberRegionList() | ||||
|     { | ||||
|         $returnList = array(); | ||||
|  | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         ShortNumberInfo::resetInstance(); | ||||
|         $shortNumberInfo = ShortNumberInfo::getInstance(); | ||||
|         foreach ($shortNumberInfo->getSupportedRegions() as $regionCode) { | ||||
|             $returnList[] = array($regionCode); | ||||
|         } | ||||
|  | ||||
|         return $returnList; | ||||
|     } | ||||
|  | ||||
|     public function supportedGlobalNetworkCallingCodes() | ||||
|     { | ||||
|         $returnList = array(); | ||||
|  | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $phoneUtil = PhoneNumberUtil::getInstance(); | ||||
|         foreach ($phoneUtil->getSupportedGlobalNetworkCallingCodes() as $callingCode) { | ||||
|             $returnList[] = array($callingCode); | ||||
|         } | ||||
|  | ||||
|         return $returnList; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider supportedGlobalNetworkCallingCodes | ||||
|      */ | ||||
|     public function testGlobalNetworkNumbers($callingCode) | ||||
|     { | ||||
|         $exampleNumber = $this->phoneNumberUtil->getExampleNumberForNonGeoEntity($callingCode); | ||||
|         $this->assertNotNull($exampleNumber, "No example phone number for calling code " . $callingCode); | ||||
|         if (!$this->phoneNumberUtil->isValidNumber($exampleNumber)) { | ||||
|             $this->fail("Failed validation for " . $exampleNumber); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider regionList | ||||
|      */ | ||||
|     public function getEveryRegionHasExampleNumber($regionCode) | ||||
|     { | ||||
|         $exampleNumber = $this->phoneNumberUtil->getExampleNumber($regionCode); | ||||
|         $this->assertNotNull($exampleNumber, "None found for region " . $regionCode); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider shortNumberRegionList | ||||
|      */ | ||||
|     public function testShortNumbersValidAndCorrectCost($regionCode) | ||||
|     { | ||||
|         $exampleShortNumber = $this->shortNumberInfo->getExampleShortNumber($regionCode); | ||||
|         if (!$this->shortNumberInfo->isValidShortNumberForRegion( | ||||
|             $this->phoneNumberUtil->parse($exampleShortNumber, $regionCode), | ||||
|             $regionCode | ||||
|         ) | ||||
|         ) { | ||||
|             $this->fail( | ||||
|                 "Failed validation for string region_code: {$regionCode}, national_number: {$exampleShortNumber}" | ||||
|             ); | ||||
|         } | ||||
|         $phoneNumber = $this->phoneNumberUtil->parse($exampleShortNumber, $regionCode); | ||||
|         if (!$this->shortNumberInfo->isValidShortNumber($phoneNumber)) { | ||||
|             $this->fail("Failed validation for " . (string)$phoneNumber); | ||||
|         } | ||||
|  | ||||
|         $costArray = array( | ||||
|             ShortNumberCost::PREMIUM_RATE, | ||||
|             ShortNumberCost::STANDARD_RATE, | ||||
|             ShortNumberCost::TOLL_FREE, | ||||
|             ShortNumberCost::UNKNOWN_COST | ||||
|         ); | ||||
|  | ||||
|         foreach ($costArray as $cost) { | ||||
|             $exampleShortNumber = $this->shortNumberInfo->getExampleShortNumberForCost($regionCode, $cost); | ||||
|             if ($exampleShortNumber != '') { | ||||
|                 $this->assertEquals( | ||||
|                     $cost, | ||||
|                     $this->shortNumberInfo->getExpectedCostForRegion($this->phoneNumberUtil->parse($exampleShortNumber, $regionCode), $regionCode), | ||||
|                     "Wrong cost for " . (string)$phoneNumber | ||||
|                 ); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider shortNumberRegionList | ||||
|      */ | ||||
|     public function testEmergency($regionCode) | ||||
|     { | ||||
|         $desc = $this->shortNumberInfo->getMetadataForRegion($regionCode)->getEmergency(); | ||||
|         if ($desc->hasExampleNumber()) { | ||||
|             $exampleNumber = $desc->getExampleNumber(); | ||||
|             $phoneNumber = $this->phoneNumberUtil->parse($exampleNumber, $regionCode); | ||||
|  | ||||
|             if (!$this->shortNumberInfo->isPossibleShortNumberForRegion( | ||||
|                     $phoneNumber, | ||||
|                     $regionCode | ||||
|                 ) || !$this->shortNumberInfo->isEmergencyNumber($exampleNumber, $regionCode) | ||||
|             ) { | ||||
|                 $this->fail("Emergency example number test failed for " . $regionCode); | ||||
|             } elseif ($this->shortNumberInfo->getExpectedCostForRegion( | ||||
|                     $phoneNumber, | ||||
|                     $regionCode | ||||
|                 ) !== ShortNumberCost::TOLL_FREE | ||||
|             ) { | ||||
|                 $this->fail("Emergency example number not toll free for " . $regionCode); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @dataProvider shortNumberRegionList | ||||
|      */ | ||||
|     public function testCarrierSpecificShortNumbers($regionCode) | ||||
|     { | ||||
|         // Test the carrier-specific tag. | ||||
|         $desc = $this->shortNumberInfo->getMetadataForRegion($regionCode)->getCarrierSpecific(); | ||||
|         if ($desc->hasExampleNumber()) { | ||||
|             $exampleNumber = $desc->getExampleNumber(); | ||||
|             $carrierSpecificNumber = $this->phoneNumberUtil->parse($exampleNumber, $regionCode); | ||||
|  | ||||
|             if (!$this->shortNumberInfo->isPossibleShortNumberForRegion( | ||||
|                     $carrierSpecificNumber, | ||||
|                     $regionCode | ||||
|                 ) || !$this->shortNumberInfo->isCarrierSpecific($carrierSpecificNumber) | ||||
|             ) { | ||||
|                 $this->fail("Carrier-specific test failed for " . $regionCode); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,37 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\core; | ||||
|  | ||||
| use libphonenumber\geocoding\PhoneNumberOfflineGeocoder; | ||||
| use libphonenumber\PhoneNumberToCarrierMapper; | ||||
|  | ||||
| /** | ||||
|  * Verifies that classes which require the Intl extension cannot be instantiated. | ||||
|  */ | ||||
| class IntlTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     public function setUp() | ||||
|     { | ||||
|         if (extension_loaded('intl')) { | ||||
|             $this->markTestSkipped('The intl extension must not be installed'); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @expectedException \RuntimeException | ||||
|      * @expectedExceptionMessage The intl extension must be installed | ||||
|      */ | ||||
|     public function testPhoneNumberOfflineGeocoder() | ||||
|     { | ||||
|         PhoneNumberOfflineGeocoder::getInstance(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @expectedException \RuntimeException | ||||
|      * @expectedExceptionMessage The intl extension must be installed | ||||
|      */ | ||||
|     public function testPhoneNumberToCarrierMapper() | ||||
|     { | ||||
|         PhoneNumberToCarrierMapper::getInstance(); | ||||
|     } | ||||
| } | ||||
| @@ -1,99 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\core; | ||||
|  | ||||
| use libphonenumber\CountryCodeSource; | ||||
| use libphonenumber\PhoneNumber; | ||||
|  | ||||
| /** | ||||
|  * Tests for the PhoneNumber object itself. | ||||
|  */ | ||||
| class PhoneNumberTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     public function testEqualSimpleNumber() | ||||
|     { | ||||
|         $numberA = new PhoneNumber(); | ||||
|         $numberA->setCountryCode(1)->setNationalNumber(6502530000); | ||||
|  | ||||
|         $numberB = new PhoneNumber(); | ||||
|         $numberB->setCountryCode(1)->setNationalNumber(6502530000); | ||||
|  | ||||
|         $this->assertEquals($numberA, $numberB); | ||||
|     } | ||||
|  | ||||
|     public function testEqualWithItalianLeadingZeroSetToDefault() | ||||
|     { | ||||
|         $numberA = new PhoneNumber(); | ||||
|         $numberA->setCountryCode(1)->setNationalNumber(6502530000)->setItalianLeadingZero(false); | ||||
|  | ||||
|         $numberB = new PhoneNumber(); | ||||
|         $numberB->setCountryCode(1)->setNationalNumber(6502530000); | ||||
|  | ||||
|         // These should still be equal, since the default value for this field is false. | ||||
|         $this->assertEquals($numberA, $numberB); | ||||
|     } | ||||
|  | ||||
|     public function testEqualWithCountryCodeSourceSet() | ||||
|     { | ||||
|         $numberA = new PhoneNumber(); | ||||
|         $numberA->setRawInput("+1 650 253 00 00")->setCountryCode(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN); | ||||
|  | ||||
|         $numberB = new PhoneNumber(); | ||||
|         $numberB->setRawInput("+1 650 253 00 00")->setCountryCode(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN); | ||||
|  | ||||
|         $this->assertEquals($numberA, $numberB); | ||||
|     } | ||||
|  | ||||
|     public function testNonEqualWithItalianLeadingZeroSetToTrue() | ||||
|     { | ||||
|         $numberA = new PhoneNumber(); | ||||
|         $numberA->setCountryCode(1)->setNationalNumber(6502530000)->setItalianLeadingZero(true); | ||||
|  | ||||
|         $numberB = new PhoneNumber(); | ||||
|         $numberB->setCountryCode(1)->setNationalNumber(6502530000); | ||||
|  | ||||
|         $this->assertNotEquals($numberA, $numberB); | ||||
|         $this->assertFalse($numberA->equals($numberB)); | ||||
|     } | ||||
|  | ||||
|     public function testNonEqualWithDifferingRawInput() | ||||
|     { | ||||
|         $numberA = new PhoneNumber(); | ||||
|         $numberA->setCountryCode(1) | ||||
|             ->setNationalNumber(6502530000) | ||||
|             ->setRawInput("+1 650 253 00 00") | ||||
|             ->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN); | ||||
|  | ||||
|         $numberB = new PhoneNumber(); | ||||
|         $numberB->setCountryCode(1) | ||||
|             ->setNationalNumber(6502530000) | ||||
|             ->setRawInput("+1-650-253-00-00") | ||||
|             ->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN); | ||||
|  | ||||
|         $this->assertNotEquals($numberA, $numberB); | ||||
|         $this->assertFalse($numberA->equals($numberB)); | ||||
|     } | ||||
|  | ||||
|     public function testNonEqualWithPreferredDomesticCarrierCodeSetToDefault() | ||||
|     { | ||||
|         $numberA = new PhoneNumber(); | ||||
|         $numberA->setCountryCode(1)->setNationalNumber(6502530000)->setPreferredDomesticCarrierCode(""); | ||||
|  | ||||
|         $numberB = new PhoneNumber(); | ||||
|         $numberB->setCountryCode(1)->setNationalNumber(6502530000); | ||||
|  | ||||
|         $this->assertNotSame($numberA, $numberB); | ||||
|         $this->assertFalse($numberA->equals($numberB)); | ||||
|     } | ||||
|  | ||||
|     public function testEqualWithPreferredDomesticCarrierCodeSetToDefault() | ||||
|     { | ||||
|         $numberA = new PhoneNumber(); | ||||
|         $numberA->setCountryCode(1)->setNationalNumber(6502530000)->setPreferredDomesticCarrierCode(""); | ||||
|  | ||||
|         $numberB = new PhoneNumber(); | ||||
|         $numberB->setCountryCode(1)->setNationalNumber(6502530000)->setPreferredDomesticCarrierCode(""); | ||||
|  | ||||
|         $this->assertEquals($numberA, $numberB); | ||||
|     } | ||||
| } | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,427 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\core; | ||||
|  | ||||
| use libphonenumber\CountryCodeToRegionCodeMapForTesting; | ||||
| use libphonenumber\NumberParseException; | ||||
| use libphonenumber\PhoneNumber; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
| use libphonenumber\RegionCode; | ||||
| use libphonenumber\ShortNumberCost; | ||||
| use libphonenumber\ShortNumberInfo; | ||||
|  | ||||
| class ShortNumberInfoTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     private static $plusSymbol; | ||||
|     /** | ||||
|      * @var PhoneNumberUtil | ||||
|      */ | ||||
|     protected $phoneUtil; | ||||
|     /** | ||||
|      * @var ShortNumberInfo | ||||
|      */ | ||||
|     private $shortInfo; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         self::$plusSymbol = pack('H*', 'efbc8b'); | ||||
|  | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         ShortNumberInfo::resetInstance(); | ||||
|         $this->phoneUtil = PhoneNumberUtil::getInstance( | ||||
|             PhoneNumberUtilTest::TEST_META_DATA_FILE_PREFIX, | ||||
|             CountryCodeToRegionCodeMapForTesting::$countryCodeToRegionCodeMapForTesting | ||||
|         ); | ||||
|         $this->shortInfo = ShortNumberInfo::getInstance(); | ||||
|     } | ||||
|  | ||||
|     public function testIsPossibleShortNumber() | ||||
|     { | ||||
|         $possibleNumber = new PhoneNumber(); | ||||
|         $possibleNumber->setCountryCode(33)->setNationalNumber(123456); | ||||
|  | ||||
|         $this->assertTrue($this->shortInfo->isPossibleShortNumber($possibleNumber)); | ||||
|         $this->assertTrue($this->shortInfo->isPossibleShortNumberForRegion($this->parse(123456, RegionCode::FR), RegionCode::FR)); | ||||
|  | ||||
|         $impossibleNumber = new PhoneNumber(); | ||||
|         $impossibleNumber->setCountryCode(33)->setNationalNumber(9); | ||||
|         $this->assertFalse($this->shortInfo->isPossibleShortNumber($impossibleNumber)); | ||||
|  | ||||
|         // Note that GB and GG share the country calling code 44, and that this number is possible but | ||||
|         // not valid. | ||||
|         $gbNumber = new PhoneNumber(); | ||||
|         $gbNumber->setCountryCode(44)->setNationalNumber(11001); | ||||
|         $this->assertTrue($this->shortInfo->isPossibleShortNumber($gbNumber)); | ||||
|     } | ||||
|  | ||||
|     public function testIsValidShortNumber() | ||||
|     { | ||||
|         $phoneNumberObj = new PhoneNumber(); | ||||
|         $phoneNumberObj->setCountryCode(33)->setNationalNumber(1010); | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumber($phoneNumberObj)); | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse(1010, RegionCode::FR), RegionCode::FR)); | ||||
|  | ||||
|         $phoneNumberObj = new PhoneNumber(); | ||||
|         $phoneNumberObj->setCountryCode(33)->setNationalNumber(123456); | ||||
|         $this->assertFalse($this->shortInfo->isValidShortNumber($phoneNumberObj)); | ||||
|         $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse(123456, RegionCode::FR), RegionCode::FR)); | ||||
|  | ||||
|         // Note that GB and GG share the country calling code 44 | ||||
|         $phoneNumberObj = new PhoneNumber(); | ||||
|         $phoneNumberObj->setCountryCode(44)->setNationalNumber(18001); | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumber($phoneNumberObj)); | ||||
|     } | ||||
|  | ||||
|     public function testGetExpectedCost() | ||||
|     { | ||||
|         $premiumRateExample = $this->shortInfo->getExampleShortNumberForCost( | ||||
|             RegionCode::FR, | ||||
|             ShortNumberCost::PREMIUM_RATE | ||||
|         ); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::PREMIUM_RATE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse($premiumRateExample, RegionCode::FR), RegionCode::FR) | ||||
|         ); | ||||
|  | ||||
|         $premiumRateNumber = new PhoneNumber(); | ||||
|         $premiumRateNumber->setCountryCode(33)->setNationalNumber($premiumRateExample); | ||||
|         $this->assertEquals(ShortNumberCost::PREMIUM_RATE, $this->shortInfo->getExpectedCost($premiumRateNumber)); | ||||
|  | ||||
|         $standardRateExample = $this->shortInfo->getExampleShortNumberForCost( | ||||
|             RegionCode::FR, | ||||
|             ShortNumberCost::STANDARD_RATE | ||||
|         ); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::STANDARD_RATE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse($standardRateExample, RegionCode::FR), RegionCode::FR) | ||||
|         ); | ||||
|  | ||||
|         $standardRateNumber = new PhoneNumber(); | ||||
|         $standardRateNumber->setCountryCode(33)->setNationalNumber($standardRateExample); | ||||
|         $this->assertEquals(ShortNumberCost::STANDARD_RATE, $this->shortInfo->getExpectedCost($standardRateNumber)); | ||||
|  | ||||
|         $tollFreeExample = $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::TOLL_FREE); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::TOLL_FREE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse($tollFreeExample, RegionCode::FR), RegionCode::FR) | ||||
|         ); | ||||
|         $tollFreeNumber = new PhoneNumber(); | ||||
|         $tollFreeNumber->setCountryCode(33)->setNationalNumber($tollFreeExample); | ||||
|         $this->assertEquals(ShortNumberCost::TOLL_FREE, $this->shortInfo->getExpectedCost($tollFreeNumber)); | ||||
|  | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::UNKNOWN_COST, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse("12345", RegionCode::FR), RegionCode::FR) | ||||
|         ); | ||||
|         $unknownCostNumber = new PhoneNumber(); | ||||
|         $unknownCostNumber->setCountryCode(33)->setNationalNumber(12345); | ||||
|         $this->assertEquals(ShortNumberCost::UNKNOWN_COST, $this->shortInfo->getExpectedCost($unknownCostNumber)); | ||||
|  | ||||
|         // Test that an invalid number may nevertheless have a cost other than UNKNOWN_COST. | ||||
|         $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse("116123", RegionCode::FR), RegionCode::FR)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::TOLL_FREE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse("116123", RegionCode::FR), RegionCode::FR) | ||||
|         ); | ||||
|         $invalidNumber = new PhoneNumber(); | ||||
|         $invalidNumber->setCountryCode(33)->setNationalNumber(116123); | ||||
|         $this->assertFalse($this->shortInfo->isValidShortNumber($invalidNumber)); | ||||
|         $this->assertEquals(ShortNumberCost::TOLL_FREE, $this->shortInfo->getExpectedCost($invalidNumber)); | ||||
|  | ||||
|         // Test a nonexistent country code. | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::UNKNOWN_COST, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse("911", RegionCode::US), RegionCode::ZZ) | ||||
|         ); | ||||
|         $unknownCostNumber->clear(); | ||||
|         $unknownCostNumber->setCountryCode(123)->setNationalNumber(911); | ||||
|         $this->assertEquals(ShortNumberCost::UNKNOWN_COST, $this->shortInfo->getExpectedCost($unknownCostNumber)); | ||||
|     } | ||||
|  | ||||
|     public function testGetExpectedCostForSharedCountryCallingCode() | ||||
|     { | ||||
|         // Test some numbers which have different costs in countries sharing the same country calling | ||||
|         // code. In Australia, 1234 is premium-rate, 1194 is standard-rate, and 733 is toll-free. These | ||||
|         // are not known to be valid numbers in the Christmas Islands. | ||||
|         $ambiguousPremiumRateString = "1234"; | ||||
|         $ambiguousPremiumRateNumber = new PhoneNumber(); | ||||
|         $ambiguousPremiumRateNumber->setCountryCode(61)->setNationalNumber(1234); | ||||
|         $ambiguousStandardRateString = "1194"; | ||||
|         $ambiguousStandardRateNumber = new PhoneNumber(); | ||||
|         $ambiguousStandardRateNumber->setCountryCode(61)->setNationalNumber(1194); | ||||
|         $ambiguousTollFreeString = "733"; | ||||
|         $ambiguousTollFreeNumber = new PhoneNumber(); | ||||
|         $ambiguousTollFreeNumber->setCountryCode(61)->setNationalNumber(733); | ||||
|  | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumber($ambiguousPremiumRateNumber)); | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumber($ambiguousStandardRateNumber)); | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumber($ambiguousTollFreeNumber)); | ||||
|  | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousPremiumRateString, RegionCode::AU), RegionCode::AU)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::PREMIUM_RATE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousPremiumRateString, RegionCode::AU), RegionCode::AU) | ||||
|         ); | ||||
|         $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousPremiumRateString, RegionCode::CX), RegionCode::CX)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::UNKNOWN_COST, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousPremiumRateString, RegionCode::CX), RegionCode::CX) | ||||
|         ); | ||||
|         // PREMIUM_RATE takes precedence over UNKNOWN_COST. | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::PREMIUM_RATE, | ||||
|             $this->shortInfo->getExpectedCost($ambiguousPremiumRateNumber) | ||||
|         ); | ||||
|  | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousStandardRateString, RegionCode::AU), RegionCode::AU)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::STANDARD_RATE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousStandardRateString, RegionCode::AU), RegionCode::AU) | ||||
|         ); | ||||
|         $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousStandardRateString, RegionCode::CX), RegionCode::CX)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::UNKNOWN_COST, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousStandardRateString, RegionCode::CX), RegionCode::CX) | ||||
|         ); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::UNKNOWN_COST, | ||||
|             $this->shortInfo->getExpectedCost($ambiguousStandardRateNumber) | ||||
|         ); | ||||
|  | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousTollFreeString, RegionCode::AU), RegionCode::AU)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::TOLL_FREE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousTollFreeString, RegionCode::AU), RegionCode::AU) | ||||
|         ); | ||||
|         $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousTollFreeString, RegionCode::CX), RegionCode::CX)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::UNKNOWN_COST, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousTollFreeString, RegionCode::CX), RegionCode::CX) | ||||
|         ); | ||||
|         $this->assertEquals(ShortNumberCost::UNKNOWN_COST, $this->shortInfo->getExpectedCost($ambiguousTollFreeNumber)); | ||||
|     } | ||||
|  | ||||
|     public function testGetExampleShortNumber() | ||||
|     { | ||||
|         $this->assertEquals("8711", $this->shortInfo->getExampleShortNumber(RegionCode::AM)); | ||||
|         $this->assertEquals("1010", $this->shortInfo->getExampleShortNumber(RegionCode::FR)); | ||||
|         $this->assertEquals("", $this->shortInfo->getExampleShortNumber(RegionCode::UN001)); | ||||
|         $this->assertEquals("", $this->shortInfo->getExampleShortNumber(null)); | ||||
|     } | ||||
|  | ||||
|     public function testGetExampleShortNumberForCost() | ||||
|     { | ||||
|         $this->assertEquals( | ||||
|             "3010", | ||||
|             $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::TOLL_FREE) | ||||
|         ); | ||||
|         $this->assertEquals( | ||||
|             "1023", | ||||
|             $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::STANDARD_RATE) | ||||
|         ); | ||||
|         $this->assertEquals( | ||||
|             "42000", | ||||
|             $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::PREMIUM_RATE) | ||||
|         ); | ||||
|         $this->assertEquals( | ||||
|             "", | ||||
|             $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::UNKNOWN_COST) | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumber_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("911", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumberLongNumber_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("9116666666", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("1126666666", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("9996666666", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumberWithFormatting_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("9-1-1", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("1-1-2", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("9-9-9", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumberWithPlusSign_US() | ||||
|     { | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("+911", RegionCode::US)); | ||||
|         $this->assertFalse( | ||||
|             $this->shortInfo->connectsToEmergencyNumber(self::$plusSymbol . "911", RegionCode::US) | ||||
|         ); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber(" +911", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("+112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("+999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumber_BR() | ||||
|     { | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("911", RegionCode::BR)); | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("190", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("999", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumberLongNumber_BR() | ||||
|     { | ||||
|         // Brazilian emergency numbers don't work when additional digits are appended. | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("9111", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("1900", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("9996", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumber_CL() | ||||
|     { | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber('131', RegionCode::CL)); | ||||
|         $this->assertTrue($this->shortInfo->connectsToEmergencyNumber('133', RegionCode::CL)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumberLongNumber_CL() | ||||
|     { | ||||
|         // Chilean emergency numbers don't work when additional digits are appended. | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber('1313', RegionCode::CL)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber('1330', RegionCode::CL)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumber_AO() | ||||
|     { | ||||
|         // Angola doesn't have any metadata for emergency numbers in the test metadata. | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("911", RegionCode::AO)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("222123456", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("923123456", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumber_ZW() | ||||
|     { | ||||
|         // Zimbabwe doesn't have any metadata in the test metadata. | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("911", RegionCode::ZW)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("01312345", RegionCode::ZW)); | ||||
|         $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("0711234567", RegionCode::ZW)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumber_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("911", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumberLongNumber_US() | ||||
|     { | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("9116666666", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("1126666666", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("9996666666", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumberWithFormatting_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("9-1-1", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("*911", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("1-1-2", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("*112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("9-9-9", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("*999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumberWithPlusSign_US() | ||||
|     { | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("+911", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber(self::$plusSymbol . "911", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber(" +911", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("+112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("+999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumber_BR() | ||||
|     { | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("911", RegionCode::BR)); | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("190", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("999", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumberLongNumber_BR() | ||||
|     { | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("9111", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("1900", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("9996", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumber_AO() | ||||
|     { | ||||
|         // Angola doesn't have any metadata for emergency numbers in the test metadata. | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("911", RegionCode::AO)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("222123456", RegionCode::AO)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("923123456", RegionCode::AO)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumber_ZW() | ||||
|     { | ||||
|         // Zimbabwe doesn't have any metadata in the test metadata. | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("911", RegionCode::ZW)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("01312345", RegionCode::ZW)); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("0711234567", RegionCode::ZW)); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     public function testEmergencyNumberForSharedCountryCallingCode() | ||||
|     { | ||||
|         // Test the emergency number 112, which is valid in both Australia and the Christmas Islands. | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("112", RegionCode::AU)); | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse("112", RegionCode::AU), RegionCode::AU)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::TOLL_FREE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse("112", RegionCode::AU), RegionCode::AU) | ||||
|         ); | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("112", RegionCode::CX)); | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse("112", RegionCode::CX), RegionCode::CX)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::TOLL_FREE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse("112", RegionCode::CX), RegionCode::CX) | ||||
|         ); | ||||
|         $sharedEmergencyNumber = new PhoneNumber(); | ||||
|         $sharedEmergencyNumber->setCountryCode(61)->setNationalNumber(112); | ||||
|         $this->assertTrue($this->shortInfo->isValidShortNumber($sharedEmergencyNumber)); | ||||
|         $this->assertEquals(ShortNumberCost::TOLL_FREE, $this->shortInfo->getExpectedCost($sharedEmergencyNumber)); | ||||
|     } | ||||
|  | ||||
|     public function testOverlappingNANPANumber() | ||||
|     { | ||||
|         // 211 is an emergency number in Barbados, while it is a toll-free information line in Canada | ||||
|         // and the USA. | ||||
|         $this->assertTrue($this->shortInfo->isEmergencyNumber("211", RegionCode::BB)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::TOLL_FREE, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse("211", RegionCode::BB), RegionCode::BB) | ||||
|         ); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("211", RegionCode::US)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::UNKNOWN_COST, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse("211", RegionCode::US), RegionCode::US) | ||||
|         ); | ||||
|         $this->assertFalse($this->shortInfo->isEmergencyNumber("211", RegionCode::CA)); | ||||
|         $this->assertEquals( | ||||
|             ShortNumberCost::UNKNOWN_COST, | ||||
|             $this->shortInfo->getExpectedCostForRegion($this->parse("211", RegionCode::CA), RegionCode::CA) | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param string $number | ||||
|      * @param string $regionCode | ||||
|      * @return PhoneNumber | ||||
|      */ | ||||
|     private function parse($number, $regionCode) | ||||
|     { | ||||
|         try { | ||||
|             return $this->phoneUtil->parse($number, $regionCode); | ||||
|         } catch (NumberParseException $e) { | ||||
|             $this->fail("Test input data should always parse correctly: " . $number . " (" . $regionCode . ")"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,157 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\core; | ||||
|  | ||||
| use libphonenumber\CountryCodeToRegionCodeMapForTesting; | ||||
| use libphonenumber\PhoneNumberUtil; | ||||
| use libphonenumber\RegionCode; | ||||
| use libphonenumber\ShortNumberUtil; | ||||
|  | ||||
| class ShortNumberUtilTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     private static $plusSymbol; | ||||
|     /** | ||||
|      * @var ShortNumberUtil | ||||
|      */ | ||||
|     private $shortUtil; | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         self::$plusSymbol = pack('H*', 'efbc8b'); | ||||
|  | ||||
|         PhoneNumberUtil::resetInstance(); | ||||
|         $this->shortUtil = new ShortNumberUtil( | ||||
|             PhoneNumberUtil::getInstance( | ||||
|                 PhoneNumberUtilTest::TEST_META_DATA_FILE_PREFIX, | ||||
|                 CountryCodeToRegionCodeMapForTesting::$countryCodeToRegionCodeMapForTesting | ||||
|             ) | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumber_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("911", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumberLongNumber_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("9116666666", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("1126666666", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("9996666666", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumberWithFormatting_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("9-1-1", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("1-1-2", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("9-9-9", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumberWithPlusSign_US() | ||||
|     { | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("+911", RegionCode::US)); | ||||
|         $this->assertFalse( | ||||
|             $this->shortUtil->connectsToEmergencyNumber(self::$plusSymbol . "911", RegionCode::US) | ||||
|         ); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber(" +911", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("+112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("+999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumber_BR() | ||||
|     { | ||||
|         $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("911", RegionCode::BR)); | ||||
|         $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("190", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("999", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumberLongNumber_BR() | ||||
|     { | ||||
|         // Brazilian emergency numbers don't work when additional digits are appended. | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("9111", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("1900", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("9996", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumber_AO() | ||||
|     { | ||||
|         // Angola doesn't have any metadata for emergency numbers in the test metadata. | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("911", RegionCode::AO)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("222123456", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("923123456", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testConnectsToEmergencyNumber_ZW() | ||||
|     { | ||||
|         // Zimbabwe doesn't have any metadata in the test metadata. | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("911", RegionCode::ZW)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("01312345", RegionCode::ZW)); | ||||
|         $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("0711234567", RegionCode::ZW)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumber_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortUtil->isEmergencyNumber("911", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortUtil->isEmergencyNumber("112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumberLongNumber_US() | ||||
|     { | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("9116666666", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("1126666666", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("9996666666", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumberWithFormatting_US() | ||||
|     { | ||||
|         $this->assertTrue($this->shortUtil->isEmergencyNumber("9-1-1", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortUtil->isEmergencyNumber("*911", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortUtil->isEmergencyNumber("1-1-2", RegionCode::US)); | ||||
|         $this->assertTrue($this->shortUtil->isEmergencyNumber("*112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("9-9-9", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("*999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumberWithPlusSign_US() | ||||
|     { | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("+911", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber(self::$plusSymbol . "911", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber(" +911", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("+112", RegionCode::US)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("+999", RegionCode::US)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumber_BR() | ||||
|     { | ||||
|         $this->assertTrue($this->shortUtil->isEmergencyNumber("911", RegionCode::BR)); | ||||
|         $this->assertTrue($this->shortUtil->isEmergencyNumber("190", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("999", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumberLongNumber_BR() | ||||
|     { | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("9111", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("1900", RegionCode::BR)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("9996", RegionCode::BR)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumber_AO() | ||||
|     { | ||||
|         // Angola doesn't have any metadata for emergency numbers in the test metadata. | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("911", RegionCode::AO)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("222123456", RegionCode::AO)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("923123456", RegionCode::AO)); | ||||
|     } | ||||
|  | ||||
|     public function testIsEmergencyNumber_ZW() | ||||
|     { | ||||
|         // Zimbabwe doesn't have any metadata in the test metadata. | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("911", RegionCode::ZW)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("01312345", RegionCode::ZW)); | ||||
|         $this->assertFalse($this->shortUtil->isEmergencyNumber("0711234567", RegionCode::ZW)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -1,116 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{8}', | ||||
|     'ExampleNumber' => '12345678', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|     'ExampleNumber' => '12345678', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|     'ExampleNumber' => '12345678', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{8}', | ||||
|     'ExampleNumber' => '12345678', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => '001', | ||||
|   'countryCode' => 800, | ||||
|   'internationalPrefix' => '', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => true, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,116 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '\\d{9}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '123456789', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|     'ExampleNumber' => '123456789', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|     'ExampleNumber' => '123456789', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '\\d{9}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '123456789', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => '001', | ||||
|   'countryCode' => 979, | ||||
|   'internationalPrefix' => '', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d)(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,96 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'AD', | ||||
|   'countryCode' => 376, | ||||
|   'internationalPrefix' => '00', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,103 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-9]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-9]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-9]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '600\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '600123456', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'AE', | ||||
|   'countryCode' => 971, | ||||
|   'internationalPrefix' => '00', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,116 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[29]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '2\\d(?:[26-9]\\d|\\d[26-9])\\d{5}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '222123456', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '9[1-3]\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '923123456', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'AO', | ||||
|   'countryCode' => 244, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '0~0', | ||||
|   'nationalPrefixForParsing' => '0~0', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{3})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,211 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-3689]\\d{9,10}', | ||||
|     'PossibleNumberPattern' => '\\d{6,11}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-3]\\d{9}', | ||||
|     'PossibleNumberPattern' => '\\d{6,10}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '9\\d{10}|[1-3]\\d{9}', | ||||
|     'PossibleNumberPattern' => '\\d{10,11}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '80\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '6(0\\d|10)\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'AR', | ||||
|   'countryCode' => 54, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0(?:(11|343|3715)15)?', | ||||
|   'nationalPrefixTransformRule' => '9$1', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '11', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})(\\d{2})(\\d{4})', | ||||
|       'format' => '$1 $2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1[02-9]|[23]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(9)(11)(\\d{4})(\\d{4})', | ||||
|       'format' => '$2 15 $3-$4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '911', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     3 =>  | ||||
|     array ( | ||||
|       'pattern' => '(9)(\\d{4})(\\d{2})(\\d{4})', | ||||
|       'format' => '$2 $3-$4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '9(?:1[02-9]|[23])', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '0$1 $CC', | ||||
|     ), | ||||
|     4 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1-$2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[68]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '11', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})(\\d{2})(\\d{4})', | ||||
|       'format' => '$1 $2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1[02-9]|[23]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(9)(11)(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '911', | ||||
|       ), | ||||
|     ), | ||||
|     3 =>  | ||||
|     array ( | ||||
|       'pattern' => '(9)(\\d{4})(\\d{2})(\\d{4})', | ||||
|       'format' => '$1 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '9(?:1[02-9]|[23])', | ||||
|       ), | ||||
|     ), | ||||
|     4 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1-$2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[68]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,127 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-578]\\d{4,14}', | ||||
|     'PossibleNumberPattern' => '\\d{5,15}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[2378]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '4\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '1800\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '190[0126]\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'AU', | ||||
|   'countryCode' => 61, | ||||
|   'internationalPrefix' => '001[12]', | ||||
|   'preferredInternationalPrefix' => '0011', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})(\\d{3})(\\d{3})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{1})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[2-478]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,96 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'BB', | ||||
|   'countryCode' => 1, | ||||
|   'internationalPrefix' => '011', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,96 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'BR', | ||||
|   'countryCode' => 55, | ||||
|   'internationalPrefix' => '', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,104 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '(242|8(00|66|77|88)|900)\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{7,10}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[3-57]|9[2-5])|4(?:2[237]|51|64|77)|502|636|702)\\d{4}', | ||||
|     'PossibleNumberPattern' => '\\d{7,10}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '242(357|359|457|557)\\d{4}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '8(00|66|77|88)\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '900\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'BS', | ||||
|   'countryCode' => 1, | ||||
|   'internationalPrefix' => '011', | ||||
|   'nationalPrefix' => '1', | ||||
|   'nationalPrefixForParsing' => '1', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,138 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-9]\\d{5}', | ||||
|     'PossibleNumberPattern' => '\\d{6}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-9]\\d{5}', | ||||
|     'PossibleNumberPattern' => '\\d{6}', | ||||
|     'ExampleNumber' => '112345', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-9]\\d{5}', | ||||
|     'PossibleNumberPattern' => '\\d{6}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'BY', | ||||
|   'countryCode' => 375, | ||||
|   'internationalPrefix' => '810', | ||||
|   'nationalPrefix' => '8', | ||||
|   'nationalPrefixForParsing' => '80?|99999', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})', | ||||
|       'format' => '$1', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[1-8]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '8 $1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{3})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[1-8]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '8$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[1-8]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '8 $1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,96 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'CA', | ||||
|   'countryCode' => 1, | ||||
|   'internationalPrefix' => '011', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,96 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'CC', | ||||
|   'countryCode' => 61, | ||||
|   'internationalPrefix' => '', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,114 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'CN', | ||||
|   'countryCode' => 86, | ||||
|   'internationalPrefix' => '', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{5,6})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[3-9]', | ||||
|         1 => '[3-9]\\d{2}[19]', | ||||
|         2 => ' | ||||
|             [3-9]\\d{2}(?: | ||||
|               10| | ||||
|               95 | ||||
|             ) | ||||
|           ', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '$CC $1', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,96 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'CX', | ||||
|   'countryCode' => 61, | ||||
|   'internationalPrefix' => '00', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,173 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '\\d{4,14}', | ||||
|     'PossibleNumberPattern' => '\\d{2,14}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '(?:[24-6]\\d{2}|3[03-9]\\d|[789](?:[1-9]\\d|0[2-9]))\\d{1,8}', | ||||
|     'PossibleNumberPattern' => '\\d{2,14}', | ||||
|     'ExampleNumber' => '30123456', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '1(5\\d{9}|7\\d{8}|6[02]\\d{8}|63\\d{7})', | ||||
|     'PossibleNumberPattern' => '\\d{10,11}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '800\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '900([135]\\d{6}|9\\d{7})', | ||||
|     'PossibleNumberPattern' => '\\d{10,11}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'DE', | ||||
|   'countryCode' => 49, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3,8})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '2|3[3-9]|906|[4-9][1-9]1', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4,11})', | ||||
|       'format' => '$1/$2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[34]0|[68]9', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '([4-9]\\d)(\\d{2})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[4-9]', | ||||
|         1 => '[4-6]|[7-9](?:\\d[1-9]|[1-9]\\d)', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     3 =>  | ||||
|     array ( | ||||
|       'pattern' => '([4-9]\\d{3})(\\d{2,7})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[4-9]', | ||||
|         1 => '[4-6]|[7-9](?:\\d[1-9]|[1-9]\\d)', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     4 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{1})(\\d{6})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '800', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     5 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3,4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '900', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,115 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '3\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{7}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '3\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{7}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '3\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{7}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'FR', | ||||
|   'countryCode' => 33, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})', | ||||
|       'format' => '$1 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '3', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,148 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '\\d{10}', | ||||
|     'PossibleNumberPattern' => '\\d{6,10}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-6]\\d{9}', | ||||
|     'PossibleNumberPattern' => '\\d{6,10}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '7[1-57-9]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '80\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '9[018]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '8(?:4[3-5]|7[0-2])\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '70\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '56\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '76\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'GB', | ||||
|   'countryCode' => 44, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[1-59]|[78]0', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '(0$1)', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})', | ||||
|       'format' => '$1 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '6', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '(0$1)', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})(\\d{3})(\\d{3})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '7[1-57-9]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '(0$1)', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     3 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '8[47]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '(0$1)', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => true, | ||||
| ); | ||||
| @@ -1,96 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'GG', | ||||
|   'countryCode' => 44, | ||||
|   'internationalPrefix' => '', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,104 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '30\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '30\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '30\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'HU', | ||||
|   'countryCode' => 36, | ||||
|   'internationalPrefix' => '', | ||||
|   'nationalPrefix' => '06', | ||||
|   'nationalPrefixForParsing' => '06', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,146 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[0389]\\d{5,10}', | ||||
|     'PossibleNumberPattern' => '\\d{6,11}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '0\\d{9,10}', | ||||
|     'PossibleNumberPattern' => '\\d{10,11}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '3\\d{8,9}', | ||||
|     'PossibleNumberPattern' => '\\d{9,10}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '80(?:0\\d{6}|3\\d{3})', | ||||
|     'PossibleNumberPattern' => '\\d{6,9}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '89(?:2\\d{3}|9\\d{6})', | ||||
|     'PossibleNumberPattern' => '\\d{6,9}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'IT', | ||||
|   'countryCode' => 39, | ||||
|   'internationalPrefix' => '00', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '0[26]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{4})(\\d{3,4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '0[13-57-9]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '3', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     3 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3,6})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '8', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => true, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,187 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '07\\d{5}|[1-357-9]\\d{3,10}', | ||||
|     'PossibleNumberPattern' => '\\d{4,11}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '07\\d{5}|[1-357-9]\\d{3,10}', | ||||
|     'PossibleNumberPattern' => '\\d{4,11}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '07\\d{5}|[1-357-9]\\d{3,10}', | ||||
|     'PossibleNumberPattern' => '\\d{4,11}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '0777[01]\\d{2}', | ||||
|     'PossibleNumberPattern' => '\\d{7}', | ||||
|     'ExampleNumber' => '0777012', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[23]\\d{3}', | ||||
|     'PossibleNumberPattern' => '\\d{4}', | ||||
|   ), | ||||
|   'id' => 'JP', | ||||
|   'countryCode' => 81, | ||||
|   'internationalPrefix' => '010', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[57-9]0', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[57-9]0', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '111|222|333', | ||||
|         1 => '(?:111|222|333)1', | ||||
|         2 => '(?:111|222|333)11', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     3 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})(\\d)(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '222|333', | ||||
|         1 => '2221|3332', | ||||
|         2 => '22212|3332', | ||||
|         3 => '222120|3332', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     4 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{2})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[23]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     5 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{4})', | ||||
|       'format' => '$1-$2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '077', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     6 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})', | ||||
|       'format' => '*$1', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[23]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => true, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,254 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-7]\\d{3,9}|8\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{4,10}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '(?:2|[34][1-3]|5[1-5]|6[1-4])(?:1\\d{2,3}|[2-9]\\d{6,7})', | ||||
|     'PossibleNumberPattern' => '\\d{4,10}', | ||||
|     'ExampleNumber' => '22123456', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '1[0-25-9]\\d{7,8}', | ||||
|     'PossibleNumberPattern' => '\\d{9,10}', | ||||
|     'ExampleNumber' => '1023456789', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '80\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '801234567', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '60[2-9]\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '602345678', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '50\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|     'ExampleNumber' => '5012345678', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '70\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|     'ExampleNumber' => '7012345678', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'KR', | ||||
|   'countryCode' => 82, | ||||
|   'internationalPrefix' => '00(?:[124-68]|[37]\\d{2})', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0(8[1-46-8]|85\\d{2})?', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1-$2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1(?:0|1[19]|[69]9|5[458])|[57]0', | ||||
|         1 => '1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1-$2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-6][1-9][2-9]', | ||||
|         1 => '1(?:[169][2-8]|[78]|5(?:[1-3]|4[56]))|[68]0|[3-6][1-9][2-9]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d)(\\d{4})', | ||||
|       'format' => '$1-$2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '131', | ||||
|         1 => '1312', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     3 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{2})(\\d{4})', | ||||
|       'format' => '$1-$2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '131', | ||||
|         1 => '131[13-9]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     4 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1-$2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '13[2-9]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     5 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1-$2-$3-$4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '30', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     6 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d)(\\d{4})(\\d{4})', | ||||
|       'format' => '$1-$2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '2(?:[26]|3[0-467])', | ||||
|         1 => '2(?:[26]|3(?:01|1[45]|2[17-9]|39|4|6[67]|7[078]))', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     7 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d)(\\d{3})(\\d{4})', | ||||
|       'format' => '$1-$2-$3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '2(?:3[0-35-9]|[457-9])', | ||||
|         1 => '2(?:3(?:0[02-9]|1[0-36-9]|2[02-6]|3[0-8]|6[0-589]|7[1-69]|[589])|[457-9])', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     8 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d)(\\d{3})', | ||||
|       'format' => '$1-$2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '21[0-46-9]', | ||||
|         1 => '21(?:[0-247-9]|3[124]|6[1269])', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     9 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d)(\\d{4})', | ||||
|       'format' => '$1-$2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '21[36]', | ||||
|         1 => '21(?:3[035-9]|6[03-578])', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     10 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{3})', | ||||
|       'format' => '$1-$2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[3-6][1-9]1', | ||||
|         1 => '[3-6][1-9]1(?:[0-46-9])', | ||||
|         2 => '[3-6][1-9]1(?:[0-247-9]|3[124]|6[1269])', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     11 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4})', | ||||
|       'format' => '$1-$2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[3-6][1-9]1', | ||||
|         1 => '[3-6][1-9]1[36]', | ||||
|         2 => '[3-6][1-9]1(?:3[035-9]|6[03-578])', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,211 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-9]\\d{9,10}', | ||||
|     'PossibleNumberPattern' => '\\d{7,11}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[2-9]\\d{9}', | ||||
|     'PossibleNumberPattern' => '\\d{7,10}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '1\\d{10}', | ||||
|     'PossibleNumberPattern' => '\\d{11}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '800\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '900\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'MX', | ||||
|   'countryCode' => 52, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '01', | ||||
|   'nationalPrefixForParsing' => '01|04[45](\\d{10})', | ||||
|   'nationalPrefixTransformRule' => '1$1', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[89]00', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '01 $1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '33|55|81', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '01 $1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[2467]|3[0-24-9]|5[0-46-9]|8[2-9]|9[1-9]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '01 $1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     3 =>  | ||||
|     array ( | ||||
|       'pattern' => '(1)(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '045 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1(?:33|55|81)', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     4 =>  | ||||
|     array ( | ||||
|       'pattern' => '(1)(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '045 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1(?:[124579]|3[0-24-9]|5[0-46-9]|8[02-9])', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[89]00', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '01 $1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '33|55|81', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '01 $1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[2467]|3[0-24-9]|5[0-46-9]|8[2-9]|9[1-9]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '01 $1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     3 =>  | ||||
|     array ( | ||||
|       'pattern' => '(1)(\\d{2})(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1(?:33|55|81)', | ||||
|       ), | ||||
|     ), | ||||
|     4 =>  | ||||
|     array ( | ||||
|       'pattern' => '(1)(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1(?:[124579]|3[0-24-9]|5[0-46-9]|8[02-9])', | ||||
|       ), | ||||
|     ), | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,140 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => ' | ||||
|           [289]\\d{7,9}| | ||||
|           [3-7]\\d{7} | ||||
|         ', | ||||
|     'PossibleNumberPattern' => '\\d{7,10}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '24099\\d{3}|(?:3[2-79]|[479][2-689]|6[235-9])\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{7,8}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '2(?:[027]\\d{7}|9\\d{6,7}|1(?:0\\d{5,7}|[12]\\d{5,6}|[3-9]\\d{5})|4[1-9]\\d{6}|8\\d{7,8})', | ||||
|     'PossibleNumberPattern' => '\\d{8,10}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '800\\d{6,7}', | ||||
|     'PossibleNumberPattern' => '\\d{9,10}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '900\\d{6,7}', | ||||
|     'PossibleNumberPattern' => '\\d{9,10}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'NZ', | ||||
|   'countryCode' => 64, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d)(\\d{3})(\\d{4})', | ||||
|       'format' => '$1-$2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '24|[34679]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d)(\\d{3})(\\d{3,5})', | ||||
|       'format' => '$1-$2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '2[179]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[89]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,114 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-9]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[1-9]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '(?:5[01]|6[069]|7[289]|88)\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '800\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '70\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'PL', | ||||
|   'countryCode' => 48, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', | ||||
|       'format' => '$1 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,119 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[268]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '262\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '262161234', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '6(?:9[23]|47)\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '692123456', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '80\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '801234567', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '8(?:1[01]|2[0156]|84|9[0-37-9])\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '810123456', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'RE', | ||||
|   'countryCode' => 262, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '([268]\\d{2})(\\d{2})(\\d{2})(\\d{2})', | ||||
|       'format' => '$1 $2 $3 $4', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '0$1', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingDigits' => '262|6(?:9[23]|47)|8', | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,139 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[13689]\\d{7,10}', | ||||
|     'PossibleNumberPattern' => ' | ||||
|           \\d{8}| | ||||
|           \\d{10,11} | ||||
|         ', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[36]\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{8}', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[89]\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{8}', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '1?800\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10,11}', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '1900\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{11}', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'SG', | ||||
|   'countryCode' => 65, | ||||
|   'internationalPrefix' => '0[0-3][0-9]', | ||||
|   'nationalPrefixForParsing' => '777777', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})(\\d{4})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '[369]|8[1-9]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{4})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '1[89]', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     2 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|         0 => '800', | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,141 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[13-689]\\d{9}|2[0-35-9]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?', | ||||
|     'ExampleNumber' => '1234567890', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[13-689]\\d{9}|2[0-35-9]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?', | ||||
|     'ExampleNumber' => '1234567890', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[13-689]\\d{9}|2[0-35-9]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?', | ||||
|     'ExampleNumber' => '1234567890', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '8(?:00|66|77|88)\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|     'ExampleNumber' => '1234567890', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '900\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|     'ExampleNumber' => '1234567890', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '800\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{10}', | ||||
|     'ExampleNumber' => '1234567890', | ||||
|   ), | ||||
|   'id' => 'US', | ||||
|   'countryCode' => 1, | ||||
|   'internationalPrefix' => '011', | ||||
|   'nationalPrefix' => '1', | ||||
|   'preferredExtnPrefix' => ' extn. ', | ||||
|   'nationalPrefixForParsing' => '1', | ||||
|   'sameMobileAndFixedLinePattern' => true, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|     1 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|     0 =>  | ||||
|     array ( | ||||
|       'pattern' => '(\\d{3})(\\d{3})(\\d{4})', | ||||
|       'format' => '$1 $2 $3', | ||||
|       'leadingDigitsPatterns' =>  | ||||
|       array ( | ||||
|       ), | ||||
|       'nationalPrefixFormattingRule' => '', | ||||
|       'domesticCarrierCodeFormattingRule' => '', | ||||
|     ), | ||||
|   ), | ||||
|   'mainCountryForCode' => true, | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => true, | ||||
| ); | ||||
| @@ -1,108 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link BuildMetadataPHPFromXml}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
|  | ||||
| return array ( | ||||
|   'generalDesc' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '[268]\\d{8}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|   ), | ||||
|   'fixedLine' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '2696[0-4]\\d{4}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '269601234', | ||||
|   ), | ||||
|   'mobile' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '639\\d{6}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '639123456', | ||||
|   ), | ||||
|   'tollFree' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => '80\\d{7}', | ||||
|     'PossibleNumberPattern' => '\\d{9}', | ||||
|     'ExampleNumber' => '801234567', | ||||
|   ), | ||||
|   'premiumRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'sharedCost' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'personalNumber' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voip' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'pager' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'uan' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'emergency' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'voicemail' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'shortCode' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'standardRate' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'carrierSpecific' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'noInternationalDialling' =>  | ||||
|   array ( | ||||
|     'NationalNumberPattern' => 'NA', | ||||
|     'PossibleNumberPattern' => 'NA', | ||||
|   ), | ||||
|   'id' => 'YT', | ||||
|   'countryCode' => 262, | ||||
|   'internationalPrefix' => '00', | ||||
|   'nationalPrefix' => '0', | ||||
|   'nationalPrefixForParsing' => '0', | ||||
|   'sameMobileAndFixedLinePattern' => false, | ||||
|   'numberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'intlNumberFormat' =>  | ||||
|   array ( | ||||
|   ), | ||||
|   'mainCountryForCode' => false, | ||||
|   'leadingDigits' => '269|639', | ||||
|   'leadingZeroPossible' => false, | ||||
|   'mobileNumberPortableRegion' => false, | ||||
| ); | ||||
| @@ -1,201 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\geocoding; | ||||
|  | ||||
| use libphonenumber\geocoding\PhoneNumberOfflineGeocoder; | ||||
| use libphonenumber\PhoneNumber; | ||||
|  | ||||
|  | ||||
| class PhoneNumberOfflineGeocoderTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     const TEST_META_DATA_FILE_PREFIX = "/../../../Tests/libphonenumber/Tests/prefixmapper/data/"; | ||||
|     private static $KO_Number1; | ||||
|     private static $KO_Number2; | ||||
|     private static $KO_Number3; | ||||
|     private static $KO_InvalidNumber; | ||||
|     private static $US_Number1; | ||||
|     private static $US_Number2; | ||||
|     private static $US_Number3; | ||||
|     private static $US_Number4; | ||||
|     private static $US_InvalidNumber; | ||||
|     private static $NANPA_TollFree; | ||||
|     private static $BS_Number1; | ||||
|     private static $AU_Number; | ||||
|     private static $AR_MobileNumber; | ||||
|     private static $numberWithInvalidCountryCode; | ||||
|     private static $internationalTollFree; | ||||
|     /** | ||||
|      * @var PhoneNumberOfflineGeocoder | ||||
|      */ | ||||
|     protected $geocoder; | ||||
|  | ||||
|     public static function setUpBeforeClass() | ||||
|     { | ||||
|         self::$KO_Number1 = new PhoneNumber(); | ||||
|         self::$KO_Number1->setCountryCode(82)->setNationalNumber(22123456); | ||||
|  | ||||
|         self::$KO_Number2 = new PhoneNumber(); | ||||
|         self::$KO_Number2->setCountryCode(82)->setNationalNumber(322123456); | ||||
|  | ||||
|         self::$KO_Number3 = new PhoneNumber(); | ||||
|         self::$KO_Number3->setCountryCode(82)->setNationalNumber(6421234567); | ||||
|  | ||||
|         self::$KO_InvalidNumber = new PhoneNumber(); | ||||
|         self::$KO_InvalidNumber->setCountryCode(82)->setNationalNumber(1234); | ||||
|  | ||||
|         self::$US_Number1 = new PhoneNumber(); | ||||
|         self::$US_Number1->setCountryCode(1)->setNationalNumber(6502530000); | ||||
|  | ||||
|         self::$US_Number2 = new PhoneNumber(); | ||||
|         self::$US_Number2->setCountryCode(1)->setNationalNumber(6509600000); | ||||
|  | ||||
|         self::$US_Number3 = new PhoneNumber(); | ||||
|         self::$US_Number3->setCountryCode(1)->setNationalNumber(2128120000); | ||||
|  | ||||
|         self::$US_Number4 = new PhoneNumber(); | ||||
|         self::$US_Number4->setCountryCode(1)->setNationalNumber(6174240000); | ||||
|  | ||||
|         self::$US_InvalidNumber = new PhoneNumber(); | ||||
|         self::$US_InvalidNumber->setCountryCode(1)->setNationalNumber(123456789); | ||||
|  | ||||
|         self::$NANPA_TollFree = new PhoneNumber(); | ||||
|         self::$NANPA_TollFree->setCountryCode(1)->setNationalNumber(8002431234); | ||||
|  | ||||
|         self::$BS_Number1 = new PhoneNumber(); | ||||
|         self::$BS_Number1->setCountryCode(1)->setNationalNumber(2423651234); | ||||
|  | ||||
|         self::$AU_Number = new PhoneNumber(); | ||||
|         self::$AU_Number->setCountryCode(61)->setNationalNumber(236618300); | ||||
|  | ||||
|         self::$AR_MobileNumber = new PhoneNumber(); | ||||
|         self::$AR_MobileNumber->setCountryCode(54)->setNationalNumber(92214000000); | ||||
|  | ||||
|         self::$numberWithInvalidCountryCode = new PhoneNumber(); | ||||
|         self::$numberWithInvalidCountryCode->setCountryCode(999)->setNationalNumber(2423651234); | ||||
|  | ||||
|         self::$internationalTollFree = new PhoneNumber(); | ||||
|         self::$internationalTollFree->setCountryCode(800)->setNationalNumber(12345678); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         if(!extension_loaded('intl')) { | ||||
|             $this->markTestSkipped('The intl extension must be installed'); | ||||
|         } | ||||
|  | ||||
|         PhoneNumberOfflineGeocoder::resetInstance(); | ||||
|         $this->geocoder = PhoneNumberOfflineGeocoder::getInstance(self::TEST_META_DATA_FILE_PREFIX); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForNumberWithNoDataFile() | ||||
|     { | ||||
|         // No data file containing mappings for US numbers is available in Chinese for the unittests. As | ||||
|         // a result, the country name of United States in simplified Chinese is returned. | ||||
|  | ||||
|         $this->assertEquals( | ||||
|             pack('H*', 'e7be8e') . pack('H*', 'e59bbd'), | ||||
|             $this->geocoder->getDescriptionForNumber(self::$US_Number1, "zh_CN") | ||||
|         ); | ||||
|         $this->assertEquals("Bahamas", $this->geocoder->getDescriptionForNumber(self::$BS_Number1, "en_US")); | ||||
|         $this->assertEquals("Australia", $this->geocoder->getDescriptionForNumber(self::$AU_Number, "en_US")); | ||||
|         $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$numberWithInvalidCountryCode, "en_US")); | ||||
|         $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$internationalTollFree, "en_US")); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForNumberWithMissingPrefix() | ||||
|     { | ||||
|         // Test that the name of the country is returned when the number passed in is valid but not | ||||
|         // covered by the geocoding data file. | ||||
|  | ||||
|         $this->assertEquals("United States", $this->geocoder->getDescriptionForNumber(self::$US_Number4, "en_US")); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForNumberBelongingToMultipleCountriesIsEmpty() | ||||
|     { | ||||
|         // Test that nothing is returned when the number passed in is valid but not | ||||
|         // covered by the geocoding data file and belongs to multiple countries | ||||
|         $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$NANPA_TollFree, 'en_US')); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForNumber_en_US() | ||||
|     { | ||||
|         $ca = $this->geocoder->getDescriptionForNumber(self::$US_Number1, "en_US"); | ||||
|         $this->assertEquals("CA", $ca); | ||||
|         $this->assertEquals("Mountain View, CA", $this->geocoder->getDescriptionForNumber(self::$US_Number2, "en_US")); | ||||
|         $this->assertEquals("New York, NY", $this->geocoder->getDescriptionForNumber(self::$US_Number3, "en_US")); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForKoreanNumber() | ||||
|     { | ||||
|         $this->assertEquals("Seoul", $this->geocoder->getDescriptionForNumber(self::$KO_Number1, "en")); | ||||
|         $this->assertEquals("Incheon", $this->geocoder->getDescriptionForNumber(self::$KO_Number2, "en")); | ||||
|         $this->assertEquals("Jeju", $this->geocoder->getDescriptionForNumber(self::$KO_Number3, "en")); | ||||
|  | ||||
|         $this->assertEquals( | ||||
|             pack('H*', 'ec849c') . pack('H*', 'ec9ab8'), | ||||
|             $this->geocoder->getDescriptionForNumber(self::$KO_Number1, "ko") | ||||
|         ); | ||||
|         $this->assertEquals( | ||||
|             pack('H*', 'ec9db8') . pack('H*', 'ecb29c'), | ||||
|             $this->geocoder->getDescriptionForNumber(self::$KO_Number2, "ko") | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForArgentinianMobileNumber() | ||||
|     { | ||||
|         $this->assertEquals("La Plata", $this->geocoder->getDescriptionForNumber(self::$AR_MobileNumber, "en")); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForFallBack() | ||||
|     { | ||||
|         // No fallback, as the location name for the given phone number is available in the requested | ||||
|         // language. | ||||
|  | ||||
|         $this->assertEquals("Kalifornien", $this->geocoder->getDescriptionForNumber(self::$US_Number1, "de")); | ||||
|  | ||||
|         // German falls back to English. | ||||
|         $this->assertEquals("New York, NY", $this->geocoder->getDescriptionForNumber(self::$US_Number3, "de")); | ||||
|  | ||||
|         // Italian fals back to English. | ||||
|         $this->assertEquals("CA", $this->geocoder->getDescriptionForNumber(self::$US_Number1, "it")); | ||||
|  | ||||
|         // Korean doesn't fall back to English. - | ||||
|         $this->assertEquals( | ||||
|             pack('H*', 'eb8c80') . pack('H*', 'ed959c') . pack('H*', 'ebafbc') . pack('H*', 'eab5ad'), | ||||
|             $this->geocoder->getDescriptionForNumber(self::$KO_Number3, "ko") | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForNumberWithUserRegion() | ||||
|     { | ||||
|         // User in Italy, American number. We should just show United States, in Spanish, and not more | ||||
|         // detailed information. | ||||
|         $this->assertEquals( | ||||
|             "Estados Unidos", | ||||
|             $this->geocoder->getDescriptionForNumber(self::$US_Number1, "es_ES", "IT") | ||||
|         ); | ||||
|  | ||||
|         // Unknown region - should just show country name. | ||||
|         $this->assertEquals( | ||||
|             "Estados Unidos", | ||||
|             $this->geocoder->getDescriptionForNumber(self::$US_Number1, "es_ES", "ZZ") | ||||
|         ); | ||||
|  | ||||
|         // User in the States, language German, should show detailed data. | ||||
|         $this->assertEquals("Kalifornien", $this->geocoder->getDescriptionForNumber(self::$US_Number1, "de", "US")); | ||||
|  | ||||
|         // User in the States, language French, no data for French, so we fallback to English detailed | ||||
|         // data. | ||||
|         $this->assertEquals("CA", $this->geocoder->getDescriptionForNumber(self::$US_Number1, "fr", "US")); | ||||
|  | ||||
|         // Invalid number - return an empty string. | ||||
|         $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$US_InvalidNumber, "en", "US")); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForInvalidNumber() | ||||
|     { | ||||
|         $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$KO_InvalidNumber, "en")); | ||||
|         $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$US_InvalidNumber, "en")); | ||||
|     } | ||||
| } | ||||
| @@ -1,79 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\prefixmapper; | ||||
|  | ||||
| use libphonenumber\PhoneNumber; | ||||
| use libphonenumber\prefixmapper\PrefixFileReader; | ||||
|  | ||||
|  | ||||
| class PrefixFileReaderTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     const TEST_META_DATA_FILE_PREFIX = "/data/"; | ||||
|     private static $KO_NUMBER; | ||||
|     private static $US_NUMBER1; | ||||
|     private static $US_NUMBER2; | ||||
|     private static $US_NUMBER3; | ||||
|     private static $SE_NUMBER; | ||||
|     /** | ||||
|      * @var PrefixFileReader | ||||
|      */ | ||||
|     protected $reader; | ||||
|  | ||||
|     public static function setUpBeforeClass() | ||||
|     { | ||||
|         self::$KO_NUMBER = new PhoneNumber(); | ||||
|         self::$KO_NUMBER->setCountryCode(82)->setNationalNumber(22123456); | ||||
|  | ||||
|         self::$US_NUMBER1 = new PhoneNumber(); | ||||
|         self::$US_NUMBER1->setCountryCode(1)->setNationalNumber(6502530000); | ||||
|  | ||||
|         self::$US_NUMBER2 = new PhoneNumber(); | ||||
|         self::$US_NUMBER2->setCountryCode(1)->setNationalNumber(2128120000); | ||||
|  | ||||
|         self::$US_NUMBER3 = new PhoneNumber(); | ||||
|         self::$US_NUMBER3->setCountryCode(1)->setNationalNumber(6174240000); | ||||
|  | ||||
|         self::$SE_NUMBER = new PhoneNumber(); | ||||
|         self::$SE_NUMBER->setCountryCode(46)->setNationalNumber(81234567); | ||||
|     } | ||||
|  | ||||
|     public function setUp() | ||||
|     { | ||||
|         $this->reader = new PrefixFileReader(__DIR__ . DIRECTORY_SEPARATOR . self::TEST_META_DATA_FILE_PREFIX); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForNumberWithMapping() | ||||
|     { | ||||
|         $this->assertEquals("Kalifornien", $this->reader->getDescriptionForNumber(self::$US_NUMBER1, "de", "", "CH")); | ||||
|         $this->assertEquals("CA", $this->reader->getDescriptionForNumber(self::$US_NUMBER1, "en", "", "AU")); | ||||
|         $this->assertEquals( | ||||
|             pack('H*', 'ec849c') . pack('H*', 'ec9ab8'), | ||||
|             $this->reader->getDescriptionForNumber(self::$KO_NUMBER, "ko", "", "") | ||||
|         ); | ||||
|         $this->assertEquals("Seoul", $this->reader->getDescriptionForNumber(self::$KO_NUMBER, "en", "", "")); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForNumberWithMissingMapping() | ||||
|     { | ||||
|         $this->assertEquals("", $this->reader->getDescriptionForNumber(self::$US_NUMBER3, "en", "", "")); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionUsingFallbackLanguage() | ||||
|     { | ||||
|         // Mapping file exists but the number isn't present, causing it to fallback. | ||||
|         $this->assertEquals("New York, NY", $this->reader->getDescriptionForNumber(self::$US_NUMBER2, "de", "", "CH")); | ||||
|         // No mapping file exists, causing it to fallback. | ||||
|         $this->assertEquals("New York, NY", $this->reader->getDescriptionForNumber(self::$US_NUMBER2, "sv", "", "")); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForNonFallbackLanguage() | ||||
|     { | ||||
|         $this->assertEquals("", $this->reader->getDescriptionForNumber(self::$US_NUMBER2, "ko", "", "")); | ||||
|     } | ||||
|  | ||||
|     public function testGetDescriptionForNumberWithoutMappingFile() | ||||
|     { | ||||
|         $this->assertEquals("", $this->reader->getDescriptionForNumber(self::$SE_NUMBER, "sv", "", "")); | ||||
|         $this->assertEquals("", $this->reader->getDescriptionForNumber(self::$SE_NUMBER, "en", "", "")); | ||||
|     } | ||||
| } | ||||
| @@ -1,27 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   'de' =>  | ||||
|   array ( | ||||
|     0 => 1201, | ||||
|     1 => 1650, | ||||
|   ), | ||||
|   'en' =>  | ||||
|   array ( | ||||
|     0 => 1201, | ||||
|     1 => 1212, | ||||
|     2 => 1617, | ||||
|     3 => 1650, | ||||
|     4 => 1989, | ||||
|     5 => 54, | ||||
|     6 => 82, | ||||
|   ), | ||||
|   'ko' =>  | ||||
|   array ( | ||||
|     0 => 82, | ||||
|   ), | ||||
| ); | ||||
| @@ -1,9 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   1201 => 'New Jersey', | ||||
| ); | ||||
| @@ -1,9 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   1650 => 'Kalifornien', | ||||
| ); | ||||
| @@ -1,9 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   1201 => 'NJ', | ||||
| ); | ||||
| @@ -1,10 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   1212 => 'NY', | ||||
|   1212812 => 'New York, NY', | ||||
| ); | ||||
| @@ -1,9 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   1617423 => 'Boston, MA', | ||||
| ); | ||||
| @@ -1,10 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   1650 => 'CA', | ||||
|   1650960 => 'Mountain View, CA', | ||||
| ); | ||||
| @@ -1,9 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   1989 => 'MA', | ||||
| ); | ||||
| @@ -1,9 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   542214 => 'La Plata', | ||||
| ); | ||||
| @@ -1,24 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   822 => 'Seoul', | ||||
|   8231 => 'Gyeonggi', | ||||
|   8232 => 'Incheon', | ||||
|   8233 => 'Gangwon', | ||||
|   8241 => 'Chungnam', | ||||
|   8242 => 'Daejeon', | ||||
|   8243 => 'Chungbuk', | ||||
|   8251 => 'Busan', | ||||
|   8252 => 'Ulsan', | ||||
|   8253 => 'Daegu', | ||||
|   8254 => 'Gyeongbuk', | ||||
|   8255 => 'Gyeongnam', | ||||
|   8261 => 'Jeonnam', | ||||
|   8262 => 'Gwangju', | ||||
|   8263 => 'Jeonbuk', | ||||
|   8264 => 'Jeju', | ||||
| ); | ||||
| @@ -1,23 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   822 => '서울', | ||||
|   8231 => '경기', | ||||
|   8232 => '인천', | ||||
|   8233 => '강원', | ||||
|   8241 => '충남', | ||||
|   8242 => '대전', | ||||
|   8243 => '충북', | ||||
|   8251 => '부산', | ||||
|   8252 => '울산', | ||||
|   8253 => '대구', | ||||
|   8254 => '경북', | ||||
|   8255 => '경남', | ||||
|   8261 => '전남', | ||||
|   8262 => '광주', | ||||
|   8263 => '전북', | ||||
| ); | ||||
| @@ -1,124 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\timezone; | ||||
|  | ||||
|  | ||||
| use libphonenumber\PhoneNumber; | ||||
| use libphonenumber\prefixmapper\PrefixTimeZonesMap; | ||||
|  | ||||
| class PrefixTimeZonesMapTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|     // US time zones | ||||
|     const CHICAGO_TZ = "America/Chicago"; | ||||
|     const DENVER_TZ = "America/Denver"; | ||||
|     const LOS_ANGELES_TZ = "America/Los_Angeles"; | ||||
|     const NEW_YORK_TZ = "America/New_York"; | ||||
|  | ||||
|     // Russian time zones | ||||
|     const IRKUTSK_TZ = "Asia/Irkutsk"; | ||||
|     const MOSCOW_TZ = "Europe/Moscow"; | ||||
|     const VLADIVOSTOK_TZ = "Asia/Vladivostok"; | ||||
|     const YEKATERINBURG_TZ = "Asia/Yekaterinburg"; | ||||
|     /** | ||||
|      * @var PrefixTimeZonesMap | ||||
|      */ | ||||
|     private static $prefixTimeZonesMapForUS; | ||||
|     /** | ||||
|      * @var PrefixTimeZonesMap | ||||
|      */ | ||||
|     private static $prefixTimeZonesMapForRU; | ||||
|  | ||||
|     public static function setUpBeforeClass() | ||||
|     { | ||||
|         $sortedMapForUS = array(); | ||||
|         $sortedMapForUS[1] = self::NEW_YORK_TZ . "&" . self::CHICAGO_TZ . "&" . self::LOS_ANGELES_TZ . "&" . self::DENVER_TZ; | ||||
|         $sortedMapForUS[1201] = self::NEW_YORK_TZ; | ||||
|         $sortedMapForUS[1205] = self::CHICAGO_TZ; | ||||
|         $sortedMapForUS[1208292] = self::LOS_ANGELES_TZ; | ||||
|         $sortedMapForUS[1208234] = self::DENVER_TZ; | ||||
|         $sortedMapForUS[1541367] = self::LOS_ANGELES_TZ; | ||||
|         $sortedMapForUS[1423843] = self::NEW_YORK_TZ; | ||||
|         $sortedMapForUS[1402721] = self::CHICAGO_TZ; | ||||
|         $sortedMapForUS[1208888] = self::DENVER_TZ; | ||||
|  | ||||
|         self::$prefixTimeZonesMapForUS = new PrefixTimeZonesMap($sortedMapForUS); | ||||
|  | ||||
|         $sortedMapForRU = array(); | ||||
|         $sortedMapForRU[7421] = self::VLADIVOSTOK_TZ; | ||||
|         $sortedMapForRU[7879] = self::MOSCOW_TZ; | ||||
|         $sortedMapForRU[7342] = self::YEKATERINBURG_TZ; | ||||
|         $sortedMapForRU[7395] = self::IRKUTSK_TZ; | ||||
|  | ||||
|         self::$prefixTimeZonesMapForRU = new PrefixTimeZonesMap($sortedMapForRU); | ||||
|     } | ||||
|  | ||||
|     public function testLookupTimeZonesForNumberCountryLevel_US() | ||||
|     { | ||||
|         $number = new PhoneNumber(); | ||||
|         $number->setCountryCode(1)->setNationalNumber(1000000000); | ||||
|  | ||||
|         $this->assertEquals( | ||||
|             array( | ||||
|                 self::NEW_YORK_TZ, | ||||
|                 self::CHICAGO_TZ, | ||||
|                 self::LOS_ANGELES_TZ, | ||||
|                 self::DENVER_TZ, | ||||
|             ), | ||||
|             self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number) | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     public function testLookupTimeZonesForNumber_ValidNumber_Chicago() | ||||
|     { | ||||
|         $number = new PhoneNumber(); | ||||
|         $number->setCountryCode(1)->setNationalNumber(2051235458); | ||||
|  | ||||
|         $this->assertEquals(array(self::CHICAGO_TZ), self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number)); | ||||
|     } | ||||
|  | ||||
|     public function testLookupTimeZonesForNumber_LA() | ||||
|     { | ||||
|         $number = new PhoneNumber(); | ||||
|         $number->setCountryCode(1)->setNationalNumber(2082924565); | ||||
|  | ||||
|         $this->assertEquals(array(self::LOS_ANGELES_TZ), self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number)); | ||||
|     } | ||||
|  | ||||
|     public function testLookupTimeZonesForNumber_NY() | ||||
|     { | ||||
|         $number = new PhoneNumber(); | ||||
|         $number->setCountryCode(1)->setNationalNumber(2016641234); | ||||
|  | ||||
|         $this->assertEquals(array(self::NEW_YORK_TZ), self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number)); | ||||
|     } | ||||
|  | ||||
|     public function testLookupTimeZonesForNumber_CH() | ||||
|     { | ||||
|         $number = new PhoneNumber(); | ||||
|         $number->setCountryCode(41)->setNationalNumber(446681300); | ||||
|  | ||||
|         $this->assertEquals(array(), self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number)); | ||||
|     } | ||||
|  | ||||
|     public function testLookupTimeZonesForNumber_RU() | ||||
|     { | ||||
|         $number = new PhoneNumber(); | ||||
|         $number->setCountryCode(7)->setNationalNumber(87945154); | ||||
|  | ||||
|         $this->assertEquals(array(self::MOSCOW_TZ), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number)); | ||||
|  | ||||
|         $number->setNationalNumber(421548578); | ||||
|         $this->assertEquals(array(self::VLADIVOSTOK_TZ), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number)); | ||||
|  | ||||
|         $number->setNationalNumber(342457897); | ||||
|         $this->assertEquals(array(self::YEKATERINBURG_TZ), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number)); | ||||
|  | ||||
|         // A mobile number | ||||
|         $number->setNationalNumber(9342457897); | ||||
|         $this->assertEquals(array(), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number)); | ||||
|  | ||||
|         // An invalid number (too short) | ||||
|         $number->setNationalNumber(3951); | ||||
|         $this->assertEquals(array(self::IRKUTSK_TZ), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number)); | ||||
|     } | ||||
| } | ||||
| @@ -1,19 +0,0 @@ | ||||
| <?php | ||||
|  | ||||
| namespace libphonenumber\Tests\timezone; | ||||
|  | ||||
| use libphonenumber\PhoneNumber; | ||||
| use libphonenumber\PhoneNumberToTimeZonesMapper; | ||||
|  | ||||
| class UKTest extends \PHPUnit_Framework_TestCase | ||||
| { | ||||
|  | ||||
|     public function testGBNumber() | ||||
|     { | ||||
|         $number = new PhoneNumber(); | ||||
|         $number->setCountryCode(44)->setNationalNumber(1614960000); | ||||
|  | ||||
|         $timeZone = PhoneNumberToTimeZonesMapper::getInstance(); | ||||
|         $this->assertEquals(array("Europe/London"), $timeZone->getTimeZonesForNumber($number)); | ||||
|     } | ||||
| } | ||||
| @@ -1,18 +0,0 @@ | ||||
| <?php | ||||
| /** | ||||
|  * This file is automatically @generated by {@link GeneratePhonePrefixData}. | ||||
|  * Please don't modify it directly. | ||||
|  */ | ||||
|  | ||||
| return array ( | ||||
|   1 => 'America/New_York&America/Chicago&America/Winnipeg&America/Los_Angeles', | ||||
|   1201 => 'America/New_York', | ||||
|   1212812 => 'America/New_York', | ||||
|   1234 => 'America/New_York', | ||||
|   1604 => 'America/Winnipeg', | ||||
|   1617423 => 'America/Chicago', | ||||
|   1650960 => 'America/Los_Angeles', | ||||
|   1989 => 'Ameriac/Los_Angeles', | ||||
|   612 => 'Australia/Sydney', | ||||
|   82 => 'Asia/Seoul', | ||||
| ); | ||||
		Reference in New Issue
	
	Block a user
	 sujitprasad
					sujitprasad