update 1.0.8.0
Commits for version update
This commit is contained in:
@@ -5,6 +5,12 @@ language: php
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: hhvm
|
||||
- php: nightly
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- PREFER_LOWEST="--prefer-lowest"
|
||||
- PREFER_LOWEST=""
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
@@ -13,10 +19,10 @@ php:
|
||||
- 5.6
|
||||
- hhvm
|
||||
- 7
|
||||
- nightly
|
||||
|
||||
before_script:
|
||||
- wget http://getcomposer.org/composer.phar
|
||||
- php composer.phar install --no-interaction
|
||||
- composer update --no-interaction $PREFER_LOWEST
|
||||
- mkdir -p build/logs
|
||||
|
||||
script:
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
# It can be a commit, branch or tag of the https://github.com/googlei18n/libphonenumber project
|
||||
#
|
||||
# For more information, look at the phing tasks in build.xml
|
||||
libphonenumber-7.4.3
|
||||
libphonenumber-7.6.1
|
||||
|
||||
@@ -33,6 +33,8 @@ $ composer require giggsey/libphonenumber-for-php
|
||||
|
||||
You can also use any other [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compliant autoloader.
|
||||
|
||||
If you do not use composer, ensure that you also load any dependencies that this project has, such as [giggsey/locale](https://github.com/giggsey/Locale).
|
||||
|
||||
## Versioning
|
||||
|
||||
This library will try to follow the same version numbers as Google. There could be additional releases where needed to fix critical issues that can not wait until the next release from Google.
|
||||
@@ -109,8 +111,6 @@ echo $phoneUtil->formatOutOfCountryCallingNumber($swissNumberProto, "GB");
|
||||
|
||||
### Geocoder
|
||||
|
||||
The PECL [intl](http://php.net/intl) extension is required for the geocoder to be used.
|
||||
|
||||
```php
|
||||
$phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
|
||||
|
||||
@@ -175,8 +175,6 @@ var_dump($shortNumberInfo->connectsToEmergencyNumber("911123", "US"));
|
||||
|
||||
### Mapping Phone Numbers to carrier
|
||||
|
||||
The PECL [intl](http://php.net/intl) extension is required for the carrier mapper to be used.
|
||||
|
||||
```php
|
||||
|
||||
$phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
|
||||
|
||||
@@ -12,16 +12,12 @@ class Issue106Test extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
self::$TW_Number1 = new PhoneNumber();
|
||||
self::$TW_Number1->setCountryCode(886)->setNationalNumber(223113731);
|
||||
self::$TW_Number1 = new PhoneNumber();
|
||||
self::$TW_Number1->setCountryCode(886)->setNationalNumber(223113731);
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if(!extension_loaded('intl')) {
|
||||
$this->markTestSkipped('The intl extension must be installed');
|
||||
}
|
||||
|
||||
PhoneNumberOfflineGeocoder::resetInstance();
|
||||
$this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
|
||||
}
|
||||
@@ -39,6 +35,5 @@ class Issue106Test extends \PHPUnit_Framework_TestCase
|
||||
pack('H*', 'e887ba') . pack('H*', 'e58c97'),
|
||||
$this->geocoder->getDescriptionForNumber(self::$TW_Number1, "zh_TW")
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumberType;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
@@ -20,10 +19,6 @@ class Issue17Test extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if(!extension_loaded('intl')) {
|
||||
$this->markTestSkipped('The intl extension must be installed');
|
||||
}
|
||||
|
||||
PhoneNumberUtil::resetInstance();
|
||||
PhoneNumberOfflineGeocoder::resetInstance();
|
||||
$this->phoneUtil = PhoneNumberUtil::getInstance();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumberFormat;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
use libphonenumber\RegionCode;
|
||||
@@ -23,9 +22,7 @@ class Issue23Test extends \PHPUnit_Framework_TestCase
|
||||
PhoneNumberUtil::resetInstance();
|
||||
$this->phoneUtil = PhoneNumberUtil::getInstance();
|
||||
|
||||
if(extension_loaded('intl')) {
|
||||
$this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
|
||||
}
|
||||
$this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
|
||||
}
|
||||
|
||||
public function testTKGeoLocation()
|
||||
@@ -36,8 +33,6 @@ class Issue23Test extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertEquals('TK', $this->phoneUtil->getRegionCodeForNumber($phoneNumber));
|
||||
|
||||
if($this->geocoder instanceof PhoneNumberOfflineGeocoder) {
|
||||
$this->assertEquals('Tokelau', $this->geocoder->getDescriptionForNumber($phoneNumber, 'en'));
|
||||
}
|
||||
$this->assertEquals('Tokelau', $this->geocoder->getDescriptionForNumber($phoneNumber, 'en'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
class Issue34Test extends \PHPUnit_Framework_TestCase
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumber;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
@@ -20,10 +19,6 @@ class Issue36Test extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if(!extension_loaded('intl')) {
|
||||
$this->markTestSkipped('The intl extension must be installed');
|
||||
}
|
||||
|
||||
PhoneNumberUtil::resetInstance();
|
||||
PhoneNumberOfflineGeocoder::resetInstance();
|
||||
$this->phoneUtil = PhoneNumberUtil::getInstance();
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumberFormat;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
@@ -25,6 +24,5 @@ class Issue3Test extends \PHPUnit_Framework_TestCase
|
||||
$number = $this->phoneNumberUtil->parse('011543549480042', 'US');
|
||||
|
||||
$this->assertEquals("+543549480042", $this->phoneNumberUtil->format($number, PhoneNumberFormat::E164));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,6 @@ class Issue44Test extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if(!extension_loaded('intl')) {
|
||||
$this->markTestSkipped('The intl extension must be installed');
|
||||
}
|
||||
|
||||
PhoneNumberUtil::resetInstance();
|
||||
$this->phoneUtil = PhoneNumberUtil::getInstance();
|
||||
|
||||
@@ -79,4 +75,3 @@ class Issue44Test extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals("China Mobile", $location);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumberFormat;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
@@ -25,6 +24,5 @@ class Issue4Test extends \PHPUnit_Framework_TestCase
|
||||
$number = $this->phoneNumberUtil->parse('0351-152-303-473', 'AR');
|
||||
|
||||
$this->assertEquals("+5493512303473", $this->phoneNumberUtil->format($number, PhoneNumberFormat::E164));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
use libphonenumber\ShortNumberInfo;
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
use libphonenumber\ShortNumberInfo;
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\CountryCodeToRegionCodeMap;
|
||||
use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
|
||||
use libphonenumber\PhoneNumberType;
|
||||
@@ -29,10 +28,6 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if(!extension_loaded('intl')) {
|
||||
$this->markTestSkipped('The intl extension must be installed');
|
||||
}
|
||||
|
||||
PhoneNumberUtil::resetInstance();
|
||||
PhoneNumberOfflineGeocoder::resetInstance();
|
||||
$this->phoneUtil = PhoneNumberUtil::getInstance();
|
||||
@@ -74,9 +69,6 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@@ -91,7 +83,7 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
'AD' => 'Andorra',
|
||||
'AO' => 'Angola',
|
||||
'AI' => 'Anguilla',
|
||||
'AG' => 'Antigua and Barbuda',
|
||||
'AG' => 'Antigua & Barbuda',
|
||||
'AR' => 'Argentina',
|
||||
'AU' => 'Australia',
|
||||
'AT' => 'Austria',
|
||||
@@ -107,7 +99,7 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
'BM' => 'Bermuda',
|
||||
'BT' => 'Bhutan',
|
||||
'BO' => 'Bolivia',
|
||||
'BA' => 'Bosnia and Herzegovina',
|
||||
'BA' => 'Bosnia & Herzegovina',
|
||||
'BW' => 'Botswana',
|
||||
'BR' => 'Brazil',
|
||||
'IO' => 'British Indian Ocean Territory',
|
||||
@@ -125,7 +117,7 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
'CL' => 'Chile',
|
||||
'CN' => 'China',
|
||||
'CX' => 'Christmas Island',
|
||||
'CC' => 'Cocos [Keeling] Islands',
|
||||
'CC' => 'Cocos (Keeling) Islands',
|
||||
'CO' => 'Colombia',
|
||||
'KM' => 'Comoros',
|
||||
'CG' => 'Congo - Brazzaville',
|
||||
@@ -226,7 +218,7 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
'MS' => 'Montserrat',
|
||||
'MA' => 'Morocco',
|
||||
'MZ' => 'Mozambique',
|
||||
'MM' => 'Myanmar [Burma]',
|
||||
'MM' => 'Myanmar (Burma)',
|
||||
'NA' => 'Namibia',
|
||||
'NR' => 'Nauru',
|
||||
'NP' => 'Nepal',
|
||||
@@ -257,14 +249,14 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
'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',
|
||||
'SH' => 'St. Helena',
|
||||
'KN' => 'St. Kitts & Nevis',
|
||||
'LC' => 'St. Lucia',
|
||||
'PM' => 'St. Pierre & Miquelon',
|
||||
'VC' => 'St. Vincent & Grenadines',
|
||||
'WS' => 'Samoa',
|
||||
'SM' => 'San Marino',
|
||||
'ST' => 'São Tomé and Príncipe',
|
||||
'ST' => 'São Tomé & Príncipe',
|
||||
'SA' => 'Saudi Arabia',
|
||||
'SN' => 'Senegal',
|
||||
'RS' => 'Serbia',
|
||||
@@ -280,7 +272,7 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
'LK' => 'Sri Lanka',
|
||||
'SD' => 'Sudan',
|
||||
'SR' => 'Suriname',
|
||||
'SJ' => 'Svalbard and Jan Mayen',
|
||||
'SJ' => 'Svalbard & Jan Mayen',
|
||||
'SZ' => 'Swaziland',
|
||||
'SE' => 'Sweden',
|
||||
'CH' => 'Switzerland',
|
||||
@@ -293,11 +285,11 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
'TG' => 'Togo',
|
||||
'TK' => 'Tokelau',
|
||||
'TO' => 'Tonga',
|
||||
'TT' => 'Trinidad and Tobago',
|
||||
'TT' => 'Trinidad & Tobago',
|
||||
'TN' => 'Tunisia',
|
||||
'TR' => 'Turkey',
|
||||
'TM' => 'Turkmenistan',
|
||||
'TC' => 'Turks and Caicos Islands',
|
||||
'TC' => 'Turks & Caicos Islands',
|
||||
'TV' => 'Tuvalu',
|
||||
'UG' => 'Uganda',
|
||||
'UA' => 'Ukraine',
|
||||
@@ -311,7 +303,7 @@ class LocaleTest extends \PHPUnit_Framework_TestCase
|
||||
'VN' => 'Vietnam',
|
||||
'VG' => 'British Virgin Islands',
|
||||
'VI' => 'U.S. Virgin Islands',
|
||||
'WF' => 'Wallis and Futuna',
|
||||
'WF' => 'Wallis & Futuna',
|
||||
'EH' => 'Western Sahara',
|
||||
'YE' => 'Yemen',
|
||||
'ZM' => 'Zambia',
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\Issues;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumberFormat;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ use libphonenumber\PhoneNumberFormat;
|
||||
use libphonenumber\PhoneNumberType;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
|
||||
class UKNumbersTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
const META_DATA_FILE_PREFIX = 'PhoneNumberMetadata';
|
||||
@@ -22,7 +21,8 @@ class UKNumbersTest extends \PHPUnit_Framework_TestCase
|
||||
$this->phoneUtil = PhoneNumberUtil::getInstance(
|
||||
self::META_DATA_FILE_PREFIX,
|
||||
CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap
|
||||
);;
|
||||
);
|
||||
;
|
||||
}
|
||||
|
||||
public function testMobileNumber()
|
||||
|
||||
@@ -0,0 +1,915 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author giggsey
|
||||
* @package libphonenumber-for-php
|
||||
*/
|
||||
|
||||
namespace libphonenumber\Tests\buildtools;
|
||||
|
||||
use libphonenumber\buildtools\BuildMetadataFromXml;
|
||||
use libphonenumber\NumberFormat;
|
||||
use libphonenumber\PhoneMetadata;
|
||||
use libphonenumber\PhoneNumberDesc;
|
||||
|
||||
class BuildMetadataFromXmlTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @param $xmlString
|
||||
* @return \DOMElement
|
||||
*/
|
||||
private function parseXMLString($xmlString)
|
||||
{
|
||||
$domDocument = new \DOMDocument();
|
||||
$domDocument->loadXML($xmlString);
|
||||
|
||||
return $domDocument->documentElement;
|
||||
}
|
||||
|
||||
public function testValidateRERemovesWhiteSpaces()
|
||||
{
|
||||
$input = " hello world ";
|
||||
// Should remove all the white spaces contained in the provided string.
|
||||
$this->assertEquals("helloworld", BuildMetadataFromXml::validateRE($input, true));
|
||||
// Make sure it only happens when the last parameter is set to true.
|
||||
$this->assertEquals(" hello world ", BuildMetadataFromXml::validateRE($input, false));
|
||||
}
|
||||
|
||||
public function testValidateREThrowsException()
|
||||
{
|
||||
$invalidPattern = '[';
|
||||
// Should throw an exception when an invalid pattern is provided independently of the last
|
||||
// parameter (remove white spaces).
|
||||
try {
|
||||
BuildMetadataFromXml::validateRE($invalidPattern, false);
|
||||
$this->fail();
|
||||
} catch (\Exception $e) {
|
||||
// Test passed.
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
try {
|
||||
BuildMetadataFromXml::validateRE($invalidPattern, true);
|
||||
$this->fail();
|
||||
} catch (\Exception $e) {
|
||||
// Test passed.
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
|
||||
// We don't allow | to be followed by ) because it introduces bugs, since we typically use it at
|
||||
// the end of each line and when a line is deleted, if the pipe from the previous line is not
|
||||
// removed, we end up erroneously accepting an empty group as well.
|
||||
$patternWithPipeFollowedByClosingParentheses = '|)';
|
||||
try {
|
||||
BuildMetadataFromXml::validateRE($patternWithPipeFollowedByClosingParentheses, true);
|
||||
$this->fail();
|
||||
} catch (\Exception $e) {
|
||||
// Test passed.
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
$patternWithPipeFollowedByNewLineAndClosingParentheses = "|\n)";
|
||||
try {
|
||||
BuildMetadataFromXml::validateRE($patternWithPipeFollowedByNewLineAndClosingParentheses, true);
|
||||
$this->fail();
|
||||
} catch (\Exception $e) {
|
||||
// Test passed.
|
||||
$this->addToAssertionCount(1);
|
||||
}
|
||||
}
|
||||
|
||||
public function testValidateRE()
|
||||
{
|
||||
$validPattern = "[a-zA-Z]d{1,9}";
|
||||
// The provided pattern should be left unchanged.
|
||||
$this->assertEquals($validPattern, BuildMetadataFromXml::validateRE($validPattern, false));
|
||||
}
|
||||
|
||||
public function testGetNationalPrefix()
|
||||
{
|
||||
$xmlInput = "<territory nationalPrefix='00'/>";
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$this->assertEquals('00', BuildMetadataFromXml::getNationalPrefix($territoryElement));
|
||||
}
|
||||
|
||||
public function testLoadTerritoryTagMetadata()
|
||||
{
|
||||
$xmlInput = "<territory"
|
||||
. " countryCode='33' leadingDigits='2' internationalPrefix='00'"
|
||||
. " preferredInternationalPrefix='0011' nationalPrefixForParsing='0'"
|
||||
. " nationalPrefixTransformRule='9$1'" // nationalPrefix manually injected.
|
||||
. " preferredExtnPrefix=' x' mainCountryForCode='true'"
|
||||
. " leadingZeroPossible='true' mobileNumberPortableRegion='true'>"
|
||||
. "</territory>";
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$phoneMetadata = BuildMetadataFromXml::loadTerritoryTagMetadata('33', $territoryElement, '0');
|
||||
$this->assertEquals(33, $phoneMetadata->getCountryCode());
|
||||
$this->assertEquals("2", $phoneMetadata->getLeadingDigits());
|
||||
$this->assertEquals("00", $phoneMetadata->getInternationalPrefix());
|
||||
$this->assertEquals("0011", $phoneMetadata->getPreferredInternationalPrefix());
|
||||
$this->assertEquals("0", $phoneMetadata->getNationalPrefixForParsing());
|
||||
$this->assertEquals("9$1", $phoneMetadata->getNationalPrefixTransformRule());
|
||||
$this->assertEquals("0", $phoneMetadata->getNationalPrefix());
|
||||
$this->assertEquals(" x", $phoneMetadata->getPreferredExtnPrefix());
|
||||
$this->assertTrue($phoneMetadata->isMainCountryForCode());
|
||||
$this->assertTrue($phoneMetadata->isLeadingZeroPossible());
|
||||
$this->assertTrue($phoneMetadata->isMobileNumberPortableRegion());
|
||||
}
|
||||
|
||||
public function testLoadTerritoryTagMetadataSetsBooleanFieldsToFalseByDefault()
|
||||
{
|
||||
$xmlInput = "<territory countryCode='33'/>";
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$phoneMetadata = BuildMetadataFromXml::loadTerritoryTagMetadata('33', $territoryElement, '');
|
||||
$this->assertFalse($phoneMetadata->isMainCountryForCode());
|
||||
$this->assertFalse($phoneMetadata->isLeadingZeroPossible());
|
||||
$this->assertFalse($phoneMetadata->isMobileNumberPortableRegion());
|
||||
}
|
||||
|
||||
public function testLoadTerritoryTagMetadataSetsNationalPrefixForParsingByDefault()
|
||||
{
|
||||
$xmlInput = "<territory countryCode='33'/>";
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$phoneMetadata = BuildMetadataFromXml::loadTerritoryTagMetadata('33', $territoryElement, '00');
|
||||
// When unspecified, nationalPrefixForParsing defaults to nationalPrefix.
|
||||
$this->assertEquals("00", $phoneMetadata->getNationalPrefix());
|
||||
$this->assertEquals($phoneMetadata->getNationalPrefix(), $phoneMetadata->getNationalPrefixForParsing());
|
||||
}
|
||||
|
||||
public function testLoadTerritoryTagMetadataWithRequiredAttributesOnly()
|
||||
{
|
||||
$xmlInput = "<territory countryCode='33' internationalPrefix='00'/>";
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
// Should not throw any exception
|
||||
BuildMetadataFromXml::loadTerritoryTagMetadata('33', $territoryElement, '');
|
||||
}
|
||||
|
||||
public function testLoadInternationalFormat()
|
||||
{
|
||||
$intlFormat = '$1 $2';
|
||||
$xmlInput = "<numberFormat><intlFormat>" . $intlFormat . "</intlFormat></numberFormat>";
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
$nationalFormat = new NumberFormat();
|
||||
|
||||
$this->assertTrue(BuildMetadataFromXml::loadInternationalFormat($metadata, $numberFormatElement, $nationalFormat));
|
||||
$this->assertEquals($intlFormat, $metadata->getIntlNumberFormat(0)->getFormat());
|
||||
}
|
||||
|
||||
public function testLoadInternationalFormatWithBothNationalAndIntlFormatsDefined()
|
||||
{
|
||||
$intlFormat = '$1 $2';
|
||||
$xmlInput = "<numberFormat><intlFormat>" . $intlFormat . "</intlFormat></numberFormat>";
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
$nationalFormat = new NumberFormat();
|
||||
$nationalFormat->setFormat('$1');
|
||||
|
||||
$this->assertTrue(BuildMetadataFromXml::loadInternationalFormat($metadata, $numberFormatElement, $nationalFormat));
|
||||
$this->assertEquals($intlFormat, $metadata->getIntlNumberFormat(0)->getFormat());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
public function testLoadInternationalFormatExpectsOnlyOnePattern()
|
||||
{
|
||||
$xmlInput = '<numberFormat><intlFormat/><intlFormat/></numberFormat>';
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
|
||||
// Should throw an exception as multiple intlFormats are provided
|
||||
BuildMetadataFromXml::loadInternationalFormat($metadata, $numberFormatElement, new NumberFormat());
|
||||
}
|
||||
|
||||
public function testLoadInternationalFormatUsesNationalFormatByDefault()
|
||||
{
|
||||
$xmlInput = '<numberFormat></numberFormat>';
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
$nationalFormat = new NumberFormat();
|
||||
$nationPattern = '$1 $2 $3';
|
||||
$nationalFormat->setFormat($nationPattern);
|
||||
|
||||
$this->assertFalse(BuildMetadataFromXml::loadInternationalFormat($metadata, $numberFormatElement, $nationalFormat));
|
||||
$this->assertEquals($nationPattern, $metadata->getIntlNumberFormat(0)->getFormat());
|
||||
}
|
||||
|
||||
public function testLoadInternationalFormatCopiesNationalFormatData()
|
||||
{
|
||||
$xmlInput = '<numberFormat></numberFormat>';
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
$nationalFormat = new NumberFormat();
|
||||
$nationalFormat->setFormat('$1-$2');
|
||||
$nationalFormat->setNationalPrefixOptionalWhenFormatting(true);
|
||||
|
||||
$this->assertFalse(BuildMetadataFromXml::loadInternationalFormat($metadata, $numberFormatElement, $nationalFormat));
|
||||
$this->assertTrue($metadata->getIntlNumberFormat(0)->isNationalPrefixOptionalWhenFormatting());
|
||||
}
|
||||
|
||||
public function testLoadNationalFormat()
|
||||
{
|
||||
$nationalFormat = '$1 $2';
|
||||
$xmlInput = '<numberFormat><format>' . $nationalFormat . '</format></numberFormat>';
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
$numberFormat = new NumberFormat();
|
||||
BuildMetadataFromXml::loadNationalFormat($metadata, $numberFormatElement, $numberFormat);
|
||||
$this->assertEquals($nationalFormat, $numberFormat->getFormat());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
public function testLoadNationalFormatRequiresFormat()
|
||||
{
|
||||
$xmlInput = '<numberFormat></numberFormat>';
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
$numberFormat = new NumberFormat();
|
||||
|
||||
BuildMetadataFromXml::loadNationalFormat($metadata, $numberFormatElement, $numberFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
*/
|
||||
public function testLoadNationalFormatExpectsExactlyOneFormat()
|
||||
{
|
||||
$xmlInput = "<numberFormat><format/><format/></numberFormat>";
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
$numberFormat = new NumberFormat();
|
||||
|
||||
BuildMetadataFromXml::loadNationalFormat($metadata, $numberFormatElement, $numberFormat);
|
||||
}
|
||||
|
||||
public function testLoadAvailableFormats()
|
||||
{
|
||||
$xmlInput = '<territory>'
|
||||
. ' <availableFormats>'
|
||||
. ' <numberFormat nationalPrefixFormattingRule=\'($FG)\''
|
||||
. ' carrierCodeFormattingRule=\'$NP $CC ($FG)\'>'
|
||||
. ' <format>$1 $2 $3</format>'
|
||||
. ' </numberFormat>'
|
||||
. ' </availableFormats>'
|
||||
. '</territory>';
|
||||
|
||||
$element = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
BuildMetadataFromXml::loadAvailableFormats($metadata, $element, '0', '', false /* NP not optional */);
|
||||
$this->assertEquals('($1)', $metadata->getNumberFormat(0)->getNationalPrefixFormattingRule());
|
||||
$this->assertEquals('0 $CC ($1)', $metadata->getNumberFormat(0)->getDomesticCarrierCodeFormattingRule());
|
||||
$this->assertEquals('$1 $2 $3', $metadata->getNumberFormat(0)->getFormat());
|
||||
}
|
||||
|
||||
public function testLoadAvailableFormatsPropagatesCarrierCodeFormattingRule()
|
||||
{
|
||||
$xmlInput =
|
||||
'<territory carrierCodeFormattingRule=\'$NP $CC ($FG)\'>'
|
||||
. ' <availableFormats>'
|
||||
. ' <numberFormat nationalPrefixFormattingRule=\'($FG)\'>'
|
||||
. ' <format>$1 $2 $3</format>'
|
||||
. ' </numberFormat>'
|
||||
. ' </availableFormats>'
|
||||
. '</territory>';
|
||||
|
||||
$element = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
BuildMetadataFromXml::loadAvailableFormats($metadata, $element, '0', '', false /* NP not optional */);
|
||||
$this->assertEquals('($1)', $metadata->getNumberFormat(0)->getNationalPrefixFormattingRule());
|
||||
$this->assertEquals('0 $CC ($1)', $metadata->getNumberFormat(0)->getDomesticCarrierCodeFormattingRule());
|
||||
$this->assertEquals('$1 $2 $3', $metadata->getNumberFormat(0)->getFormat());
|
||||
}
|
||||
|
||||
public function testLoadAvailableFormatsSetsProvidedNationalPrefixFormattingRule()
|
||||
{
|
||||
$xmlInput = "<territory>"
|
||||
. " <availableFormats>"
|
||||
. ' <numberFormat><format>$1 $2 $3</format></numberFormat>'
|
||||
. " </availableFormats>"
|
||||
. "</territory>";
|
||||
|
||||
$element = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
BuildMetadataFromXml::loadAvailableFormats($metadata, $element, '', '($1)', false /* NP not optional */);
|
||||
$this->assertEquals('($1)', $metadata->getNumberFormat(0)->getNationalPrefixFormattingRule());
|
||||
}
|
||||
|
||||
public function testLoadAvailableFormatsClearsIntlFormat()
|
||||
{
|
||||
$xmlInput = "<territory>"
|
||||
. " <availableFormats>"
|
||||
. ' <numberFormat><format>$1 $2 $3</format></numberFormat>'
|
||||
. " </availableFormats>"
|
||||
. "</territory>";
|
||||
|
||||
$element = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
BuildMetadataFromXml::loadAvailableFormats($metadata, $element, '0', '($1)', false /* NP not optional */);
|
||||
$this->assertCount(0, $metadata->intlNumberFormats());
|
||||
}
|
||||
|
||||
public function testLoadAvailableFormatsHandlesMultipleNumberFormats()
|
||||
{
|
||||
$xmlInput = "<territory>"
|
||||
. " <availableFormats>"
|
||||
. ' <numberFormat><format>$1 $2 $3</format></numberFormat>'
|
||||
. ' <numberFormat><format>$1-$2</format></numberFormat>'
|
||||
. " </availableFormats>"
|
||||
. "</territory>";
|
||||
|
||||
$element = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
BuildMetadataFromXml::loadAvailableFormats($metadata, $element, '0', '($1)', false /* NP not optional */);
|
||||
$this->assertEquals('$1 $2 $3', $metadata->getNumberFormat(0)->getFormat());
|
||||
$this->assertEquals('$1-$2', $metadata->getNumberFormat(1)->getFormat());
|
||||
}
|
||||
|
||||
public function testLoadInternationalFormatDoesNotSetIntlFormatWhenNA()
|
||||
{
|
||||
$xmlInput = '<numberFormat><intlFormat>NA</intlFormat></numberFormat>';
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
$nationalFormat = new NumberFormat();
|
||||
$nationalFormat->setFormat('$1 $2');
|
||||
|
||||
BuildMetadataFromXml::loadInternationalFormat($metadata, $numberFormatElement, $nationalFormat);
|
||||
$this->assertCount(0, $metadata->intlNumberFormats());
|
||||
}
|
||||
|
||||
public function testSetLeadingDigitsPatterns()
|
||||
{
|
||||
$xmlInput = "<numberFormat>"
|
||||
. "<leadingDigits>1</leadingDigits><leadingDigits>2</leadingDigits>"
|
||||
. "</numberFormat>";
|
||||
|
||||
$numberFormatElement = $this->parseXMLString($xmlInput);
|
||||
$numberFormat = new NumberFormat();
|
||||
BuildMetadataFromXml::setLeadingDigitsPatterns($numberFormatElement, $numberFormat);
|
||||
|
||||
$this->assertEquals('1', $numberFormat->getLeadingDigitsPattern(0));
|
||||
$this->assertEquals('2', $numberFormat->getLeadingDigitsPattern(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests setLeadingDigitsPatterns() in the case of international and national formatting rules
|
||||
* being present but not both defined for this numberFormat - we don't want to add them twice.
|
||||
*/
|
||||
public function testSetLeadingDigitsPatternsNotAddedTwiceWhenInternationalFormatsPresent()
|
||||
{
|
||||
$xmlInput = "<availableFormats>"
|
||||
. " <numberFormat pattern=\"(1)(\\d{3})\">"
|
||||
. " <leadingDigits>1</leadingDigits>"
|
||||
. ' <format>$1</format>'
|
||||
. " </numberFormat>"
|
||||
. " <numberFormat pattern=\"(2)(\\d{3})\">"
|
||||
. " <leadingDigits>2</leadingDigits>"
|
||||
. ' <format>$1</format>'
|
||||
. ' <intlFormat>9-$1</intlFormat>'
|
||||
. " </numberFormat>"
|
||||
. "</availableFormats>";
|
||||
|
||||
$element = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
BuildMetadataFromXml::loadAvailableFormats($metadata, $element, '0', '', false /* NP not optional */);
|
||||
$this->assertCount(1, $metadata->getNumberFormat(0)->leadingDigitPatterns());
|
||||
$this->assertCount(1, $metadata->getNumberFormat(1)->leadingDigitPatterns());
|
||||
// When we merge the national format rules into the international format rules, we shouldn't add
|
||||
// the leading digit patterns multiple times.
|
||||
$this->assertCount(1, $metadata->getIntlNumberFormat(0)->leadingDigitPatterns());
|
||||
$this->assertCount(1, $metadata->getIntlNumberFormat(1)->leadingDigitPatterns());
|
||||
}
|
||||
|
||||
public function testGetNationalPrefixFormattingRuleFromElement()
|
||||
{
|
||||
$xmlInput = '<territory nationalPrefixFormattingRule="$NP$FG" />';
|
||||
$element = $this->parseXMLString($xmlInput);
|
||||
$this->assertEquals('0$1', BuildMetadataFromXml::getNationalPrefixFormattingRuleFromElement($element, '0'));
|
||||
}
|
||||
|
||||
public function testGetDomesticCarrierCodeFormattingRuleFromElement()
|
||||
{
|
||||
$xmlInput = '<territory carrierCodeFormattingRule=\'$NP$CC $FG\'/>';
|
||||
$element = $this->parseXMLString($xmlInput);
|
||||
$this->assertEquals('0$CC $1', BuildMetadataFromXml::getDomesticCarrierCodeFormattingRuleFromElement($element, '0'));
|
||||
}
|
||||
|
||||
public function testIsValidNumberTypeWithInvalidInput()
|
||||
{
|
||||
$this->assertFalse(BuildMetadataFromXml::numberTypeShouldAlwaysBeFilledIn('invalidType'));
|
||||
$this->assertFalse(BuildMetadataFromXml::numberTypeShouldAlwaysBeFilledIn('tollFree'));
|
||||
}
|
||||
|
||||
public function testProcessPhoneNumberDescElementWithInvalidInputWithRegex()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$territoryElement = $this->parseXMLString("<territory/>");
|
||||
|
||||
$phoneNumberDesc = BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'invalidType', false);
|
||||
$this->assertEquals('NA', $phoneNumberDesc->getPossibleNumberPattern());
|
||||
$this->assertEquals('NA', $phoneNumberDesc->getNationalNumberPattern());
|
||||
}
|
||||
|
||||
public function testProcessPhoneNumberDescElementMergesWithGeneralDesc()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleNumberPattern('\\d{6}');
|
||||
$territoryElement = $this->parseXMLString('<territory><fixedLine/></territory>');
|
||||
|
||||
$phoneNumberDesc = BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false);
|
||||
$this->assertEquals('\\d{6}', $phoneNumberDesc->getPossibleNumberPattern());
|
||||
}
|
||||
|
||||
public function testProcessPhoneNumberDescElementOverridesGeneralDesc()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleNumberPattern('\\d{8');
|
||||
$xmlInput = "<territory><fixedLine>"
|
||||
. " <possibleNumberPattern>\\d{6}</possibleNumberPattern>"
|
||||
. "</fixedLine></territory>";
|
||||
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
|
||||
$phoneNumberDesc = BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false);
|
||||
$this->assertEquals('\\d{6}', $phoneNumberDesc->getPossibleNumberPattern());
|
||||
}
|
||||
|
||||
public function testProcessPhoneNumberDescElementHandlesLiteBuild()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$xmlInput = "<territory><fixedLine>"
|
||||
. " <exampleNumber>01 01 01 01</exampleNumber>"
|
||||
. "</fixedLine></territory>";
|
||||
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
|
||||
$phoneNumberDesc = BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', true);
|
||||
$this->assertEquals('', $phoneNumberDesc->getExampleNumber());
|
||||
}
|
||||
|
||||
public function testProcessPhoneNumberDescOutputsExampleNumberByDefault()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$xmlInput = "<territory><fixedLine>"
|
||||
. " <exampleNumber>01 01 01 01</exampleNumber>"
|
||||
. "</fixedLine></territory>";
|
||||
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
|
||||
$phoneNumberDesc = BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false);
|
||||
$this->assertEquals('01 01 01 01', $phoneNumberDesc->getExampleNumber());
|
||||
}
|
||||
|
||||
public function testProcessPhoneNumberDescRemovesWhiteSpacesInPatterns()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$xmlInput = "<territory><fixedLine>"
|
||||
. " <possibleNumberPattern>\t \\d { 6 } </possibleNumberPattern>"
|
||||
. "</fixedLine></territory>";
|
||||
|
||||
$countryElement = $this->parseXMLString($xmlInput);
|
||||
|
||||
$phoneNumberDesc = BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $countryElement, 'fixedLine', false);
|
||||
$this->assertEquals('\\d{6}', $phoneNumberDesc->getPossibleNumberPattern());
|
||||
}
|
||||
|
||||
public function testSetRelevantDescPatternsSetsSameMobileAndFixedLinePattern()
|
||||
{
|
||||
$xmlInput = "<territory countryCode=\"33\">"
|
||||
. " <fixedLine><nationalNumberPattern>\\d{6}</nationalNumberPattern></fixedLine>"
|
||||
. " <mobile><nationalNumberPattern>\\d{6}</nationalNumberPattern></mobile>"
|
||||
. "</territory>";
|
||||
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
// Should set sameMobileAndFixedPattern to true.
|
||||
BuildMetadataFromXml::setRelevantDescPatterns($metadata, $territoryElement, false /* liteBuild */, false /* isShortNumberMetadata */);
|
||||
$this->assertTrue($metadata->hasSameMobileAndFixedLinePattern());
|
||||
}
|
||||
|
||||
public function testSetRelevantDescPatternsSetsAllDescriptionsForRegularLengthNumbers()
|
||||
{
|
||||
$xmlInput = "<territory countryCode=\"33\">"
|
||||
. " <fixedLine><nationalNumberPattern>\\d{1}</nationalNumberPattern></fixedLine>"
|
||||
. " <mobile><nationalNumberPattern>\\d{2}</nationalNumberPattern></mobile>"
|
||||
. " <pager><nationalNumberPattern>\\d{3}</nationalNumberPattern></pager>"
|
||||
. " <tollFree><nationalNumberPattern>\\d{4}</nationalNumberPattern></tollFree>"
|
||||
. " <premiumRate><nationalNumberPattern>\\d{5}</nationalNumberPattern></premiumRate>"
|
||||
. " <sharedCost><nationalNumberPattern>\\d{6}</nationalNumberPattern></sharedCost>"
|
||||
. " <personalNumber><nationalNumberPattern>\\d{7}</nationalNumberPattern></personalNumber>"
|
||||
. " <voip><nationalNumberPattern>\\d{8}</nationalNumberPattern></voip>"
|
||||
. " <uan><nationalNumberPattern>\\d{9}</nationalNumberPattern></uan>"
|
||||
. "</territory>";
|
||||
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
BuildMetadataFromXml::setRelevantDescPatterns($metadata, $territoryElement, false /* liteBuild */, false /* isShortNumberMetadata */);
|
||||
$this->assertEquals("\\d{1}", $metadata->getFixedLine()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{2}", $metadata->getMobile()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{3}", $metadata->getPager()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{4}", $metadata->getTollFree()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{5}", $metadata->getPremiumRate()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{6}", $metadata->getSharedCost()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{7}", $metadata->getPersonalNumber()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{8}", $metadata->getVoip()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{9}", $metadata->getUan()->getNationalNumberPattern());
|
||||
}
|
||||
|
||||
public function testSetRelevantDescPatternsSetsAllDescriptionsForShortNumbers()
|
||||
{
|
||||
$xmlInput = "<territory ID=\"FR\">"
|
||||
. " <tollFree><nationalNumberPattern>\\d{1}</nationalNumberPattern></tollFree>"
|
||||
. " <standardRate><nationalNumberPattern>\\d{2}</nationalNumberPattern></standardRate>"
|
||||
. " <premiumRate><nationalNumberPattern>\\d{3}</nationalNumberPattern></premiumRate>"
|
||||
. " <shortCode><nationalNumberPattern>\\d{4}</nationalNumberPattern></shortCode>"
|
||||
. " <carrierSpecific>"
|
||||
. " <nationalNumberPattern>\\d{5}</nationalNumberPattern>"
|
||||
. " </carrierSpecific>"
|
||||
. "</territory>";
|
||||
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
BuildMetadataFromXml::setRelevantDescPatterns($metadata, $territoryElement, false /* liteBuild */, true /* isShortNumberMetadata */);
|
||||
$this->assertEquals("\\d{1}", $metadata->getTollFree()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{2}", $metadata->getStandardRate()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{3}", $metadata->getPremiumRate()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{4}", $metadata->getShortCode()->getNationalNumberPattern());
|
||||
$this->assertEquals("\\d{5}", $metadata->getCarrierSpecific()->getNationalNumberPattern());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Multiple elements with type fixedLine found.
|
||||
*/
|
||||
public function testSetRelevantDescPatternsThrowsErrorIfTypePresentMultipleTimes()
|
||||
{
|
||||
$xmlInput = "<territory countryCode=\"33\">"
|
||||
. " <fixedLine><nationalNumberPattern>\\d{6}</nationalNumberPattern></fixedLine>"
|
||||
. " <fixedLine><nationalNumberPattern>\\d{6}</nationalNumberPattern></fixedLine>"
|
||||
. "</territory>";
|
||||
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = new PhoneMetadata();
|
||||
BuildMetadataFromXml::setRelevantDescPatterns($metadata, $territoryElement, false /* liteBuild */, false /* isShortNumberMetadata */);
|
||||
}
|
||||
|
||||
public function testAlternateFormatsOmitsDescPatterns()
|
||||
{
|
||||
$xmlInput = "<territory countryCode=\"33\">"
|
||||
. " <availableFormats>"
|
||||
. " <numberFormat pattern=\"(1)(\\d{3})\">"
|
||||
. " <leadingDigits>1</leadingDigits>"
|
||||
. ' <format>$1</format>'
|
||||
. " </numberFormat>"
|
||||
. " </availableFormats>"
|
||||
. " <fixedLine><nationalNumberPattern>\\d{1}</nationalNumberPattern></fixedLine>"
|
||||
. " <shortCode><nationalNumberPattern>\\d{2}</nationalNumberPattern></shortCode>"
|
||||
. "</territory>";
|
||||
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = BuildMetadataFromXml::loadCountryMetadata('FR', $territoryElement, false /* liteBuild */, false /* isShortNumberMetadata */, true /* isAlternateFormatsMetadata */);
|
||||
$this->assertEquals('(1)(\\d{3})', $metadata->getNumberFormat(0)->getPattern());
|
||||
$this->assertEquals('1', $metadata->getNumberFormat(0)->getLeadingDigitsPattern(0));
|
||||
$this->assertEquals('$1', $metadata->getNumberFormat(0)->getFormat());
|
||||
$this->assertNull($metadata->getFixedLine());
|
||||
$this->assertNull($metadata->getShortCode());
|
||||
}
|
||||
|
||||
public function testNationalPrefixRulesSetCorrectly()
|
||||
{
|
||||
$xmlInput = "<territory countryCode=\"33\" nationalPrefix=\"0\""
|
||||
. ' nationalPrefixFormattingRule="$NP$FG">'
|
||||
. " <availableFormats>"
|
||||
. " <numberFormat pattern=\"(1)(\\d{3})\" nationalPrefixOptionalWhenFormatting=\"true\">"
|
||||
. " <leadingDigits>1</leadingDigits>"
|
||||
. ' <format>$1</format>'
|
||||
. " </numberFormat>"
|
||||
. " <numberFormat pattern=\"(\\d{3})\" nationalPrefixOptionalWhenFormatting=\"false\">"
|
||||
. " <leadingDigits>2</leadingDigits>"
|
||||
. ' <format>$1</format>'
|
||||
. " </numberFormat>"
|
||||
. " </availableFormats>"
|
||||
. " <fixedLine><nationalNumberPattern>\\d{1}</nationalNumberPattern></fixedLine>"
|
||||
. "</territory>";
|
||||
$territoryElement = $this->parseXMLString($xmlInput);
|
||||
$metadata = BuildMetadataFromXml::loadCountryMetadata('FR', $territoryElement, false /* liteBuild */, false /* isShortNumberMetadata */, true /* isAlternateFormatsMetadata */);
|
||||
$this->assertTrue($metadata->getNumberFormat(0)->isNationalPrefixOptionalWhenFormatting());
|
||||
// This is inherited from the territory, with $NP replaced by the actual national prefix, and
|
||||
// $FG replaced with $1.
|
||||
$this->assertEquals("0$1", $metadata->getNumberFormat(0)->getNationalPrefixFormattingRule());
|
||||
// Here it is explicitly set to false.
|
||||
$this->assertFalse($metadata->getNumberFormat(1)->isNationalPrefixOptionalWhenFormatting());
|
||||
}
|
||||
|
||||
public function testProcessPhoneNumberDescElement_PossibleLengthsSetCorrectly()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
// The number lengths set for the general description must be a super-set of those in the
|
||||
// element being parsed.
|
||||
$generalDesc->setPossibleLength(array(4, 6, 7, 13));
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
// Sorting will be done when parsing.
|
||||
. " <possibleLengths national=\"13,4\" localOnly=\"6\"/>"
|
||||
. "</fixedLine>"
|
||||
. "</territory>");
|
||||
|
||||
$phoneNumberDesc = BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false /* no liteBuild */);
|
||||
$possibleLength = $phoneNumberDesc->getPossibleLength();
|
||||
$this->assertCount(2, $possibleLength);
|
||||
$this->assertEquals(4, $possibleLength[0]);
|
||||
$this->assertEquals(13, $possibleLength[1]);
|
||||
// We don't set the local-only lengths on child elements such as fixed-line.
|
||||
$this->assertCount(0, $phoneNumberDesc->getPossibleLengthLocalOnly());
|
||||
}
|
||||
|
||||
public function testSetPossibleLengthsGeneralDesc_BuiltFromChildElements()
|
||||
{
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
. " <possibleLengths national=\"13\" localOnly=\"6\"/>"
|
||||
. "</fixedLine>"
|
||||
. "<mobile>"
|
||||
. " <possibleLengths national=\"15\" localOnly=\"7,13\"/>"
|
||||
. "</mobile>"
|
||||
. "<tollFree>"
|
||||
. " <possibleLengths national=\"15\"/>"
|
||||
. "</tollFree>"
|
||||
. "</territory>");
|
||||
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
BuildMetadataFromXml::setPossibleLengthsGeneralDesc($generalDesc, 'someId', $territoryElement, false /* not short-number metadata */);
|
||||
|
||||
$possibleLength = $generalDesc->getPossibleLength();
|
||||
$this->assertCount(2, $possibleLength);
|
||||
$this->assertEquals(13, $possibleLength[0]);
|
||||
// 15 is present twice in the input in different sections, but only once in the output.
|
||||
$this->assertEquals(15, $possibleLength[1]);
|
||||
$possibleLengthLocalOnly = $generalDesc->getPossibleLengthLocalOnly();
|
||||
$this->assertCount(2, $possibleLengthLocalOnly);
|
||||
$this->assertEquals(6, $possibleLengthLocalOnly[0]);
|
||||
$this->assertEquals(7, $possibleLengthLocalOnly[1]);
|
||||
// 13 is skipped as a "local only" length, since it is also present as a normal length.
|
||||
}
|
||||
|
||||
public function testSetPossibleLengthsGeneralDesc_IgnoresNoIntlDialling()
|
||||
{
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
. " <possibleLengths national=\"13\"/>"
|
||||
. "</fixedLine>"
|
||||
. "<noInternationalDialling>"
|
||||
. " <possibleLengths national=\"15\"/>"
|
||||
. "</noInternationalDialling>"
|
||||
. "</territory>");
|
||||
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
BuildMetadataFromXml::setPossibleLengthsGeneralDesc($generalDesc, 'someId', $territoryElement, false /* not short-number metadata */);
|
||||
|
||||
$possibleLength = $generalDesc->getPossibleLength();
|
||||
$this->assertCount(1, $possibleLength);
|
||||
$this->assertEquals(13, $possibleLength[0]);
|
||||
// 15 is skipped because noInternationalDialling should not contribute to the general lengths;
|
||||
// it isn't a particular "type" of number per se, it is a property that different types may
|
||||
// have.
|
||||
}
|
||||
|
||||
public function testSetPossibleLengthsGeneralDesc_ShortNumberMetadata()
|
||||
{
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<shortCode>"
|
||||
. " <possibleLengths national=\"6,13\"/>"
|
||||
. "</shortCode>"
|
||||
. "<carrierSpecific>"
|
||||
. " <possibleLengths national=\"7,13,15\"/>"
|
||||
. "</carrierSpecific>"
|
||||
. "<tollFree>"
|
||||
. " <possibleLengths national=\"15\"/>"
|
||||
. "</tollFree>"
|
||||
. "</territory>");
|
||||
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
BuildMetadataFromXml::setPossibleLengthsGeneralDesc($generalDesc, 'someId', $territoryElement, true /* short-number metadata */);
|
||||
|
||||
// All elements other than shortCode are ignored when creating the general desc.
|
||||
$possibleLength = $generalDesc->getPossibleLength();
|
||||
$this->assertCount(2, $possibleLength);
|
||||
$this->assertEquals(6, $possibleLength[0]);
|
||||
$this->assertEquals(13, $possibleLength[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Found local-only lengths in short-number metadata
|
||||
*/
|
||||
public function testSetPossibleLengthsGeneralDesc_ShortNumberMetadataErrorsOnLocalLengths()
|
||||
{
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<shortCode>"
|
||||
. " <possibleLengths national=\"13\" localOnly=\"6\"/>"
|
||||
. "</shortCode>"
|
||||
. "</territory>");
|
||||
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
BuildMetadataFromXml::setPossibleLengthsGeneralDesc($generalDesc, 'someId', $territoryElement, true /* short-number metadata */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Duplicate length element found (6) in possibleLength string 6,6
|
||||
*/
|
||||
public function testProcessPhoneNumberDescElement_ErrorDuplicates()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleLength(array(6));
|
||||
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<mobile>"
|
||||
. " <possibleLengths national=\"6,6\"/>"
|
||||
. "</mobile>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'mobile', false /* not light build */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Possible length(s) found specified as a normal and local-only length: [6]
|
||||
*/
|
||||
public function testProcessPhoneNumberDescElement_ErrorDuplicatesOneLocal()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleLength(array(6));
|
||||
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<mobile>"
|
||||
. " <possibleLengths national=\"6\" localOnly=\"6\"/>"
|
||||
. "</mobile>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'mobile', false /* not light build */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Out-of-range possible length
|
||||
*/
|
||||
public function testProcessPhoneNumberDescElement_ErrorUncoveredLengths()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleLength(array(4));
|
||||
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<noInternationalDialling>"
|
||||
// Sorting will be done when parsing.
|
||||
. " <possibleLengths national=\"6,7,4\"/>"
|
||||
. "</noInternationalDialling>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'noInternationalDialling', false /* not light build */);
|
||||
}
|
||||
|
||||
public function testProcessPhoneNumberDescElement_SameAsParent()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
// The number lengths set for the general description must be a super-set of those in the
|
||||
// element being parsed.
|
||||
$generalDesc->setPossibleLength(array(4, 6, 7));
|
||||
$generalDesc->setPossibleLengthLocalOnly(array(2));
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
// Sorting will be done when parsing.
|
||||
. " <possibleLengths national=\"6,7,4\" localOnly=\"2\"/>"
|
||||
. "</fixedLine>"
|
||||
. "</territory>");
|
||||
|
||||
$phoneNumberDesc = BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false /* not light build */);
|
||||
|
||||
// No possible lengths should be present, because they match the general description.
|
||||
$this->assertCount(0, $phoneNumberDesc->getPossibleLength());
|
||||
$this->assertCount(0, $phoneNumberDesc->getPossibleLengthLocalOnly());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage For input string "4d"
|
||||
*/
|
||||
public function testProcessPhoneNumberDescElement_InvalidNumber()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleLength(array(4));
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
. " <possibleLengths national=\"4d\"/>"
|
||||
. "</fixedLine>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false /* not light build */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Found possible lengths specified at general desc: this should be derived from child elements. Affected country: FR
|
||||
*/
|
||||
public function testLoadCountryMetadata_GeneralDescHasNumberLengthsSet()
|
||||
{
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<generalDesc>"
|
||||
// This shouldn't be set, the possible lengths should be derived for generalDesc.
|
||||
. " <possibleLengths national=\"4\"/>"
|
||||
. "</generalDesc>"
|
||||
. "<fixedLine>"
|
||||
. " <possibleLengths national=\"4\"/>"
|
||||
. "</fixedLine>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::loadCountryMetadata('FR', $territoryElement, false /* liteBuild */, false /* isShortNumberMetadata */, false /* isAlternateFormatsMetadata */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Empty possibleLength string found.
|
||||
*/
|
||||
public function testProcessPhoneNumberDescElement_ErrorEmptyPossibleLengthStringAttribute()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleLength(array(4));
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
. " <possibleLengths national=\"\"/>"
|
||||
. "</fixedLine>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false /* not light build */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Missing end of range character in possible length string [4,7].
|
||||
*/
|
||||
public function testProcessPhoneNumberDescElement_ErrorRangeSpecifiedWithComma()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleLength(array(4));
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
. " <possibleLengths national=\"[4,7]\"/>"
|
||||
. "</fixedLine>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false /* not light build */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Missing end of range character in possible length string [4-.
|
||||
*/
|
||||
public function testProcessPhoneNumberDescElement_ErrorIncompleteRange()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleLength(array(4));
|
||||
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
. " <possibleLengths national=\"[4-\"/>"
|
||||
. "</fixedLine>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false /* not light build */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Ranges must have exactly one - character: missing for [4:10].
|
||||
*/
|
||||
public function testProcessPhoneNumberDescElement_ErrorNoDashInRange()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleLength(array(4));
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
. " <possibleLengths national=\"[4:10]\"/>"
|
||||
. "</fixedLine>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false /* not light build */);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage The first number in a range should be two or more digits lower than the second. Culprit possibleLength string: [10-10]
|
||||
*/
|
||||
public function testProcessPhoneNumberDescElement_ErrorRangeIsNotFromMinToMax()
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc->setPossibleLength(array(4));
|
||||
$territoryElement = $this->parseXMLString("<territory>"
|
||||
. "<fixedLine>"
|
||||
. " <possibleLengths national=\"[10-10]\"/>"
|
||||
. "</fixedLine>"
|
||||
. "</territory>");
|
||||
|
||||
BuildMetadataFromXml::processPhoneNumberDescElement($generalDesc, $territoryElement, 'fixedLine', false /* not light build */);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\buildtools;
|
||||
|
||||
|
||||
use libphonenumber\buildtools\GeneratePhonePrefixData;
|
||||
|
||||
class GeneratePhonePrefixDataTest extends \PHPUnit_Framework_TestCase
|
||||
@@ -51,6 +50,4 @@ class GeneratePhonePrefixDataTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertContains("zh_Hans", $languagesForCN);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -77,10 +77,6 @@ class PhoneNumberToCarrierMapperTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -138,6 +134,5 @@ class PhoneNumberToCarrierMapperTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$UK_INVALID_NUMBER, "en"));
|
||||
$this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$AO_INVALID_NUMBER, "en"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,6 @@ class ExampleNumbersTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCanBeInternationallyDialled($regionCode)
|
||||
{
|
||||
|
||||
$exampleNumber = null;
|
||||
/** @var \libphonenumber\PhoneNumberDesc $desc */
|
||||
$desc = $this->phoneNumberUtil->getMetadataForRegion($regionCode)->getNoInternationalDialling();
|
||||
@@ -200,7 +199,6 @@ class ExampleNumbersTest extends \PHPUnit_Framework_TestCase
|
||||
$exampleNumber = $this->phoneNumberUtil->parse($desc->getExampleNumber(), $regionCode);
|
||||
}
|
||||
} catch (NumberParseException $e) {
|
||||
|
||||
}
|
||||
|
||||
if ($exampleNumber !== null && $this->phoneNumberUtil->canBeInternationallyDialled($exampleNumber)) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\core;
|
||||
|
||||
|
||||
use libphonenumber\DefaultMetadataLoader;
|
||||
use libphonenumber\MultiFileMetadataSourceImpl;
|
||||
use libphonenumber\PhoneNumberUtil;
|
||||
|
||||
@@ -16,10 +16,8 @@ use libphonenumber\PhoneNumberUtil;
|
||||
use libphonenumber\RegionCode;
|
||||
use libphonenumber\ValidationResult;
|
||||
|
||||
|
||||
class PhoneNumberUtilTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
const TEST_META_DATA_FILE_PREFIX = "../../../Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting";
|
||||
private static $bsNumber = null;
|
||||
private static $internationalTollFree = null;
|
||||
@@ -151,8 +149,7 @@ class PhoneNumberUtilTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertGreaterThan(0, count($globalNetworkCallingCodes));
|
||||
|
||||
foreach ($globalNetworkCallingCodes as $callingCode)
|
||||
{
|
||||
foreach ($globalNetworkCallingCodes as $callingCode) {
|
||||
$this->assertGreaterThan(0, $callingCode);
|
||||
$this->assertEquals(RegionCode::UN001, $this->phoneUtil->getRegionCodeForCountryCode($callingCode));
|
||||
}
|
||||
@@ -178,6 +175,11 @@ class PhoneNumberUtilTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals("\\d{7}(?:\\d{3})?", $metadata->getGeneralDesc()->getPossibleNumberPattern());
|
||||
$this->assertTrue($metadata->getGeneralDesc()->exactlySameAs($metadata->getFixedLine()));
|
||||
$this->assertEquals("\\d{10}", $metadata->getTollFree()->getPossibleNumberPattern());
|
||||
$possibleLength = $metadata->getGeneralDesc()->getPossibleLength();
|
||||
$this->assertEquals(10, $possibleLength[0]);
|
||||
// Possible lengths are the same as the general description, so aren't stored separately in the
|
||||
// toll free element as well.
|
||||
$this->assertCount(0, $metadata->getTollFree()->getPossibleLength());
|
||||
$this->assertEquals("900\\d{7}", $metadata->getPremiumRate()->getNationalNumberPattern());
|
||||
// No shared-cost data is available, so it should be initialised to "NA".
|
||||
$this->assertEquals("NA", $metadata->getSharedCost()->getNationalNumberPattern());
|
||||
@@ -196,8 +198,15 @@ class PhoneNumberUtilTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals("900", $metadata->getNumberFormat(5)->getLeadingDigitsPattern(0));
|
||||
$this->assertEquals("(\\d{3})(\\d{3,4})(\\d{4})", $metadata->getNumberFormat(5)->getPattern());
|
||||
$this->assertEquals("$1 $2 $3", $metadata->getNumberFormat(5)->getFormat());
|
||||
$this->assertCount(2, $metadata->getGeneralDesc()->getPossibleLengthLocalOnly());
|
||||
$this->assertCount(8, $metadata->getGeneralDesc()->getPossibleLength());
|
||||
// Nothing is present for fixed-line, since it is the same as the general desc, so for
|
||||
// efficiency reasons we don't store an extra value.
|
||||
$this->assertCount(0, $metadata->getFixedLine()->getPossibleLength());
|
||||
$this->assertCount(2, $metadata->getMobile()->getPossibleLength());
|
||||
|
||||
$this->assertEquals(
|
||||
"(?:[24-6]\\d{2}|3[03-9]\\d|[789](?:[1-9]\\d|0[2-9]))\\d{1,8}",
|
||||
"(?:[24-6]\\d{2}|3[03-9]\\d|[789](?:0[2-9]|[1-9]\\d))\\d{1,8}",
|
||||
$metadata->getFixedLine()->getNationalNumberPattern()
|
||||
);
|
||||
$this->assertEquals("\\d{2,14}", $metadata->getFixedLine()->getPossibleNumberPattern());
|
||||
@@ -262,12 +271,19 @@ class PhoneNumberUtilTest extends \PHPUnit_Framework_TestCase
|
||||
// Google London, which has area code "20".
|
||||
$this->assertEquals(2, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$gbNumber));
|
||||
|
||||
// A mobile number in the UK does not have an area code (by default, mobile numbers do not,
|
||||
// unless they have been added to our list of exceptions).
|
||||
$this->assertEquals(0, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$gbMobile));
|
||||
|
||||
// A UK mobile phone, which has no area code.
|
||||
$this->assertEquals(0, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$gbMobile));
|
||||
|
||||
// Google Buenos Aires, which has area code "11".
|
||||
$this->assertEquals(2, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$arNumber));
|
||||
|
||||
// A mobile number in Argentina also has an area code.
|
||||
$this->assertEquals(3, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$arMobile));
|
||||
|
||||
// Google Sydney, which has area code "2".
|
||||
$this->assertEquals(1, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$auNumber));
|
||||
|
||||
@@ -282,6 +298,12 @@ class PhoneNumberUtilTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
// An international toll free number, which has no area code.
|
||||
$this->assertEquals(0, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$internationalTollFree));
|
||||
|
||||
// A mobile number from China is geographical, but does not have an area code.
|
||||
$cnMobile = new PhoneNumber();
|
||||
$cnMobile->setCountryCode(86)->setNationalNumber('18912341234');
|
||||
|
||||
$this->assertEquals(0, $this->phoneUtil->getLengthOfGeographicalAreaCode($cnMobile));
|
||||
}
|
||||
|
||||
public function testGetLengthOfNationalDestinationCode()
|
||||
@@ -320,6 +342,13 @@ class PhoneNumberUtilTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
// An international toll free number, which has NDC "1234".
|
||||
$this->assertEquals(4, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$internationalTollFree));
|
||||
|
||||
// A mobile number from China is geographical, but does not have an area code: however it still
|
||||
// can be considered to have a national destination code.
|
||||
$cnMobile= new PhoneNumber();
|
||||
$cnMobile->setCountryCode(86)->setNationalNumber('18912341234');
|
||||
|
||||
$this->assertEquals(3, $this->phoneUtil->getLengthOfNationalDestinationCode($cnMobile));
|
||||
}
|
||||
|
||||
public function testGetCountryMobileToken()
|
||||
@@ -1769,7 +1798,6 @@ class PhoneNumberUtilTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($this->phoneUtil->isPossibleNumber("1 3000", RegionCode::GB));
|
||||
$this->assertFalse($this->phoneUtil->isPossibleNumber("+44 300", RegionCode::GB));
|
||||
$this->assertFalse($this->phoneUtil->isPossibleNumber("+800 1234 5678 9", RegionCode::UN001));
|
||||
|
||||
}
|
||||
|
||||
public function testTruncateTooLongNumber()
|
||||
|
||||
@@ -153,5 +153,4 @@ class ShortNumberUtilTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($this->shortUtil->isEmergencyNumber("01312345", RegionCode::ZW));
|
||||
$this->assertFalse($this->shortUtil->isEmergencyNumber("0711234567", RegionCode::ZW));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,84 +11,149 @@ return array (
|
||||
'NationalNumberPattern' => '\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{8}',
|
||||
'ExampleNumber' => '12345678',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '-1',
|
||||
1 => '8',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'ExampleNumber' => '12345678',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '-1',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'ExampleNumber' => '12345678',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '-1',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{8}',
|
||||
'ExampleNumber' => '12345678',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '8',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => '001',
|
||||
'countryCode' => 800,
|
||||
@@ -105,6 +170,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -11,84 +11,149 @@ return array (
|
||||
'NationalNumberPattern' => '\\d{9}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '123456789',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '-1',
|
||||
1 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'ExampleNumber' => '123456789',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '-1',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'ExampleNumber' => '123456789',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '-1',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '\\d{9}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '123456789',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => '001',
|
||||
'countryCode' => 979,
|
||||
@@ -105,6 +170,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -8,77 +8,138 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'AD',
|
||||
'countryCode' => 376,
|
||||
|
||||
@@ -10,82 +10,143 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-9]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-9]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-9]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '600\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '600123456',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'AE',
|
||||
'countryCode' => 971,
|
||||
|
||||
@@ -10,83 +10,145 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[29]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '2\\d(?:[26-9]\\d|\\d[26-9])\\d{5}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '222123456',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '9[1-3]\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '923123456',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'AO',
|
||||
'countryCode' => 244,
|
||||
@@ -105,6 +167,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -10,81 +10,155 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-3689]\\d{9,10}',
|
||||
'PossibleNumberPattern' => '\\d{6,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => 6,
|
||||
1 => 7,
|
||||
2 => 8,
|
||||
3 => 9,
|
||||
4 => 10,
|
||||
5 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-3]\\d{9}',
|
||||
'PossibleNumberPattern' => '\\d{6,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => 6,
|
||||
1 => 7,
|
||||
2 => 8,
|
||||
3 => 9,
|
||||
4 => 10,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '9\\d{10}|[1-3]\\d{9}',
|
||||
'PossibleNumberPattern' => '\\d{10,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
1 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '80\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '6(0\\d|10)\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'AR',
|
||||
'countryCode' => 54,
|
||||
@@ -105,6 +179,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -116,6 +191,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -127,6 +203,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
@@ -138,6 +215,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '0$1 $CC',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
@@ -149,6 +227,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
@@ -163,6 +242,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -174,6 +254,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -183,6 +264,9 @@ return array (
|
||||
array (
|
||||
0 => '911',
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
@@ -192,6 +276,9 @@ return array (
|
||||
array (
|
||||
0 => '9(?:1[02-9]|[23])',
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
@@ -203,6 +290,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'mainCountryForCode' => false,
|
||||
|
||||
@@ -10,81 +10,146 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-578]\\d{4,14}',
|
||||
'PossibleNumberPattern' => '\\d{5,15}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
1 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[2378]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '4\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '1800\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '190[0126]\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'AU',
|
||||
'countryCode' => 61,
|
||||
@@ -105,6 +170,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -116,6 +182,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -8,77 +8,138 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'BB',
|
||||
'countryCode' => 1,
|
||||
|
||||
@@ -8,77 +8,138 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'BR',
|
||||
'countryCode' => 55,
|
||||
|
||||
@@ -10,81 +10,142 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '(242|8(00|66|77|88)|900)\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{7,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
0 => '7',
|
||||
),
|
||||
),
|
||||
'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}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '242(357|359|457|557)\\d{4}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '8(00|66|77|88)\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '900\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'BS',
|
||||
'countryCode' => 1,
|
||||
|
||||
@@ -10,82 +10,144 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-9]\\d{5}',
|
||||
'PossibleNumberPattern' => '\\d{6}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '6',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-9]\\d{5}',
|
||||
'PossibleNumberPattern' => '\\d{6}',
|
||||
'ExampleNumber' => '112345',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-9]\\d{5}',
|
||||
'PossibleNumberPattern' => '\\d{6}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'BY',
|
||||
'countryCode' => 375,
|
||||
@@ -105,6 +167,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '8 $1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -116,6 +179,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '8$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -127,6 +191,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '8 $1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -8,77 +8,138 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'CA',
|
||||
'countryCode' => 1,
|
||||
|
||||
@@ -8,77 +8,138 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'CC',
|
||||
'countryCode' => 61,
|
||||
|
||||
@@ -8,82 +8,154 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-7]\\d{6,11}|8[0-357-9]\\d{6,9}|9\\d{7,10}',
|
||||
'PossibleNumberPattern' => '\\d{4,12}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[2-9]\\d{10}',
|
||||
'PossibleNumberPattern' => '\\d{11}',
|
||||
'ExampleNumber' => '91234567',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '1(?:[38]\\d|4[57]|5[0-35-9]|7[0136-8])\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{11}',
|
||||
'ExampleNumber' => '13123456789',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'CN',
|
||||
'countryCode' => 86,
|
||||
'internationalPrefix' => '',
|
||||
'sameMobileAndFixedLinePattern' => true,
|
||||
'nationalPrefix' => '0',
|
||||
'nationalPrefixForParsing' => '0',
|
||||
'sameMobileAndFixedLinePattern' => false,
|
||||
'numberFormat' =>
|
||||
array (
|
||||
0 =>
|
||||
@@ -94,15 +166,23 @@ return array (
|
||||
array (
|
||||
0 => '[3-9]',
|
||||
1 => '[3-9]\\d{2}[19]',
|
||||
2 => '
|
||||
[3-9]\\d{2}(?:
|
||||
10|
|
||||
95
|
||||
)
|
||||
',
|
||||
2 => '[3-9]\\d{2}(?:10|95)',
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '$CC $1',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'pattern' => '(\\d{3})(\\d{8})',
|
||||
'format' => '$1 $2',
|
||||
'leadingDigitsPatterns' =>
|
||||
array (
|
||||
0 => '1',
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '$1',
|
||||
'domesticCarrierCodeFormattingRule' => '$CC $1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -8,77 +8,138 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'CX',
|
||||
'countryCode' => 61,
|
||||
|
||||
@@ -10,82 +10,156 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '\\d{4,14}',
|
||||
'PossibleNumberPattern' => '\\d{2,14}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => 4,
|
||||
1 => 5,
|
||||
2 => 6,
|
||||
3 => 7,
|
||||
4 => 8,
|
||||
5 => 9,
|
||||
6 => 10,
|
||||
7 => 11,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
0 => '2',
|
||||
1 => '3',
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '(?:[24-6]\\d{2}|3[03-9]\\d|[789](?:[1-9]\\d|0[2-9]))\\d{1,8}',
|
||||
'NationalNumberPattern' => '(?:[24-6]\\d{2}|3[03-9]\\d|[789](?:0[2-9]|[1-9]\\d))\\d{1,8}',
|
||||
'PossibleNumberPattern' => '\\d{2,14}',
|
||||
'ExampleNumber' => '30123456',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '1(5\\d{9}|7\\d{8}|6[02]\\d{8}|63\\d{7})',
|
||||
'PossibleNumberPattern' => '\\d{10,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
1 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '800\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '900([135]\\d{6}|9\\d{7})',
|
||||
'PossibleNumberPattern' => '\\d{10,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
1 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'DE',
|
||||
'countryCode' => 49,
|
||||
@@ -105,6 +179,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -116,6 +191,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -128,6 +204,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
@@ -140,6 +217,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
@@ -151,6 +229,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
5 =>
|
||||
array (
|
||||
@@ -162,6 +241,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -10,81 +10,142 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '3\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{7}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '3\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{7}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '3\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{7}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'FR',
|
||||
'countryCode' => 33,
|
||||
@@ -104,6 +165,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -10,81 +10,138 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '\\d{10}',
|
||||
'PossibleNumberPattern' => '\\d{6,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
0 => '6',
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-6]\\d{9}',
|
||||
'PossibleNumberPattern' => '\\d{6,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '7[1-57-9]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '80\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '9[018]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '8(?:4[3-5]|7[0-2])\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '70\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '56\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '76\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'GB',
|
||||
'countryCode' => 44,
|
||||
@@ -104,6 +161,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '(0$1)',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -115,6 +173,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '(0$1)',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -126,6 +185,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '(0$1)',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
@@ -137,6 +197,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '(0$1)',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -8,77 +8,138 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'GG',
|
||||
'countryCode' => 44,
|
||||
|
||||
@@ -10,81 +10,143 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '30\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '30\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '30\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'HU',
|
||||
'countryCode' => 36,
|
||||
|
||||
@@ -10,81 +10,152 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[0389]\\d{5,10}',
|
||||
'PossibleNumberPattern' => '\\d{6,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '6',
|
||||
1 => '9',
|
||||
2 => '10',
|
||||
3 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '0\\d{9,10}',
|
||||
'PossibleNumberPattern' => '\\d{10,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
1 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '3\\d{8,9}',
|
||||
'PossibleNumberPattern' => '\\d{9,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
1 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '80(?:0\\d{6}|3\\d{3})',
|
||||
'PossibleNumberPattern' => '\\d{6,9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '6',
|
||||
1 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '89(?:2\\d{3}|9\\d{6})',
|
||||
'PossibleNumberPattern' => '\\d{6,9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '6',
|
||||
1 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'IT',
|
||||
'countryCode' => 39,
|
||||
@@ -102,6 +173,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -113,6 +185,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -124,6 +197,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
@@ -135,6 +209,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -10,82 +10,151 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '07\\d{5}|[1-357-9]\\d{3,10}',
|
||||
'PossibleNumberPattern' => '\\d{4,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => 4,
|
||||
1 => 5,
|
||||
2 => 6,
|
||||
3 => 7,
|
||||
4 => 8,
|
||||
5 => 9,
|
||||
6 => 10,
|
||||
7 => 11,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '07\\d{5}|[1-357-9]\\d{3,10}',
|
||||
'PossibleNumberPattern' => '\\d{4,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '07\\d{5}|[1-357-9]\\d{3,10}',
|
||||
'PossibleNumberPattern' => '\\d{4,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '0777[01]\\d{2}',
|
||||
'PossibleNumberPattern' => '\\d{7}',
|
||||
'ExampleNumber' => '0777012',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '7',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[23]\\d{3}',
|
||||
'PossibleNumberPattern' => '\\d{4}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '4',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'JP',
|
||||
'countryCode' => 81,
|
||||
@@ -105,6 +174,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -116,6 +186,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -129,6 +200,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
@@ -143,6 +215,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
@@ -154,6 +227,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
5 =>
|
||||
array (
|
||||
@@ -165,6 +239,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
6 =>
|
||||
array (
|
||||
@@ -176,6 +251,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -10,87 +10,157 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-7]\\d{3,9}|8\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{4,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => 4,
|
||||
1 => 5,
|
||||
2 => 6,
|
||||
3 => 7,
|
||||
4 => 8,
|
||||
5 => 9,
|
||||
6 => 10,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'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',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '1[0-25-9]\\d{7,8}',
|
||||
'PossibleNumberPattern' => '\\d{9,10}',
|
||||
'ExampleNumber' => '1023456789',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
1 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '80\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '801234567',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '60[2-9]\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '602345678',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '50\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'ExampleNumber' => '5012345678',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '70\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'ExampleNumber' => '7012345678',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'KR',
|
||||
'countryCode' => 82,
|
||||
@@ -111,6 +181,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -123,6 +194,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -135,6 +207,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
@@ -147,6 +220,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
@@ -158,6 +232,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
5 =>
|
||||
array (
|
||||
@@ -169,6 +244,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
6 =>
|
||||
array (
|
||||
@@ -181,6 +257,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
7 =>
|
||||
array (
|
||||
@@ -193,6 +270,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
8 =>
|
||||
array (
|
||||
@@ -205,6 +283,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
9 =>
|
||||
array (
|
||||
@@ -217,6 +296,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
10 =>
|
||||
array (
|
||||
@@ -230,6 +310,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
11 =>
|
||||
array (
|
||||
@@ -243,6 +324,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -10,81 +10,147 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-9]\\d{9,10}',
|
||||
'PossibleNumberPattern' => '\\d{7,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
1 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
0 => '7',
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[2-9]\\d{9}',
|
||||
'PossibleNumberPattern' => '\\d{7,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '1\\d{10}',
|
||||
'PossibleNumberPattern' => '\\d{11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '800\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '900\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'MX',
|
||||
'countryCode' => 52,
|
||||
@@ -105,6 +171,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '01 $1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -116,6 +183,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '01 $1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -127,6 +195,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '01 $1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
@@ -138,6 +207,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
@@ -149,6 +219,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
@@ -163,6 +234,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '01 $1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -174,6 +246,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '01 $1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -185,6 +258,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '01 $1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
@@ -194,6 +268,9 @@ return array (
|
||||
array (
|
||||
0 => '1(?:33|55|81)',
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
4 =>
|
||||
array (
|
||||
@@ -203,6 +280,9 @@ return array (
|
||||
array (
|
||||
0 => '1(?:[124579]|3[0-24-9]|5[0-46-9]|8[02-9])',
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'mainCountryForCode' => false,
|
||||
|
||||
@@ -8,86 +8,155 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '
|
||||
[289]\\d{7,9}|
|
||||
[3-7]\\d{7}
|
||||
',
|
||||
'NationalNumberPattern' => '[289]\\d{7,9}|[3-7]\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{7,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '7',
|
||||
1 => '8',
|
||||
2 => 9,
|
||||
3 => 10,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '24099\\d{3}|(?:3[2-79]|[479][2-689]|6[235-9])\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{7,8}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '7',
|
||||
1 => '8',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'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}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => 8,
|
||||
1 => 9,
|
||||
2 => 10,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '800\\d{6,7}',
|
||||
'PossibleNumberPattern' => '\\d{9,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
1 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '900\\d{6,7}',
|
||||
'PossibleNumberPattern' => '\\d{9,10}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
1 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'NZ',
|
||||
'countryCode' => 64,
|
||||
@@ -107,6 +176,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -118,6 +188,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -129,6 +200,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -10,81 +10,141 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-9]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[1-9]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '(?:5[01]|6[069]|7[289]|88)\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '800\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '70\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'PL',
|
||||
'countryCode' => 48,
|
||||
@@ -103,6 +163,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -10,85 +10,145 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[268]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '262\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '262161234',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '6(?:9[23]|47)\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '692123456',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '80\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '801234567',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '8(?:1[01]|2[0156]|84|9[0-37-9])\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '810123456',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'RE',
|
||||
'countryCode' => 262,
|
||||
@@ -107,6 +167,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '0$1',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -8,77 +8,138 @@
|
||||
return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'SE',
|
||||
'countryCode' => 46,
|
||||
|
||||
@@ -9,85 +9,149 @@ return array (
|
||||
'generalDesc' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[13689]\\d{7,10}',
|
||||
'PossibleNumberPattern' => '
|
||||
\\d{8}|
|
||||
\\d{10,11}
|
||||
',
|
||||
'PossibleNumberPattern' => '\\d{8}|\\d{10,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '8',
|
||||
1 => '10',
|
||||
2 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[36]\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{8}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '8',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[89]\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{8}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '8',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '1?800\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10,11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
1 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '1900\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{11}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '11',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'SG',
|
||||
'countryCode' => 65,
|
||||
@@ -106,6 +170,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -117,6 +182,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
@@ -128,6 +194,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => false,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
|
||||
@@ -11,86 +11,145 @@ return array (
|
||||
'NationalNumberPattern' => '[13-689]\\d{9}|2[0-35-9]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?',
|
||||
'ExampleNumber' => '1234567890',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '10',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[13-689]\\d{9}|2[0-35-9]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?',
|
||||
'ExampleNumber' => '1234567890',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '[13-689]\\d{9}|2[0-35-9]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?',
|
||||
'ExampleNumber' => '1234567890',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '8(?:00|66|77|88)\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'ExampleNumber' => '1234567890',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '900\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'ExampleNumber' => '1234567890',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '800\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{10}',
|
||||
'ExampleNumber' => '1234567890',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'US',
|
||||
'countryCode' => 1,
|
||||
@@ -110,6 +169,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
@@ -120,6 +180,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
),
|
||||
'intlNumberFormat' =>
|
||||
@@ -133,6 +194,7 @@ return array (
|
||||
),
|
||||
'nationalPrefixFormattingRule' => '',
|
||||
'domesticCarrierCodeFormattingRule' => '',
|
||||
'nationalPrefixOptionalWhenFormatting' => true,
|
||||
),
|
||||
),
|
||||
'mainCountryForCode' => true,
|
||||
|
||||
@@ -10,84 +10,145 @@ return array (
|
||||
array (
|
||||
'NationalNumberPattern' => '[268]\\d{8}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => '9',
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'fixedLine' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '2696[0-4]\\d{4}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '269601234',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'mobile' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '639\\d{6}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '639123456',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'tollFree' =>
|
||||
array (
|
||||
'NationalNumberPattern' => '80\\d{7}',
|
||||
'PossibleNumberPattern' => '\\d{9}',
|
||||
'ExampleNumber' => '801234567',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'premiumRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'sharedCost' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'personalNumber' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voip' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'pager' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'uan' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'emergency' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'voicemail' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'shortCode' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'standardRate' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
),
|
||||
'carrierSpecific' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'noInternationalDialling' =>
|
||||
array (
|
||||
'NationalNumberPattern' => 'NA',
|
||||
'PossibleNumberPattern' => 'NA',
|
||||
'PossibleLength' =>
|
||||
array (
|
||||
0 => -1,
|
||||
),
|
||||
'PossibleLengthLocalOnly' =>
|
||||
array (
|
||||
),
|
||||
),
|
||||
'id' => 'YT',
|
||||
'countryCode' => 262,
|
||||
|
||||
@@ -5,7 +5,6 @@ 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/";
|
||||
@@ -13,6 +12,7 @@ class PhoneNumberOfflineGeocoderTest extends \PHPUnit_Framework_TestCase
|
||||
private static $KO_Number2;
|
||||
private static $KO_Number3;
|
||||
private static $KO_InvalidNumber;
|
||||
private static $KO_Mobile;
|
||||
private static $US_Number1;
|
||||
private static $US_Number2;
|
||||
private static $US_Number3;
|
||||
@@ -43,6 +43,9 @@ class PhoneNumberOfflineGeocoderTest extends \PHPUnit_Framework_TestCase
|
||||
self::$KO_InvalidNumber = new PhoneNumber();
|
||||
self::$KO_InvalidNumber->setCountryCode(82)->setNationalNumber(1234);
|
||||
|
||||
self::$KO_Mobile = new PhoneNumber();
|
||||
self::$KO_Mobile->setCountryCode(82)->setNationalNumber(101234567);
|
||||
|
||||
self::$US_Number1 = new PhoneNumber();
|
||||
self::$US_Number1->setCountryCode(1)->setNationalNumber(6502530000);
|
||||
|
||||
@@ -75,15 +78,10 @@ class PhoneNumberOfflineGeocoderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -198,4 +196,10 @@ class PhoneNumberOfflineGeocoderTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$KO_InvalidNumber, "en"));
|
||||
$this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$US_InvalidNumber, "en"));
|
||||
}
|
||||
|
||||
public function testGetDescriptionForNonGeographicalNumberWithGeocodingPrefix()
|
||||
{
|
||||
// We have a geocoding prefix, but we shouldn't use it since this is not geographical.
|
||||
$this->assertEquals("South Korea", $this->geocoder->getDescriptionForNumber(self::$KO_Mobile, 'en'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace libphonenumber\Tests\prefixmapper;
|
||||
use libphonenumber\PhoneNumber;
|
||||
use libphonenumber\prefixmapper\PrefixFileReader;
|
||||
|
||||
|
||||
class PrefixFileReaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
const TEST_META_DATA_FILE_PREFIX = "/data/";
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
return array (
|
||||
8210 => 'Mobile prefix, should not be geocoded.',
|
||||
822 => 'Seoul',
|
||||
8231 => 'Gyeonggi',
|
||||
8232 => 'Incheon',
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\Tests\timezone;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumber;
|
||||
use libphonenumber\prefixmapper\PrefixTimeZonesMap;
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ class BuildMetadataFromXml
|
||||
const PATTERN = "pattern";
|
||||
const PERSONAL_NUMBER = "personalNumber";
|
||||
const POSSIBLE_NUMBER_PATTERN = "possibleNumberPattern";
|
||||
const POSSIBLE_LENGTHS = "possibleLengths";
|
||||
const NATIONAL = "national";
|
||||
const LOCAL_ONLY = "localOnly";
|
||||
const PREFERRED_EXTN_PREFIX = "preferredExtnPrefix";
|
||||
const PREFERRED_INTERNATIONAL_PREFIX = "preferredInternationalPrefix";
|
||||
const PREMIUM_RATE = "premiumRate";
|
||||
@@ -51,10 +54,33 @@ class BuildMetadataFromXml
|
||||
const UAN = "uan";
|
||||
const VOICEMAIL = "voicemail";
|
||||
const VOIP = "voip";
|
||||
|
||||
private static $phoneNumberDescsWithoutMatchingTypes = array(
|
||||
self::NO_INTERNATIONAL_DIALLING
|
||||
);
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
* @internal
|
||||
* @param $regex
|
||||
* @param bool $removeWhitespace
|
||||
* @return string
|
||||
*/
|
||||
private static $liteBuild;
|
||||
public static function validateRE($regex, $removeWhitespace = false)
|
||||
{
|
||||
$compressedRegex = $removeWhitespace ? preg_replace('/\\s/', '', $regex) : $regex;
|
||||
// Match regex against an empty string to check the regex is valid
|
||||
if (preg_match('/' . $compressedRegex . '/', '') === false) {
|
||||
throw new \RuntimeException("Regex error: " . preg_last_error());
|
||||
}
|
||||
// We don't ever expect to see | followed by a ) in our metadata - this would be an indication
|
||||
// of a bug. If one wants to make something optional, we prefer ? to using an empty group.
|
||||
$errorIndex = strpos($compressedRegex, '|)');
|
||||
if ($errorIndex !== false) {
|
||||
throw new \RuntimeException("| followed by )");
|
||||
}
|
||||
// return the regex if it is of correct syntax, i.e. compile did not fail with a
|
||||
return $compressedRegex;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -64,18 +90,25 @@ class BuildMetadataFromXml
|
||||
*/
|
||||
public static function buildPhoneMetadataCollection($inputXmlFile, $liteBuild)
|
||||
{
|
||||
self::$liteBuild = $liteBuild;
|
||||
$document = new \DOMDocument();
|
||||
$document->load($inputXmlFile);
|
||||
$document->normalizeDocument();
|
||||
$territories = $document->getElementsByTagName("territory");
|
||||
$metadataCollection = array();
|
||||
foreach ($territories as $territory) {
|
||||
if ($territory->hasAttribute("id")) {
|
||||
$regionCode = $territory->getAttribute("id");
|
||||
|
||||
$isShortNumberMetadata = strpos($inputXmlFile, 'ShortNumberMetadata');
|
||||
$isAlternateFormatsMetadata = strpos($inputXmlFile, 'PhoneNumberAlternateFormats');
|
||||
|
||||
foreach ($territories as $territoryElement) {
|
||||
/** @var $territoryElement \DOMElement */
|
||||
// For the main metadata file this should always be set, but for other supplementary data
|
||||
// files the country calling code may be all that is needed.
|
||||
if ($territoryElement->hasAttribute("id")) {
|
||||
$regionCode = $territoryElement->getAttribute("id");
|
||||
} else {
|
||||
$regionCode = "";
|
||||
}
|
||||
$metadata = self::loadCountryMetadata($regionCode, $territory);
|
||||
$metadata = self::loadCountryMetadata($regionCode, $territoryElement, $liteBuild, $isShortNumberMetadata, $isAlternateFormatsMetadata);
|
||||
$metadataCollection[] = $metadata;
|
||||
}
|
||||
return $metadataCollection;
|
||||
@@ -84,41 +117,44 @@ class BuildMetadataFromXml
|
||||
/**
|
||||
* @param string $regionCode
|
||||
* @param \DOMElement $element
|
||||
* @param string $liteBuild
|
||||
* @param string $isShortNumberMetadata
|
||||
* @param string $isAlternateFormatsMetadata
|
||||
* @return PhoneMetadata
|
||||
*/
|
||||
public static function loadCountryMetadata($regionCode, \DOMElement $element)
|
||||
public static function loadCountryMetadata($regionCode, \DOMElement $element, $liteBuild, $isShortNumberMetadata, $isAlternateFormatsMetadata)
|
||||
{
|
||||
$nationalPrefix = self::getNationalPrefix($element);
|
||||
$metadata = self::loadTerritoryTagMetadata($regionCode, $element, $nationalPrefix);
|
||||
$nationalPrefixFormattingRule = self::getNationalPrefixFormattingRuleFromElement($element, $nationalPrefix);
|
||||
$metadata = self::loadTerritoryTagMetadata(
|
||||
$regionCode,
|
||||
$element,
|
||||
$nationalPrefix,
|
||||
$nationalPrefixFormattingRule
|
||||
);
|
||||
|
||||
self::loadAvailableFormats($metadata, $regionCode, $element, $nationalPrefix, $nationalPrefixFormattingRule);
|
||||
self::loadGeneralDesc($metadata, $element);
|
||||
self::loadAvailableFormats($metadata, $element, $nationalPrefix, $nationalPrefixFormattingRule, $element->hasAttribute(self::NATIONAL_PREFIX_OPTIONAL_WHEN_FORMATTING));
|
||||
if (!$isAlternateFormatsMetadata) {
|
||||
// The alternate formats metadata does not need most of the patterns to be set.
|
||||
self::setRelevantDescPatterns($metadata, $element, $liteBuild, $isShortNumberMetadata);
|
||||
}
|
||||
return $metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the national prefix of the provided country element.
|
||||
* @internal
|
||||
* @param \DOMElement $element
|
||||
* @return string
|
||||
*/
|
||||
private static function getNationalPrefix(\DOMElement $element)
|
||||
public static function getNationalPrefix(\DOMElement $element)
|
||||
{
|
||||
return $element->hasAttribute(self::NATIONAL_PREFIX) ? $element->getAttribute(self::NATIONAL_PREFIX) : "";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @internal
|
||||
* @param \DOMElement $element
|
||||
* @param string $nationalPrefix
|
||||
* @return string
|
||||
*/
|
||||
private static function getNationalPrefixFormattingRuleFromElement(\DOMElement $element, $nationalPrefix)
|
||||
public static function getNationalPrefixFormattingRuleFromElement(\DOMElement $element, $nationalPrefix)
|
||||
{
|
||||
$nationalPrefixFormattingRule = $element->getAttribute(self::NATIONAL_PREFIX_FORMATTING_RULE);
|
||||
// Replace $NP with national prefix and $FG with the first group ($1).
|
||||
@@ -129,35 +165,34 @@ class BuildMetadataFromXml
|
||||
|
||||
/**
|
||||
*
|
||||
* @internal
|
||||
* @param string $regionCode
|
||||
* @param \DOMElement $element
|
||||
* @param string $nationalPrefix
|
||||
* @param string $nationalPrefixFormattingRule
|
||||
* @return PhoneMetadata
|
||||
*/
|
||||
private static function loadTerritoryTagMetadata(
|
||||
public static function loadTerritoryTagMetadata(
|
||||
$regionCode,
|
||||
\DOMElement $element,
|
||||
$nationalPrefix,
|
||||
$nationalPrefixFormattingRule
|
||||
$nationalPrefix
|
||||
) {
|
||||
$metadata = new PhoneMetadata();
|
||||
$metadata->setId($regionCode);
|
||||
$metadata->setCountryCode((int)$element->getAttribute(self::COUNTRY_CODE));
|
||||
if ($element->hasAttribute(self::LEADING_DIGITS)) {
|
||||
$metadata->setLeadingDigits($element->getAttribute(self::LEADING_DIGITS));
|
||||
$metadata->setLeadingDigits(self::validateRE($element->getAttribute(self::LEADING_DIGITS)));
|
||||
}
|
||||
$metadata->setInternationalPrefix($element->getAttribute(self::INTERNATIONAL_PREFIX));
|
||||
$metadata->setInternationalPrefix(self::validateRE($element->getAttribute(self::INTERNATIONAL_PREFIX)));
|
||||
if ($element->hasAttribute(self::PREFERRED_INTERNATIONAL_PREFIX)) {
|
||||
$preferredInternationalPrefix = $element->getAttribute(self::PREFERRED_INTERNATIONAL_PREFIX);
|
||||
$metadata->setPreferredInternationalPrefix($preferredInternationalPrefix);
|
||||
}
|
||||
if ($element->hasAttribute(self::NATIONAL_PREFIX_FOR_PARSING)) {
|
||||
$metadata->setNationalPrefixForParsing(
|
||||
$element->getAttribute(self::NATIONAL_PREFIX_FOR_PARSING)
|
||||
self::validateRE($element->getAttribute(self::NATIONAL_PREFIX_FOR_PARSING), true)
|
||||
);
|
||||
if ($element->hasAttribute(self::NATIONAL_PREFIX_TRANSFORM_RULE)) {
|
||||
$metadata->setNationalPrefixTransformRule($element->getAttribute(self::NATIONAL_PREFIX_TRANSFORM_RULE));
|
||||
$metadata->setNationalPrefixTransformRule(self::validateRE($element->getAttribute(self::NATIONAL_PREFIX_TRANSFORM_RULE)));
|
||||
}
|
||||
}
|
||||
if ($nationalPrefix != '') {
|
||||
@@ -183,27 +218,26 @@ class BuildMetadataFromXml
|
||||
|
||||
/**
|
||||
* Extracts the available formats from the provided DOM element. If it does not contain any
|
||||
* nationalPrefixFormattingRule, the one passed-in is retained.
|
||||
* nationalPrefixFormattingRule, the one passed-in is retained; similarly for
|
||||
* nationalPrefixOptionalWhenFormatting. The nationalPrefix, nationalPrefixFormattingRule and
|
||||
* nationalPrefixOptionalWhenFormatting values are provided from the parent (territory) element.
|
||||
* @internal
|
||||
* @param PhoneMetadata $metadata
|
||||
* @param string $regionCode
|
||||
* @param \DOMElement $element
|
||||
* @param string $nationalPrefix
|
||||
* @param string $nationalPrefixFormattingRule
|
||||
* @param bool $nationalPrefixOptionalWhenFormatting
|
||||
*/
|
||||
private static function loadAvailableFormats(
|
||||
public static function loadAvailableFormats(
|
||||
PhoneMetadata $metadata,
|
||||
$regionCode,
|
||||
\DOMElement $element,
|
||||
$nationalPrefix,
|
||||
$nationalPrefixFormattingRule
|
||||
$nationalPrefixFormattingRule,
|
||||
$nationalPrefixOptionalWhenFormatting
|
||||
) {
|
||||
|
||||
$carrierCodeFormattingRule = "";
|
||||
if ($element->hasAttribute(self::CARRIER_CODE_FORMATTING_RULE)) {
|
||||
$carrierCodeFormattingRule = self::getDomesticCarrierCodeFormattingRuleFromElement(
|
||||
$element,
|
||||
$nationalPrefix
|
||||
);
|
||||
$carrierCodeFormattingRule = self::validateRE(self::getDomesticCarrierCodeFormattingRuleFromElement($element, $nationalPrefix));
|
||||
}
|
||||
$numberFormatElements = $element->getElementsByTagName(self::NUMBER_FORMAT);
|
||||
$hasExplicitIntlFormatDefined = false;
|
||||
@@ -211,6 +245,7 @@ class BuildMetadataFromXml
|
||||
$numOfFormatElements = $numberFormatElements->length;
|
||||
if ($numOfFormatElements > 0) {
|
||||
for ($i = 0; $i < $numOfFormatElements; $i++) {
|
||||
/** @var \DOMElement $numberFormatElement */
|
||||
$numberFormatElement = $numberFormatElements->item($i);
|
||||
$format = new NumberFormat();
|
||||
|
||||
@@ -221,9 +256,14 @@ class BuildMetadataFromXml
|
||||
} else {
|
||||
$format->setNationalPrefixFormattingRule($nationalPrefixFormattingRule);
|
||||
}
|
||||
if ($numberFormatElement->hasAttribute(self::NATIONAL_PREFIX_OPTIONAL_WHEN_FORMATTING)) {
|
||||
$format->setNationalPrefixOptionalWhenFormatting($numberFormatElement->getAttribute(self::NATIONAL_PREFIX_OPTIONAL_WHEN_FORMATTING) == 'true' ? true : false);
|
||||
} else {
|
||||
$format->setNationalPrefixOptionalWhenFormatting($nationalPrefixOptionalWhenFormatting);
|
||||
}
|
||||
if ($numberFormatElement->hasAttribute(self::CARRIER_CODE_FORMATTING_RULE)) {
|
||||
$format->setDomesticCarrierCodeFormattingRule(
|
||||
self::getDomesticCarrierCodeFormattingRuleFromElement($numberFormatElement, $nationalPrefix)
|
||||
self::validateRE(self::getDomesticCarrierCodeFormattingRuleFromElement($numberFormatElement, $nationalPrefix))
|
||||
);
|
||||
} else {
|
||||
$format->setDomesticCarrierCodeFormattingRule($carrierCodeFormattingRule);
|
||||
@@ -245,7 +285,13 @@ class BuildMetadataFromXml
|
||||
}
|
||||
}
|
||||
|
||||
private static function getDomesticCarrierCodeFormattingRuleFromElement(\DOMElement $element, $nationalPrefix)
|
||||
/**
|
||||
* @internal
|
||||
* @param \DOMElement $element
|
||||
* @param string $nationalPrefix
|
||||
* @return mixed|string
|
||||
*/
|
||||
public static function getDomesticCarrierCodeFormattingRuleFromElement(\DOMElement $element, $nationalPrefix)
|
||||
{
|
||||
$carrierCodeFormattingRule = $element->getAttribute(self::CARRIER_CODE_FORMATTING_RULE);
|
||||
// Replace $FG with the first group ($1) and $NP with the national prefix.
|
||||
@@ -257,18 +303,19 @@ class BuildMetadataFromXml
|
||||
/**
|
||||
* Extracts the pattern for the national format.
|
||||
*
|
||||
* @internal
|
||||
* @param PhoneMetadata $metadata
|
||||
* @param \DOMElement $numberFormatElement
|
||||
* @param NumberFormat $format
|
||||
* @throws \RuntimeException if multiple or no formats have been encountered.
|
||||
*/
|
||||
private static function loadNationalFormat(
|
||||
public static function loadNationalFormat(
|
||||
PhoneMetadata $metadata,
|
||||
\DOMElement $numberFormatElement,
|
||||
NumberFormat $format
|
||||
) {
|
||||
self::setLeadingDigitsPatterns($numberFormatElement, $format);
|
||||
$format->setPattern($numberFormatElement->getAttribute(self::PATTERN));
|
||||
$format->setPattern(self::validateRE($numberFormatElement->getAttribute(self::PATTERN)));
|
||||
|
||||
$formatPattern = $numberFormatElement->getElementsByTagName(self::FORMAT);
|
||||
if ($formatPattern->length != 1) {
|
||||
@@ -279,17 +326,18 @@ class BuildMetadataFromXml
|
||||
$format->setFormat($nationalFormat);
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param \DOMElement $numberFormatElement
|
||||
* @param NumberFormat $format
|
||||
*/
|
||||
public static function setLeadingDigitsPatterns(\DOMElement $numberFormatElement, NumberFormat $format)
|
||||
{
|
||||
$leadingDigitsPatternNodes = $numberFormatElement->getElementsByTagName(self::LEADING_DIGITS);
|
||||
$numOfLeadingDigitsPatterns = $leadingDigitsPatternNodes->length;
|
||||
if ($numOfLeadingDigitsPatterns > 0) {
|
||||
for ($i = 0; $i < $numOfLeadingDigitsPatterns; $i++) {
|
||||
$elt = $leadingDigitsPatternNodes->item($i);
|
||||
$format->addLeadingDigitsPattern(
|
||||
$elt->firstChild->nodeValue,
|
||||
true
|
||||
);
|
||||
$format->addLeadingDigitsPattern(self::validateRE($leadingDigitsPatternNodes->item($i)->firstChild->nodeValue, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -298,13 +346,14 @@ class BuildMetadataFromXml
|
||||
* Extracts the pattern for international format. If there is no intlFormat, default to using the
|
||||
* national format. If the intlFormat is set to "NA" the intlFormat should be ignored.
|
||||
*
|
||||
* @internal
|
||||
* @param PhoneMetadata $metadata
|
||||
* @param \DOMElement $numberFormatElement
|
||||
* @param NumberFormat $nationalFormat
|
||||
* @throws \RuntimeException if multiple intlFormats have been encountered.
|
||||
* @return bool whether an international number format is defined.
|
||||
*/
|
||||
private static function loadInternationalFormat(
|
||||
public static function loadInternationalFormat(
|
||||
PhoneMetadata $metadata,
|
||||
\DOMElement $numberFormatElement,
|
||||
NumberFormat $nationalFormat
|
||||
@@ -335,83 +384,354 @@ class BuildMetadataFromXml
|
||||
return $hasExplicitIntlFormatDefined;
|
||||
}
|
||||
|
||||
private static function loadGeneralDesc(PhoneMetadata $metadata, \DOMElement $element)
|
||||
/**
|
||||
* @internal
|
||||
* @param PhoneMetadata $metadata
|
||||
* @param \DOMElement $element
|
||||
* @param bool $liteBuild
|
||||
* @param bool $isShortNumberMetadata
|
||||
*/
|
||||
public static function setRelevantDescPatterns(PhoneMetadata $metadata, \DOMElement $element, $liteBuild, $isShortNumberMetadata)
|
||||
{
|
||||
$generalDesc = new PhoneNumberDesc();
|
||||
$generalDesc = self::processPhoneNumberDescElement($generalDesc, $element, self::GENERAL_DESC);
|
||||
$generalDesc = self::processPhoneNumberDescElement(null, $element, self::GENERAL_DESC, $liteBuild);
|
||||
$metadata->setGeneralDesc($generalDesc);
|
||||
$metadata->setFixedLine(self::processPhoneNumberDescElement($generalDesc, $element, self::FIXED_LINE));
|
||||
$metadata->setMobile(self::processPhoneNumberDescElement($generalDesc, $element, self::MOBILE));
|
||||
$metadata->setStandardRate(self::processPhoneNumberDescElement($generalDesc, $element, self::STANDARD_RATE));
|
||||
$metadata->setPremiumRate(self::processPhoneNumberDescElement($generalDesc, $element, self::PREMIUM_RATE));
|
||||
$metadata->setShortCode(self::processPhoneNumberDescElement($generalDesc, $element, self::SHORT_CODE));
|
||||
$metadata->setTollFree(self::processPhoneNumberDescElement($generalDesc, $element, self::TOLL_FREE));
|
||||
$metadata->setSharedCost(self::processPhoneNumberDescElement($generalDesc, $element, self::SHARED_COST));
|
||||
|
||||
$metadataId = $metadata->getId();
|
||||
// Calculate the possible lengths for the general description. This will be based on the
|
||||
// possible lengths of the child elements.
|
||||
self::setPossibleLengthsGeneralDesc($generalDesc, $metadataId, $element, $isShortNumberMetadata);
|
||||
|
||||
if (!$isShortNumberMetadata) {
|
||||
// Set fields used by regular length phone numbers.
|
||||
$metadata->setFixedLine(self::processPhoneNumberDescElement($generalDesc, $element, self::FIXED_LINE, $liteBuild));
|
||||
$metadata->setMobile(self::processPhoneNumberDescElement($generalDesc, $element, self::MOBILE, $liteBuild));
|
||||
$metadata->setSharedCost(self::processPhoneNumberDescElement($generalDesc, $element, self::SHARED_COST, $liteBuild));
|
||||
$metadata->setVoip(self::processPhoneNumberDescElement($generalDesc, $element, self::VOIP, $liteBuild));
|
||||
$metadata->setPersonalNumber(self::processPhoneNumberDescElement($generalDesc, $element, self::PERSONAL_NUMBER, $liteBuild));
|
||||
$metadata->setPager(self::processPhoneNumberDescElement($generalDesc, $element, self::PAGER, $liteBuild));
|
||||
$metadata->setUan(self::processPhoneNumberDescElement($generalDesc, $element, self::UAN, $liteBuild));
|
||||
$metadata->setVoicemail(self::processPhoneNumberDescElement($generalDesc, $element, self::VOICEMAIL, $liteBuild));
|
||||
$metadata->setNoInternationalDialling(self::processPhoneNumberDescElement($generalDesc, $element, self::NO_INTERNATIONAL_DIALLING, $liteBuild));
|
||||
$metadata->setSameMobileAndFixedLinePattern($metadata->getMobile()->getNationalNumberPattern() === $metadata->getFixedLine()->getNationalNumberPattern());
|
||||
$metadata->setTollFree(self::processPhoneNumberDescElement($generalDesc, $element, self::TOLL_FREE, $liteBuild));
|
||||
$metadata->setPremiumRate(self::processPhoneNumberDescElement($generalDesc, $element, self::PREMIUM_RATE, $liteBuild));
|
||||
} else {
|
||||
// Set fields used by short numbers.
|
||||
$metadata->setStandardRate(self::processPhoneNumberDescElement($generalDesc, $element, self::STANDARD_RATE, $liteBuild));
|
||||
$metadata->setShortCode(self::processPhoneNumberDescElement($generalDesc, $element, self::SHORT_CODE, $liteBuild));
|
||||
$metadata->setCarrierSpecific(self::processPhoneNumberDescElement($generalDesc, $element, self::CARRIER_SPECIFIC, $liteBuild));
|
||||
$metadata->setEmergency(self::processPhoneNumberDescElement($generalDesc, $element, self::EMERGENCY, $liteBuild));
|
||||
$metadata->setTollFree(self::processPhoneNumberDescElement($generalDesc, $element, self::TOLL_FREE, $liteBuild));
|
||||
$metadata->setPremiumRate(self::processPhoneNumberDescElement($generalDesc, $element, self::PREMIUM_RATE, $liteBuild));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a possible length string into a set of the integers that are covered.
|
||||
*
|
||||
* @param string $possibleLengthString a string specifying the possible lengths of phone numbers. Follows
|
||||
* this syntax: ranges or elements are separated by commas, and ranges are specified in
|
||||
* [min-max] notation, inclusive. For example, [3-5],7,9,[11-14] should be parsed to
|
||||
* 3,4,5,7,9,11,12,13,14
|
||||
* @return array
|
||||
*/
|
||||
private static function parsePossibleLengthStringToSet($possibleLengthString)
|
||||
{
|
||||
if (strlen($possibleLengthString) === 0) {
|
||||
throw new \RuntimeException("Empty possibleLength string found.");
|
||||
}
|
||||
|
||||
$lengths = explode(",", $possibleLengthString);
|
||||
$lengthSet = array();
|
||||
|
||||
|
||||
$metadata->setVoip(self::processPhoneNumberDescElement($generalDesc, $element, self::VOIP));
|
||||
$metadata->setPersonalNumber(
|
||||
self::processPhoneNumberDescElement($generalDesc, $element, self::PERSONAL_NUMBER)
|
||||
);
|
||||
$metadata->setPager(self::processPhoneNumberDescElement($generalDesc, $element, self::PAGER));
|
||||
$metadata->setUan(self::processPhoneNumberDescElement($generalDesc, $element, self::UAN));
|
||||
$metadata->setEmergency(self::processPhoneNumberDescElement($generalDesc, $element, self::EMERGENCY));
|
||||
$metadata->setVoicemail(self::processPhoneNumberDescElement($generalDesc, $element, self::VOICEMAIL));
|
||||
$metadata->setCarrierSpecific(
|
||||
self::processPhoneNumberDescElement($generalDesc, $element, self::CARRIER_SPECIFIC)
|
||||
);
|
||||
$lengthLength = count($lengths);
|
||||
for ($i = 0; $i < $lengthLength; $i++) {
|
||||
$lengthSubstring = $lengths[$i];
|
||||
if (strlen($lengthSubstring) === 0) {
|
||||
throw new \RuntimeException("Leading, trailing or adjacent commas in possible "
|
||||
. "length string {$possibleLengthString}, these should only separate numbers or ranges.");
|
||||
} elseif (substr($lengthSubstring, 0, 1) === '[') {
|
||||
if (substr($lengthSubstring, -1) !== ']') {
|
||||
throw new \RuntimeException("Missing end of range character in possible length string {$possibleLengthString}.");
|
||||
}
|
||||
|
||||
// Strip the leading and trailing [], and split on the -.
|
||||
$minMax = explode('-', substr($lengthSubstring, 1, -1));
|
||||
if (count($minMax) !== 2) {
|
||||
throw new \RuntimeException("Ranges must have exactly one - character: missing for {$possibleLengthString}.");
|
||||
}
|
||||
$min = (int)$minMax[0];
|
||||
$max = (int)$minMax[1];
|
||||
// We don't even accept [6-7] since we prefer the shorter 6,7 variant; for a range to be in
|
||||
// use the hyphen needs to replace at least one digit.
|
||||
if ($max - $min < 2) {
|
||||
throw new \RuntimeException("The first number in a range should be two or more digits lower than the second. Culprit possibleLength string: {$possibleLengthString}.");
|
||||
}
|
||||
for ($j = $min; $j <= $max; $j++) {
|
||||
if (in_array($j, $lengthSet)) {
|
||||
throw new \RuntimeException("Duplicate length element found ({$j}) in possibleLength string {$possibleLengthString}.");
|
||||
}
|
||||
array_push($lengthSet, $j);
|
||||
}
|
||||
} else {
|
||||
$length = $lengthSubstring;
|
||||
if (in_array($length, $lengthSet)) {
|
||||
throw new \RuntimeException("Duplicate length element found ({$length}) in possibleLength string {$possibleLengthString}.");
|
||||
}
|
||||
if (!is_numeric($length)) {
|
||||
throw new \RuntimeException("For input string \"{$length}\"");
|
||||
}
|
||||
array_push($lengthSet, $length);
|
||||
}
|
||||
}
|
||||
return $lengthSet;
|
||||
}
|
||||
|
||||
$metadata->setNoInternationalDialling(
|
||||
self::processPhoneNumberDescElement($generalDesc, $element, self::NO_INTERNATIONAL_DIALLING)
|
||||
);
|
||||
$metadata->setSameMobileAndFixedLinePattern(
|
||||
$metadata->getMobile()->getNationalNumberPattern() === $metadata->getFixedLine()->getNationalNumberPattern()
|
||||
);
|
||||
/**
|
||||
* Reads the possible length present in the metadata and splits them into two sets: one for
|
||||
* full-length numbers, one for local numbers.
|
||||
*
|
||||
*
|
||||
* @param \DOMElement $data One or more phone number descriptions
|
||||
* @param array $lengths An array in which to add possible lengths of full phone numbers
|
||||
* @param array $localOnlyLengths An array in which to add possible lengths of phone numbers only diallable
|
||||
* locally (e.g. within a province)
|
||||
*/
|
||||
private static function populatePossibleLengthSets(\DOMElement $data, &$lengths, &$localOnlyLengths)
|
||||
{
|
||||
$possibleLengths = $data->getElementsByTagName(self::POSSIBLE_LENGTHS);
|
||||
|
||||
for ($i = 0; $i < $possibleLengths->length; $i++) {
|
||||
/** @var \DOMElement $element */
|
||||
$element = $possibleLengths->item($i);
|
||||
$nationalLengths = $element->getAttribute(self::NATIONAL);
|
||||
// We don't add to the phone metadata yet, since we want to sort length elements found under
|
||||
// different nodes first, make sure there are no duplicates between them and that the
|
||||
// localOnly lengths don't overlap with the others.
|
||||
$thisElementLengths = self::parsePossibleLengthStringToSet($nationalLengths);
|
||||
if ($element->hasAttribute(self::LOCAL_ONLY)) {
|
||||
$localLengths = $element->getAttribute(self::LOCAL_ONLY);
|
||||
$thisElementLocalOnlyLengths = self::parsePossibleLengthStringToSet($localLengths);
|
||||
$intersection = array_intersect($thisElementLengths, $thisElementLocalOnlyLengths);
|
||||
if (count($intersection) > 0) {
|
||||
throw new \RuntimeException("Possible length(s) found specified as a normal and local-only length: [" . implode(',', $intersection) . '].');
|
||||
}
|
||||
// We check again when we set these lengths on the metadata itself in setPossibleLengths
|
||||
// that the elements in localOnly are not also in lengths. For e.g. the generalDesc, it
|
||||
// might have a local-only length for one type that is a normal length for another type. We
|
||||
// don't consider this an error, but we do want to remove the local-only lengths.
|
||||
$localOnlyLengths = array_merge($localOnlyLengths, $thisElementLocalOnlyLengths);
|
||||
sort($localOnlyLengths);
|
||||
}
|
||||
// It is okay if at this time we have duplicates, because the same length might be possible
|
||||
// for e.g. fixed-line and for mobile numbers, and this method operates potentially on
|
||||
// multiple phoneNumberDesc XML elements.
|
||||
$lengths = array_merge($lengths, $thisElementLengths);
|
||||
sort($lengths);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets possible lengths in the general description, derived from certain child elements
|
||||
*
|
||||
* @internal
|
||||
* @param PhoneNumberDesc $generalDesc
|
||||
* @param string $metadataId
|
||||
* @param \DOMElement $data
|
||||
* @param bool $isShortNumberMetadata
|
||||
*/
|
||||
public static function setPossibleLengthsGeneralDesc(PhoneNumberDesc $generalDesc, $metadataId, \DOMElement $data, $isShortNumberMetadata)
|
||||
{
|
||||
$lengths = array();
|
||||
$localOnlyLengths = array();
|
||||
// The general description node should *always* be present if metadata for other types is
|
||||
// present, aside from in some unit tests.
|
||||
// (However, for e.g. formatting metadata in PhoneNumberAlternateFormats, no PhoneNumberDesc
|
||||
// elements are present).
|
||||
$generalDescNodes = $data->getElementsByTagName(self::GENERAL_DESC);
|
||||
if ($generalDescNodes->length > 0) {
|
||||
$generalDescNode = $generalDescNodes->item(0);
|
||||
self::populatePossibleLengthSets($generalDescNode, $lengths, $localOnlyLengths);
|
||||
if (count($lengths) > 0 || count($localOnlyLengths) > 0) {
|
||||
// We shouldn't have anything specified at the "general desc" level: we are going to
|
||||
// calculate this ourselves from child elements.
|
||||
throw new \RuntimeException("Found possible lengths specified at general desc: this should be derived from child elements. Affected country: {$metadataId}");
|
||||
}
|
||||
}
|
||||
if (!$isShortNumberMetadata) {
|
||||
// Make a copy here since we want to remove some nodes, but we don't want to do that on our
|
||||
// actual data.
|
||||
/** @var \DOMElement $allDescData */
|
||||
$allDescData = $data->cloneNode(true);
|
||||
foreach (self::$phoneNumberDescsWithoutMatchingTypes as $tag) {
|
||||
$nodesToRemove = $allDescData->getElementsByTagName($tag);
|
||||
if ($nodesToRemove->length > 0) {
|
||||
// We check when we process phone number descriptions that there are only one of each
|
||||
// type, so this is safe to do.
|
||||
$allDescData->removeChild($nodesToRemove->item(0));
|
||||
}
|
||||
}
|
||||
self::populatePossibleLengthSets($allDescData, $lengths, $localOnlyLengths);
|
||||
} else {
|
||||
// For short number metadata, we want to copy the lengths from the "short code" section only.
|
||||
// This is because it's the more detailed validation pattern, it's not a sub-type of short
|
||||
// codes. The other lengths will be checked later to see that they are a sub-set of these
|
||||
// possible lengths.
|
||||
$shortCodeDescList = $data->getElementsByTagName(self::SHORT_CODE);
|
||||
if (count($shortCodeDescList) > 0) {
|
||||
$shortCodeDesc = $shortCodeDescList->item(0);
|
||||
self::populatePossibleLengthSets($shortCodeDesc, $lengths, $localOnlyLengths);
|
||||
}
|
||||
if (count($localOnlyLengths) > 0) {
|
||||
throw new \RuntimeException("Found local-only lengths in short-number metadata");
|
||||
}
|
||||
}
|
||||
self::setPossibleLengths($lengths, $localOnlyLengths, null, $generalDesc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the possible length fields in the metadata from the sets of data passed in. Checks that
|
||||
* the length is covered by the "parent" phone number description element if one is present, and
|
||||
* if the lengths are exactly the same as this, they are not filled in for efficiency reasons.
|
||||
*
|
||||
* @param array $lengths
|
||||
* @param array $localOnlyLengths
|
||||
* @param PhoneNumberDesc $parentDesc
|
||||
* @param PhoneNumberDesc $desc
|
||||
*/
|
||||
private static function setPossibleLengths($lengths, $localOnlyLengths, PhoneNumberDesc $parentDesc = null, PhoneNumberDesc $desc)
|
||||
{
|
||||
$parentDescPossibleLengths = ($parentDesc === null) ? null : $parentDesc->getPossibleLength();
|
||||
$parentDescPossibleLengthLocalOnlys = ($parentDesc === null) ? null : $parentDesc->getPossibleLengthLocalOnly();
|
||||
$descPossibleLengths = array();
|
||||
$descPossibleLengthLocalOnlys = array();
|
||||
|
||||
// Only add the lengths to this sub-type if they aren't exactly the same as the possible
|
||||
// lengths in the general desc (for metadata size reasons).
|
||||
if ($parentDesc === null || !self::arePossibleLengthsEqual($lengths, $parentDesc)) {
|
||||
foreach ($lengths as $length) {
|
||||
if ($parentDesc === null || in_array($length, $parentDescPossibleLengths)) {
|
||||
if (!in_array($length, $descPossibleLengths)) {
|
||||
$descPossibleLengths[] = $length;
|
||||
}
|
||||
} else {
|
||||
// We shouldn't have possible lengths defined in a child element that are not covered by
|
||||
// the general description. We check this here even though the general description is
|
||||
// derived from child elements because it is only derived from a subset, and we need to
|
||||
// ensure *all* child elements have a valid possible length.
|
||||
throw new \RuntimeException("Out-of-range possible length found ({$length}), parent lengths " . implode(',', $parentDesc->getPossibleLength()));
|
||||
}
|
||||
}
|
||||
}
|
||||
// We check that the local-only length isn't also a normal possible length (only relevant for
|
||||
// the general-desc, since within elements such as fixed-line we would throw an exception if we
|
||||
// saw this) before adding it to the collection of possible local-only lengths.
|
||||
foreach ($localOnlyLengths as $length) {
|
||||
if (!in_array($length, $lengths)) {
|
||||
// We check it is covered by either of the possible length sets of the parent
|
||||
// PhoneNumberDesc, because for example 7 might be a valid localOnly length for mobile, but
|
||||
// a valid national length for fixedLine, so the generalDesc would have the 7 removed from
|
||||
// localOnly.
|
||||
if ($parentDesc === null || in_array($length, $parentDescPossibleLengthLocalOnlys) || in_array($length, $parentDescPossibleLengths)) {
|
||||
if (!in_array($length, $descPossibleLengthLocalOnlys)) {
|
||||
$descPossibleLengthLocalOnlys[] = $length;
|
||||
}
|
||||
} else {
|
||||
throw new \RuntimeException("Out-of-range local-only possible length found ({$length}), parent length {$parentDesc->getPossibleLengthLocalOnly()}");
|
||||
}
|
||||
}
|
||||
}
|
||||
$desc->setPossibleLength($descPossibleLengths);
|
||||
$desc->setPossibleLengthLocalOnly($descPossibleLengthLocalOnlys);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes a phone number description element from the XML file and returns it as a
|
||||
* PhoneNumberDesc. If the description element is a fixed line or mobile number, the general
|
||||
* PhoneNumberDesc. If the description element is a fixed line or mobile number, the parent
|
||||
* description will be used to fill in the whole element if necessary, or any components that are
|
||||
* missing. For all other types, the general description will only be used to fill in missing
|
||||
* missing. For all other types, the parent description will only be used to fill in missing
|
||||
* components if the type has a partial definition. For example, if no "tollFree" element exists,
|
||||
* we assume there are no toll free numbers for that locale, and return a phone number description
|
||||
* with "NA" for both the national and possible number patterns.
|
||||
* with "NA" for both the national and possible number patterns. Note that the parent description
|
||||
* must therefore already be processed before this method is called on any child elements.
|
||||
*
|
||||
* @param PhoneNumberDesc $generalDesc generic phone number description that will be used to fill in missing
|
||||
* parts of the description
|
||||
* @internal
|
||||
* @param PhoneNumberDesc $parentDesc a generic phone number description that will be used to fill in missing
|
||||
* parts of the description, or null if this is the root node. This must be processed before
|
||||
* this is run on any child elements.
|
||||
* @param \DOMElement $countryElement XML element representing all the country information
|
||||
* @param string $numberType name of the number type, corresponding to the appropriate tag in the XML
|
||||
* file with information about that type
|
||||
* @param bool $liteBuild
|
||||
* @return PhoneNumberDesc complete description of that phone number type
|
||||
*/
|
||||
private static function processPhoneNumberDescElement(
|
||||
PhoneNumberDesc $generalDesc,
|
||||
public static function processPhoneNumberDescElement(
|
||||
PhoneNumberDesc $parentDesc = null,
|
||||
\DOMElement $countryElement,
|
||||
$numberType
|
||||
$numberType,
|
||||
$liteBuild
|
||||
) {
|
||||
$phoneNumberDescList = $countryElement->getElementsByTagName($numberType);
|
||||
$numberDesc = new PhoneNumberDesc();
|
||||
if ($phoneNumberDescList->length == 0 && !self::isValidNumberType($numberType)) {
|
||||
if ($phoneNumberDescList->length == 0 && !self::numberTypeShouldAlwaysBeFilledIn($numberType)) {
|
||||
$numberDesc->setNationalNumberPattern("NA");
|
||||
$numberDesc->setPossibleNumberPattern("NA");
|
||||
// -1 will never match a possible phone number length, so is safe to use to ensure this never
|
||||
// matches. We don't leave it empty, since for compression reasons, we use the empty list to
|
||||
// mean that the generalDesc possible lengths apply.
|
||||
$numberDesc->setPossibleLength(array(-1));
|
||||
return $numberDesc;
|
||||
}
|
||||
$numberDesc->mergeFrom($generalDesc);
|
||||
|
||||
if ($parentDesc != null) {
|
||||
if ($parentDesc->getNationalNumberPattern() !== "") {
|
||||
$numberDesc->setNationalNumberPattern($parentDesc->getNationalNumberPattern());
|
||||
}
|
||||
if ($parentDesc->getPossibleNumberPattern() !== "") {
|
||||
$numberDesc->setPossibleNumberPattern($parentDesc->getPossibleNumberPattern());
|
||||
}
|
||||
if ($parentDesc->getExampleNumber() !== "") {
|
||||
$numberDesc->setExampleNumber($parentDesc->getExampleNumber());
|
||||
}
|
||||
}
|
||||
|
||||
if ($phoneNumberDescList->length > 0) {
|
||||
if ($phoneNumberDescList->length > 1) {
|
||||
throw new \RuntimeException("Multiple elements with type {$numberType} found.");
|
||||
}
|
||||
|
||||
/** @var \DOMElement $element */
|
||||
$element = $phoneNumberDescList->item(0);
|
||||
// Old way of handling possible number lengths. This will be deleted when no data is
|
||||
// represented in this way anymore.
|
||||
$possiblePattern = $element->getElementsByTagName(self::POSSIBLE_NUMBER_PATTERN);
|
||||
if ($possiblePattern->length > 0) {
|
||||
$numberDesc->setPossibleNumberPattern($possiblePattern->item(0)->firstChild->nodeValue);
|
||||
$numberDesc->setPossibleNumberPattern(self::validateRE($possiblePattern->item(0)->firstChild->nodeValue, true));
|
||||
}
|
||||
|
||||
if ($parentDesc != null) {
|
||||
// New way of handling possible number lengths. We don't do this for the general
|
||||
// description, since these tags won't be present; instead we will calculate its values
|
||||
// based on the values for all the other number type descriptions (see
|
||||
// setPossibleLengthsGeneralDesc).
|
||||
$lengths = array();
|
||||
$localOnlyLengths = array();
|
||||
self::populatePossibleLengthSets($element, $lengths, $localOnlyLengths);
|
||||
// NOTE: We don't use the localOnlyLengths for specific number types yet, since they aren't
|
||||
// used in the API and won't be until a method that assesses whether a number is possible
|
||||
// for a certain type or not is available. To ensure size is small, we don't set them
|
||||
// outside the general desc at this time. If we want this data later, the empty set here
|
||||
// should be replaced with the localOnlyLengths set above.
|
||||
self::setPossibleLengths($lengths, array(), $parentDesc, $numberDesc);
|
||||
}
|
||||
|
||||
$validPattern = $element->getElementsByTagName(self::NATIONAL_NUMBER_PATTERN);
|
||||
if ($validPattern->length > 0) {
|
||||
$numberDesc->setNationalNumberPattern($validPattern->item(0)->firstChild->nodeValue);
|
||||
$numberDesc->setNationalNumberPattern(self::validateRE($validPattern->item(0)->firstChild->nodeValue, true));
|
||||
}
|
||||
|
||||
if (!self::$liteBuild) {
|
||||
if (!$liteBuild) {
|
||||
$exampleNumber = $element->getElementsByTagName(self::EXAMPLE_NUMBER);
|
||||
if ($exampleNumber->length > 0) {
|
||||
$numberDesc->setExampleNumber($exampleNumber->item(0)->firstChild->nodeValue);
|
||||
@@ -422,14 +742,33 @@ class BuildMetadataFromXml
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @param string $numberType
|
||||
* @return bool
|
||||
*/
|
||||
private static function isValidNumberType($numberType)
|
||||
public static function numberTypeShouldAlwaysBeFilledIn($numberType)
|
||||
{
|
||||
return $numberType == self::FIXED_LINE || $numberType == self::MOBILE || $numberType == self::GENERAL_DESC;
|
||||
}
|
||||
|
||||
private static function arePossibleLengthsEqual($possibleLengths, PhoneNumberDesc $desc)
|
||||
{
|
||||
$descPossibleLength = $desc->getPossibleLength();
|
||||
if (count($possibleLengths) != count($descPossibleLength)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Note that both should be sorted already, and we know they are the same length.
|
||||
$i = 0;
|
||||
foreach ($possibleLengths as $length) {
|
||||
if ($length != $descPossibleLength[$i]) {
|
||||
return false;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $metadataCollection PhoneMetadata[]
|
||||
* @return array
|
||||
@@ -459,5 +798,4 @@ class BuildMetadataFromXml
|
||||
|
||||
return $countryCodeToRegionCodeMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -119,6 +119,4 @@ EOT;
|
||||
|
||||
file_put_contents($outputDir . $mappingClass . '.php', $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\buildtools\Commands;
|
||||
|
||||
|
||||
use libphonenumber\buildtools\BuildMetadataPHPFromXml;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\buildtools\Commands;
|
||||
|
||||
|
||||
use libphonenumber\buildtools\GeneratePhonePrefixData;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\buildtools\Commands;
|
||||
|
||||
|
||||
use libphonenumber\buildtools\GenerateTimeZonesMapData;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
@@ -162,7 +162,6 @@ EOT;
|
||||
*/
|
||||
private function parseTextFile($filePath, \Closure $handler)
|
||||
{
|
||||
|
||||
if (!file_exists($filePath) || !is_readable($filePath)) {
|
||||
throw new \InvalidArgumentException("File '{$filePath}' does not exist");
|
||||
}
|
||||
@@ -190,11 +189,9 @@ EOT;
|
||||
|
||||
$handler($prefix, $location);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $countryData;
|
||||
|
||||
}
|
||||
|
||||
private function getFilePathFromLanguageAndCountryCode($language, $code)
|
||||
@@ -285,7 +282,6 @@ EOT;
|
||||
private function compressAccordingToEnglishData($englishMap, &$nonEnglishMap)
|
||||
{
|
||||
foreach ($nonEnglishMap as $prefix => $value) {
|
||||
|
||||
if (array_key_exists($prefix, $englishMap)) {
|
||||
$englishDescription = $englishMap[$prefix];
|
||||
if ($englishDescription == $value) {
|
||||
@@ -366,7 +362,6 @@ EOT;
|
||||
|
||||
private function writeMappingFile($language, $outputFile, $data)
|
||||
{
|
||||
|
||||
if (!file_exists($this->outputDir . $language)) {
|
||||
mkdir($this->outputDir . $language);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber\buildtools;
|
||||
|
||||
|
||||
use libphonenumber\PhoneNumberToTimeZonesMapper;
|
||||
|
||||
class GenerateTimeZonesMapData
|
||||
|
||||
@@ -32,20 +32,18 @@
|
||||
"exclude": ["Tests/", "build/", "/.travis.yml", "/build.xml", "phpunit.xml.dist", "libphonenumber-for-php.spec"]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"ext-mbstring": "*"
|
||||
"php": ">=5.3.2",
|
||||
"ext-mbstring": "*",
|
||||
"giggsey/locale": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phing/phing": "~2.7",
|
||||
"phing/phing": "^2.7",
|
||||
"pear/versioncontrol_git": "dev-master",
|
||||
"pear/pear-core-minimal": "^1.9",
|
||||
"pear/pear_exception": "^1.0",
|
||||
"phpunit/phpunit": "~4.0",
|
||||
"symfony/console": "^2.5",
|
||||
"satooshi/php-coveralls": "~0.6"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-intl": "To use the geocoder and carrier mapping"
|
||||
"phpunit/phpunit": "^4.8|^5.0",
|
||||
"symfony/console": "^2.8|^3.0",
|
||||
"satooshi/php-coveralls": "^1.0"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber;
|
||||
|
||||
|
||||
class DefaultMetadataLoader implements MetadataLoaderInterface
|
||||
{
|
||||
public function loadMetadata($metadataFileName)
|
||||
|
||||
@@ -48,7 +48,7 @@ class Matcher
|
||||
break;
|
||||
case 'find':
|
||||
default:
|
||||
// no changes
|
||||
// no changes
|
||||
break;
|
||||
}
|
||||
$final_pattern = '/' . $final_pattern . '/x';
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber;
|
||||
|
||||
|
||||
/**
|
||||
* Interface MatcherAPIInterface
|
||||
*
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber;
|
||||
|
||||
|
||||
interface MetadataLoaderInterface
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace libphonenumber;
|
||||
|
||||
|
||||
interface MetadataSourceInterface
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
namespace libphonenumber;
|
||||
|
||||
|
||||
class MultiFileMetadataSourceImpl implements MetadataSourceInterface
|
||||
{
|
||||
protected static $metaDataFilePrefix = PhoneNumberUtil::META_DATA_FILE_PREFIX;
|
||||
@@ -105,5 +104,4 @@ class MultiFileMetadataSourceImpl implements MetadataSourceInterface
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,8 +11,32 @@ class NumberFormat
|
||||
protected $format = null;
|
||||
protected $leadingDigitsPattern = array();
|
||||
protected $nationalPrefixFormattingRule = null;
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $nationalPrefixOptionalWhenFormatting = false;
|
||||
protected $domesticCarrierCodeFormattingRule = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return NumberFormat
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
$this->pattern = "";
|
||||
$this->format = "";
|
||||
$this->leadingDigitsPattern = array();
|
||||
$this->nationalPrefixFormattingRule = "";
|
||||
$this->nationalPrefixOptionalWhenFormatting = false;
|
||||
$this->domesticCarrierCodeFormattingRule = "";
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
@@ -40,12 +64,28 @@ class NumberFormat
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function isNationalPrefixOptionalWhenFormatting()
|
||||
{
|
||||
return $this->nationalPrefixOptionalWhenFormatting;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param boolean $nationalPrefixOptionalWhenFormatting
|
||||
*/
|
||||
public function setNationalPrefixOptionalWhenFormatting($nationalPrefixOptionalWhenFormatting)
|
||||
{
|
||||
$this->nationalPrefixOptionalWhenFormatting = $nationalPrefixOptionalWhenFormatting;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function hasFormat()
|
||||
{
|
||||
return isset($this->format);
|
||||
return ($this->format);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,6 +229,8 @@ class NumberFormat
|
||||
if ($other->hasDomesticCarrierCodeFormattingRule()) {
|
||||
$this->setDomesticCarrierCodeFormattingRule($other->getDomesticCarrierCodeFormattingRule());
|
||||
}
|
||||
$this->setNationalPrefixOptionalWhenFormatting($other->isNationalPrefixOptionalWhenFormatting());
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -210,6 +252,9 @@ class NumberFormat
|
||||
if ($this->hasDomesticCarrierCodeFormattingRule()) {
|
||||
$output['domesticCarrierCodeFormattingRule'] = $this->getDomesticCarrierCodeFormattingRule();
|
||||
}
|
||||
|
||||
$output['nationalPrefixOptionalWhenFormatting'] = $this->isNationalPrefixOptionalWhenFormatting();
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
@@ -230,5 +275,7 @@ class NumberFormat
|
||||
if (isset($input['domesticCarrierCodeFormattingRule'])) {
|
||||
$this->setDomesticCarrierCodeFormattingRule($input['domesticCarrierCodeFormattingRule']);
|
||||
}
|
||||
|
||||
$this->setNationalPrefixOptionalWhenFormatting($input['nationalPrefixOptionalWhenFormatting']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace libphonenumber;
|
||||
*/
|
||||
class NumberParseException extends \Exception
|
||||
{
|
||||
|
||||
const INVALID_COUNTRY_CODE = 0;
|
||||
// This generally indicates the string passed in had less than 3 digits in it. More
|
||||
// specifically, the number failed to match the regular expression VALID_PHONE_NUMBER in
|
||||
@@ -45,5 +44,4 @@ class NumberParseException extends \Exception
|
||||
{
|
||||
return "Error type: " . $this->errorType . ". " . $this->message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -586,7 +586,7 @@ class PhoneNumber implements \Serializable
|
||||
{
|
||||
$data = unserialize($serialized);
|
||||
|
||||
list (
|
||||
list(
|
||||
$this->countryCode,
|
||||
$this->nationalNumber,
|
||||
$this->extension,
|
||||
|
||||
@@ -13,6 +13,65 @@ class PhoneNumberDesc
|
||||
protected $possibleNumberPattern = "";
|
||||
protected $hasExampleNumber = false;
|
||||
protected $exampleNumber = "";
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $possibleLength;
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $possibleLengthLocalOnly;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PhoneNumberDesc
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
$this->nationalNumberPattern = "";
|
||||
$this->possibleNumberPattern = "";
|
||||
$this->possibleLength = array();
|
||||
$this->possibleLengthLocalOnly = array();
|
||||
$this->exampleNumber = "";
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPossibleLength()
|
||||
{
|
||||
return $this->possibleLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $possibleLength
|
||||
*/
|
||||
public function setPossibleLength($possibleLength)
|
||||
{
|
||||
$this->possibleLength = $possibleLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPossibleLengthLocalOnly()
|
||||
{
|
||||
return $this->possibleLengthLocalOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $possibleLengthLocalOnly
|
||||
*/
|
||||
public function setPossibleLengthLocalOnly($possibleLengthLocalOnly)
|
||||
{
|
||||
$this->possibleLengthLocalOnly = $possibleLengthLocalOnly;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
@@ -113,6 +172,8 @@ class PhoneNumberDesc
|
||||
if ($other->hasExampleNumber()) {
|
||||
$this->setExampleNumber($other->getExampleNumber());
|
||||
}
|
||||
$this->setPossibleLength($other->getPossibleLength());
|
||||
$this->setPossibleLengthLocalOnly($other->getPossibleLengthLocalOnly());
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -144,6 +205,9 @@ class PhoneNumberDesc
|
||||
$data['ExampleNumber'] = $this->getExampleNumber();
|
||||
}
|
||||
|
||||
$data['PossibleLength'] = $this->getPossibleLength();
|
||||
$data['PossibleLengthLocalOnly'] = $this->getPossibleLengthLocalOnly();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -162,6 +226,8 @@ class PhoneNumberDesc
|
||||
if (isset($input['ExampleNumber']) && $input['NationalNumberPattern'] != '') {
|
||||
$this->setExampleNumber($input['ExampleNumber']);
|
||||
}
|
||||
$this->setPossibleLength($input['PossibleLength']);
|
||||
$this->setPossibleLengthLocalOnly($input['PossibleLengthLocalOnly']);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace libphonenumber;
|
||||
|
||||
|
||||
use Giggsey\Locale\Locale;
|
||||
use libphonenumber\prefixmapper\PrefixFileReader;
|
||||
|
||||
class PhoneNumberToCarrierMapper
|
||||
@@ -32,10 +32,6 @@ class PhoneNumberToCarrierMapper
|
||||
|
||||
protected function __construct($phonePrefixDataDirectory)
|
||||
{
|
||||
if(!extension_loaded('intl')) {
|
||||
throw new \RuntimeException('The intl extension must be installed');
|
||||
}
|
||||
|
||||
$this->prefixFileReader = new PrefixFileReader(dirname(__FILE__) . $phonePrefixDataDirectory);
|
||||
$this->phoneUtil = PhoneNumberUtil::getInstance();
|
||||
}
|
||||
@@ -74,9 +70,9 @@ class PhoneNumberToCarrierMapper
|
||||
*/
|
||||
public function getNameForValidNumber(PhoneNumber $number, $languageCode)
|
||||
{
|
||||
$languageStr = \Locale::getPrimaryLanguage($languageCode);
|
||||
$languageStr = Locale::getPrimaryLanguage($languageCode);
|
||||
$scriptStr = "";
|
||||
$regionStr = \Locale::getRegion($languageCode);
|
||||
$regionStr = Locale::getRegion($languageCode);
|
||||
|
||||
return $this->prefixFileReader->getDescriptionForNumber($number, $languageStr, $scriptStr, $regionStr);
|
||||
}
|
||||
|
||||
@@ -155,5 +155,4 @@ class PhoneNumberToTimeZonesMapper
|
||||
$timezones = $this->prefixTimeZonesMap->lookupTimeZonesForNumber($number);
|
||||
return (count($timezones) == 0) ? $this->unknownTimeZoneList : $timezones;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -156,10 +156,22 @@ class PhoneNumberUtil
|
||||
*/
|
||||
protected static $MOBILE_TOKEN_MAPPINGS;
|
||||
|
||||
/**
|
||||
* Set of country codes that have geographically assigned mobile numbers (see GEO_MOBILE_COUNTRIES
|
||||
* below) which are not based on *area codes*. For example, in China mobile numbers start with a
|
||||
* carrier indicator, and beyond that are geographically assigned: this carrier indicator is not
|
||||
* considered to be an area code.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $GEO_MOBILE_COUNTRIES_WITHOUT_MOBILE_AREA_CODES;
|
||||
|
||||
/**
|
||||
* Set of country calling codes that have geographically assigned mobile numbers. This may not be
|
||||
* complete; we add calling codes case by case, as we find geographical mobile numbers or hear
|
||||
* from user reports.
|
||||
* from user reports. Note that countries like the US, where we can't distinguish between
|
||||
* fixed-line or mobile numbers, are not listed here, since we consider FIXED_LINE_OR_MOBILE to be
|
||||
* a possibly geographically-related type anyway (like FIXED_LINE).
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
@@ -361,10 +373,16 @@ class PhoneNumberUtil
|
||||
static::$MOBILE_TOKEN_MAPPINGS['52'] = "1";
|
||||
static::$MOBILE_TOKEN_MAPPINGS['54'] = "9";
|
||||
|
||||
static::$GEO_MOBILE_COUNTRIES_WITHOUT_MOBILE_AREA_CODES = array();
|
||||
static::$GEO_MOBILE_COUNTRIES_WITHOUT_MOBILE_AREA_CODES[] = 86; // China
|
||||
|
||||
static::$GEO_MOBILE_COUNTRIES = array();
|
||||
static::$GEO_MOBILE_COUNTRIES[] = 52; // Mexico
|
||||
static::$GEO_MOBILE_COUNTRIES[] = 54; // Argentina
|
||||
static::$GEO_MOBILE_COUNTRIES[] = 55; // Brazil
|
||||
static::$GEO_MOBILE_COUNTRIES[] = 62; // Indonesia: some prefixes only (fixed CMDA wireless)
|
||||
|
||||
static::$GEO_MOBILE_COUNTRIES = array_merge(static::$GEO_MOBILE_COUNTRIES, static::$GEO_MOBILE_COUNTRIES_WITHOUT_MOBILE_AREA_CODES);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -606,7 +624,19 @@ class PhoneNumberUtil
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!$this->isNumberGeographical($number)) {
|
||||
$type = $this->getNumberType($number);
|
||||
$countryCallingCode = $number->getCountryCode();
|
||||
|
||||
if ($type === PhoneNumberType::MOBILE
|
||||
// Note this is a rough heuristic; it doesn't cover Indonesia well, for example, where area
|
||||
// codes are present for some mobile phones but not for others. We have no better way of
|
||||
// representing this in the metadata at this point.
|
||||
&& in_array($countryCallingCode, self::$GEO_MOBILE_COUNTRIES_WITHOUT_MOBILE_AREA_CODES)
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!$this->isNumberGeographical($type, $countryCallingCode)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -682,7 +712,7 @@ class PhoneNumberUtil
|
||||
if ($nbMatches > 0 && $matches[0][1] === 0) {
|
||||
return $regionCode;
|
||||
}
|
||||
} else if ($this->getNumberTypeHelper($nationalNumber, $metadata) != PhoneNumberType::UNKNOWN) {
|
||||
} elseif ($this->getNumberTypeHelper($nationalNumber, $metadata) != PhoneNumberType::UNKNOWN) {
|
||||
return $regionCode;
|
||||
}
|
||||
}
|
||||
@@ -748,7 +778,7 @@ class PhoneNumberUtil
|
||||
if ($isFixedLine) {
|
||||
if ($metadata->isSameMobileAndFixedLinePattern()) {
|
||||
return PhoneNumberType::FIXED_LINE_OR_MOBILE;
|
||||
} else if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getMobile())) {
|
||||
} elseif ($this->isNumberMatchingDesc($nationalNumber, $metadata->getMobile())) {
|
||||
return PhoneNumberType::FIXED_LINE_OR_MOBILE;
|
||||
}
|
||||
return PhoneNumberType::FIXED_LINE;
|
||||
@@ -803,20 +833,34 @@ class PhoneNumberUtil
|
||||
}
|
||||
|
||||
/**
|
||||
* isNumberGeographical(PhoneNumber)
|
||||
*
|
||||
* Tests whether a phone number has a geographical association. It checks if the number is
|
||||
* associated to a certain region in the country where it belongs to. Note that this doesn't
|
||||
* verify if the number is actually in use.
|
||||
* @param PhoneNumber $phoneNumber
|
||||
*
|
||||
* isNumberGeographical(PhoneNumberType, $countryCallingCode)
|
||||
*
|
||||
* Tests whether a phone number has a geographical association, as represented by its type and the
|
||||
* country it belongs to.
|
||||
*
|
||||
* This version exists since calculating the phone number type is expensive; if we have already
|
||||
* done this, we don't want to do it again.
|
||||
*
|
||||
* @param PhoneNumber|PhoneNumberType $phoneNumberObjOrType A PhoneNumber object, or a PhoneNumberType integer
|
||||
* @param int|null $countryCallingCode Used when passing a PhoneNumberType
|
||||
* @return bool
|
||||
*/
|
||||
public function isNumberGeographical(PhoneNumber $phoneNumber)
|
||||
public function isNumberGeographical($phoneNumberObjOrType, $countryCallingCode = null)
|
||||
{
|
||||
$numberType = $this->getNumberType($phoneNumber);
|
||||
if ($phoneNumberObjOrType instanceof PhoneNumber) {
|
||||
return $this->isNumberGeographical($this->getNumberType($phoneNumberObjOrType), $phoneNumberObjOrType->getCountryCode());
|
||||
}
|
||||
|
||||
return $numberType == PhoneNumberType::FIXED_LINE
|
||||
|| $numberType == PhoneNumberType::FIXED_LINE_OR_MOBILE
|
||||
|| (in_array($phoneNumber->getCountryCode(), static::$GEO_MOBILE_COUNTRIES)
|
||||
&& $numberType == PhoneNumberType::MOBILE);
|
||||
return $phoneNumberObjOrType == PhoneNumberType::FIXED_LINE
|
||||
|| $phoneNumberObjOrType == PhoneNumberType::FIXED_LINE_OR_MOBILE
|
||||
|| (in_array($countryCallingCode, static::$GEO_MOBILE_COUNTRIES)
|
||||
&& $phoneNumberObjOrType == PhoneNumberType::MOBILE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1124,7 +1168,6 @@ class PhoneNumberUtil
|
||||
} else {
|
||||
$formattedNationalNumber = $m->replaceAll($numberFormatRule);
|
||||
}
|
||||
|
||||
}
|
||||
if ($numberFormat == PhoneNumberFormat::RFC3966) {
|
||||
// Strip any leading punctuation.
|
||||
@@ -1412,7 +1455,7 @@ class PhoneNumberUtil
|
||||
if ($defaultRegion !== null) {
|
||||
$countryCode = $regionMetadata->getCountryCode();
|
||||
$phoneNumber->setCountryCode($countryCode);
|
||||
} else if ($keepRawInput) {
|
||||
} elseif ($keepRawInput) {
|
||||
$phoneNumber->clearCountryCodeSource();
|
||||
}
|
||||
}
|
||||
@@ -1652,7 +1695,7 @@ class PhoneNumberUtil
|
||||
NumberParseException::INVALID_COUNTRY_CODE,
|
||||
"Country calling code supplied was not recognised."
|
||||
);
|
||||
} else if ($defaultRegionMetadata !== null) {
|
||||
} elseif ($defaultRegionMetadata !== null) {
|
||||
// Check to see if the number starts with the country calling code for the default region. If
|
||||
// so, we remove the country calling code, and do some checks on the validity of the number
|
||||
// before and after.
|
||||
@@ -1939,7 +1982,7 @@ class PhoneNumberUtil
|
||||
* non-geographical country calling codes, the region code 001 is returned. Also, in the case
|
||||
* of no region code being found, an empty list is returned.
|
||||
* @param int $countryCallingCode
|
||||
* @return array|null
|
||||
* @return array
|
||||
*/
|
||||
public function getRegionCodesForCountryCode($countryCallingCode)
|
||||
{
|
||||
@@ -2234,7 +2277,7 @@ class PhoneNumberUtil
|
||||
if ($this->isNANPACountry($regionCallingFrom)) {
|
||||
return $countryCode . " " . $rawInput;
|
||||
}
|
||||
} else if ($metadataForRegionCallingFrom !== null &&
|
||||
} elseif ($metadataForRegionCallingFrom !== null &&
|
||||
$countryCode == $this->getCountryCodeForValidRegion($regionCallingFrom)
|
||||
) {
|
||||
$formattingPattern =
|
||||
@@ -2328,7 +2371,7 @@ class PhoneNumberUtil
|
||||
// country calling code.
|
||||
return $countryCallingCode . " " . $this->format($number, PhoneNumberFormat::NATIONAL);
|
||||
}
|
||||
} else if ($countryCallingCode == $this->getCountryCodeForValidRegion($regionCallingFrom)) {
|
||||
} elseif ($countryCallingCode == $this->getCountryCodeForValidRegion($regionCallingFrom)) {
|
||||
// If regions share a country calling code, the country calling code need not be dialled.
|
||||
// This also applies when dialling within a region, so this if clause covers both these cases.
|
||||
// Technically this is the case for dialling from La Reunion to other overseas departments of
|
||||
@@ -2349,7 +2392,7 @@ class PhoneNumberUtil
|
||||
|
||||
if ($uniqueInternationalPrefixMatcher->matches()) {
|
||||
$internationalPrefixForFormatting = $internationalPrefix;
|
||||
} else if ($metadataForRegionCallingFrom->hasPreferredInternationalPrefix()) {
|
||||
} elseif ($metadataForRegionCallingFrom->hasPreferredInternationalPrefix()) {
|
||||
$internationalPrefixForFormatting = $metadataForRegionCallingFrom->getPreferredInternationalPrefix();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace libphonenumber;
|
||||
|
||||
|
||||
class ShortNumberInfo
|
||||
{
|
||||
const META_DATA_FILE_PREFIX = 'ShortNumberMetadata';
|
||||
|
||||
@@ -107,126 +107,130 @@ return array (
|
||||
89 => 376,
|
||||
90 => 380,
|
||||
91 => 381,
|
||||
92 => 385,
|
||||
93 => 386,
|
||||
94 => 387,
|
||||
95 => 389,
|
||||
96 => 39,
|
||||
97 => 40,
|
||||
98 => 41,
|
||||
99 => 420,
|
||||
100 => 421,
|
||||
101 => 43,
|
||||
102 => 45,
|
||||
103 => 47,
|
||||
104 => 48,
|
||||
105 => 49,
|
||||
106 => 501,
|
||||
107 => 505,
|
||||
108 => 506,
|
||||
109 => 507,
|
||||
110 => 509,
|
||||
111 => 51,
|
||||
112 => 53,
|
||||
113 => 54,
|
||||
114 => 55,
|
||||
115 => 56,
|
||||
116 => 57,
|
||||
117 => 58,
|
||||
118 => 591,
|
||||
119 => 592,
|
||||
120 => 595,
|
||||
121 => 597,
|
||||
122 => 598,
|
||||
123 => 599,
|
||||
124 => 60,
|
||||
125 => 61,
|
||||
126 => 62,
|
||||
127 => 63,
|
||||
128 => 64,
|
||||
129 => 65,
|
||||
130 => 66,
|
||||
131 => 670,
|
||||
132 => 673,
|
||||
133 => 675,
|
||||
134 => 676,
|
||||
135 => 677,
|
||||
136 => 678,
|
||||
137 => 679,
|
||||
138 => 685,
|
||||
139 => 686,
|
||||
140 => 689,
|
||||
141 => 7,
|
||||
142 => 84,
|
||||
143 => 852,
|
||||
144 => 853,
|
||||
145 => 855,
|
||||
146 => 856,
|
||||
147 => 86130,
|
||||
148 => 86131,
|
||||
149 => 86132,
|
||||
150 => 86133,
|
||||
151 => 86134,
|
||||
152 => 86135,
|
||||
153 => 86136,
|
||||
154 => 86137,
|
||||
155 => 86138,
|
||||
156 => 86139,
|
||||
157 => 86145,
|
||||
158 => 86147,
|
||||
159 => 86150,
|
||||
160 => 86151,
|
||||
161 => 86152,
|
||||
162 => 86153,
|
||||
163 => 86155,
|
||||
164 => 86156,
|
||||
165 => 86157,
|
||||
166 => 86158,
|
||||
167 => 86159,
|
||||
168 => 86173,
|
||||
169 => 86176,
|
||||
170 => 86177,
|
||||
171 => 86178,
|
||||
172 => 86180,
|
||||
173 => 86181,
|
||||
174 => 86182,
|
||||
175 => 86183,
|
||||
176 => 86184,
|
||||
177 => 86185,
|
||||
178 => 86186,
|
||||
179 => 86187,
|
||||
180 => 86188,
|
||||
181 => 86189,
|
||||
182 => 880,
|
||||
183 => 90,
|
||||
184 => 91,
|
||||
185 => 92,
|
||||
186 => 93,
|
||||
187 => 94,
|
||||
188 => 95,
|
||||
189 => 960,
|
||||
190 => 961,
|
||||
191 => 962,
|
||||
192 => 964,
|
||||
193 => 965,
|
||||
194 => 966,
|
||||
195 => 967,
|
||||
196 => 968,
|
||||
197 => 970,
|
||||
198 => 971,
|
||||
199 => 972,
|
||||
200 => 973,
|
||||
201 => 974,
|
||||
202 => 975,
|
||||
203 => 976,
|
||||
204 => 977,
|
||||
205 => 98,
|
||||
206 => 992,
|
||||
207 => 993,
|
||||
208 => 994,
|
||||
209 => 995,
|
||||
210 => 996,
|
||||
211 => 998,
|
||||
92 => 382,
|
||||
93 => 385,
|
||||
94 => 386,
|
||||
95 => 387,
|
||||
96 => 389,
|
||||
97 => 39,
|
||||
98 => 40,
|
||||
99 => 41,
|
||||
100 => 420,
|
||||
101 => 421,
|
||||
102 => 43,
|
||||
103 => 45,
|
||||
104 => 47,
|
||||
105 => 48,
|
||||
106 => 49,
|
||||
107 => 501,
|
||||
108 => 505,
|
||||
109 => 506,
|
||||
110 => 507,
|
||||
111 => 509,
|
||||
112 => 51,
|
||||
113 => 53,
|
||||
114 => 54,
|
||||
115 => 55,
|
||||
116 => 56,
|
||||
117 => 57,
|
||||
118 => 58,
|
||||
119 => 591,
|
||||
120 => 592,
|
||||
121 => 595,
|
||||
122 => 597,
|
||||
123 => 598,
|
||||
124 => 599,
|
||||
125 => 60,
|
||||
126 => 61,
|
||||
127 => 62,
|
||||
128 => 63,
|
||||
129 => 64,
|
||||
130 => 65,
|
||||
131 => 66,
|
||||
132 => 670,
|
||||
133 => 673,
|
||||
134 => 675,
|
||||
135 => 676,
|
||||
136 => 677,
|
||||
137 => 678,
|
||||
138 => 679,
|
||||
139 => 685,
|
||||
140 => 686,
|
||||
141 => 689,
|
||||
142 => 7,
|
||||
143 => 84,
|
||||
144 => 852,
|
||||
145 => 853,
|
||||
146 => 855,
|
||||
147 => 856,
|
||||
148 => 86130,
|
||||
149 => 86131,
|
||||
150 => 86132,
|
||||
151 => 86133,
|
||||
152 => 86134,
|
||||
153 => 86135,
|
||||
154 => 86136,
|
||||
155 => 86137,
|
||||
156 => 86138,
|
||||
157 => 86139,
|
||||
158 => 86145,
|
||||
159 => 86147,
|
||||
160 => 86150,
|
||||
161 => 86151,
|
||||
162 => 86152,
|
||||
163 => 86153,
|
||||
164 => 86155,
|
||||
165 => 86156,
|
||||
166 => 86157,
|
||||
167 => 86158,
|
||||
168 => 86159,
|
||||
169 => 86170,
|
||||
170 => 86172,
|
||||
171 => 86173,
|
||||
172 => 86176,
|
||||
173 => 86177,
|
||||
174 => 86178,
|
||||
175 => 86180,
|
||||
176 => 86181,
|
||||
177 => 86182,
|
||||
178 => 86183,
|
||||
179 => 86184,
|
||||
180 => 86185,
|
||||
181 => 86186,
|
||||
182 => 86187,
|
||||
183 => 86188,
|
||||
184 => 86189,
|
||||
185 => 880,
|
||||
186 => 90,
|
||||
187 => 91,
|
||||
188 => 92,
|
||||
189 => 93,
|
||||
190 => 94,
|
||||
191 => 95,
|
||||
192 => 960,
|
||||
193 => 961,
|
||||
194 => 962,
|
||||
195 => 963,
|
||||
196 => 964,
|
||||
197 => 965,
|
||||
198 => 966,
|
||||
199 => 967,
|
||||
200 => 968,
|
||||
201 => 970,
|
||||
202 => 971,
|
||||
203 => 972,
|
||||
204 => 973,
|
||||
205 => 974,
|
||||
206 => 975,
|
||||
207 => 976,
|
||||
208 => 977,
|
||||
209 => 98,
|
||||
210 => 992,
|
||||
211 => 993,
|
||||
212 => 994,
|
||||
213 => 995,
|
||||
214 => 996,
|
||||
215 => 998,
|
||||
),
|
||||
'fa' =>
|
||||
array (
|
||||
@@ -235,6 +239,89 @@ return array (
|
||||
),
|
||||
'ru' =>
|
||||
array (
|
||||
0 => 375,
|
||||
0 => 374,
|
||||
1 => 375,
|
||||
),
|
||||
'zh' =>
|
||||
array (
|
||||
0 => 852,
|
||||
1 => 86130,
|
||||
2 => 86131,
|
||||
3 => 86132,
|
||||
4 => 86133,
|
||||
5 => 86134,
|
||||
6 => 86135,
|
||||
7 => 86136,
|
||||
8 => 86137,
|
||||
9 => 86138,
|
||||
10 => 86139,
|
||||
11 => 86145,
|
||||
12 => 86147,
|
||||
13 => 86150,
|
||||
14 => 86151,
|
||||
15 => 86152,
|
||||
16 => 86153,
|
||||
17 => 86155,
|
||||
18 => 86156,
|
||||
19 => 86157,
|
||||
20 => 86158,
|
||||
21 => 86159,
|
||||
22 => 86170,
|
||||
23 => 86172,
|
||||
24 => 86173,
|
||||
25 => 86176,
|
||||
26 => 86177,
|
||||
27 => 86178,
|
||||
28 => 86180,
|
||||
29 => 86181,
|
||||
30 => 86182,
|
||||
31 => 86183,
|
||||
32 => 86184,
|
||||
33 => 86185,
|
||||
34 => 86186,
|
||||
35 => 86187,
|
||||
36 => 86188,
|
||||
37 => 86189,
|
||||
),
|
||||
'zh_Hant' =>
|
||||
array (
|
||||
0 => 852,
|
||||
1 => 86130,
|
||||
2 => 86131,
|
||||
3 => 86132,
|
||||
4 => 86133,
|
||||
5 => 86134,
|
||||
6 => 86135,
|
||||
7 => 86136,
|
||||
8 => 86137,
|
||||
9 => 86138,
|
||||
10 => 86139,
|
||||
11 => 86145,
|
||||
12 => 86147,
|
||||
13 => 86150,
|
||||
14 => 86151,
|
||||
15 => 86152,
|
||||
16 => 86153,
|
||||
17 => 86155,
|
||||
18 => 86156,
|
||||
19 => 86157,
|
||||
20 => 86158,
|
||||
21 => 86159,
|
||||
22 => 86170,
|
||||
23 => 86172,
|
||||
24 => 86173,
|
||||
25 => 86176,
|
||||
26 => 86177,
|
||||
27 => 86178,
|
||||
28 => 86180,
|
||||
29 => 86181,
|
||||
30 => 86182,
|
||||
31 => 86183,
|
||||
32 => 86184,
|
||||
33 => 86185,
|
||||
34 => 86186,
|
||||
35 => 86187,
|
||||
36 => 86188,
|
||||
37 => 86189,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ return array (
|
||||
212606 => 'Inwi',
|
||||
212607 => 'Inwi',
|
||||
212608 => 'Inwi',
|
||||
212609 => 'Inwi',
|
||||
212610 => 'Maroc Telecom',
|
||||
212611 => 'Maroc Telecom',
|
||||
212612 => 'Méditel',
|
||||
@@ -86,14 +87,26 @@ return array (
|
||||
212679 => 'Méditel',
|
||||
212680 => 'Inwi',
|
||||
212681 => 'Inwi',
|
||||
212682 => 'Maroc Telecom',
|
||||
212684 => 'Méditel',
|
||||
212687 => 'Inwi',
|
||||
212688 => 'Méditel',
|
||||
212689 => 'Maroc Telecom',
|
||||
212690 => 'Inwi',
|
||||
212691 => 'Inwi',
|
||||
212692 => 'GlobalStar',
|
||||
212691 => 'Méditel',
|
||||
2126921 => 'Al Hourria Telecom',
|
||||
2126922 => 'Al Hourria Telecom',
|
||||
212693 => 'Méditel',
|
||||
212694 => 'Méditel',
|
||||
212695 => 'Inwi',
|
||||
212696 => 'Inwi',
|
||||
212696 => 'Maroc Telecom',
|
||||
212697 => 'Maroc Telecom',
|
||||
212698 => 'Inwi',
|
||||
212699 => 'Inwi',
|
||||
212700 => 'Inwi',
|
||||
212707 => 'Inwi',
|
||||
212761 => 'Maroc Telecom',
|
||||
212762 => 'Maroc Telecom',
|
||||
212770 => 'Méditel',
|
||||
212777 => 'Méditel',
|
||||
);
|
||||
|
||||
@@ -11,6 +11,8 @@ return array (
|
||||
24384 => 'CCT',
|
||||
24388 => 'Yozma Timeturns sprl -YTT',
|
||||
24389 => 'Tigo',
|
||||
24390 => 'Africell',
|
||||
24391 => 'Africell',
|
||||
24397 => 'Zain',
|
||||
24398 => 'Zain',
|
||||
24399 => 'Zain',
|
||||
|
||||
@@ -11,4 +11,5 @@ return array (
|
||||
25194 => 'Ethio Telecom',
|
||||
25195 => 'Ethio Telecom',
|
||||
25196 => 'Ethio Telecom',
|
||||
25198 => 'Ethio Telecom',
|
||||
);
|
||||
|
||||
@@ -22,11 +22,25 @@ return array (
|
||||
27617 => 'Cell C',
|
||||
27618 => 'Cell C',
|
||||
27619 => 'Cell C',
|
||||
27620 => 'Cell C',
|
||||
27621 => 'Cell C',
|
||||
27622 => 'Cell C',
|
||||
27623 => 'Cell C',
|
||||
27624 => 'Cell C',
|
||||
2762 => 'Cell C',
|
||||
27630 => 'MTN',
|
||||
27631 => 'MTN',
|
||||
27632 => 'MTN',
|
||||
27633 => 'MTN',
|
||||
27634 => 'MTN',
|
||||
27635 => 'MTN',
|
||||
27636 => 'Vodacom',
|
||||
27637 => 'Vodacom',
|
||||
27638 => 'MTN',
|
||||
27639 => 'MTN',
|
||||
27640 => 'MTN',
|
||||
27641 => 'Cell C',
|
||||
27642 => 'Cell C',
|
||||
27643 => 'Cell C',
|
||||
27644 => 'Cell C',
|
||||
27645 => 'Cell C',
|
||||
27646 => 'Vodacom',
|
||||
27647 => 'Vodacom',
|
||||
27710 => 'MTN',
|
||||
27711 => 'Vodacom',
|
||||
27712 => 'Vodacom',
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
*/
|
||||
|
||||
return array (
|
||||
37441 => 'Orange',
|
||||
37441 => 'Ucom',
|
||||
37443 => 'Beeline',
|
||||
37449 => 'VivaCell-MTS',
|
||||
37455 => 'Orange',
|
||||
37455 => 'Ucom',
|
||||
37477 => 'VivaCell-MTS',
|
||||
37491 => 'Beeline',
|
||||
37493 => 'VivaCell-MTS',
|
||||
37494 => 'VivaCell-MTS',
|
||||
37495 => 'Orange',
|
||||
37495 => 'Ucom',
|
||||
37496 => 'Beeline',
|
||||
37498 => 'VivaCell-MTS',
|
||||
37499 => 'Beeline',
|
||||
|
||||
14
vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/382.php
vendored
Normal file
14
vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/382.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is automatically @generated by {@link GeneratePhonePrefixData}.
|
||||
* Please don't modify it directly.
|
||||
*/
|
||||
|
||||
return array (
|
||||
38260 => 'm:tel',
|
||||
38263 => 'Telenor',
|
||||
38266 => 'Telekom',
|
||||
38267 => 'Telekom',
|
||||
38268 => 'm:tel',
|
||||
38269 => 'Telenor',
|
||||
);
|
||||
@@ -25,6 +25,7 @@ return array (
|
||||
421919 => 'Orange',
|
||||
421940 => 'O2',
|
||||
421944 => 'O2',
|
||||
421945 => 'Orange',
|
||||
421948 => 'O2',
|
||||
421949 => 'O2',
|
||||
421950 => '4ka of SWAN',
|
||||
|
||||
@@ -5,5 +5,13 @@
|
||||
*/
|
||||
|
||||
return array (
|
||||
86134 => 'China Mobile',
|
||||
861340 => 'China Mobile',
|
||||
861341 => 'China Mobile',
|
||||
861342 => 'China Mobile',
|
||||
861343 => 'China Mobile',
|
||||
861344 => 'China Mobile',
|
||||
861345 => 'China Mobile',
|
||||
861346 => 'China Mobile',
|
||||
861347 => 'China Mobile',
|
||||
861348 => 'China Mobile',
|
||||
);
|
||||
|
||||
11
vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/86170.php
vendored
Normal file
11
vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/86170.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is automatically @generated by {@link GeneratePhonePrefixData}.
|
||||
* Please don't modify it directly.
|
||||
*/
|
||||
|
||||
return array (
|
||||
861703 => 'China Mobile',
|
||||
861705 => 'China Mobile',
|
||||
861706 => 'China Mobile',
|
||||
);
|
||||
9
vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/86172.php
vendored
Normal file
9
vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/86172.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is automatically @generated by {@link GeneratePhonePrefixData}.
|
||||
* Please don't modify it directly.
|
||||
*/
|
||||
|
||||
return array (
|
||||
86172 => 'China Mobile',
|
||||
);
|
||||
@@ -195,7 +195,16 @@ return array (
|
||||
917281 => 'Vodafone',
|
||||
917282 => 'Vodafone',
|
||||
917283 => 'Vodafone',
|
||||
917287 => 'Airtel',
|
||||
9172870 => 'Airtel',
|
||||
9172871 => 'Airtel',
|
||||
9172872 => 'Airtel',
|
||||
9172873 => 'Airtel',
|
||||
9172874 => 'Airtel',
|
||||
9172875 => 'Airtel',
|
||||
9172876 => 'Airtel',
|
||||
9172877 => 'Airtel',
|
||||
9172878 => 'Idea',
|
||||
9172879 => 'Airtel',
|
||||
917289 => 'Airtel',
|
||||
917293 => 'Dishnet',
|
||||
917298 => 'Dishnet',
|
||||
@@ -233,6 +242,7 @@ return array (
|
||||
9173279 => 'Airtel',
|
||||
9173280 => 'Airtel',
|
||||
9173288 => 'Airtel',
|
||||
9173307 => 'Airtel',
|
||||
9173376 => 'Airtel',
|
||||
9173377 => 'Airtel',
|
||||
9173378 => 'Airtel',
|
||||
@@ -368,6 +378,7 @@ return array (
|
||||
9173910 => 'Vodafone',
|
||||
9173918 => 'Vodafone',
|
||||
9173919 => 'Vodafone',
|
||||
9173959 => 'Airtel',
|
||||
917396 => 'Telewings',
|
||||
917398 => 'Telewings',
|
||||
917399 => 'Dishnet',
|
||||
@@ -388,10 +399,84 @@ return array (
|
||||
917417 => 'Tata Docomo',
|
||||
917418 => 'Tata Docomo',
|
||||
917419 => 'Reliance',
|
||||
9174209 => 'Airtel',
|
||||
9174210 => 'Dishnet',
|
||||
9174218 => 'Dishnet',
|
||||
9174219 => 'Dishnet',
|
||||
9174220 => 'Dishnet',
|
||||
9174228 => 'Dishnet',
|
||||
9174229 => 'Dishnet',
|
||||
9174230 => 'Dishnet',
|
||||
9174238 => 'Dishnet',
|
||||
9174239 => 'Dishnet',
|
||||
9174240 => 'Dishnet',
|
||||
9174248 => 'Hexacom',
|
||||
9174249 => 'Hexacom',
|
||||
9174250 => 'Hexacom',
|
||||
9174258 => 'Hexacom',
|
||||
9174259 => 'Hexacom',
|
||||
9174260 => 'Hexacom',
|
||||
9174268 => 'Hexacom',
|
||||
9174269 => 'Hexacom',
|
||||
9174270 => 'Hexacom',
|
||||
9174278 => 'Hexacom',
|
||||
9174279 => 'Vodafone',
|
||||
917428 => 'Reliance',
|
||||
917429 => 'Reliance',
|
||||
9174300 => 'Vodafone',
|
||||
9174308 => 'Vodafone',
|
||||
9174309 => 'Vodafone',
|
||||
9174310 => 'Vodafone',
|
||||
9174318 => 'Vodafone',
|
||||
9174319 => 'Vodafone',
|
||||
9174320 => 'Vodafone',
|
||||
9174328 => 'Vodafone',
|
||||
9174329 => 'Vodafone',
|
||||
9174330 => 'Vodafone',
|
||||
9174338 => 'Vodafone',
|
||||
9174339 => 'Vodafone',
|
||||
9174340 => 'Vodafone',
|
||||
9174348 => 'Vodafone',
|
||||
9174349 => 'Vodafone',
|
||||
9174350 => 'Vodafone',
|
||||
9174358 => 'Vodafone',
|
||||
9174359 => 'Vodafone',
|
||||
9174360 => 'Vodafone',
|
||||
9174368 => 'Vodafone',
|
||||
9174369 => 'Vodafone',
|
||||
9174370 => 'Vodafone',
|
||||
9174378 => 'Vodafone',
|
||||
9174379 => 'Vodafone',
|
||||
9174380 => 'Vodafone',
|
||||
9174388 => 'Vodafone',
|
||||
9174389 => 'Vodafone',
|
||||
917439 => 'Reliance',
|
||||
9174400 => 'Vodafone',
|
||||
9174401 => 'Vodafone',
|
||||
9174402 => 'Idea',
|
||||
9174403 => 'Idea',
|
||||
9174404 => 'Idea',
|
||||
9174405 => 'Idea',
|
||||
9174406 => 'Idea',
|
||||
9174407 => 'Idea',
|
||||
9174408 => 'Idea',
|
||||
9174409 => 'Idea',
|
||||
9174411 => 'Idea',
|
||||
9174470 => 'Idea',
|
||||
9174472 => 'Idea',
|
||||
9174473 => 'Idea',
|
||||
9174474 => 'Idea',
|
||||
9174475 => 'Idea',
|
||||
9174476 => 'Idea',
|
||||
9174477 => 'Idea',
|
||||
9174478 => 'Idea',
|
||||
917448 => 'Idea',
|
||||
917449 => 'Idea',
|
||||
9174500 => 'Idea',
|
||||
9174508 => 'Idea',
|
||||
9174509 => 'Idea',
|
||||
9174559 => 'Airtel',
|
||||
9174599 => 'Airtel',
|
||||
9174703 => 'Airtel',
|
||||
9174704 => 'Airtel',
|
||||
9174705 => 'Airtel',
|
||||
@@ -835,6 +920,8 @@ return array (
|
||||
917877 => 'Reliance',
|
||||
917878 => 'Reliance',
|
||||
917879 => 'Reliance',
|
||||
9178880 => 'Idea',
|
||||
9178881 => 'Idea',
|
||||
917890 => 'Idea',
|
||||
917891 => 'Idea',
|
||||
917893 => 'Airtel',
|
||||
|
||||
28
vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/963.php
vendored
Normal file
28
vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/963.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is automatically @generated by {@link GeneratePhonePrefixData}.
|
||||
* Please don't modify it directly.
|
||||
*/
|
||||
|
||||
return array (
|
||||
963922 => 'Syriatel',
|
||||
96393 => 'Syriatel',
|
||||
96394 => 'MTN',
|
||||
963950 => 'MTN',
|
||||
963952 => 'MTN',
|
||||
963954 => 'MTN',
|
||||
963955 => 'MTN',
|
||||
963956 => 'MTN',
|
||||
963957 => 'MTN',
|
||||
963958 => 'MTN',
|
||||
963959 => 'MTN',
|
||||
963962 => 'MTN',
|
||||
963964 => 'MTN',
|
||||
963965 => 'MTN',
|
||||
963966 => 'MTN',
|
||||
963967 => 'MTN',
|
||||
963968 => 'MTN',
|
||||
963969 => 'MTN',
|
||||
96398 => 'Syriatel',
|
||||
96399 => 'Syriatel',
|
||||
);
|
||||
@@ -14,6 +14,7 @@ return array (
|
||||
97337 => 'zain BH',
|
||||
97338 => 'Batelco',
|
||||
97339 => 'Batelco',
|
||||
97354 => 'VIVA',
|
||||
97363 => 'VIVA',
|
||||
973663 => 'zain BH',
|
||||
973666 => 'zain BH',
|
||||
|
||||
@@ -9,6 +9,7 @@ return array (
|
||||
992418 => 'Megafon',
|
||||
992501 => 'Tcell',
|
||||
992502 => 'Tcell',
|
||||
99255 => 'Megafon',
|
||||
99288 => 'Megafon',
|
||||
99290 => 'Megafon',
|
||||
992917 => 'Tacom',
|
||||
|
||||
@@ -5,10 +5,13 @@
|
||||
*/
|
||||
|
||||
return array (
|
||||
99436554 => 'Nakhtel',
|
||||
99440 => 'FONEX',
|
||||
99444 => 'Aztelekom',
|
||||
99450 => 'Azercell',
|
||||
99451 => 'Azercell',
|
||||
99455 => 'Bakcell',
|
||||
99460 => 'Nakhtel',
|
||||
99470 => 'Nar Mobile',
|
||||
99477 => 'Nar Mobile',
|
||||
);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user