當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhoneNumberUtil::resetInstance方法代碼示例

本文整理匯總了PHP中libphonenumber\PhoneNumberUtil::resetInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhoneNumberUtil::resetInstance方法的具體用法?PHP PhoneNumberUtil::resetInstance怎麽用?PHP PhoneNumberUtil::resetInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在libphonenumber\PhoneNumberUtil的用法示例。


在下文中一共展示了PhoneNumberUtil::resetInstance方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     PhoneNumberUtil::resetInstance();
     PhoneNumberOfflineGeocoder::resetInstance();
     $this->phoneUtil = PhoneNumberUtil::getInstance();
     $this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
 }
開發者ID:gnovaro,項目名稱:libphonenumber-for-php,代碼行數:7,代碼來源:Issue36Test.php

示例2: setUpBeforeClass

 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);
 }
開發者ID:RonLab1987,項目名稱:ride-workshop,代碼行數:32,代碼來源:PhoneNumberToCarrierMapperTest.php

示例3: setUp

 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();
 }
開發者ID:wakeless,項目名稱:libphonenumber-for-php,代碼行數:8,代碼來源:ShortNumberInfoTest.php

示例4: setUp

 public function setUp()
 {
     PhoneNumberUtil::resetInstance();
     $this->phoneUtil = PhoneNumberUtil::getInstance();
     if (extension_loaded('intl')) {
         $this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
     }
 }
開發者ID:RonLab1987,項目名稱:ride-workshop,代碼行數:8,代碼來源:Issue23Test.php

示例5: getExampleNumber

 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;
 }
開發者ID:ayurmedia,項目名稱:faveo-helpdesk,代碼行數:8,代碼來源:Issue68Test.php

示例6: setUp

 public function setUp()
 {
     if (!extension_loaded('intl')) {
         $this->markTestSkipped('The intl extension must be installed');
     }
     PhoneNumberUtil::resetInstance();
     $this->phoneUtil = PhoneNumberUtil::getInstance();
     $this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
 }
開發者ID:ayurmedia,項目名稱:faveo-helpdesk,代碼行數:9,代碼來源:Issue44Test.php

示例7: initializePhoneUtilForTesting

 private static function initializePhoneUtilForTesting()
 {
     self::$bsNumber = new PhoneNumber();
     self::$bsNumber->setCountryCode(1)->setNationalNumber(2423651234);
     self::$bsMobile = new PhoneNumber();
     self::$bsMobile->setCountryCode(1)->setNationalNumber(2423591234);
     self::$internationalTollFree = new PhoneNumber();
     self::$internationalTollFree->setCountryCode(800)->setNationalNumber(12345678);
     self::$internationalTollFreeTooLong = new PhoneNumber();
     self::$internationalTollFreeTooLong->setCountryCode(800)->setNationalNumber(123456789);
     self::$universalPremiumRate = new PhoneNumber();
     self::$universalPremiumRate->setCountryCode(979)->setNationalNumber(123456789);
     self::$sgNumber = new PhoneNumber();
     self::$sgNumber->setCountryCode(65)->setNationalNumber(65218000);
     // A too-long and hence invalid US number.
     self::$usLongNumber = new PhoneNumber();
     self::$usLongNumber->setCountryCode(1)->setNationalNumber(65025300001);
     self::$usShortByOneNumber = new PhoneNumber();
     self::$usShortByOneNumber->setCountryCode(1)->setNationalNumber(650253000);
     self::$usTollFree = new PhoneNumber();
     self::$usTollFree->setCountryCode(1)->setNationalNumber(8002530000);
     self::$usNumber = new PhoneNumber();
     self::$usNumber->setCountryCode(1)->setNationalNumber(6502530000);
     self::$usLocalNumber = new PhoneNumber();
     self::$usLocalNumber->setCountryCode(1)->setNationalNumber(2530000);
     self::$nzNumber = new PhoneNumber();
     self::$nzNumber->setCountryCode(64)->setNationalNumber(33316005);
     self::$usPremium = new PhoneNumber();
     self::$usPremium->setCountryCode(1)->setNationalNumber(9002530000);
     self::$usSpoof = new PhoneNumber();
     self::$usSpoof->setCountryCode(1)->setNationalNumber(0);
     self::$usSpoofWithRawInput = new PhoneNumber();
     self::$usSpoofWithRawInput->setCountryCode(1)->setNationalNumber(0)->setRawInput("000-000-0000");
     self::$gbMobile = new PhoneNumber();
     self::$gbMobile->setCountryCode(44)->setNationalNumber(7912345678);
     self::$gbNumber = new PhoneNumber();
     self::$gbNumber->setCountryCode(44)->setNationalNumber(2070313000);
     self::$deShortNumber = new PhoneNumber();
     self::$deShortNumber->setCountryCode(49)->setNationalNumber(1234);
     self::$itMobile = new PhoneNumber();
     self::$itMobile->setCountryCode(39)->setNationalNumber(345678901);
     self::$itNumber = new PhoneNumber();
     self::$itNumber->setCountryCode(39)->setNationalNumber(236618300)->setItalianLeadingZero(true);
     self::$auNumber = new PhoneNumber();
     self::$auNumber->setCountryCode(61)->setNationalNumber(236618300);
     self::$arMobile = new PhoneNumber();
     self::$arMobile->setCountryCode(54)->setNationalNumber(91187654321);
     self::$arNumber = new PhoneNumber();
     self::$arNumber->setCountryCode(54)->setNationalNumber(1187654321);
     self::$mxMobile1 = new PhoneNumber();
     self::$mxMobile1->setCountryCode(52)->setNationalNumber(12345678900);
     self::$mxNumber1 = new PhoneNumber();
     self::$mxNumber1->setCountryCode(52)->setNationalNumber(3312345678);
     self::$mxMobile2 = new PhoneNumber();
     self::$mxMobile2->setCountryCode(52)->setNationalNumber(15512345678);
     self::$mxNumber2 = new PhoneNumber();
     self::$mxNumber2->setCountryCode(52)->setNationalNumber(8211234567);
     // Note that this is the same as the example number for DE in the metadata.
     self::$deNumber = new PhoneNumber();
     self::$deNumber->setCountryCode(49)->setNationalNumber(30123456);
     self::$jpStarNumber = new PhoneNumber();
     self::$jpStarNumber->setCountryCode(81)->setNationalNumber(2345);
     self::$alphaNumericNumber = new PhoneNumber();
     self::$alphaNumericNumber->setCountryCode(1)->setNationalNumber(80074935247);
     self::$aeUAN = new PhoneNumber();
     self::$aeUAN->setCountryCode(971)->setNationalNumber(600123456);
     self::$unknownCountryCodeNoRawInput = new PhoneNumber();
     self::$unknownCountryCodeNoRawInput->setCountryCode(2)->setNationalNumber(12345);
     PhoneNumberUtil::resetInstance();
     return PhoneNumberUtil::getInstance(self::TEST_META_DATA_FILE_PREFIX, CountryCodeToRegionCodeMapForTesting::$countryCodeToRegionCodeMapForTesting);
 }
