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