開發者ID:wasabiNorman,項目名稱:libphonenumber-for-php,代碼行數:71,代碼來源:PhoneNumberUtilTest.php

示例8: setUp

 public function setUp()
 {
     PhoneNumberUtil::resetInstance();
     $this->phoneUtil = PhoneNumberUtil::getInstance();
 }
開發者ID:ayurmedia,項目名稱:faveo-helpdesk,代碼行數:5,代碼來源:Issue14Test.php

示例9: supportedGlobalNetworkCallingCodes

 public function supportedGlobalNetworkCallingCodes()
 {
     $returnList = array();
     PhoneNumberUtil::resetInstance();
     $phoneUtil = PhoneNumberUtil::getInstance();
     foreach ($phoneUtil->getSupportedGlobalNetworkCallingCodes() as $callingCode) {
         $returnList[] = array($callingCode);
     }
     return $returnList;
 }
開發者ID:gnovaro,項目名稱:libphonenumber-for-php,代碼行數:10,代碼來源:ExampleNumbersTest.php

示例10: testIssue64WithoutPhoneNumberUtilresetInstance

 public function testIssue64WithoutPhoneNumberUtilresetInstance()
 {
     PhoneNumberUtil::resetInstance();
     $sortNumberUtil = ShortNumberInfo::getInstance();
     $this->assertTrue($sortNumberUtil->isEmergencyNumber('999', 'GB'));
 }
開發者ID:wakeless,項目名稱:libphonenumber-for-php,代碼行數:6,代碼來源:Issue64Test.php

示例11: __construct

 public function __construct()
 {
     PhoneNumberUtil::resetInstance();
     $this->phoneUtil = PhoneNumberUtil::getInstance(self::META_DATA_FILE_PREFIX, CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap);
 }
開發者ID:wasabiNorman,項目名稱:libphonenumber-for-php,代碼行數:5,代碼來源:UKNumbersTest.php

示例12: setUp

 public function setUp()
 {
     PhoneNumberUtil::resetInstance();
 }
開發者ID:kasirye,項目名稱:faveo-helpdesk,代碼行數:4,代碼來源:UKTest.php

示例13: setUp

 public function setUp()
 {
     PhoneNumberUtil::resetInstance();
     $this->carrierMapper = PhoneNumberToCarrierMapper::getInstance(self::TEST_META_DATA_FILE_PREFIX);
 }
開發者ID:wasabiNorman,項目名稱:libphonenumber-for-php,代碼行數:5,代碼來源:PhoneNumberToCarrierMapperTest.php


注:本文中的libphonenumber\PhoneNumberUtil::resetInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。