dev-moceansms - Version 1.0.1

Version Notes

Moceansms notification extension

Download this release

Release Info

Developer Donald
Extension dev-moceansms
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

Files changed (264) hide show
  1. app/code/local/Mocean/moceansms/Block/Adminhtml/Moceansms.php +12 -0
  2. app/code/local/Mocean/moceansms/Helper/Data.php +285 -0
  3. app/code/local/Mocean/moceansms/Model/Dropdown/Values.php +17 -0
  4. app/code/local/Mocean/moceansms/Model/Observer.php +425 -0
  5. app/code/local/Mocean/moceansms/composer.json +5 -0
  6. app/code/local/Mocean/moceansms/composer.lock +82 -0
  7. app/code/local/Mocean/moceansms/composer.phar +0 -0
  8. app/code/local/Mocean/moceansms/controllers/Adminhtml/MoceansmsController.php +92 -0
  9. app/code/local/Mocean/moceansms/etc/adminhtml.xml +36 -0
  10. app/code/local/Mocean/moceansms/etc/config.xml +156 -0
  11. app/code/local/Mocean/moceansms/etc/system.xml +284 -0
  12. app/code/local/Mocean/moceansms/vendor/autoload.php +7 -0
  13. app/code/local/Mocean/moceansms/vendor/composer/ClassLoader.php +413 -0
  14. app/code/local/Mocean/moceansms/vendor/composer/LICENSE +21 -0
  15. app/code/local/Mocean/moceansms/vendor/composer/autoload_classmap.php +9 -0
  16. app/code/local/Mocean/moceansms/vendor/composer/autoload_namespaces.php +10 -0
  17. app/code/local/Mocean/moceansms/vendor/composer/autoload_psr4.php +9 -0
  18. app/code/local/Mocean/moceansms/vendor/composer/autoload_real.php +45 -0
  19. app/code/local/Mocean/moceansms/vendor/composer/installed.json +67 -0
  20. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/.gitignore +5 -0
  21. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/.travis.yml +31 -0
  22. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/LICENSE +177 -0
  23. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/METADATA-VERSION.txt +5 -0
  24. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/README.md +232 -0
  25. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/bootstrap.php +4 -0
  26. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/CodeCoverageTest.php +44 -0
  27. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue14Test.php +30 -0
  28. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue17Test.php +41 -0
  29. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue21Test.php +50 -0
  30. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue23Test.php +43 -0
  31. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue34Test.php +28 -0
  32. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue35Test.php +51 -0
  33. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue36Test.php +41 -0
  34. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue3Test.php +30 -0
  35. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue44Test.php +82 -0
  36. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue4Test.php +30 -0
  37. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue64Test.php +32 -0
  38. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue68Test.php +40 -0
  39. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue76Test.php +21 -0
  40. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/LocaleTest.php +321 -0
  41. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/PHP7Test.php +52 -0
  42. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/UKNumbersTest.php +188 -0
  43. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/buildtools/GeneratePhonePrefixDataTest.php +56 -0
  44. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/PhoneNumberToCarrierMapperTest.php +143 -0
  45. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/Map.php +18 -0
  46. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/en/1650.php +10 -0
  47. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/en/244.php +10 -0
  48. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/en/44.php +11 -0
  49. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/sv/44.php +9 -0
  50. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/ExampleNumbersTest.php +337 -0
  51. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/IntlTest.php +37 -0
  52. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/MultiFileMetadataSourceImplTest.php +50 -0
  53. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/PhoneNumberTest.php +99 -0
  54. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/PhoneNumberUtilTest.php +3314 -0
  55. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/ShortNumberInfoTest.php +435 -0
  56. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/ShortNumberUtilTest.php +157 -0
  57. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_800.php +116 -0
  58. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_979.php +116 -0
  59. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AD.php +96 -0
  60. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AE.php +103 -0
  61. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AO.php +116 -0
  62. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AR.php +211 -0
  63. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AU.php +127 -0
  64. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_BB.php +96 -0
  65. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_BR.php +96 -0
  66. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_BS.php +104 -0
  67. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_BY.php +138 -0
  68. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_CA.php +96 -0
  69. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_CC.php +96 -0
  70. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_CN.php +114 -0
  71. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_CX.php +96 -0
  72. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_DE.php +173 -0
  73. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_FR.php +115 -0
  74. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_GB.php +148 -0
  75. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_GG.php +96 -0
  76. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_HU.php +104 -0
  77. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_IT.php +146 -0
  78. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_JP.php +187 -0
  79. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_KR.php +254 -0
  80. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_MX.php +211 -0
  81. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_NZ.php +140 -0
  82. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_PL.php +114 -0
  83. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_RE.php +119 -0
  84. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_SE.php +96 -0
  85. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_SG.php +139 -0
  86. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_US.php +141 -0
  87. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_YT.php +108 -0
  88. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/geocoding/PhoneNumberOfflineGeocoderTest.php +201 -0
  89. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/PrefixFileReaderTest.php +79 -0
  90. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/Map.php +27 -0
  91. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/de/1201.php +9 -0
  92. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/de/1650.php +9 -0
  93. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1201.php +9 -0
  94. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1212.php +10 -0
  95. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1617.php +9 -0
  96. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1650.php +10 -0
  97. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1989.php +9 -0
  98. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/54.php +9 -0
  99. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/82.php +24 -0
  100. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/ko/82.php +23 -0
  101. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/timezone/PrefixTimeZonesMapTest.php +124 -0
  102. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/timezone/UKTest.php +33 -0
  103. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/timezone/data/map_data.php +18 -0
  104. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build.xml +221 -0
  105. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/build.php +7 -0
  106. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/data-patches/.gitkeep +0 -0
  107. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/data-patches/001-PHP7-PL.patch +13 -0
  108. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/BuildApplication.php +26 -0
  109. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/BuildMetadataFromXml.php +463 -0
  110. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/BuildMetadataPHPFromXml.php +124 -0
  111. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/Commands/BuildMetadataPHPFromXMLCommand.php +42 -0
  112. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/Commands/GeneratePhonePrefixDataCommand.php +39 -0
  113. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/Commands/GenerateTimeZonesMapDataCommand.php +30 -0
  114. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/GeneratePhonePrefixData.php +406 -0
  115. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/GenerateTimeZonesMapData.php +77 -0
  116. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/composer.json +54 -0
  117. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/libphonenumber-for-php.spec +45 -0
  118. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/phpunit.xml.dist +29 -0
  119. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/AlternateFormatsCountryCodeSet.php +59 -0
  120. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/CountryCodeSource.php +14 -0
  121. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/CountryCodeToRegionCodeMap.php +914 -0
  122. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/CountryCodeToRegionCodeMapForTesting.php +122 -0
  123. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/DefaultMetadataLoader.php +12 -0
  124. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MatchType.php +16 -0
  125. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/Matcher.php +161 -0
  126. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MatcherAPIInterface.php +36 -0
  127. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MetadataLoaderInterface.php +13 -0
  128. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MetadataSourceInterface.php +21 -0
  129. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MultiFileMetadataSourceImpl.php +109 -0
  130. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/NumberFormat.php +234 -0
  131. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/NumberParseException.php +49 -0
  132. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneMetadata.php +937 -0
  133. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumber.php +578 -0
  134. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberDesc.php +168 -0
  135. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberFormat.php +23 -0
  136. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberToCarrierMapper.php +135 -0
  137. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberToTimeZonesMapper.php +159 -0
  138. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberType.php +47 -0
  139. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberUtil.php +3118 -0
  140. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/RegexBasedMatcher.php +43 -0
  141. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/RegionCode.php +63 -0
  142. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ShortNumberCost.php +15 -0
  143. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ShortNumberInfo.php +626 -0
  144. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ShortNumberUtil.php +65 -0
  145. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ShortNumbersRegionCodeSet.php +254 -0
  146. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ValidationResult.php +14 -0
  147. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/Map.php +226 -0
  148. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/ar/965.php +11 -0
  149. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/be/375.php +20 -0
  150. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1242.php +11 -0
  151. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1246.php +28 -0
  152. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1264.php +18 -0
  153. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1441.php +14 -0
  154. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1473.php +15 -0
  155. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1649.php +13 -0
  156. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1671.php +15 -0
  157. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1684.php +16 -0
  158. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1758.php +22 -0
  159. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1767.php +26 -0
  160. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1784.php +31 -0
  161. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1787.php +210 -0
  162. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1809.php +71 -0
  163. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1868.php +15 -0
  164. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1869.php +12 -0
  165. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1876.php +16 -0
  166. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1939.php +67 -0
  167. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/20.php +11 -0
  168. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/211.php +12 -0
  169. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/212.php +99 -0
  170. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/213.php +14 -0
  171. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/216.php +18 -0
  172. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/220.php +13 -0
  173. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/221.php +14 -0
  174. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/222.php +11 -0
  175. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/223.php +9 -0
  176. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/224.php +13 -0
  177. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/225.php +42 -0
  178. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/226.php +28 -0
  179. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/227.php +20 -0
  180. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/228.php +10 -0
  181. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/229.php +20 -0
  182. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/230.php +55 -0
  183. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/231.php +16 -0
  184. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/232.php +25 -0
  185. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/233.php +22 -0
  186. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/234.php +240 -0
  187. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/235.php +10 -0
  188. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/236.php +12 -0
  189. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/237.php +22 -0
  190. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/238.php +14 -0
  191. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/239.php +11 -0
  192. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/240.php +11 -0
  193. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/241.php +29 -0
  194. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/242.php +13 -0
  195. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/243.php +17 -0
  196. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/244.php +13 -0
  197. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/245.php +12 -0
  198. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/248.php +12 -0
  199. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/249.php +14 -0
  200. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/250.php +9 -0
  201. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/251.php +9 -0
  202. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/252.php +27 -0
  203. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/253.php +11 -0
  204. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/254.php +37 -0
  205. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/255.php +21 -0
  206. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/256.php +20 -0
  207. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/257.php +19 -0
  208. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/258.php +12 -0
  209. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/260.php +11 -0
  210. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/261.php +12 -0
  211. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/263.php +12 -0
  212. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/265.php +10 -0
  213. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/267.php +48 -0
  214. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/268.php +9 -0
  215. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/27.php +59 -0
  216. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/297.php +23 -0
  217. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/298.php +12 -0
  218. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/299.php +11 -0
  219. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/30.php +14 -0
  220. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/31.php +59 -0
  221. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/32.php +29 -0
  222. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/33.php +66 -0
  223. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/350.php +13 -0
  224. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/351.php +20 -0
  225. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/352.php +16 -0
  226. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/353.php +14 -0
  227. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/354.php +47 -0
  228. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/355.php +12 -0
  229. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/356.php +21 -0
  230. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/357.php +14 -0
  231. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/358.php +38 -0
  232. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/359.php +13 -0
  233. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/36.php +11 -0
  234. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/370.php +44 -0
  235. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/372.php +24 -0
  236. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/373.php +33 -0
  237. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/374.php +20 -0
  238. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/375.php +20 -0
  239. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/376.php +9 -0
  240. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/380.php +20 -0
  241. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/381.php +17 -0
  242. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/385.php +16 -0
  243. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/386.php +17 -0
  244. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/387.php +14 -0
  245. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/389.php +17 -0
  246. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/39.php +17 -0
  247. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/40.php +15 -0
  248. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/41.php +12 -0
  249. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/420.php +26 -0
  250. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/421.php +30 -0
  251. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/43.php +20 -0
  252. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/45.php +593 -0
  253. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/47.php +233 -0
  254. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/48.php +112 -0
  255. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/49.php +41 -0
  256. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/501.php +10 -0
  257. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/505.php +93 -0
  258. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/506.php +43 -0
  259. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/507.php +75 -0
  260. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/509.php +18 -0
  261. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/51.php +578 -0
  262. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/53.php +9 -0
  263. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/54.php +92 -0
  264. app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/55.php +854 -0
app/code/local/Mocean/moceansms/Block/Adminhtml/Moceansms.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mocean_Moceansms_Block_Adminhtml_Moceansms extends Mage_Adminhtml_Block_Template
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_moceansms';
7
+ $this->setFormAction(Mage::getUrl('*/*/sendsms'));
8
+ $this->_headerText = Mage::helper('moceansms')->__('Send SMS');
9
+
10
+ }
11
+
12
+ }
app/code/local/Mocean/moceansms/Helper/Data.php ADDED
@@ -0,0 +1,285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mocean_Moceansms_Helper_Data extends Mage_Core_Helper_Data
4
+ {
5
+ const CONFIG_PATH = 'moceansms/';
6
+
7
+ public function isAdminEnabled()
8
+ {
9
+ return Mage::getStoreConfig(self::CONFIG_PATH.'admin/enabled');
10
+ }
11
+
12
+ public function isOrdersEnabled()
13
+ {
14
+ return Mage::getStoreConfig(self::CONFIG_PATH.'orders/enabled');
15
+ }
16
+
17
+ public function isOrderHoldEnabled()
18
+ {
19
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/enabled');
20
+ }
21
+
22
+ public function isOrderUnholdEnabled()
23
+ {
24
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/enabled');
25
+ }
26
+
27
+ public function isOrderCanceledEnabled()
28
+ {
29
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/enabled');
30
+ }
31
+
32
+ public function isShipmentsEnabled()
33
+ {
34
+ return Mage::getStoreConfig(self::CONFIG_PATH.'shipments/enabled');
35
+ }
36
+
37
+ public function getAPI()
38
+ {
39
+ return Mage::getStoreConfig(self::CONFIG_PATH.'general/api');
40
+ }
41
+
42
+ public function getAPIKey()
43
+ {
44
+ return Mage::getStoreConfig(self::CONFIG_PATH.'general/api_key');
45
+ }
46
+
47
+ public function getAPISecret()
48
+ {
49
+ return Mage::getStoreConfig(self::CONFIG_PATH.'general/api_secret');
50
+ }
51
+
52
+ public function getAdminMobile()
53
+ {
54
+ return Mage::getStoreConfig(self::CONFIG_PATH.'admin/admin_mobile');
55
+ }
56
+
57
+ public function getMoceanFrom()
58
+ {
59
+ return Mage::getStoreConfig(self::CONFIG_PATH.'general/mocean_from');
60
+ }
61
+
62
+ public function getMessageField()
63
+ {
64
+ return Mage::getStoreConfig(self::CONFIG_PATH.'general/message_field');
65
+ }
66
+
67
+ public function getToField()
68
+ {
69
+ return Mage::getStoreConfig(self::CONFIG_PATH.'general/to_field');
70
+ }
71
+
72
+ public function getSentMethod()
73
+ {
74
+ return Mage::getStoreConfig(self::CONFIG_PATH.'general/urlmethod');
75
+ }
76
+
77
+ public function getSender()
78
+ {
79
+ return Mage::getStoreConfig(self::CONFIG_PATH.'orders/sender');
80
+ }
81
+
82
+ public function getSenderForOrderHold()
83
+ {
84
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/sender');
85
+ }
86
+
87
+ public function getSenderForOrderUnhold()
88
+ {
89
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/sender');
90
+ }
91
+
92
+ public function getSenderForOrderCanceled()
93
+ {
94
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/sender');
95
+ }
96
+
97
+ public function getSenderForShipment()
98
+ {
99
+ return Mage::getStoreConfig(self::CONFIG_PATH.'shipments/sender');
100
+ }
101
+
102
+ public function getAdminMessage(Mage_Sales_Model_Order $order)
103
+ {
104
+
105
+ $store = Mage::app()->getStore();
106
+ $sitename = $store->getName();
107
+ $amount = $order->getGrandTotal() - $order->getShippingAmount();
108
+ $billingAddress = $order->getBillingAddress();
109
+ $whatArray = array('{{sitename}}','{{amount}}','{{order_id}}');
110
+ $withWhatArray = array($sitename,$amount,$order->getIncrementId());
111
+
112
+ return str_replace($whatArray,$withWhatArray,Mage::getStoreConfig(self::CONFIG_PATH.'admin/message'));
113
+ }
114
+
115
+ public function getMessage(Mage_Sales_Model_Order $order)
116
+ {
117
+ $billingAddress = $order->getBillingAddress();
118
+ $whatArray = array('{{firstname}}','{{order_id}}');
119
+ $withWhatArray = array($billingAddress->getFirstname(),$order->getIncrementId());
120
+
121
+ return str_replace($whatArray,$withWhatArray,Mage::getStoreConfig(self::CONFIG_PATH.'orders/message'));
122
+ }
123
+
124
+ public function getMessageForOrderHold(Mage_Sales_Model_Order $order)
125
+ {
126
+ $billingAddress = $order->getBillingAddress();
127
+ $whatArray = array('{{firstname}}','{{order_id}}');
128
+ $withWhatArray = array($billingAddress->getFirstname(),$order->getIncrementId());
129
+
130
+ return str_replace($whatArray,$withWhatArray,Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/message'));
131
+ }
132
+
133
+ public function getMessageForOrderUnhold(Mage_Sales_Model_Order $order)
134
+ {
135
+ $billingAddress = $order->getBillingAddress();
136
+ $whatArray = array('{{firstname}}','{{order_id}}');
137
+ $withWhatArray = array($billingAddress->getFirstname(),$order->getIncrementId());
138
+
139
+ return str_replace($whatArray,$withWhatArray,Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/message'));
140
+ }
141
+
142
+ public function getMessageForOrderCanceled(Mage_Sales_Model_Order $order)
143
+ {
144
+ $billingAddress = $order->getBillingAddress();
145
+ $whatArray = array('{{firstname}}','{{order_id}}');
146
+ $withWhatArray = array($billingAddress->getFirstname(),$order->getIncrementId());
147
+
148
+ return str_replace($whatArray,$withWhatArray,Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/message'));
149
+ }
150
+
151
+ public function getMessageForShipment(Mage_Sales_Model_Order $order)
152
+ {
153
+ $billingAddress = $order->getBillingAddress();
154
+ $whatArray = array('{{firstname}}','{{order_id}}');
155
+ $withWhatArray = array($billingAddress->getFirstname(),$order->getIncrementId());
156
+
157
+ return str_replace($whatArray,$withWhatArray,Mage::getStoreConfig(self::CONFIG_PATH.'shipments/message'));
158
+ }
159
+
160
+ public function getTelephoneFromOrder(Mage_Sales_Model_Order $order)
161
+ {
162
+ $billingAddress = $order->getBillingAddress();
163
+
164
+ $number = $billingAddress->getTelephone();
165
+ $number = preg_replace('#[^\+\d]#', '', trim($number));
166
+
167
+ if (substr($number, 0, 1) === '+') {
168
+ $number = substr($number, 1);
169
+ } elseif (substr($number, 0, 2) === '00') {
170
+ $number = substr($number, 2);
171
+ } else {
172
+ if (substr($number, 0, 1) === '0') {
173
+ $number = substr($number, 1);
174
+ }
175
+ $expectedPrefix = Zend_Locale_Data::getContent(Mage::app()->getLocale()->getLocale(), 'phonetoterritory', $billingAddress->getCountry());
176
+ if (!empty($expectedPrefix)) {
177
+ $prefix = substr($number, 0, strlen($expectedPrefix));
178
+ if ($prefix !== $expectedPrefix) {
179
+ $number = $expectedPrefix . $number;
180
+ }
181
+ }
182
+ }
183
+ $number = preg_replace('#[^\d]#', '', trim($number));
184
+
185
+ return $number;
186
+ }
187
+
188
+ public function filterPrefixNumber($number, $order)
189
+ {
190
+ $billingAddress = $order->getBillingAddress();
191
+
192
+ $number = preg_replace('#[^\+\d]#', '', trim($number));
193
+
194
+ if (substr($number, 0, 1) === '+') {
195
+ $number = substr($number, 1);
196
+ } elseif (substr($number, 0, 2) === '00') {
197
+ $number = substr($number, 2);
198
+ } else {
199
+ if (substr($number, 0, 1) === '0') {
200
+ $number = substr($number, 1);
201
+ }
202
+ $expectedPrefix = Zend_Locale_Data::getContent(Mage::app()->getLocale()->getLocale(), 'phonetoterritory', $billingAddress->getCountry());
203
+ if (!empty($expectedPrefix)) {
204
+ $prefix = substr($number, 0, strlen($expectedPrefix));
205
+ if ($prefix !== $expectedPrefix) {
206
+ $number = $expectedPrefix . $number;
207
+ }
208
+ }
209
+ }
210
+ $number = preg_replace('#[^\d]#', '', trim($number));
211
+
212
+ return $number;
213
+ }
214
+
215
+ public function getCountry(Mage_Sales_Model_Order $order){
216
+ $billingAddress = $order->getBillingAddress();
217
+ return $billingAddress->getCountry();
218
+ }
219
+
220
+ public function isOrdersNotify()
221
+ {
222
+ return Mage::getStoreConfig(self::CONFIG_PATH.'orders/notify');
223
+ }
224
+
225
+ public function getAdminTelephone()
226
+ {
227
+ return Mage::getStoreConfig(self::CONFIG_PATH.'orders/receiver');
228
+ }
229
+
230
+ public function sendSms($url,$data=NULL)
231
+ {
232
+
233
+ try
234
+ { if($data!='')
235
+ {
236
+
237
+ $sendSms = $this->file_get_contents_curl_POST($url,$data);
238
+ }
239
+ else
240
+ {
241
+
242
+ $sendSms = $this->file_get_contents_curl($url);
243
+ }
244
+
245
+ }
246
+ catch(Exception $e)
247
+ {
248
+ $sendSms = '';
249
+ }
250
+ if($sendSms)
251
+ {
252
+ return true;
253
+ }
254
+ else
255
+ {
256
+ return false;
257
+ }
258
+
259
+ }
260
+
261
+ public function file_get_contents_curl($url)
262
+ {
263
+ $ch = curl_init();
264
+ curl_setopt($ch, CURLOPT_URL, $url);
265
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
266
+ $res = curl_exec($ch);
267
+ curl_close($ch);
268
+ return $res;
269
+ }
270
+
271
+ public function file_get_contents_curl_POST($url,$data)
272
+ {
273
+ $ch = curl_init();
274
+ curl_setopt($ch,CURLOPT_URL, $url);
275
+ curl_setopt($ch,CURLOPT_VERBOSE,1);
276
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // required as godaddy fails
277
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // required as godaddy fails
278
+ curl_setopt($ch,CURLOPT_POSTFIELDS, $data);
279
+ curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
280
+ $result = curl_exec($ch);
281
+ curl_close($ch);
282
+ return $result;
283
+ }
284
+
285
+ }
app/code/local/Mocean/moceansms/Model/Dropdown/Values.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Mocean_Moceansms_Model_Dropdown_Values
3
+ {
4
+ public function toOptionArray()
5
+ {
6
+ return array(
7
+ array(
8
+ 'value' => '0',
9
+ 'label' => 'POST',
10
+ ),
11
+ array(
12
+ 'value' => '1',
13
+ 'label' => 'GET',
14
+ ),
15
+ );
16
+ }
17
+ }
app/code/local/Mocean/moceansms/Model/Observer.php ADDED
@@ -0,0 +1,425 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once dirname(dirname(__FILE__)). '/vendor/autoload.php';
3
+ class Mocean_moceansms_Model_Observer
4
+ {
5
+ public function sendSmsOnOrderCreated(Varien_Event_Observer $observer)
6
+ {
7
+ if($this->getHelper()->isOrdersEnabled())
8
+ {
9
+ $orders = $observer->getEvent()->getOrderIds();
10
+
11
+ if(!empty($orders))
12
+ {
13
+ $order = Mage::getModel('sales/order')->load($orders['0']);
14
+ $order_inc_id = $order->getIncrementId();
15
+ if ($order instanceof Mage_Sales_Model_Order)
16
+ {
17
+ $api_url = "https://rest-api.moceansms.com/rest/1/sms";
18
+ $key = $this->getHelper()->getAPIKey();
19
+ $secret = $this->getHelper()->getAPISecret();
20
+ $from = $this->getHelper()->getMoceanFrom();
21
+ if(is_numeric($from)){
22
+ if(strlen($from) > 20){
23
+ $from = "SMS";
24
+ }
25
+ }
26
+ else{
27
+ if(strlen($from) > 11){
28
+ $from = "SMS";
29
+ }
30
+ }
31
+ $adminNo = urlencode($this->getHelper()->filterPrefixNumber($this->getHelper()->getAdminMobile(), $order));
32
+
33
+ $sent_method = $this->getHelper()->getSentMethod();
34
+ $smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
35
+ $phoneNumberUtil = \libphonenumber\PhoneNumberUtil::getInstance();
36
+ $phoneNumber = $phoneNumberUtil->parse($smsto, $this->getHelper()->getCountry($order));
37
+ if($phoneNumberUtil->isValidNumber($phoneNumber) && $phoneNumberUtil->getNumberType($phoneNumber) == 1) {
38
+ $smsto = $phoneNumberUtil->format($phoneNumber, \libphonenumber\PhoneNumberFormat::E164);
39
+ $smsto = str_replace("+","",$customer_phone_no);
40
+ }
41
+ else{
42
+ $error_message = "Error: Invalid Number! (".$smsto.")";
43
+ $smsto = '';
44
+ }
45
+
46
+ $smsmsg = urlencode($this->getHelper()->getMessage($order));
47
+ Mage::log("Order placed!",null,'moceansms.log');
48
+ /*handling error*/
49
+ $flag = 1;
50
+
51
+ if($key=='' || $secret=='')
52
+ {
53
+ $flag = 0;
54
+ $error_message = "Error: Send SMS - Not able to send SMS. Make sure that your provided correct Mocean Key and Secret.";
55
+ }
56
+
57
+ if($flag==1 && $smsto!='')
58
+ {
59
+
60
+ $method = 'POST';
61
+ $post_data = '';
62
+ $post_data .= 'mocean-api-key=' . $key;
63
+ $post_data .= '&mocean-api-secret=' . $secret;
64
+ $post_data .= '&mocean-from=' . $from;
65
+ $post_data .= '&mocean-text=' . $smsmsg;
66
+ $post_data .= '&mocean-to=' . $smsto;
67
+ $url = $api_url;
68
+ //$sendSms = $this->getHelper()->sendSms($url,$post_data);
69
+ Mage::log("response: ".$sendSms,null,'moceansms.log');
70
+ if($this->getHelper()->isAdminEnabled() && $adminNo != ''){
71
+
72
+ $smsmsg = urlencode($this->getHelper()->getAdminMessage($order));
73
+
74
+ $post_data = '';
75
+ $post_data .= 'mocean-api-key=' . $key;
76
+ $post_data .= '&mocean-api-secret=' . $secret;
77
+ $post_data .= '&mocean-from=' . $from;
78
+ $post_data .= '&mocean-text=' . $smsmsg;
79
+ $post_data .= '&mocean-to=' . $adminNo;
80
+ $url = $api_url;
81
+ //$sendSms = $this->getHelper()->sendSms($url,$post_data);
82
+ Mage::log("response: ".$sendSms,null,'moceansms.log');
83
+ }
84
+
85
+ Mage::log($sendSms,null,'moceansms.log');
86
+ Mage::log($post_data,null,'moceansms.log');
87
+
88
+ }
89
+ else
90
+ {
91
+ Mage::log($error_message,null,'moceansms.log');
92
+ }
93
+ }
94
+ } // end empty
95
+ else
96
+ {
97
+ Mage::log("Error: order create - $order_inc_id - Not able to call observer. ",null,'moceansms.log');
98
+ }
99
+ }
100
+ }
101
+
102
+ public function sendSmsOnOrderHold(Varien_Event_Observer $observer)
103
+ {
104
+ if($this->getHelper()->isOrderHoldEnabled())
105
+ {
106
+ $order = $observer->getOrder();
107
+ if ($order instanceof Mage_Sales_Model_Order)
108
+ {
109
+
110
+ if ($order->getState() !== $order->getOrigData('state') && $order->getState() === Mage_Sales_Model_Order::STATE_HOLDED)
111
+ {
112
+ $order_inc_id = $order->getIncrementId();
113
+ $api_url = "https://rest-api.moceansms.com/rest/1/sms";
114
+ $key = $this->getHelper()->getAPIKey();
115
+ $secret = $this->getHelper()->getAPISecret();
116
+ $from = $this->getHelper()->getMoceanFrom();
117
+ if(is_numeric($from)){
118
+ if(strlen($from) > 20){
119
+ $from = "SMS";
120
+ }
121
+ }
122
+ else{
123
+ if(strlen($from) > 11){
124
+ $from = "SMS";
125
+ }
126
+ }
127
+ $sent_method = $this->getHelper()->getSentMethod();
128
+ $smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
129
+ $phoneNumberUtil = \libphonenumber\PhoneNumberUtil::getInstance();
130
+ $phoneNumber = $phoneNumberUtil->parse($smsto, $this->getHelper()->getCountry($order));
131
+ if($phoneNumberUtil->isValidNumber($phoneNumber) && $phoneNumberUtil->getNumberType($phoneNumber) == 1) {
132
+ $smsto = $phoneNumberUtil->format($phoneNumber, \libphonenumber\PhoneNumberFormat::E164);
133
+ $smsto = str_replace("+","",$customer_phone_no);
134
+ }
135
+ else{
136
+ $error_message = "Error: Invalid Number! (".$smsto.")";
137
+ $smsto = '';
138
+ }
139
+ $smsmsg = urlencode($this->getHelper()->getMessage($order));
140
+ Mage::log("Order placed!",null,'moceansms.log');
141
+ /*handling error*/
142
+ $flag = 1;
143
+
144
+ if($key=='' || $secret=='')
145
+ {
146
+ $flag = 0;
147
+ $error_message = "Error: Send SMS - Not able to send SMS. Make sure that your provided correct Mocean Key and Secret.";
148
+ }
149
+
150
+ if($flag==1 && $smsto!='')
151
+ {
152
+
153
+ $method = 'POST';
154
+ $post_data = '';
155
+ $post_data .= 'mocean-api-key=' . $key;
156
+ $post_data .= '&mocean-api-secret=' . $secret;
157
+ $post_data .= '&mocean-from=' . $from;
158
+ $post_data .= '&mocean-text=' . $smsmsg;
159
+ $post_data .= '&mocean-to=' . $smsto;
160
+ $url = $api_url;
161
+ $sendSms = $this->getHelper()->sendSms($url,$post_data);
162
+
163
+ Mage::log($sendSms,null,'moceansms.log');
164
+ Mage::log($post_data,null,'moceansms.log');
165
+
166
+ }
167
+ else
168
+ {
169
+ Mage::log($error_message,null,'moceansms.log');
170
+ }
171
+ Mage::log("fin",null,'moceansms.log');
172
+ }
173
+ } // end state
174
+ else
175
+ {
176
+ Mage::log("Error: order hold - $order_inc_id - Not able to call observer.",null,'moceansms.log');
177
+ }
178
+
179
+ }
180
+ }
181
+
182
+ public function sendSmsOnOrderUnhold(Varien_Event_Observer $observer)
183
+ {
184
+ if($this->getHelper()->isOrderUnholdEnabled())
185
+ {
186
+ $order = $observer->getOrder();
187
+ if ($order instanceof Mage_Sales_Model_Order)
188
+ {
189
+
190
+ if ($order->getState() !== $order->getOrigData('state') && $order->getOrigData('state') === Mage_Sales_Model_Order::STATE_HOLDED)
191
+ {
192
+ $order_inc_id = $order->getIncrementId();
193
+ $api_url = "https://rest-api.moceansms.com/rest/1/sms";
194
+ $key = $this->getHelper()->getAPIKey();
195
+ $secret = $this->getHelper()->getAPISecret();
196
+ $from = $this->getHelper()->getMoceanFrom();
197
+ if(is_numeric($from)){
198
+ if(strlen($from) > 20){
199
+ $from = "SMS";
200
+ }
201
+ }
202
+ else{
203
+ if(strlen($from) > 11){
204
+ $from = "SMS";
205
+ }
206
+ }
207
+ $sent_method = $this->getHelper()->getSentMethod();
208
+ $smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
209
+ $phoneNumberUtil = \libphonenumber\PhoneNumberUtil::getInstance();
210
+ $phoneNumber = $phoneNumberUtil->parse($smsto, $this->getHelper()->getCountry($order));
211
+ if($phoneNumberUtil->isValidNumber($phoneNumber) && $phoneNumberUtil->getNumberType($phoneNumber) == 1) {
212
+ $smsto = $phoneNumberUtil->format($phoneNumber, \libphonenumber\PhoneNumberFormat::E164);
213
+ $smsto = str_replace("+","",$customer_phone_no);
214
+ }
215
+ else{
216
+ $error_message = "Error: Invalid Number! (".$smsto.")";
217
+ $smsto = '';
218
+ }
219
+ $smsmsg = urlencode($this->getHelper()->getMessage($order));
220
+ Mage::log("Order placed!",null,'moceansms.log');
221
+ /*handling error*/
222
+ $flag = 1;
223
+
224
+ if($key=='' || $secret=='')
225
+ {
226
+ $flag = 0;
227
+ $error_message = "Error: Send SMS - Not able to send SMS. Make sure that your provided correct Mocean Key and Secret.";
228
+ }
229
+
230
+ if($flag==1 && $smsto!='')
231
+ {
232
+
233
+ $method = 'POST';
234
+ $post_data = '';
235
+ $post_data .= 'mocean-api-key=' . $key;
236
+ $post_data .= '&mocean-api-secret=' . $secret;
237
+ $post_data .= '&mocean-from=' . $from;
238
+ $post_data .= '&mocean-text=' . $smsmsg;
239
+ $post_data .= '&mocean-to=' . $smsto;
240
+ $url = $api_url;
241
+ $sendSms = $this->getHelper()->sendSms($url,$post_data);
242
+
243
+ Mage::log($sendSms,null,'moceansms.log');
244
+ Mage::log($post_data,null,'moceansms.log');
245
+
246
+ }
247
+ else
248
+ {
249
+ Mage::log($error_message,null,'moceansms.log');
250
+ }
251
+ Mage::log("fin",null,'moceansms.log');
252
+ }
253
+ } // end state
254
+ else
255
+ {
256
+ Mage::log("Error: order unhold - $order_inc_id - Not able to call observer.",null,'moceansms.log');
257
+ }
258
+
259
+ }
260
+ }
261
+
262
+ public function sendSmsOnOrderCanceled(Varien_Event_Observer $observer)
263
+ {
264
+ if($this->getHelper()->isOrderCanceledEnabled())
265
+ {
266
+ $order = $observer->getOrder();
267
+ if ($order instanceof Mage_Sales_Model_Order)
268
+ {
269
+ if ($order->getState() !== $order->getOrigData('state') && $order->getState() === Mage_Sales_Model_Order::STATE_CANCELED)
270
+ {
271
+ $order_inc_id = $order->getIncrementId();
272
+ $api_url = "https://rest-api.moceansms.com/rest/1/sms";
273
+ $key = $this->getHelper()->getAPIKey();
274
+ $secret = $this->getHelper()->getAPISecret();
275
+ $from = $this->getHelper()->getMoceanFrom();
276
+ if(is_numeric($from)){
277
+ if(strlen($from) > 20){
278
+ $from = "SMS";
279
+ }
280
+ }
281
+ else{
282
+ if(strlen($from) > 11){
283
+ $from = "SMS";
284
+ }
285
+ }
286
+ $sent_method = $this->getHelper()->getSentMethod();
287
+ $smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
288
+ $phoneNumberUtil = \libphonenumber\PhoneNumberUtil::getInstance();
289
+ $phoneNumber = $phoneNumberUtil->parse($smsto, $this->getHelper()->getCountry($order));
290
+ if($phoneNumberUtil->isValidNumber($phoneNumber) && $phoneNumberUtil->getNumberType($phoneNumber) == 1) {
291
+ $smsto = $phoneNumberUtil->format($phoneNumber, \libphonenumber\PhoneNumberFormat::E164);
292
+ $smsto = str_replace("+","",$customer_phone_no);
293
+ }
294
+ else{
295
+ $error_message = "Error: Invalid Number! (".$smsto.")";
296
+ $smsto = '';
297
+ }
298
+ $smsmsg = urlencode($this->getHelper()->getMessage($order));
299
+ Mage::log("Order placed!",null,'moceansms.log');
300
+ /*handling error*/
301
+ $flag = 1;
302
+
303
+ if($key=='' || $secret=='')
304
+ {
305
+ $flag = 0;
306
+ $error_message = "Error: Send SMS - Not able to send SMS. Make sure that your provided correct Mocean Key and Secret.";
307
+ }
308
+
309
+ if($flag==1 && $smsto!='')
310
+ {
311
+
312
+ $method = 'POST';
313
+ $post_data = '';
314
+ $post_data .= 'mocean-api-key=' . $key;
315
+ $post_data .= '&mocean-api-secret=' . $secret;
316
+ $post_data .= '&mocean-from=' . $from;
317
+ $post_data .= '&mocean-text=' . $smsmsg;
318
+ $post_data .= '&mocean-to=' . $smsto;
319
+ $url = $api_url;
320
+ $sendSms = $this->getHelper()->sendSms($url,$post_data);
321
+
322
+ Mage::log($sendSms,null,'moceansms.log');
323
+ Mage::log($post_data,null,'moceansms.log');
324
+
325
+ }
326
+ else
327
+ {
328
+ Mage::log($error_message,null,'moceansms.log');
329
+ }
330
+ Mage::log("fin",null,'moceansms.log');
331
+ }
332
+ } // end state
333
+ else
334
+ {
335
+ Mage::log("Error: order cancel - $order_inc_id - Not able to call observer.",null,'moceansms.log');
336
+ }
337
+
338
+ }
339
+ }
340
+
341
+ public function sendSmsOnShipmentCreated(Varien_Event_Observer $observer)
342
+ {
343
+ if($this->getHelper()->isShipmentsEnabled())
344
+ {
345
+ Mage::log("ITEM SIHIPPED.",null,'moceansms.log');
346
+ $shipment = $observer->getEvent()->getShipment();
347
+ $order = $shipment->getOrder();
348
+
349
+ if ($order instanceof Mage_Sales_Model_Order)
350
+ {
351
+ $order_inc_id = $order->getIncrementId();
352
+ $api_url = "https://rest-api.moceansms.com/rest/1/sms";
353
+ $key = $this->getHelper()->getAPIKey();
354
+ $secret = $this->getHelper()->getAPISecret();
355
+ $from = $this->getHelper()->getMoceanFrom();
356
+ if(is_numeric($from)){
357
+ if(strlen($from) > 20){
358
+ $from = "SMS";
359
+ }
360
+ }
361
+ else{
362
+ if(strlen($from) > 11){
363
+ $from = "SMS";
364
+ }
365
+ }
366
+ $sent_method = $this->getHelper()->getSentMethod();
367
+ $smsto = urlencode($this->getHelper()->getTelephoneFromOrder($order));
368
+ $phoneNumberUtil = \libphonenumber\PhoneNumberUtil::getInstance();
369
+ $phoneNumber = $phoneNumberUtil->parse($smsto, $this->getHelper()->getCountry($order));
370
+ if($phoneNumberUtil->isValidNumber($phoneNumber) && $phoneNumberUtil->getNumberType($phoneNumber) == 1) {
371
+ $smsto = $phoneNumberUtil->format($phoneNumber, \libphonenumber\PhoneNumberFormat::E164);
372
+ $smsto = str_replace("+","",$customer_phone_no);
373
+ }
374
+ else{
375
+ $error_message = "Error: Invalid Number! (".$smsto.")";
376
+ $smsto = '';
377
+ }
378
+ $smsmsg = urlencode($this->getHelper()->getMessage($order));
379
+ Mage::log("Order placed!",null,'moceansms.log');
380
+ /*handling error*/
381
+ $flag = 1;
382
+
383
+ if($key=='' || $secret=='')
384
+ {
385
+ $flag = 0;
386
+ $error_message = "Error: Send SMS - Not able to send SMS. Make sure that your provided correct Mocean Key and Secret.";
387
+ }
388
+
389
+ if($flag==1 && $smsto!='')
390
+ {
391
+
392
+ $method = 'POST';
393
+ $post_data = '';
394
+ $post_data .= 'mocean-api-key=' . $key;
395
+ $post_data .= '&mocean-api-secret=' . $secret;
396
+ $post_data .= '&mocean-from=' . $from;
397
+ $post_data .= '&mocean-text=' . $smsmsg;
398
+ $post_data .= '&mocean-to=' . $smsto;
399
+ $url = $api_url;
400
+ $sendSms = $this->getHelper()->sendSms($url,$post_data);
401
+
402
+ Mage::log($sendSms,null,'moceansms.log');
403
+ Mage::log($post_data,null,'moceansms.log');
404
+
405
+ }
406
+ else
407
+ {
408
+ Mage::log($error_message,null,'moceansms.log');
409
+ }
410
+ Mage::log("fin",null,'moceansms.log');
411
+
412
+ } // end state
413
+ else
414
+ {
415
+ Mage::log("Error: order shipment - $order_inc_id - Not able to call observer.",null,'moceansms.log');
416
+ }
417
+
418
+ }
419
+ }
420
+
421
+ public function getHelper()
422
+ {
423
+ return Mage::helper('moceansms/Data');
424
+ }
425
+ }
app/code/local/Mocean/moceansms/composer.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ {
2
+ "require": {
3
+ "giggsey/libphonenumber-for-php": "^7.2"
4
+ }
5
+ }
app/code/local/Mocean/moceansms/composer.lock ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_readme": [
3
+ "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
+ "This file is @generated automatically"
6
+ ],
7
+ "hash": "cc9b73c65415d7b1f53bb2a933ce3a2f",
8
+ "content-hash": "e4c93e339fb4522aedf51496bb0ac989",
9
+ "packages": [
10
+ {
11
+ "name": "giggsey/libphonenumber-for-php",
12
+ "version": "7.2.2",
13
+ "source": {
14
+ "type": "git",
15
+ "url": "https://github.com/giggsey/libphonenumber-for-php.git",
16
+ "reference": "8b64ea2ecd4080f9ce75cf688dda0c4afedb6b64"
17
+ },
18
+ "dist": {
19
+ "type": "zip",
20
+ "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/8b64ea2ecd4080f9ce75cf688dda0c4afedb6b64",
21
+ "reference": "8b64ea2ecd4080f9ce75cf688dda0c4afedb6b64",
22
+ "shasum": ""
23
+ },
24
+ "require": {
25
+ "ext-mbstring": "*"
26
+ },
27
+ "require-dev": {
28
+ "pear/pear-core-minimal": "^1.9",
29
+ "pear/pear_exception": "*",
30
+ "pear/versioncontrol_git": "dev-master",
31
+ "phing/phing": "~2.7",
32
+ "phpunit/phpunit": "~4.0",
33
+ "satooshi/php-coveralls": "~0.6",
34
+ "symfony/console": "~2.4"
35
+ },
36
+ "suggest": {
37
+ "ext-intl": "To use the geocoder and carrier mapping"
38
+ },
39
+ "type": "library",
40
+ "extra": {
41
+ "branch-alias": {
42
+ "dev-master": "7.x-dev"
43
+ }
44
+ },
45
+ "autoload": {
46
+ "psr-0": {
47
+ "libphonenumber": "src/"
48
+ }
49
+ },
50
+ "notification-url": "https://packagist.org/downloads/",
51
+ "license": [
52
+ "Apache-2.0"
53
+ ],
54
+ "authors": [
55
+ {
56
+ "name": "Joshua Gigg",
57
+ "email": "giggsey@gmail.com",
58
+ "homepage": "http://giggsey.com/"
59
+ }
60
+ ],
61
+ "description": "PHP Port of Google's libphonenumber",
62
+ "homepage": "https://github.com/giggsey/libphonenumber-for-php",
63
+ "keywords": [
64
+ "geocoding",
65
+ "geolocation",
66
+ "libphonenumber",
67
+ "mobile",
68
+ "phonenumber",
69
+ "validation"
70
+ ],
71
+ "time": "2015-12-15 17:24:20"
72
+ }
73
+ ],
74
+ "packages-dev": [],
75
+ "aliases": [],
76
+ "minimum-stability": "stable",
77
+ "stability-flags": [],
78
+ "prefer-stable": false,
79
+ "prefer-lowest": false,
80
+ "platform": [],
81
+ "platform-dev": []
82
+ }
app/code/local/Mocean/moceansms/composer.phar ADDED
Binary file
app/code/local/Mocean/moceansms/controllers/Adminhtml/MoceansmsController.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Mocean_Moceansms_Adminhtml_MoceansmsController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ protected function _initAction() {
7
+ $this->loadLayout()
8
+ ->_setActiveMenu('customer/customer')
9
+ ->_addBreadcrumb(Mage::helper('moceansms')->__('Items Manager'), Mage::helper('moceansms')->__('Item Manager'));
10
+
11
+ return $this;
12
+ }
13
+
14
+ public function indexAction() {
15
+
16
+ $this->_initAction();
17
+ $this->loadLayout()
18
+ ->_setActiveMenu('customer/customer')
19
+ ->renderLayout();
20
+ }
21
+
22
+ public function sendsmsAction()
23
+ {
24
+ extract($_POST);
25
+ if(isset($_POST)){
26
+ $phone_array = explode(',',$phone_numbers);
27
+ //Gateway credentials
28
+
29
+ //$api_url = Mage::helper('moceansms')->getAPI();
30
+ $api_url = "https://rest-api.moceansms.com/rest/1/sms";
31
+ $key = Mage::helper('moceansms')->getAPIKey();
32
+ $secret = Mage::helper('moceansms')->getAPISecret();
33
+ $from = 'donald';
34
+
35
+ /*handling error*/
36
+ $flag = 1;
37
+ $error_message = "Error: Send SMS - Not able to send SMS. Make sure that your provided correct Mocean Key and Secret.";
38
+ if($key=='' || $secret=='')
39
+ {
40
+ $flag = 0;
41
+ }
42
+
43
+ /*check balance*/
44
+ $data = '';
45
+ $data .= 'mocean-api-key=' . $key;
46
+ $data .= '&mocean-api-secret=' . $secret;
47
+
48
+ $method = 'GET';
49
+ $url = 'https://rest-api.moceansms.com/rest/1/account/balance?'.$data;
50
+ $checkBal = Mage::helper('moceansms')->sendSms($url);
51
+ Mage::log('bal='.$checkBal,null,'moceansms.log');
52
+
53
+
54
+ if($flag==1)
55
+ {
56
+ for($i=0;$i<count($phone_array);$i++)
57
+ {
58
+ if($phone_array[$i]!='')
59
+ {
60
+
61
+ $post_data = '';
62
+ $post_data .= 'mocean-api-key=' . $key;
63
+ $post_data .= '&mocean-api-secret=' . $secret;
64
+ $post_data .= '&mocean-from=' . $from;
65
+ $post_data .= '&mocean-text=' . $message;
66
+ $post_data .= '&mocean-to=' . $phone_array[$i];
67
+
68
+ $url = $api_url;
69
+ $sendSms = Mage::helper('moceansms')->sendSms($url,$post_data);
70
+
71
+ }
72
+ }
73
+ Mage::getSingleton('core/session')->setSmsstatus('success');
74
+ Mage::getSingleton('core/session')->setSmsmsg('Message sent successfully.');
75
+ $this->_redirect('*/*/');
76
+ }
77
+ else
78
+ {
79
+ Mage::log($error_message,null,'moceansms.log');
80
+ }
81
+ }
82
+ else
83
+ {
84
+ Mage::getSingleton('core/session')->setSmsstatus('error');
85
+ Mage::getSingleton('core/session')->setSmsmsg('Unable to send SMS.');
86
+ $this->_redirect('*/*/');
87
+ }
88
+
89
+ $this->loadLayout();
90
+ $this->renderLayout();
91
+ }
92
+ }
app/code/local/Mocean/moceansms/etc/adminhtml.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <all>
6
+ <title>Allow Everything</title>
7
+ </all>
8
+ <admin>
9
+ <children>
10
+ <!-- acl for menu -->
11
+ <customer>
12
+ <children>
13
+ <moceansms translate="title" module="moceansms">
14
+ <title>Send SMS</title>
15
+ <sort_order>200</sort_order>
16
+ </moceansms>
17
+ </children>
18
+ </customer>
19
+ <!-- acl for configuration -->
20
+ <system>
21
+ <children>
22
+ <config>
23
+ <children>
24
+ <moceansms translate="title">
25
+ <title>SMS</title>
26
+ <sort_order>100</sort_order>
27
+ </moceansms>
28
+ </children>
29
+ </config>
30
+ </children>
31
+ </system>
32
+ </children>
33
+ </admin>
34
+ </resources>
35
+ </acl>
36
+ </config>
app/code/local/Mocean/moceansms/etc/config.xml ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category SMS
5
+ * @package Mocean_Moceansms
6
+ * @author Mocean
7
+ */
8
+ -->
9
+ <config>
10
+ <modules>
11
+ <Mocean_Moceansms>
12
+ <version>0.1.5</version>
13
+ </Mocean_Moceansms>
14
+ </modules>
15
+
16
+
17
+ <admin>
18
+ <routers>
19
+ <moceansms>
20
+ <use>admin</use>
21
+ <args>
22
+ <module>Mocean_Moceansms</module>
23
+ <frontName>moceansms</frontName>
24
+ </args>
25
+ </moceansms>
26
+ </routers>
27
+ </admin>
28
+
29
+
30
+ <adminhtml>
31
+ <menu>
32
+ <customer>
33
+ <children>
34
+ <moceansms module="moceansms">
35
+ <title>Send SMS</title>
36
+ <sort_order>200</sort_order>
37
+ <action>moceansms/adminhtml_moceansms/index</action>
38
+ </moceansms>
39
+ </children>
40
+ </customer>
41
+ </menu>
42
+
43
+ <layout>
44
+ <updates>
45
+ <moceansms>
46
+ <file>moceansms.xml</file>
47
+ </moceansms>
48
+ </updates>
49
+ </layout>
50
+ </adminhtml>
51
+
52
+
53
+ <global>
54
+ <blocks>
55
+ <moceansms>
56
+ <class>Mocean_moceansms_Block</class>
57
+ </moceansms>
58
+ </blocks>
59
+
60
+ <models>
61
+ <moceansms>
62
+ <class>Mocean_moceansms_Model</class>
63
+ </moceansms>
64
+ </models>
65
+
66
+
67
+ <helpers>
68
+ <moceansms>
69
+ <class>Mocean_moceansms_Helper</class>
70
+ </moceansms>
71
+ </helpers>
72
+
73
+ <events>
74
+ <checkout_onepage_controller_success_action>
75
+ <observers>
76
+ <Mocean_moceansms_Created>
77
+ <type>singleton</type>
78
+ <class>Mocean_moceansms_Model_Observer</class>
79
+ <method>sendSmsOnOrderCreated</method>
80
+ </Mocean_moceansms_Created>
81
+ </observers>
82
+ </checkout_onepage_controller_success_action>
83
+ <sales_order_save_after>
84
+ <observers>
85
+ <Mocean_moceansms_Order_Hold>
86
+ <type>singleton</type>
87
+ <class>Mocean_moceansms_Model_Observer</class>
88
+ <method>sendSmsOnOrderHold</method>
89
+ </Mocean_moceansms_Order_Hold>
90
+ <Mocean_moceansms_Order_Unhold>
91
+ <type>singleton</type>
92
+ <class>Mocean_moceansms_Model_Observer</class>
93
+ <method>sendSmsOnOrderUnhold</method>
94
+ </Mocean_moceansms_Order_Unhold>
95
+ <Mocean_moceansms_Order_Canceled>
96
+ <type>singleton</type>
97
+ <class>Mocean_moceansms_Model_Observer</class>
98
+ <method>sendSmsOnOrderCanceled</method>
99
+ </Mocean_moceansms_Order_Canceled>
100
+ </observers>
101
+ </sales_order_save_after>
102
+ <sales_order_shipment_save_after>
103
+ <observers>
104
+ <Mocean_moceansms_Shipment_Created>
105
+ <type>singleton</type>
106
+ <class>Mocean_moceansms_Model_Observer</class>
107
+ <method>sendSmsOnShipmentCreated</method>
108
+ </Mocean_moceansms_Shipment_Created>
109
+ </observers>
110
+ </sales_order_shipment_save_after>
111
+ </events>
112
+ </global>
113
+
114
+
115
+ <default>
116
+ <moceansms>
117
+ <general>
118
+ <weburl>your-mocean-key</weburl>
119
+ <api_key>your-mocean-key</api_key>
120
+ <api_secret>your-mocean-secret</api_secret>
121
+ <mocean_from>Admin</mocean_from>
122
+ </general>
123
+ <admin>
124
+ <enabled>0</enabled>
125
+ <admin_mobile>60123456789</admin_mobile>
126
+ <message>{{sitename}}: New order were made. Order no. {{order_id}} Total amount: {{amount}}</message>
127
+ </admin>
128
+ <orders>
129
+ <enabled>0</enabled>
130
+ <sender>Magento</sender>
131
+ <message>Dear {{firstname}}, Your order has been received. Order no. {{order_id}}. Thank you for your purchase!</message>
132
+ <notify>0</notify>
133
+ </orders>
134
+ <order_hold>
135
+ <enabled>0</enabled>
136
+ <sender>Magento</sender>
137
+ <message>Dear {{firstname}}, Your order {{order_id}} has been placed on hold.</message>
138
+ </order_hold>
139
+ <order_unhold>
140
+ <enabled>0</enabled>
141
+ <sender>Magento</sender>
142
+ <message>Dear {{firstname}}, Your order {{order_id}} has been released for delivery.</message>
143
+ </order_unhold>
144
+ <order_canceled>
145
+ <enabled>0</enabled>
146
+ <sender>Magento</sender>
147
+ <message>Dear {{firstname}}, Your order {{order_id}} has been canceled.</message>
148
+ </order_canceled>
149
+ <shipments>
150
+ <enabled>0</enabled>
151
+ <sender>Magento</sender>
152
+ <message>Dear {{firstname}}. Your order ({{order_id}}) has been shipped. Thank you for buying from us!</message>
153
+ </shipments>
154
+ </moceansms>
155
+ </default>
156
+ </config>
app/code/local/Mocean/moceansms/etc/system.xml ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <Mocean_extensions translate="label" module="moceansms">
5
+ <label>Mocean Extensions</label>
6
+ <sort_order>0</sort_order>
7
+ </Mocean_extensions>
8
+ </tabs>
9
+ <sections>
10
+ <moceansms translate="label" module="moceansms">
11
+ <label>Sms Notifications</label>
12
+ <comment>Your mocean key here you can find it from your mocean profile.</comment>
13
+ <tab>Mocean_extensions</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>200</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <general translate="label">
21
+ <label>Mocean setting</label>
22
+ <frontend_type>text</frontend_type>
23
+ <comment><![CDATA[Website URL: <a href="http://dev.moceansms.com/register?fr=mg" target="_blank">Register an account</a>]]></comment>
24
+ <sort_order>10</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ <fields>
29
+
30
+ <!--<api translate="label">
31
+ <label>SMS Gateway API URL</label>
32
+ <comment>Include all parameters in the API except message and customer phone number parameters.</comment>
33
+ <frontend_type>text</frontend_type>
34
+ <sort_order>1</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ </api>
39
+ -->
40
+ <api_key translate="label">
41
+ <label>Mocean Key</label>
42
+ <comment>Your mocean key here you can find it from your mocean profile.</comment>
43
+ <frontend_type>text</frontend_type>
44
+ <sort_order>2</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ </api_key>
49
+
50
+ <api_secret translate="label">
51
+ <label>Mocean Secret</label>
52
+ <comment>Your mocean secret here you can find it from your mocean profile.</comment>
53
+ <frontend_type>password</frontend_type>
54
+ <sort_order>3</sort_order>
55
+ <show_in_default>1</show_in_default>
56
+ <show_in_website>1</show_in_website>
57
+ <show_in_store>1</show_in_store>
58
+ </api_secret>
59
+
60
+ <mocean_from translate="label">
61
+ <label>Sender</label>
62
+ <comment>Sender to display on SMS. Characters limit to Alphanumeric(11) OR Numeric(20).</comment>
63
+ <validate>required-entry</validate>
64
+ <frontend_type>text</frontend_type>
65
+ <sort_order>6</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>1</show_in_store>
69
+ </mocean_from>
70
+
71
+ </fields>
72
+ </general>
73
+
74
+ <admin translate="label">
75
+ <label>Admin</label>
76
+ <frontend_type>text</frontend_type>
77
+ <sort_order>10</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ <fields>
82
+
83
+ <enabled translate="label comment">
84
+ <label>Enabled</label>
85
+ <comment>Automatically sends a text message to the Admin when enabled notifications were made.</comment>
86
+ <frontend_type>select</frontend_type>
87
+ <source_model>adminhtml/system_config_source_yesno</source_model>
88
+ <sort_order>1</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ </enabled>
93
+
94
+ <admin_mobile translate="label">
95
+ <label>Admin Mobile</label>
96
+ <comment>(Optional) SMS notify admin on orders. Please do provide mobile number with country code. Example: 60123456789</comment>
97
+ <frontend_type>text</frontend_type>
98
+ <sort_order>5</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>1</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ </admin_mobile>
103
+
104
+ <message translate="label comment">
105
+ <label>Message</label>
106
+ <comment>Please enter the message you like to send. Use {{sitename}} to replace with the Website name, {{amount}} to replace with Order total price and {{order_id}} to replace with Order No. in the message.</comment>
107
+ <tooltip>{{sitename}} = Site Name {{order_id}} = Order Id {{amount}} = Total Price</tooltip>
108
+ <validate>required-entry</validate>
109
+ <frontend_type>textarea</frontend_type>
110
+ <sort_order>15</sort_order>
111
+ <show_in_default>1</show_in_default>
112
+ <show_in_website>1</show_in_website>
113
+ <show_in_store>1</show_in_store>
114
+ </message>
115
+
116
+ </fields>
117
+ </admin>
118
+
119
+ <orders translate="label">
120
+ <label>Orders</label>
121
+ <frontend_type>text</frontend_type>
122
+ <sort_order>15</sort_order>
123
+ <show_in_default>1</show_in_default>
124
+ <show_in_website>1</show_in_website>
125
+ <show_in_store>1</show_in_store>
126
+ <fields>
127
+ <enabled translate="label comment">
128
+ <label>Enabled</label>
129
+ <comment>Automatically sends a text message to the customer when an order is made</comment>
130
+ <frontend_type>select</frontend_type>
131
+ <source_model>adminhtml/system_config_source_yesno</source_model>
132
+ <sort_order>1</sort_order>
133
+ <show_in_default>1</show_in_default>
134
+ <show_in_website>1</show_in_website>
135
+ <show_in_store>1</show_in_store>
136
+ </enabled>
137
+
138
+ <message translate="label comment">
139
+ <label>Message</label>
140
+ <comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
141
+ <tooltip>{{firstname}} = First Name</tooltip>
142
+ <validate>required-entry</validate>
143
+ <frontend_type>textarea</frontend_type>
144
+ <sort_order>15</sort_order>
145
+ <show_in_default>1</show_in_default>
146
+ <show_in_website>1</show_in_website>
147
+ <show_in_store>1</show_in_store>
148
+ </message>
149
+
150
+ </fields>
151
+ </orders>
152
+ <order_hold translate="label">
153
+ <label>Order Hold</label>
154
+ <frontend_type>text</frontend_type>
155
+ <sort_order>20</sort_order>
156
+ <show_in_default>1</show_in_default>
157
+ <show_in_website>1</show_in_website>
158
+ <show_in_store>1</show_in_store>
159
+ <fields>
160
+ <enabled translate="label comment">
161
+ <label>Enabled</label>
162
+ <comment>Automatically sends a text message to the customer when an order is placed on hold</comment>
163
+ <frontend_type>select</frontend_type>
164
+ <source_model>adminhtml/system_config_source_yesno</source_model>
165
+ <sort_order>5</sort_order>
166
+ <show_in_default>1</show_in_default>
167
+ <show_in_website>1</show_in_website>
168
+ <show_in_store>1</show_in_store>
169
+ </enabled>
170
+
171
+ <message translate="label comment">
172
+ <label>Message</label>
173
+ <comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
174
+ <tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
175
+ <validate>required-entry</validate>
176
+ <frontend_type>textarea</frontend_type>
177
+ <sort_order>15</sort_order>
178
+ <show_in_default>1</show_in_default>
179
+ <show_in_website>1</show_in_website>
180
+ <show_in_store>1</show_in_store>
181
+ </message>
182
+ </fields>
183
+ </order_hold>
184
+ <order_unhold translate="label">
185
+ <label>Order Unhold</label>
186
+ <frontend_type>text</frontend_type>
187
+ <sort_order>25</sort_order>
188
+ <show_in_default>1</show_in_default>
189
+ <show_in_website>1</show_in_website>
190
+ <show_in_store>1</show_in_store>
191
+ <fields>
192
+ <enabled translate="label comment">
193
+ <label>Enabled</label>
194
+ <comment>Automatically sends a text message to the customer when an order has been released from holding status</comment>
195
+ <frontend_type>select</frontend_type>
196
+ <source_model>adminhtml/system_config_source_yesno</source_model>
197
+ <sort_order>5</sort_order>
198
+ <show_in_default>1</show_in_default>
199
+ <show_in_website>1</show_in_website>
200
+ <show_in_store>1</show_in_store>
201
+ </enabled>
202
+
203
+ <message translate="label comment">
204
+ <label>Message</label>
205
+ <comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
206
+ <tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
207
+ <validate>required-entry</validate>
208
+ <frontend_type>textarea</frontend_type>
209
+ <sort_order>15</sort_order>
210
+ <show_in_default>1</show_in_default>
211
+ <show_in_website>1</show_in_website>
212
+ <show_in_store>1</show_in_store>
213
+ </message>
214
+ </fields>
215
+ </order_unhold>
216
+ <order_canceled translate="label">
217
+ <label>Order Canceled</label>
218
+ <frontend_type>text</frontend_type>
219
+ <sort_order>30</sort_order>
220
+ <show_in_default>1</show_in_default>
221
+ <show_in_website>1</show_in_website>
222
+ <show_in_store>1</show_in_store>
223
+ <fields>
224
+ <enabled translate="label comment">
225
+ <label>Enabled</label>
226
+ <comment>Automatically sends a text message to the customer when an order has been canceled</comment>
227
+ <frontend_type>select</frontend_type>
228
+ <source_model>adminhtml/system_config_source_yesno</source_model>
229
+ <sort_order>5</sort_order>
230
+ <show_in_default>1</show_in_default>
231
+ <show_in_website>1</show_in_website>
232
+ <show_in_store>1</show_in_store>
233
+ </enabled>
234
+
235
+ <message translate="label comment">
236
+ <label>Message</label>
237
+ <comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
238
+ <tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
239
+ <validate>required-entry</validate>
240
+ <frontend_type>textarea</frontend_type>
241
+ <sort_order>15</sort_order>
242
+ <show_in_default>1</show_in_default>
243
+ <show_in_website>1</show_in_website>
244
+ <show_in_store>1</show_in_store>
245
+ </message>
246
+ </fields>
247
+ </order_canceled>
248
+ <shipments translate="label">
249
+ <label>Shipments</label>
250
+ <frontend_type>text</frontend_type>
251
+ <sort_order>35</sort_order>
252
+ <show_in_default>1</show_in_default>
253
+ <show_in_website>1</show_in_website>
254
+ <show_in_store>1</show_in_store>
255
+ <fields>
256
+ <enabled translate="label comment">
257
+ <label>Enabled</label>
258
+ <comment>Automatically sends a text message to the customer when the shipment is made</comment>
259
+ <frontend_type>select</frontend_type>
260
+ <source_model>adminhtml/system_config_source_yesno</source_model>
261
+ <sort_order>5</sort_order>
262
+ <show_in_default>1</show_in_default>
263
+ <show_in_website>1</show_in_website>
264
+ <show_in_store>1</show_in_store>
265
+ </enabled>
266
+
267
+ <message translate="label comment">
268
+ <label>Message</label>
269
+ <comment>Please enter the message you like to send. Use {{firstname}} to replace with the Customer's First Name in the Order and {{order_id}} to replace with Order No. in the message.</comment>
270
+ <tooltip>{{firstname}} = First Name {{order_id}} = Order Id</tooltip>
271
+ <validate>required-entry</validate>
272
+ <frontend_type>textarea</frontend_type>
273
+ <sort_order>15</sort_order>
274
+ <show_in_default>1</show_in_default>
275
+ <show_in_website>1</show_in_website>
276
+ <show_in_store>1</show_in_store>
277
+ </message>
278
+ </fields>
279
+ </shipments>
280
+ </groups>
281
+ </moceansms>
282
+
283
+ </sections>
284
+ </config>
app/code/local/Mocean/moceansms/vendor/autoload.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer' . '/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInit154b0309d43c99c96b9e1195d0145e4a::getLoader();
app/code/local/Mocean/moceansms/vendor/composer/ClassLoader.php ADDED
@@ -0,0 +1,413 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Autoload;
14
+
15
+ /**
16
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
+ *
18
+ * $loader = new \Composer\Autoload\ClassLoader();
19
+ *
20
+ * // register classes with namespaces
21
+ * $loader->add('Symfony\Component', __DIR__.'/component');
22
+ * $loader->add('Symfony', __DIR__.'/framework');
23
+ *
24
+ * // activate the autoloader
25
+ * $loader->register();
26
+ *
27
+ * // to enable searching the include path (eg. for PEAR packages)
28
+ * $loader->setUseIncludePath(true);
29
+ *
30
+ * In this example, if you try to use a class in the Symfony\Component
31
+ * namespace or one of its children (Symfony\Component\Console for instance),
32
+ * the autoloader will first look for the class under the component/
33
+ * directory, and it will then fallback to the framework/ directory if not
34
+ * found before giving up.
35
+ *
36
+ * This class is loosely based on the Symfony UniversalClassLoader.
37
+ *
38
+ * @author Fabien Potencier <fabien@symfony.com>
39
+ * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see http://www.php-fig.org/psr/psr-0/
41
+ * @see http://www.php-fig.org/psr/psr-4/
42
+ */
43
+ class ClassLoader
44
+ {
45
+ // PSR-4
46
+ private $prefixLengthsPsr4 = array();
47
+ private $prefixDirsPsr4 = array();
48
+ private $fallbackDirsPsr4 = array();
49
+
50
+ // PSR-0
51
+ private $prefixesPsr0 = array();
52
+ private $fallbackDirsPsr0 = array();
53
+
54
+ private $useIncludePath = false;
55
+ private $classMap = array();
56
+
57
+ private $classMapAuthoritative = false;
58
+
59
+ public function getPrefixes()
60
+ {
61
+ if (!empty($this->prefixesPsr0)) {
62
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
63
+ }
64
+
65
+ return array();
66
+ }
67
+
68
+ public function getPrefixesPsr4()
69
+ {
70
+ return $this->prefixDirsPsr4;
71
+ }
72
+
73
+ public function getFallbackDirs()
74
+ {
75
+ return $this->fallbackDirsPsr0;
76
+ }
77
+
78
+ public function getFallbackDirsPsr4()
79
+ {
80
+ return $this->fallbackDirsPsr4;
81
+ }
82
+
83
+ public function getClassMap()
84
+ {
85
+ return $this->classMap;
86
+ }
87
+
88
+ /**
89
+ * @param array $classMap Class to filename map
90
+ */
91
+ public function addClassMap(array $classMap)
92
+ {
93
+ if ($this->classMap) {
94
+ $this->classMap = array_merge($this->classMap, $classMap);
95
+ } else {
96
+ $this->classMap = $classMap;
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Registers a set of PSR-0 directories for a given prefix, either
102
+ * appending or prepending to the ones previously set for this prefix.
103
+ *
104
+ * @param string $prefix The prefix
105
+ * @param array|string $paths The PSR-0 root directories
106
+ * @param bool $prepend Whether to prepend the directories
107
+ */
108
+ public function add($prefix, $paths, $prepend = false)
109
+ {
110
+ if (!$prefix) {
111
+ if ($prepend) {
112
+ $this->fallbackDirsPsr0 = array_merge(
113
+ (array) $paths,
114
+ $this->fallbackDirsPsr0
115
+ );
116
+ } else {
117
+ $this->fallbackDirsPsr0 = array_merge(
118
+ $this->fallbackDirsPsr0,
119
+ (array) $paths
120
+ );
121
+ }
122
+
123
+ return;
124
+ }
125
+
126
+ $first = $prefix[0];
127
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
128
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
129
+
130
+ return;
131
+ }
132
+ if ($prepend) {
133
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
134
+ (array) $paths,
135
+ $this->prefixesPsr0[$first][$prefix]
136
+ );
137
+ } else {
138
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
139
+ $this->prefixesPsr0[$first][$prefix],
140
+ (array) $paths
141
+ );
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Registers a set of PSR-4 directories for a given namespace, either
147
+ * appending or prepending to the ones previously set for this namespace.
148
+ *
149
+ * @param string $prefix The prefix/namespace, with trailing '\\'
150
+ * @param array|string $paths The PSR-0 base directories
151
+ * @param bool $prepend Whether to prepend the directories
152
+ *
153
+ * @throws \InvalidArgumentException
154
+ */
155
+ public function addPsr4($prefix, $paths, $prepend = false)
156
+ {
157
+ if (!$prefix) {
158
+ // Register directories for the root namespace.
159
+ if ($prepend) {
160
+ $this->fallbackDirsPsr4 = array_merge(
161
+ (array) $paths,
162
+ $this->fallbackDirsPsr4
163
+ );
164
+ } else {
165
+ $this->fallbackDirsPsr4 = array_merge(
166
+ $this->fallbackDirsPsr4,
167
+ (array) $paths
168
+ );
169
+ }
170
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
+ // Register directories for a new namespace.
172
+ $length = strlen($prefix);
173
+ if ('\\' !== $prefix[$length - 1]) {
174
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175
+ }
176
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
178
+ } elseif ($prepend) {
179
+ // Prepend directories for an already registered namespace.
180
+ $this->prefixDirsPsr4[$prefix] = array_merge(
181
+ (array) $paths,
182
+ $this->prefixDirsPsr4[$prefix]
183
+ );
184
+ } else {
185
+ // Append directories for an already registered namespace.
186
+ $this->prefixDirsPsr4[$prefix] = array_merge(
187
+ $this->prefixDirsPsr4[$prefix],
188
+ (array) $paths
189
+ );
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Registers a set of PSR-0 directories for a given prefix,
195
+ * replacing any others previously set for this prefix.
196
+ *
197
+ * @param string $prefix The prefix
198
+ * @param array|string $paths The PSR-0 base directories
199
+ */
200
+ public function set($prefix, $paths)
201
+ {
202
+ if (!$prefix) {
203
+ $this->fallbackDirsPsr0 = (array) $paths;
204
+ } else {
205
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Registers a set of PSR-4 directories for a given namespace,
211
+ * replacing any others previously set for this namespace.
212
+ *
213
+ * @param string $prefix The prefix/namespace, with trailing '\\'
214
+ * @param array|string $paths The PSR-4 base directories
215
+ *
216
+ * @throws \InvalidArgumentException
217
+ */
218
+ public function setPsr4($prefix, $paths)
219
+ {
220
+ if (!$prefix) {
221
+ $this->fallbackDirsPsr4 = (array) $paths;
222
+ } else {
223
+ $length = strlen($prefix);
224
+ if ('\\' !== $prefix[$length - 1]) {
225
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226
+ }
227
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Turns on searching the include path for class files.
234
+ *
235
+ * @param bool $useIncludePath
236
+ */
237
+ public function setUseIncludePath($useIncludePath)
238
+ {
239
+ $this->useIncludePath = $useIncludePath;
240
+ }
241
+
242
+ /**
243
+ * Can be used to check if the autoloader uses the include path to check
244
+ * for classes.
245
+ *
246
+ * @return bool
247
+ */
248
+ public function getUseIncludePath()
249
+ {
250
+ return $this->useIncludePath;
251
+ }
252
+
253
+ /**
254
+ * Turns off searching the prefix and fallback directories for classes
255
+ * that have not been registered with the class map.
256
+ *
257
+ * @param bool $classMapAuthoritative
258
+ */
259
+ public function setClassMapAuthoritative($classMapAuthoritative)
260
+ {
261
+ $this->classMapAuthoritative = $classMapAuthoritative;
262
+ }
263
+
264
+ /**
265
+ * Should class lookup fail if not found in the current class map?
266
+ *
267
+ * @return bool
268
+ */
269
+ public function isClassMapAuthoritative()
270
+ {
271
+ return $this->classMapAuthoritative;
272
+ }
273
+
274
+ /**
275
+ * Registers this instance as an autoloader.
276
+ *
277
+ * @param bool $prepend Whether to prepend the autoloader or not
278
+ */
279
+ public function register($prepend = false)
280
+ {
281
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
282
+ }
283
+
284
+ /**
285
+ * Unregisters this instance as an autoloader.
286
+ */
287
+ public function unregister()
288
+ {
289
+ spl_autoload_unregister(array($this, 'loadClass'));
290
+ }
291
+
292
+ /**
293
+ * Loads the given class or interface.
294
+ *
295
+ * @param string $class The name of the class
296
+ * @return bool|null True if loaded, null otherwise
297
+ */
298
+ public function loadClass($class)
299
+ {
300
+ if ($file = $this->findFile($class)) {
301
+ includeFile($file);
302
+
303
+ return true;
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Finds the path to the file where the class is defined.
309
+ *
310
+ * @param string $class The name of the class
311
+ *
312
+ * @return string|false The path if found, false otherwise
313
+ */
314
+ public function findFile($class)
315
+ {
316
+ // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
+ if ('\\' == $class[0]) {
318
+ $class = substr($class, 1);
319
+ }
320
+
321
+ // class map lookup
322
+ if (isset($this->classMap[$class])) {
323
+ return $this->classMap[$class];
324
+ }
325
+ if ($this->classMapAuthoritative) {
326
+ return false;
327
+ }
328
+
329
+ $file = $this->findFileWithExtension($class, '.php');
330
+
331
+ // Search for Hack files if we are running on HHVM
332
+ if ($file === null && defined('HHVM_VERSION')) {
333
+ $file = $this->findFileWithExtension($class, '.hh');
334
+ }
335
+
336
+ if ($file === null) {
337
+ // Remember that this class does not exist.
338
+ return $this->classMap[$class] = false;
339
+ }
340
+
341
+ return $file;
342
+ }
343
+
344
+ private function findFileWithExtension($class, $ext)
345
+ {
346
+ // PSR-4 lookup
347
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
348
+
349
+ $first = $class[0];
350
+ if (isset($this->prefixLengthsPsr4[$first])) {
351
+ foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
+ if (0 === strpos($class, $prefix)) {
353
+ foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
+ return $file;
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+
362
+ // PSR-4 fallback dirs
363
+ foreach ($this->fallbackDirsPsr4 as $dir) {
364
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
+ return $file;
366
+ }
367
+ }
368
+
369
+ // PSR-0 lookup
370
+ if (false !== $pos = strrpos($class, '\\')) {
371
+ // namespaced class name
372
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
373
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
374
+ } else {
375
+ // PEAR-like class name
376
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
377
+ }
378
+
379
+ if (isset($this->prefixesPsr0[$first])) {
380
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
+ if (0 === strpos($class, $prefix)) {
382
+ foreach ($dirs as $dir) {
383
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
+ return $file;
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+
391
+ // PSR-0 fallback dirs
392
+ foreach ($this->fallbackDirsPsr0 as $dir) {
393
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
+ return $file;
395
+ }
396
+ }
397
+
398
+ // PSR-0 include paths.
399
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
+ return $file;
401
+ }
402
+ }
403
+ }
404
+
405
+ /**
406
+ * Scope isolated include.
407
+ *
408
+ * Prevents access to $this/self from included files.
409
+ */
410
+ function includeFile($file)
411
+ {
412
+ include $file;
413
+ }
app/code/local/Mocean/moceansms/vendor/composer/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Copyright (c) 2015 Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
app/code/local/Mocean/moceansms/vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_classmap.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
app/code/local/Mocean/moceansms/vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'libphonenumber' => array($vendorDir . '/giggsey/libphonenumber-for-php/src'),
10
+ );
app/code/local/Mocean/moceansms/vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_psr4.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
app/code/local/Mocean/moceansms/vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInit154b0309d43c99c96b9e1195d0145e4a
6
+ {
7
+ private static $loader;
8
+
9
+ public static function loadClassLoader($class)
10
+ {
11
+ if ('Composer\Autoload\ClassLoader' === $class) {
12
+ require __DIR__ . '/ClassLoader.php';
13
+ }
14
+ }
15
+
16
+ public static function getLoader()
17
+ {
18
+ if (null !== self::$loader) {
19
+ return self::$loader;
20
+ }
21
+
22
+ spl_autoload_register(array('ComposerAutoloaderInit154b0309d43c99c96b9e1195d0145e4a', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit154b0309d43c99c96b9e1195d0145e4a', 'loadClassLoader'));
25
+
26
+ $map = require __DIR__ . '/autoload_namespaces.php';
27
+ foreach ($map as $namespace => $path) {
28
+ $loader->set($namespace, $path);
29
+ }
30
+
31
+ $map = require __DIR__ . '/autoload_psr4.php';
32
+ foreach ($map as $namespace => $path) {
33
+ $loader->setPsr4($namespace, $path);
34
+ }
35
+
36
+ $classMap = require __DIR__ . '/autoload_classmap.php';
37
+ if ($classMap) {
38
+ $loader->addClassMap($classMap);
39
+ }
40
+
41
+ $loader->register(true);
42
+
43
+ return $loader;
44
+ }
45
+ }
app/code/local/Mocean/moceansms/vendor/composer/installed.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "giggsey/libphonenumber-for-php",
4
+ "version": "7.2.2",
5
+ "version_normalized": "7.2.2.0",
6
+ "source": {
7
+ "type": "git",
8
+ "url": "https://github.com/giggsey/libphonenumber-for-php.git",
9
+ "reference": "8b64ea2ecd4080f9ce75cf688dda0c4afedb6b64"
10
+ },
11
+ "dist": {
12
+ "type": "zip",
13
+ "url": "https://api.github.com/repos/giggsey/libphonenumber-for-php/zipball/8b64ea2ecd4080f9ce75cf688dda0c4afedb6b64",
14
+ "reference": "8b64ea2ecd4080f9ce75cf688dda0c4afedb6b64",
15
+ "shasum": ""
16
+ },
17
+ "require": {
18
+ "ext-mbstring": "*"
19
+ },
20
+ "require-dev": {
21
+ "pear/pear-core-minimal": "^1.9",
22
+ "pear/pear_exception": "*",
23
+ "pear/versioncontrol_git": "dev-master",
24
+ "phing/phing": "~2.7",
25
+ "phpunit/phpunit": "~4.0",
26
+ "satooshi/php-coveralls": "~0.6",
27
+ "symfony/console": "~2.4"
28
+ },
29
+ "suggest": {
30
+ "ext-intl": "To use the geocoder and carrier mapping"
31
+ },
32
+ "time": "2015-12-15 17:24:20",
33
+ "type": "library",
34
+ "extra": {
35
+ "branch-alias": {
36
+ "dev-master": "7.x-dev"
37
+ }
38
+ },
39
+ "installation-source": "dist",
40
+ "autoload": {
41
+ "psr-0": {
42
+ "libphonenumber": "src/"
43
+ }
44
+ },
45
+ "notification-url": "https://packagist.org/downloads/",
46
+ "license": [
47
+ "Apache-2.0"
48
+ ],
49
+ "authors": [
50
+ {
51
+ "name": "Joshua Gigg",
52
+ "email": "giggsey@gmail.com",
53
+ "homepage": "http://giggsey.com/"
54
+ }
55
+ ],
56
+ "description": "PHP Port of Google's libphonenumber",
57
+ "homepage": "https://github.com/giggsey/libphonenumber-for-php",
58
+ "keywords": [
59
+ "geocoding",
60
+ "geolocation",
61
+ "libphonenumber",
62
+ "mobile",
63
+ "phonenumber",
64
+ "validation"
65
+ ]
66
+ }
67
+ ]
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/.gitignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ vendor/
2
+ composer.phar
3
+ composer.lock
4
+ libphonenumber-data-dir/
5
+ build/logs/
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/.travis.yml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ sudo: false
2
+
3
+ language: php
4
+
5
+ matrix:
6
+ allow_failures:
7
+ - php: hhvm
8
+
9
+ php:
10
+ - 5.3
11
+ - 5.4
12
+ - 5.5
13
+ - 5.6
14
+ - hhvm
15
+ - 7
16
+
17
+ before_script:
18
+ - wget http://getcomposer.org/composer.phar
19
+ - php composer.phar install --no-interaction
20
+ - mkdir -p build/logs
21
+
22
+ script:
23
+ - ./vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
24
+
25
+ after_script:
26
+ - php vendor/bin/coveralls -v --exclude-no-stmt
27
+ - wget https://scrutinizer-ci.com/ocular.phar
28
+ - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
29
+
30
+ notifications:
31
+ irc: "irc.appliedirc.com#applied"
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/LICENSE ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/METADATA-VERSION.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ # This file specifies the revision of the metadata to build from
2
+ # It can be a commit, branch or tag of the https://github.com/googlei18n/libphonenumber project
3
+ #
4
+ # For more information, look at the phing tasks in build.xml
5
+ libphonenumber-7.2.2
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/README.md ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # libphonenumber for PHP [![Build Status](https://img.shields.io/travis/giggsey/libphonenumber-for-php.svg?style=flat-square)](https://travis-ci.org/giggsey/libphonenumber-for-php) [![Coverage Status](https://img.shields.io/coveralls/giggsey/libphonenumber-for-php.svg?style=flat-square)](https://coveralls.io/r/giggsey/libphonenumber-for-php?branch=master)
2
+
3
+ [![Total Downloads](https://img.shields.io/packagist/dt/giggsey/libphonenumber-for-php.svg?style=flat-square)](https://packagist.org/packages/giggsey/libphonenumber-for-php)
4
+ [![Latest Stable Version](https://img.shields.io/packagist/v/giggsey/libphonenumber-for-php.svg?style=flat-square)](https://packagist.org/packages/giggsey/libphonenumber-for-php)
5
+ [![License](http://img.shields.io/badge/license-Apache%202.0-red.svg?style=flat-square)](https://packagist.org/packages/giggsey/libphonenumber-for-php)
6
+
7
+ ## What is it?
8
+ A PHP library for parsing, formatting, storing and validating international phone numbers. This library is based on Google's [libphonenumber](https://github.com/googlei18n/libphonenumber).
9
+
10
+
11
+ # Highlights of functionality
12
+ * Parsing/formatting/validating phone numbers for all countries/regions of the world.
13
+ * `getNumberType` - gets the type of the number based on the number itself; able to distinguish Fixed-line, Mobile, Toll-free, Premium Rate, Shared Cost, VoIP and Personal Numbers (whenever feasible).
14
+ * `isNumberMatch` - gets a confidence level on whether two numbers could be the same.
15
+ * `getExampleNumber`/`getExampleNumberByType` - provides valid example numbers for all countries/regions, with the option of specifying which type of example phone number is needed.
16
+ * `isValidNumber` - full validation of a phone number for a region using length and prefix information.
17
+ * PhoneNumberOfflineGeocoder - provides geographical information related to a phone number.
18
+ * PhoneNumberToTimeZonesMapper - provides timezone information related to a phone number.
19
+ * PhoneNumberToCarrierMapper - provides carrier information related to a phone number.
20
+
21
+ ## Installation
22
+
23
+ The library can be installed via [composer](http://getcomposer.org/). You can also use any other [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compliant autoloader.
24
+
25
+ The PECL [mbstring](http://php.net/mbstring) extension is required for this library to be used.
26
+
27
+ ```json
28
+ {
29
+ "require": {
30
+ "giggsey/libphonenumber-for-php": "~7.0"
31
+ }
32
+ }
33
+ ```
34
+
35
+ ## Versioning
36
+
37
+ This library will try to follow the same version numbers as Google. There could be additional releases where needed to fix critical issues that can not wait until the next release from Google.
38
+
39
+ This does mean that this project will not follow [Semantic Versioning](http://semver.org/), but instead Google's version policy. As a result, jumps in major versions may not actually contain any backwards
40
+ incompatible changes. Please read the release notes for such releases.
41
+
42
+
43
+ ## Online Demo
44
+ An [online demo](http://giggsey.com/libphonenumber/) is available, and the source can be found at [giggsey/libphonenumber-example](https://github.com/giggsey/libphonenumber-example).
45
+
46
+ ## Quick Examples
47
+ Let's say you have a string representing a phone number from Switzerland. This is how you parse/normalize it into a PhoneNumber object:
48
+
49
+ ```php
50
+ $swissNumberStr = "044 668 18 00";
51
+ $phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
52
+ try {
53
+ $swissNumberProto = $phoneUtil->parse($swissNumberStr, "CH");
54
+ var_dump($swissNumberProto);
55
+ } catch (\libphonenumber\NumberParseException $e) {
56
+ var_dump($e);
57
+ }
58
+ ```
59
+
60
+ At this point, swissNumberProto contains:
61
+
62
+ class libphonenumber\PhoneNumber#9 (7) {
63
+ private $countryCode =>
64
+ int(41)
65
+ private $nationalNumber =>
66
+ double(446681800)
67
+ private $extension =>
68
+ NULL
69
+ private $italianLeadingZero =>
70
+ NULL
71
+ private $rawInput =>
72
+ NULL
73
+ private $countryCodeSource =>
74
+ NULL
75
+ private $preferredDomesticCarrierCode =>
76
+ NULL
77
+ }
78
+
79
+ Now let us validate whether the number is valid:
80
+
81
+ ```php
82
+ $isValid = $phoneUtil->isValidNumber($swissNumberProto);
83
+ var_dump($isValid); // true
84
+ ```
85
+
86
+ There are a few formats supported by the formatting method, as illustrated below:
87
+
88
+ ```php
89
+ // Produces "+41446681800"
90
+ echo $phoneUtil->format($swissNumberProto, \libphonenumber\PhoneNumberFormat::E164);
91
+
92
+ // Produces "044 668 18 00"
93
+ echo $phoneUtil->format($swissNumberProto, \libphonenumber\PhoneNumberFormat::NATIONAL);
94
+
95
+ // Produces "+41 44 668 18 00"
96
+ echo $phoneUtil->format($swissNumberProto, \libphonenumber\PhoneNumberFormat::INTERNATIONAL);
97
+ ```
98
+
99
+ You could also choose to format the number in the way it is dialled from another country:
100
+
101
+ ```php
102
+ // Produces "011 41 44 668 1800", the number when it is dialled in the United States.
103
+ echo $phoneUtil->formatOutOfCountryCallingNumber($swissNumberProto, "US");
104
+
105
+ // Produces "00 41 44 668 18 00", the number when it is dialled in Great Britain.
106
+ echo $phoneUtil->formatOutOfCountryCallingNumber($swissNumberProto, "GB");
107
+ ```
108
+
109
+ ### Geocoder
110
+
111
+ The PECL [intl](http://php.net/intl) extension is required for the geocoder to be used.
112
+
113
+ ```php
114
+ $phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
115
+
116
+ $swissNumberProto = $phoneUtil->parse("044 668 18 00", "CH");
117
+ $usNumberProto = $phoneUtil->parse("+1 650 253 0000", "US");
118
+ $gbNumberProto = $phoneUtil->parse("0161 496 0000", "GB");
119
+
120
+ $geocoder = \libphonenumber\geocoding\PhoneNumberOfflineGeocoder::getInstance();
121
+
122
+ // Outputs "Zurich"
123
+ echo $geocoder->getDescriptionForNumber($swissNumberProto, "en_US");
124
+
125
+ // Outputs "Zürich"
126
+ echo $geocoder->getDescriptionForNumber($swissNumberProto, "de_DE");
127
+
128
+ // Outputs "Zurigo"
129
+ echo $geocoder->getDescriptionForNumber($swissNumberProto, "it_IT");
130
+
131
+
132
+ // Outputs "Mountain View, CA"
133
+ echo $geocoder->getDescriptionForNumber($usNumberProto, "en_US");
134
+
135
+ // Outputs "Mountain View, CA"
136
+ echo $geocoder->getDescriptionForNumber($usNumberProto, "de_DE");
137
+
138
+ // Outputs "미국" (Korean for United States)
139
+ echo $geocoder->getDescriptionForNumber($usNumberProto, "ko-KR");
140
+
141
+ // Outputs "Manchester"
142
+ echo $geocoder->getDescriptionForNumber($gbNumberProto, "en_GB");
143
+
144
+ // Outputs "영국" (Korean for United Kingdom)
145
+ echo $geocoder->getDescriptionForNumber($gbNumberProto, "ko-KR");
146
+ ```
147
+
148
+ ### ShortNumberInfo
149
+
150
+ ```php
151
+ $shortNumberInfo = \libphonenumber\ShortNumberInfo::getInstance();
152
+
153
+ // true
154
+ var_dump($shortNumberInfo->isEmergencyNumber("999", "GB"));
155
+
156
+ // true
157
+ var_dump($shortNumberInfo->connectsToEmergencyNumber("999", "GB"));
158
+
159
+ // false
160
+ var_dump($shortNumberInfo->connectsToEmergencyNumber("911", "GB"));
161
+
162
+ // true
163
+ var_dump($shortNumberInfo->isEmergencyNumber("911", "US"));
164
+
165
+ // true
166
+ var_dump($shortNumberInfo->connectsToEmergencyNumber("911", "US"));
167
+
168
+ // false
169
+ var_dump($shortNumberInfo->isEmergencyNumber("911123", "US"));
170
+
171
+ // true
172
+ var_dump($shortNumberInfo->connectsToEmergencyNumber("911123", "US"));
173
+ ```
174
+
175
+ ### Mapping Phone Numbers to carrier
176
+
177
+ The PECL [intl](http://php.net/intl) extension is required for the carrier mapper to be used.
178
+
179
+ ```php
180
+
181
+ $phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
182
+ $swissNumberProto = $phoneUtil->parse("798765432", "CH");
183
+
184
+ $carrierMapper = \libphonenumber\PhoneNumberToCarrierMapper::getInstance();
185
+ // Outputs "Swisscom"
186
+ echo $carrierMapper->getNameForNumber($swissNumberProto, "en");
187
+ ```
188
+
189
+ ### Mapping Phone Numbers to TimeZones
190
+
191
+ ```php
192
+
193
+ $phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
194
+ $swissNumberProto = $phoneUtil->parse("798765432", "CH");
195
+
196
+ $timeZoneMapper = \libphonenumber\PhoneNumberToTimeZonesMapper::getInstance();
197
+ // returns array("Europe/Zurich")
198
+ $timeZones = $timeZoneMapper->getTimeZonesForNumber($swissNumberProto);
199
+
200
+ ```
201
+
202
+ ## FAQ
203
+
204
+ #### Problems with Invalid Numbers?
205
+
206
+ This library uses phone number metadata from Google's [libphonenumber](https://github.com/googlei18n/libphonenumber). If this library is working as intended, it should provide the same result as the Java version of Google's project.
207
+
208
+ If you believe that a phone number is returning an incorrect result, first test it with [libphonenumber](https://github.com/googlei18n/libphonenumber) via their [Online Demo](https://libphonenumber.appspot.com/). If that returns the same result as this project, and you feel it is in error, raise it as an Issue with the libphonenumber project.
209
+
210
+ If Google's [Online Demo](https://libphonenumber.appspot.com/) gives a different result to the [libphonenumber-for-php demo](http://giggsey.com/libphonenumber/), then please raise an Issue here.
211
+
212
+ ## Generating data
213
+
214
+ Phing is used to 'compile' the metadata.
215
+
216
+ Ensure you have all the dev composer dependencies installed, then run
217
+
218
+ ```bash
219
+ vendor/bin/phing compile
220
+ ```
221
+
222
+ This compile process clones the [libphonenumber](https://github.com/googlei18n/libphonenumber) project at the version specified in [METADATA-VERSION.txt](METADATA-VERSION.txt).
223
+
224
+ ## Integration with frameworks
225
+
226
+ Other packages exist that integrate libphonenumber-for-php into frameworks.
227
+
228
+ These packages are supplied by third parties, and their quality can not be guaranteed.
229
+
230
+ - Symfony: [PhoneNumberBundle](https://github.com/misd-service-development/phone-number-bundle)
231
+ - Laravel: [Laravel Phone](https://github.com/Propaganistas/Laravel-Phone)
232
+
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/bootstrap.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ ini_set('memory_limit', '1024M');
3
+
4
+ require __DIR__ . '/../vendor/autoload.php';
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/CodeCoverageTest.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+ use libphonenumber\PhoneNumberUtil;
6
+
7
+ class CodeCoverageTest extends \PHPUnit_Framework_TestCase
8
+ {
9
+ /**
10
+ * @var PhoneNumberUtil
11
+ */
12
+ private $phoneUtil;
13
+
14
+ public function setUp()
15
+ {
16
+ PhoneNumberUtil::resetInstance();
17
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
18
+ }
19
+
20
+ public function testNullException()
21
+ {
22
+ try {
23
+ $this->phoneUtil->parse(null, null);
24
+ } catch (\Exception $e) {
25
+ $this->assertEquals("libphonenumber\\NumberParseException", get_class($e));
26
+ $this->assertEquals("The phone number supplied was null.", $e->getMessage());
27
+
28
+ $this->assertEquals("Error type: 1. The phone number supplied was null.", (string)$e);
29
+ }
30
+ }
31
+
32
+ public function testTooShortNumber()
33
+ {
34
+ try {
35
+ $this->phoneUtil->parse("+441", "GB");
36
+ } catch (\Exception $e) {
37
+ $this->assertEquals("libphonenumber\\NumberParseException", get_class($e));
38
+ $this->assertEquals("The string supplied is too short to be a phone number.", $e->getMessage());
39
+ $this->assertEquals(3, $e->getCode());
40
+
41
+ $this->assertEquals("Error type: 3. The string supplied is too short to be a phone number.", (string)$e);
42
+ }
43
+ }
44
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue14Test.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+
6
+ use libphonenumber\PhoneNumberType;
7
+ use libphonenumber\PhoneNumberUtil;
8
+
9
+ class Issue14Test extends \PHPUnit_Framework_TestCase
10
+ {
11
+ /**
12
+ * @var PhoneNumberUtil
13
+ */
14
+ private $phoneUtil;
15
+
16
+ public function setUp()
17
+ {
18
+ PhoneNumberUtil::resetInstance();
19
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
20
+ }
21
+
22
+ public function testKWMobileNumber()
23
+ {
24
+ $number = "51440519";
25
+ $phoneNumber = $this->phoneUtil->parse($number, "KW");
26
+
27
+ $this->assertTrue($this->phoneUtil->isValidNumber($phoneNumber));
28
+ $this->assertEquals(PhoneNumberType::MOBILE, $this->phoneUtil->getNumberType($phoneNumber));
29
+ }
30
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue17Test.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+
6
+ use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
7
+ use libphonenumber\PhoneNumberUtil;
8
+
9
+ class Issue17Test extends \PHPUnit_Framework_TestCase
10
+ {
11
+ /**
12
+ * @var PhoneNumberOfflineGeocoder
13
+ */
14
+ private $geocoder;
15
+
16
+ /**
17
+ * @var PhoneNumberUtil
18
+ */
19
+ private $phoneUtil;
20
+
21
+ public function setUp()
22
+ {
23
+ if(!extension_loaded('intl')) {
24
+ $this->markTestSkipped('The intl extension must be installed');
25
+ }
26
+
27
+ PhoneNumberUtil::resetInstance();
28
+ PhoneNumberOfflineGeocoder::resetInstance();
29
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
30
+ $this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
31
+ }
32
+
33
+ public function testIsleOfManLocale()
34
+ {
35
+ $number = "447624806000";
36
+
37
+ $phoneNumber = $this->phoneUtil->parse($number, 'GB');
38
+
39
+ $this->assertEquals("Isle of Man", $this->geocoder->getDescriptionForNumber($phoneNumber, 'en'));
40
+ }
41
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue21Test.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace libphonenumber\Tests\Issues;
3
+
4
+
5
+ use libphonenumber\PhoneNumberFormat;
6
+ use libphonenumber\PhoneNumberUtil;
7
+
8
+ class Issue21Test extends \PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @var PhoneNumberUtil
12
+ */
13
+ private $phoneUtil;
14
+
15
+ public function setUp()
16
+ {
17
+ PhoneNumberUtil::resetInstance();
18
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
19
+ }
20
+
21
+ public function testFloatNumber()
22
+ {
23
+ $number = "0358112345678987";
24
+ $phoneNumber = $this->phoneUtil->parse($number, "DE");
25
+
26
+ $this->assertTrue($this->phoneUtil->isValidNumber($phoneNumber));
27
+
28
+ $this->assertEquals('+49358112345678987', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::E164));
29
+ $this->assertEquals('+49 3581 12345678987', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::INTERNATIONAL));
30
+ $this->assertEquals('03581 12345678987', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::NATIONAL));
31
+
32
+
33
+ $this->assertEquals('011 49 3581 12345678987', $this->phoneUtil->formatOutOfCountryCallingNumber($phoneNumber, 'US'));
34
+ $this->assertEquals('00 49 3581 12345678987', $this->phoneUtil->formatOutOfCountryCallingNumber($phoneNumber, 'CH'));
35
+ }
36
+
37
+ public function testLongerNumber()
38
+ {
39
+ $number = "12345678901234567";
40
+ $phoneNumber = $this->phoneUtil->parse($number, "DE");
41
+
42
+ $this->assertEquals('+4912345678901234567', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::E164));
43
+ $this->assertEquals('+49 12345678901234567', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::INTERNATIONAL));
44
+ $this->assertEquals('12345678901234567', $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::NATIONAL));
45
+
46
+
47
+ $this->assertEquals('011 49 12345678901234567', $this->phoneUtil->formatOutOfCountryCallingNumber($phoneNumber, 'US'));
48
+ $this->assertEquals('00 49 12345678901234567', $this->phoneUtil->formatOutOfCountryCallingNumber($phoneNumber, 'CH'));
49
+ }
50
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue23Test.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+
6
+ use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
7
+ use libphonenumber\PhoneNumberUtil;
8
+ use libphonenumber\RegionCode;
9
+
10
+ class Issue23Test extends \PHPUnit_Framework_TestCase
11
+ {
12
+ /**
13
+ * @var PhoneNumberUtil
14
+ */
15
+ private $phoneUtil;
16
+ /**
17
+ * @var PhoneNumberOfflineGeocoder|null
18
+ */
19
+ private $geocoder;
20
+
21
+ public function setUp()
22
+ {
23
+ PhoneNumberUtil::resetInstance();
24
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
25
+
26
+ if(extension_loaded('intl')) {
27
+ $this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
28
+ }
29
+ }
30
+
31
+ public function testTKGeoLocation()
32
+ {
33
+ $number = '+6903010';
34
+
35
+ $phoneNumber = $this->phoneUtil->parse($number, RegionCode::ZZ);
36
+
37
+ $this->assertEquals('TK', $this->phoneUtil->getRegionCodeForNumber($phoneNumber));
38
+
39
+ if($this->geocoder instanceof PhoneNumberOfflineGeocoder) {
40
+ $this->assertEquals('Tokelau', $this->geocoder->getDescriptionForNumber($phoneNumber, 'en'));
41
+ }
42
+ }
43
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue34Test.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace libphonenumber\Tests\Issues;
3
+
4
+
5
+ use libphonenumber\PhoneNumberUtil;
6
+
7
+ class Issue34Test extends \PHPUnit_Framework_TestCase
8
+ {
9
+ /**
10
+ * @var PhoneNumberUtil
11
+ */
12
+ private $phoneUtil;
13
+
14
+ public function setUp()
15
+ {
16
+ PhoneNumberUtil::resetInstance();
17
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
18
+ }
19
+
20
+ public function testIsValidNumberForRegion()
21
+ {
22
+ $number = "+33 6 76 83 51 85";
23
+ $region = "DE";
24
+ $phoneNumber = $this->phoneUtil->parse($number, $region);
25
+
26
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion($phoneNumber, "DE"));
27
+ }
28
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue35Test.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace libphonenumber\Tests\Issues;
3
+
4
+
5
+ use libphonenumber\PhoneNumber;
6
+ use libphonenumber\PhoneNumberUtil;
7
+
8
+ class Issue35Test extends \PHPUnit_Framework_TestCase
9
+ {
10
+ /**
11
+ * @var PhoneNumberUtil
12
+ */
13
+ private $phoneUtil;
14
+
15
+ public function setUp()
16
+ {
17
+ PhoneNumberUtil::resetInstance();
18
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
19
+ }
20
+
21
+ public function testSerializingPhoneNumber()
22
+ {
23
+ $number = "+441174900000";
24
+ $region = "GB";
25
+ $phoneNumber = $this->phoneUtil->parse($number, $region);
26
+
27
+ $serializedString = serialize($phoneNumber);
28
+
29
+ $phoneObject2 = unserialize($serializedString);
30
+
31
+ $this->assertTrue($phoneObject2->equals($phoneNumber));
32
+ }
33
+
34
+ public function testSerializingPhoneNumber2()
35
+ {
36
+ $phoneNumber = new PhoneNumber();
37
+ $phoneNumber->setCountryCode(1);
38
+ $phoneNumber->setNationalNumber(1);
39
+ $phoneNumber->setExtension(1);
40
+ $phoneNumber->setItalianLeadingZero(1);
41
+ $phoneNumber->setNumberOfLeadingZeros(1);
42
+ $phoneNumber->setRawInput(1);
43
+ $phoneNumber->setCountryCodeSource(1);
44
+ $phoneNumber->setPreferredDomesticCarrierCode(1);
45
+
46
+ $serializedString = serialize($phoneNumber);
47
+ $phoneObject2 = unserialize($serializedString);
48
+
49
+ $this->assertTrue($phoneObject2->equals($phoneNumber));
50
+ }
51
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue36Test.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+
6
+ use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
7
+ use libphonenumber\PhoneNumberUtil;
8
+
9
+ class Issue36Test extends \PHPUnit_Framework_TestCase
10
+ {
11
+ /**
12
+ * @var PhoneNumberOfflineGeocoder
13
+ */
14
+ private $geocoder;
15
+
16
+ /**
17
+ * @var PhoneNumberUtil
18
+ */
19
+ private $phoneUtil;
20
+
21
+ public function setUp()
22
+ {
23
+ if(!extension_loaded('intl')) {
24
+ $this->markTestSkipped('The intl extension must be installed');
25
+ }
26
+
27
+ PhoneNumberUtil::resetInstance();
28
+ PhoneNumberOfflineGeocoder::resetInstance();
29
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
30
+ $this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
31
+ }
32
+
33
+ public function testIsleOfManLocale()
34
+ {
35
+ $number = "447797752305";
36
+
37
+ $phoneNumber = $this->phoneUtil->parse($number, 'GB');
38
+
39
+ $this->assertEquals("Jersey", $this->geocoder->getDescriptionForNumber($phoneNumber, 'en'));
40
+ }
41
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue3Test.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+
6
+ use libphonenumber\PhoneNumberFormat;
7
+ use libphonenumber\PhoneNumberUtil;
8
+
9
+ class Issue3Test extends \PHPUnit_Framework_TestCase
10
+ {
11
+
12
+ /**
13
+ * @var PhoneNumberUtil
14
+ */
15
+ public $phoneNumberUtil;
16
+
17
+ public function setUp()
18
+ {
19
+ PhoneNumberUtil::resetInstance();
20
+ $this->phoneNumberUtil = PhoneNumberUtil::getInstance();
21
+ }
22
+
23
+ public function testParseUSNumber()
24
+ {
25
+ $number = $this->phoneNumberUtil->parse('011543549480042', 'US');
26
+
27
+ $this->assertEquals("+543549480042", $this->phoneNumberUtil->format($number, PhoneNumberFormat::E164));
28
+
29
+ }
30
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue44Test.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+ use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
6
+ use libphonenumber\PhoneNumberToCarrierMapper;
7
+ use libphonenumber\PhoneNumberUtil;
8
+
9
+ class Issue44Test extends \PHPUnit_Framework_TestCase
10
+ {
11
+ /**
12
+ * @var PhoneNumberUtil
13
+ */
14
+ private $phoneUtil;
15
+
16
+ /**
17
+ * @var PhoneNumberOfflineGeocoder
18
+ */
19
+ private $geocoder;
20
+
21
+ public function setUp()
22
+ {
23
+ if(!extension_loaded('intl')) {
24
+ $this->markTestSkipped('The intl extension must be installed');
25
+ }
26
+
27
+ PhoneNumberUtil::resetInstance();
28
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
29
+
30
+ $this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
31
+ }
32
+
33
+ public function testMemoryUsageOfGeoLocationWithNoResult()
34
+ {
35
+ $number = $this->phoneUtil->parse("86-157-9662-1289", "CN");
36
+
37
+ $startMemory = memory_get_usage();
38
+ $location = $this->geocoder->getDescriptionForNumber($number, "en");
39
+ $endMemory = memory_get_usage();
40
+
41
+ $this->assertEquals("China", $location);
42
+
43
+ $memoryUsed = $endMemory - $startMemory;
44
+
45
+ $this->assertLessThan(5000000, $memoryUsed, "Memory usage should be below 5MB");
46
+ }
47
+
48
+ public function testMemoryUsageOfGeoLocationWithResult()
49
+ {
50
+ $number = $this->phoneUtil->parse("86-131-2270-1411", "CN");
51
+
52
+ $startMemory = memory_get_usage();
53
+ $location = $this->geocoder->getDescriptionForNumber($number, "en");
54
+ $endMemory = memory_get_usage();
55
+
56
+ $this->assertEquals("Shanghai", $location);
57
+
58
+ $memoryUsed = $endMemory - $startMemory;
59
+
60
+ $this->assertLessThan(5000000, $memoryUsed, "Memory usage should be below 5MB");
61
+ }
62
+
63
+ public function testChineseGeolocation()
64
+ {
65
+ $number = $this->phoneUtil->parse("+86 150 3657 7264", "CN");
66
+ $location = $this->geocoder->getDescriptionForNumber($number, "en");
67
+
68
+ $this->assertEquals("Luoyang, Henan", $location);
69
+ }
70
+
71
+ public function testChineseCarrierLookup()
72
+ {
73
+ $number = $this->phoneUtil->parse("+86 150 3657 7264", "CN");
74
+
75
+ $carrier = PhoneNumberToCarrierMapper::getInstance();
76
+
77
+ $location = $carrier->getNameForNumber($number, "en");
78
+
79
+ $this->assertEquals("China Mobile", $location);
80
+ }
81
+ }
82
+
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue4Test.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+
6
+ use libphonenumber\PhoneNumberFormat;
7
+ use libphonenumber\PhoneNumberUtil;
8
+
9
+ class Issue4Test extends \PHPUnit_Framework_TestCase
10
+ {
11
+
12
+ /**
13
+ * @var PhoneNumberUtil
14
+ */
15
+ public $phoneNumberUtil;
16
+
17
+ public function setUp()
18
+ {
19
+ PhoneNumberUtil::resetInstance();
20
+ $this->phoneNumberUtil = PhoneNumberUtil::getInstance();
21
+ }
22
+
23
+ public function testParseUSNumber()
24
+ {
25
+ $number = $this->phoneNumberUtil->parse('0351-152-303-473', 'AR');
26
+
27
+ $this->assertEquals("+5493512303473", $this->phoneNumberUtil->format($number, PhoneNumberFormat::E164));
28
+
29
+ }
30
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue64Test.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+
6
+ use libphonenumber\PhoneNumberUtil;
7
+ use libphonenumber\ShortNumberInfo;
8
+
9
+ class Issue64Test extends \PHPUnit_Framework_TestCase
10
+ {
11
+ public function testIssue64WithoutPhoneNumberUtil()
12
+ {
13
+ $sortNumberUtil = ShortNumberInfo::getInstance();
14
+ $this->assertTrue($sortNumberUtil->isEmergencyNumber('999', 'GB'));
15
+ }
16
+
17
+ public function testIssue64WithoutPhoneNumberUtilgetInstance()
18
+ {
19
+ PhoneNumberUtil::getInstance();
20
+
21
+ $sortNumberUtil = ShortNumberInfo::getInstance();
22
+ $this->assertTrue($sortNumberUtil->isEmergencyNumber('999', 'GB'));
23
+ }
24
+
25
+ public function testIssue64WithoutPhoneNumberUtilresetInstance()
26
+ {
27
+ PhoneNumberUtil::resetInstance();
28
+
29
+ $sortNumberUtil = ShortNumberInfo::getInstance();
30
+ $this->assertTrue($sortNumberUtil->isEmergencyNumber('999', 'GB'));
31
+ }
32
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue68Test.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+
6
+ use libphonenumber\PhoneNumberUtil;
7
+ use libphonenumber\ShortNumberInfo;
8
+
9
+ class Issue68Test extends \PHPUnit_Framework_TestCase
10
+ {
11
+ public function testShortNumberInfoIsPossibleShortNumberWithRegionMissingFromCodeSet()
12
+ {
13
+ $exampleNumber = $this->getExampleNumber('NE');
14
+
15
+ $shortNumberInfo = ShortNumberInfo::getInstance();
16
+
17
+ $this->assertFalse($shortNumberInfo->isPossibleShortNumber($exampleNumber));
18
+ }
19
+
20
+ public function testShortNumberInfoIsPossibleShortNumberForRegionWithRegionMissingFromCodeSet()
21
+ {
22
+ $exampleNumber = $this->getExampleNumber('NE');
23
+
24
+ $shortNumberInfo = ShortNumberInfo::getInstance();
25
+
26
+ $this->assertFalse($shortNumberInfo->isPossibleShortNumberForRegion($exampleNumber, 'NE'));
27
+ }
28
+
29
+ private function getExampleNumber($region)
30
+ {
31
+ $phoneUtil = PhoneNumberUtil::getInstance();
32
+
33
+ $exampleNumber = $phoneUtil->getExampleNumber($region);
34
+
35
+ // Reset PhoneNumberUtil just to make sure that doesn't interfere
36
+ PhoneNumberUtil::resetInstance();
37
+
38
+ return $exampleNumber;
39
+ }
40
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/Issue76Test.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+ use libphonenumber\PhoneNumberUtil;
6
+
7
+ class Issue76Test extends \PHPUnit_Framework_TestCase
8
+ {
9
+ /**
10
+ * @expectedException \libphonenumber\NumberParseException
11
+ * @expectedExceptionCode 1
12
+ * @expectedExceptionMessage The string supplied did not seem to be a phone number.
13
+ */
14
+ public function testIssue76()
15
+ {
16
+ $number = 'Abc811@hotmail.com';
17
+ $region = 'DE';
18
+ $util = PhoneNumberUtil::getInstance();
19
+ $util->parse($number, $region);
20
+ }
21
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/LocaleTest.php ADDED
@@ -0,0 +1,321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ *
5
+ * @author joshuag
6
+ * @created: 14/08/2014 12:35
7
+ * @project libphonenumber-for-php
8
+ */
9
+
10
+ namespace libphonenumber\Tests\Issues;
11
+
12
+
13
+ use libphonenumber\CountryCodeToRegionCodeMap;
14
+ use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
15
+ use libphonenumber\PhoneNumberType;
16
+ use libphonenumber\PhoneNumberUtil;
17
+
18
+ class LocaleTest extends \PHPUnit_Framework_TestCase
19
+ {
20
+ /**
21
+ * @var PhoneNumberOfflineGeocoder
22
+ */
23
+ private $geocoder;
24
+
25
+ /**
26
+ * @var PhoneNumberUtil
27
+ */
28
+ private $phoneUtil;
29
+
30
+ public function setUp()
31
+ {
32
+ if(!extension_loaded('intl')) {
33
+ $this->markTestSkipped('The intl extension must be installed');
34
+ }
35
+
36
+ PhoneNumberUtil::resetInstance();
37
+ PhoneNumberOfflineGeocoder::resetInstance();
38
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
39
+ $this->geocoder = PhoneNumberOfflineGeocoder::getInstance();
40
+ }
41
+
42
+ /**
43
+ * @dataProvider localeList
44
+ * @param string $regionCode
45
+ * @param string $countryName
46
+ */
47
+ public function testLocales($regionCode, $countryName)
48
+ {
49
+ if (!in_array($regionCode, $this->phoneUtil->getSupportedRegions())) {
50
+ $this->markTestSkipped("{$regionCode} is not supported");
51
+ }
52
+
53
+ $phoneNumber = $this->phoneUtil->getExampleNumberForType($regionCode, PhoneNumberType::FIXED_LINE_OR_MOBILE);
54
+
55
+ $this->assertContains($regionCode, CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap[$phoneNumber->getCountryCode()]);
56
+
57
+ $this->assertEquals($regionCode, $this->phoneUtil->getRegionCodeForNumber($phoneNumber));
58
+
59
+ $this->assertEquals($countryName, $this->geocoder->getDescriptionForValidNumber($phoneNumber, 'en', 'ZZ'), "Checking {$phoneNumber} is part of {$countryName}");
60
+ }
61
+
62
+ public function localeList()
63
+ {
64
+ $codes = $this->getCountryCodes();
65
+
66
+ $return = array();
67
+ foreach ($codes as $code => $country) {
68
+ $return[] = array($code, $country);
69
+ }
70
+
71
+ return $return;
72
+ }
73
+
74
+ /**
75
+ * This list was got from the Internet, and altered slightly to make the tests pass
76
+ *
77
+ * Bad country codes were removed, and names updated to match my Windows 7 Locale settings (these might be different
78
+ * on different operating systems and other Locales).
79
+ *
80
+ * @see https://gist.github.com/vxnick/380904
81
+ * @return array
82
+ */
83
+ private function getCountryCodes()
84
+ {
85
+ return array(
86
+ 'AF' => 'Afghanistan',
87
+ 'AX' => 'Åland Islands',
88
+ 'AL' => 'Albania',
89
+ 'DZ' => 'Algeria',
90
+ 'AS' => 'American Samoa',
91
+ 'AD' => 'Andorra',
92
+ 'AO' => 'Angola',
93
+ 'AI' => 'Anguilla',
94
+ 'AG' => 'Antigua and Barbuda',
95
+ 'AR' => 'Argentina',
96
+ 'AU' => 'Australia',
97
+ 'AT' => 'Austria',
98
+ 'AZ' => 'Azerbaijan',
99
+ 'BS' => 'Bahamas',
100
+ 'BH' => 'Bahrain',
101
+ 'BD' => 'Bangladesh',
102
+ 'BB' => 'Barbados',
103
+ 'BY' => 'Belarus',
104
+ 'BE' => 'Belgium',
105
+ 'BZ' => 'Belize',
106
+ 'BJ' => 'Benin',
107
+ 'BM' => 'Bermuda',
108
+ 'BT' => 'Bhutan',
109
+ 'BO' => 'Bolivia',
110
+ 'BA' => 'Bosnia and Herzegovina',
111
+ 'BW' => 'Botswana',
112
+ 'BR' => 'Brazil',
113
+ 'IO' => 'British Indian Ocean Territory',
114
+ 'BN' => 'Brunei',
115
+ 'BG' => 'Bulgaria',
116
+ 'BF' => 'Burkina Faso',
117
+ 'BI' => 'Burundi',
118
+ 'KH' => 'Cambodia',
119
+ 'CM' => 'Cameroon',
120
+ 'CA' => 'Canada',
121
+ 'CV' => 'Cape Verde',
122
+ 'KY' => 'Cayman Islands',
123
+ 'CF' => 'Central African Republic',
124
+ 'TD' => 'Chad',
125
+ 'CL' => 'Chile',
126
+ 'CN' => 'China',
127
+ 'CX' => 'Christmas Island',
128
+ 'CC' => 'Cocos [Keeling] Islands',
129
+ 'CO' => 'Colombia',
130
+ 'KM' => 'Comoros',
131
+ 'CG' => 'Congo - Brazzaville',
132
+ 'CD' => 'Congo - Kinshasa',
133
+ 'CK' => 'Cook Islands',
134
+ 'CR' => 'Costa Rica',
135
+ 'CI' => 'Côte d’Ivoire',
136
+ 'HR' => 'Croatia',
137
+ 'CU' => 'Cuba',
138
+ 'CY' => 'Cyprus',
139
+ 'CZ' => 'Czech Republic',
140
+ 'DK' => 'Denmark',
141
+ 'DJ' => 'Djibouti',
142
+ 'DM' => 'Dominica',
143
+ 'DO' => 'Dominican Republic',
144
+ 'EC' => 'Ecuador',
145
+ 'EG' => 'Egypt',
146
+ 'SV' => 'El Salvador',
147
+ 'GQ' => 'Equatorial Guinea',
148
+ 'ER' => 'Eritrea',
149
+ 'EE' => 'Estonia',
150
+ 'ET' => 'Ethiopia',
151
+ 'FK' => 'Falkland Islands',
152
+ 'FO' => 'Faroe Islands',
153
+ 'FJ' => 'Fiji',
154
+ 'FI' => 'Finland',
155
+ 'FR' => 'France',
156
+ 'GF' => 'French Guiana',
157
+ 'PF' => 'French Polynesia',
158
+ 'GA' => 'Gabon',
159
+ 'GM' => 'Gambia',
160
+ 'GE' => 'Georgia',
161
+ 'DE' => 'Germany',
162
+ 'GH' => 'Ghana',
163
+ 'GI' => 'Gibraltar',
164
+ 'GR' => 'Greece',
165
+ 'GL' => 'Greenland',
166
+ 'GD' => 'Grenada',
167
+ 'GP' => 'Guadeloupe',
168
+ 'GU' => 'Guam',
169
+ 'GT' => 'Guatemala',
170
+ 'GG' => 'Guernsey',
171
+ 'GN' => 'Guinea',
172
+ 'GW' => 'Guinea-Bissau',
173
+ 'GY' => 'Guyana',
174
+ 'HT' => 'Haiti',
175
+ 'HN' => 'Honduras',
176
+ 'HK' => 'Hong Kong SAR China',
177
+ 'HU' => 'Hungary',
178
+ 'IS' => 'Iceland',
179
+ 'IN' => 'India',
180
+ 'ID' => 'Indonesia',
181
+ 'IR' => 'Iran',
182
+ 'IQ' => 'Iraq',
183
+ 'IE' => 'Ireland',
184
+ 'IM' => 'Isle of Man',
185
+ 'IL' => 'Israel',
186
+ 'IT' => 'Italy',
187
+ 'JM' => 'Jamaica',
188
+ 'JP' => 'Japan',
189
+ 'JE' => 'Jersey',
190
+ 'JO' => 'Jordan',
191
+ 'KZ' => 'Kazakhstan',
192
+ 'KE' => 'Kenya',
193
+ 'KI' => 'Kiribati',
194
+ 'KP' => 'North Korea',
195
+ 'KR' => 'South Korea',
196
+ 'KW' => 'Kuwait',
197
+ 'KG' => 'Kyrgyzstan',
198
+ 'LA' => 'Laos',
199
+ 'LV' => 'Latvia',
200
+ 'LB' => 'Lebanon',
201
+ 'LS' => 'Lesotho',
202
+ 'LR' => 'Liberia',
203
+ 'LY' => 'Libya',
204
+ 'LI' => 'Liechtenstein',
205
+ 'LT' => 'Lithuania',
206
+ 'LU' => 'Luxembourg',
207
+ 'MO' => 'Macau SAR China',
208
+ 'MK' => 'Macedonia',
209
+ 'MG' => 'Madagascar',
210
+ 'MW' => 'Malawi',
211
+ 'MY' => 'Malaysia',
212
+ 'MV' => 'Maldives',
213
+ 'ML' => 'Mali',
214
+ 'MT' => 'Malta',
215
+ 'MH' => 'Marshall Islands',
216
+ 'MQ' => 'Martinique',
217
+ 'MR' => 'Mauritania',
218
+ 'MU' => 'Mauritius',
219
+ 'YT' => 'Mayotte',
220
+ 'MX' => 'Mexico',
221
+ 'FM' => 'Micronesia',
222
+ 'MD' => 'Moldova',
223
+ 'MC' => 'Monaco',
224
+ 'MN' => 'Mongolia',
225
+ 'ME' => 'Montenegro',
226
+ 'MS' => 'Montserrat',
227
+ 'MA' => 'Morocco',
228
+ 'MZ' => 'Mozambique',
229
+ 'MM' => 'Myanmar [Burma]',
230
+ 'NA' => 'Namibia',
231
+ 'NR' => 'Nauru',
232
+ 'NP' => 'Nepal',
233
+ 'NL' => 'Netherlands',
234
+ 'NC' => 'New Caledonia',
235
+ 'NZ' => 'New Zealand',
236
+ 'NI' => 'Nicaragua',
237
+ 'NE' => 'Niger',
238
+ 'NG' => 'Nigeria',
239
+ 'NU' => 'Niue',
240
+ 'NF' => 'Norfolk Island',
241
+ 'MP' => 'Northern Mariana Islands',
242
+ 'NO' => 'Norway',
243
+ 'OM' => 'Oman',
244
+ 'PK' => 'Pakistan',
245
+ 'PW' => 'Palau',
246
+ 'PS' => 'Palestinian Territories',
247
+ 'PA' => 'Panama',
248
+ 'PG' => 'Papua New Guinea',
249
+ 'PY' => 'Paraguay',
250
+ 'PE' => 'Peru',
251
+ 'PH' => 'Philippines',
252
+ 'PL' => 'Poland',
253
+ 'PT' => 'Portugal',
254
+ 'PR' => 'Puerto Rico',
255
+ 'QA' => 'Qatar',
256
+ 'RE' => 'Réunion',
257
+ 'RO' => 'Romania',
258
+ 'RU' => 'Russia',
259
+ 'RW' => 'Rwanda',
260
+ 'SH' => 'Saint Helena',
261
+ 'KN' => 'Saint Kitts and Nevis',
262
+ 'LC' => 'Saint Lucia',
263
+ 'PM' => 'Saint Pierre and Miquelon',
264
+ 'VC' => 'Saint Vincent and the Grenadines',
265
+ 'WS' => 'Samoa',
266
+ 'SM' => 'San Marino',
267
+ 'ST' => 'São Tomé and Príncipe',
268
+ 'SA' => 'Saudi Arabia',
269
+ 'SN' => 'Senegal',
270
+ 'RS' => 'Serbia',
271
+ 'SC' => 'Seychelles',
272
+ 'SL' => 'Sierra Leone',
273
+ 'SG' => 'Singapore',
274
+ 'SK' => 'Slovakia',
275
+ 'SI' => 'Slovenia',
276
+ 'SB' => 'Solomon Islands',
277
+ 'SO' => 'Somalia',
278
+ 'ZA' => 'South Africa',
279
+ 'ES' => 'Spain',
280
+ 'LK' => 'Sri Lanka',
281
+ 'SD' => 'Sudan',
282
+ 'SR' => 'Suriname',
283
+ 'SJ' => 'Svalbard and Jan Mayen',
284
+ 'SZ' => 'Swaziland',
285
+ 'SE' => 'Sweden',
286
+ 'CH' => 'Switzerland',
287
+ 'SY' => 'Syria',
288
+ 'TW' => 'Taiwan',
289
+ 'TJ' => 'Tajikistan',
290
+ 'TZ' => 'Tanzania',
291
+ 'TH' => 'Thailand',
292
+ 'TL' => 'Timor-Leste',
293
+ 'TG' => 'Togo',
294
+ 'TK' => 'Tokelau',
295
+ 'TO' => 'Tonga',
296
+ 'TT' => 'Trinidad and Tobago',
297
+ 'TN' => 'Tunisia',
298
+ 'TR' => 'Turkey',
299
+ 'TM' => 'Turkmenistan',
300
+ 'TC' => 'Turks and Caicos Islands',
301
+ 'TV' => 'Tuvalu',
302
+ 'UG' => 'Uganda',
303
+ 'UA' => 'Ukraine',
304
+ 'AE' => 'United Arab Emirates',
305
+ 'GB' => 'United Kingdom',
306
+ 'US' => 'United States',
307
+ 'UY' => 'Uruguay',
308
+ 'UZ' => 'Uzbekistan',
309
+ 'VU' => 'Vanuatu',
310
+ 'VE' => 'Venezuela',
311
+ 'VN' => 'Vietnam',
312
+ 'VG' => 'British Virgin Islands',
313
+ 'VI' => 'U.S. Virgin Islands',
314
+ 'WF' => 'Wallis and Futuna',
315
+ 'EH' => 'Western Sahara',
316
+ 'YE' => 'Yemen',
317
+ 'ZM' => 'Zambia',
318
+ 'ZW' => 'Zimbabwe',
319
+ );
320
+ }
321
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/PHP7Test.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace libphonenumber\Tests\Issues;
5
+
6
+
7
+ use libphonenumber\PhoneNumberFormat;
8
+ use libphonenumber\PhoneNumberUtil;
9
+
10
+ class PHP7Test extends \PHPUnit_Framework_TestCase
11
+ {
12
+ /**
13
+ * @var PhoneNumberUtil
14
+ */
15
+ private $phoneUtil;
16
+
17
+ public function setUp()
18
+ {
19
+ PhoneNumberUtil::resetInstance();
20
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
21
+ }
22
+
23
+ /**
24
+ * @param $number
25
+ * @dataProvider validPolishNumbers
26
+ */
27
+ public function testValidPolishNumbers($number)
28
+ {
29
+ $phoneNumber = $this->phoneUtil->parse($number, 'PL');
30
+
31
+ $this->assertTrue($this->phoneUtil->isValidNumber($phoneNumber));
32
+ $this->assertEquals($number, $this->phoneUtil->format($phoneNumber, PhoneNumberFormat::NATIONAL));
33
+ }
34
+
35
+ public function validPolishNumbers()
36
+ {
37
+ return array(
38
+ array('22 222 22 22'),
39
+ array('33 222 22 22'),
40
+ array('46 222 22 22'),
41
+ array('61 222 22 22'),
42
+ array('62 222 22 22'),
43
+ array('642 222 222'),
44
+ array('65 222 22 22'),
45
+ array('512 345 678'),
46
+ array('800 123 456'),
47
+ array('700 000 000'),
48
+ array('801 234 567'),
49
+ array('91 000 00 00'),
50
+ );
51
+ }
52
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/Issues/UKNumbersTest.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\Issues;
4
+
5
+ use libphonenumber\CountryCodeToRegionCodeMap;
6
+ use libphonenumber\PhoneNumberFormat;
7
+ use libphonenumber\PhoneNumberType;
8
+ use libphonenumber\PhoneNumberUtil;
9
+
10
+
11
+ class UKNumbersTest extends \PHPUnit_Framework_TestCase
12
+ {
13
+ const META_DATA_FILE_PREFIX = 'PhoneNumberMetadata';
14
+ /**
15
+ * @var \libphonenumber\PhoneNumberUtil
16
+ */
17
+ protected $phoneUtil;
18
+
19
+ public function __construct()
20
+ {
21
+ PhoneNumberUtil::resetInstance();
22
+ $this->phoneUtil = PhoneNumberUtil::getInstance(
23
+ self::META_DATA_FILE_PREFIX,
24
+ CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap
25
+ );;
26
+ }
27
+
28
+ public function testMobileNumber()
29
+ {
30
+ $number = '07987458147';
31
+ $phoneObject = $this->phoneUtil->parse($number, 'GB');
32
+
33
+ $valid = $this->phoneUtil->isValidNumber($phoneObject);
34
+ $this->assertTrue($valid, "Checking phone number is valid");
35
+
36
+ $type = $this->phoneUtil->getNumberType($phoneObject);
37
+ $this->assertEquals(PhoneNumberType::MOBILE, $type, "Checking phone number is detected as mobile");
38
+
39
+ $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164);
40
+ $this->assertEquals("+447987458147", $formattedE164, "Checking E164 format is correct");
41
+
42
+ $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL);
43
+ $this->assertEquals("07987 458147", $formattedNational, "Checking National format is correct");
44
+ }
45
+
46
+ public function testFixedLine()
47
+ {
48
+ $number = '01234512345';
49
+ $phoneObject = $this->phoneUtil->parse($number, 'GB');
50
+
51
+ $valid = $this->phoneUtil->isValidNumber($phoneObject);
52
+ $this->assertTrue($valid, "Checking phone number is valid");
53
+
54
+ $type = $this->phoneUtil->getNumberType($phoneObject);
55
+ $this->assertEquals(PhoneNumberType::FIXED_LINE, $type, "Checking phone number is detected as fixed line");
56
+
57
+ $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164);
58
+ $this->assertEquals("+441234512345", $formattedE164, "Checking E164 format is correct");
59
+
60
+ $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL);
61
+ $this->assertEquals("01234 512345", $formattedNational, "Checking National format is correct");
62
+ }
63
+
64
+ public function testSharedCost()
65
+ {
66
+ $number = '08451234568';
67
+ $phoneObject = $this->phoneUtil->parse($number, 'GB');
68
+
69
+ $valid = $this->phoneUtil->isValidNumber($phoneObject);
70
+ $this->assertTrue($valid, "Checking phone number is valid");
71
+
72
+ $type = $this->phoneUtil->getNumberType($phoneObject);
73
+ $this->assertEquals(PhoneNumberType::SHARED_COST, $type, "Checking phone number is detected as shared cost");
74
+
75
+ $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164);
76
+ $this->assertEquals("+448451234568", $formattedE164, "Checking E164 format is correct");
77
+
78
+ $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL);
79
+ $this->assertEquals("0845 123 4568", $formattedNational, "Checking National format is correct");
80
+ }
81
+
82
+ public function testPersonalNumber()
83
+ {
84
+ $number = '07010020249';
85
+ $phoneObject = $this->phoneUtil->parse($number, 'GB');
86
+
87
+ $valid = $this->phoneUtil->isValidNumber($phoneObject);
88
+ $this->assertTrue($valid, "Checking phone number is valid");
89
+
90
+ $type = $this->phoneUtil->getNumberType($phoneObject);
91
+ $this->assertEquals(
92
+ PhoneNumberType::PERSONAL_NUMBER,
93
+ $type,
94
+ "Checking phone number is detected as a personal number"
95
+ );
96
+
97
+ $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164);
98
+ $this->assertEquals("+447010020249", $formattedE164, "Checking E164 format is correct");
99
+
100
+ $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL);
101
+ $this->assertEquals("070 1002 0249", $formattedNational, "Checking National format is correct");
102
+ }
103
+
104
+ public function testUAN()
105
+ {
106
+ $number = '03335555555';
107
+ $phoneObject = $this->phoneUtil->parse($number, 'GB');
108
+
109
+ $valid = $this->phoneUtil->isValidNumber($phoneObject);
110
+ $this->assertTrue($valid, "Checking phone number is valid");
111
+
112
+ $type = $this->phoneUtil->getNumberType($phoneObject);
113
+ $this->assertEquals(PhoneNumberType::UAN, $type, "Checking phone number is detected as UAN");
114
+
115
+ $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164);
116
+ $this->assertEquals("+443335555555", $formattedE164, "Checking E164 format is correct");
117
+
118
+ $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL);
119
+ $this->assertEquals("0333 555 5555", $formattedNational, "Checking National format is correct");
120
+ }
121
+
122
+ public function testTollFree()
123
+ {
124
+ $number = '0800800150';
125
+ $phoneObject = $this->phoneUtil->parse($number, 'GB');
126
+
127
+ $valid = $this->phoneUtil->isValidNumber($phoneObject);
128
+ $this->assertTrue($valid, "Checking phone number is valid");
129
+
130
+ $type = $this->phoneUtil->getNumberType($phoneObject);
131
+ $this->assertEquals(PhoneNumberType::TOLL_FREE, $type, "Checking phone number is detected as TOLL FREE");
132
+
133
+ $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164);
134
+ $this->assertEquals("+44800800150", $formattedE164, "Checking E164 format is correct");
135
+
136
+ $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL);
137
+ $this->assertEquals("0800 800150", $formattedNational, "Checking National format is correct");
138
+ }
139
+
140
+ public function testPremium()
141
+ {
142
+ $number = '09063020288';
143
+ $phoneObject = $this->phoneUtil->parse($number, 'GB');
144
+
145
+ $valid = $this->phoneUtil->isValidNumber($phoneObject);
146
+ $this->assertTrue($valid, "Checking phone number is valid");
147
+
148
+ $type = $this->phoneUtil->getNumberType($phoneObject);
149
+ $this->assertEquals(PhoneNumberType::PREMIUM_RATE, $type, "Checking phone number is detected as PREMIUM RATE");
150
+
151
+ $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164);
152
+ $this->assertEquals("+449063020288", $formattedE164, "Checking E164 format is correct");
153
+
154
+ $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL);
155
+ $this->assertEquals("0906 302 0288", $formattedNational, "Checking National format is correct");
156
+ }
157
+
158
+ public function testChildLine()
159
+ {
160
+ $number = '08001111';
161
+ $phoneObject = $this->phoneUtil->parse($number, 'GB');
162
+
163
+ $valid = $this->phoneUtil->isValidNumber($phoneObject);
164
+ $this->assertTrue($valid, "Checking phone number is valid");
165
+
166
+ $type = $this->phoneUtil->getNumberType($phoneObject);
167
+ $this->assertEquals(
168
+ PhoneNumberType::TOLL_FREE,
169
+ $type,
170
+ "Checking phone number is detected as TOLL FREE"
171
+ );
172
+
173
+ $formattedE164 = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::E164);
174
+ $this->assertEquals("+448001111", $formattedE164, "Checking E164 format is correct");
175
+
176
+ $formattedNational = $this->phoneUtil->format($phoneObject, PhoneNumberFormat::NATIONAL);
177
+ $this->assertEquals("0800 1111", $formattedNational, "Checking National format is correct");
178
+ }
179
+
180
+ public function testInvalidNumber()
181
+ {
182
+ $number = '123401234512345';
183
+ $phoneObject = $this->phoneUtil->parse($number, 'GB');
184
+
185
+ $valid = $this->phoneUtil->isValidNumber($phoneObject);
186
+ $this->assertFalse($valid, "Checking phone number is invalid");
187
+ }
188
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/buildtools/GeneratePhonePrefixDataTest.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\buildtools;
4
+
5
+
6
+ use libphonenumber\buildtools\GeneratePhonePrefixData;
7
+
8
+ class GeneratePhonePrefixDataTest extends \PHPUnit_Framework_TestCase
9
+ {
10
+ private static $available_data_files;
11
+
12
+ public static function setUpBeforeClass()
13
+ {
14
+ $temporaryMap = array();
15
+
16
+ $phonePrefixData = new GeneratePhonePrefixData();
17
+
18
+
19
+ // Languages for US.
20
+ $phonePrefixData->addConfigurationMapping($temporaryMap, "1", "en");
21
+ $phonePrefixData->addConfigurationMapping($temporaryMap, "1", "en_US");
22
+ $phonePrefixData->addConfigurationMapping($temporaryMap, "1", "es");
23
+
24
+ // Languages for France.
25
+ $phonePrefixData->addConfigurationMapping($temporaryMap, "33", "fr");
26
+ $phonePrefixData->addConfigurationMapping($temporaryMap, "33", "en");
27
+
28
+ // Languages for China.
29
+ $phonePrefixData->addConfigurationMapping($temporaryMap, "86", "zh_Hans");
30
+
31
+ self::$available_data_files = $temporaryMap;
32
+ }
33
+
34
+ public function testAddConfigurationMapping()
35
+ {
36
+ $this->assertCount(3, self::$available_data_files);
37
+
38
+ $languagesForUS = self::$available_data_files[1];
39
+
40
+ $this->assertContains("en", $languagesForUS);
41
+ $this->assertContains("en_US", $languagesForUS);
42
+ $this->assertContains("es", $languagesForUS);
43
+
44
+ $languagesForFR = self::$available_data_files[33];
45
+
46
+ $this->assertContains("fr", $languagesForFR);
47
+ $this->assertContains("en", $languagesForFR);
48
+
49
+ $languagesForCN = self::$available_data_files[86];
50
+ $this->assertCount(1, $languagesForCN);
51
+
52
+ $this->assertContains("zh_Hans", $languagesForCN);
53
+ }
54
+
55
+
56
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/PhoneNumberToCarrierMapperTest.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\carrier;
4
+
5
+ use libphonenumber\PhoneNumber;
6
+ use libphonenumber\PhoneNumberToCarrierMapper;
7
+ use libphonenumber\PhoneNumberUtil;
8
+
9
+ class PhoneNumberToCarrierMapperTest extends \PHPUnit_Framework_TestCase
10
+ {
11
+ const TEST_META_DATA_FILE_PREFIX = "/../../Tests/libphonenumber/Tests/carrier/data/";
12
+ private static $AO_MOBILE1;
13
+ private static $AO_MOBILE2;
14
+ private static $AO_FIXED1;
15
+ private static $AO_FIXED2;
16
+ private static $AO_INVALID_NUMBER;
17
+ private static $UK_MOBILE1;
18
+ private static $UK_MOBILE2;
19
+ private static $UK_FIXED1;
20
+ private static $UK_FIXED2;
21
+ private static $UK_INVALID_NUMBER;
22
+ private static $UK_PAGER;
23
+ private static $US_FIXED_OR_MOBILE;
24
+ private static $NUMBER_WITH_INVALID_COUNTRY_CODE;
25
+ private static $INTERNATIONAL_TOLL_FREE;
26
+ /**
27
+ * @var PhoneNumberToCarrierMapper
28
+ */
29
+ protected $carrierMapper;
30
+
31
+ public static function setUpBeforeClass()
32
+ {
33
+ PhoneNumberUtil::resetInstance();
34
+
35
+ self::$AO_MOBILE1 = new PhoneNumber();
36
+ self::$AO_MOBILE1->setCountryCode(244)->setNationalNumber(917654321);
37
+
38
+ self::$AO_MOBILE2 = new PhoneNumber();
39
+ self::$AO_MOBILE2->setCountryCode(244)->setNationalNumber(927654321);
40
+
41
+ self::$AO_FIXED1 = new PhoneNumber();
42
+ self::$AO_FIXED1->setCountryCode(244)->setNationalNumber(22254321);
43
+
44
+ self::$AO_FIXED2 = new PhoneNumber();
45
+ self::$AO_FIXED2->setCountryCode(244)->setNationalNumber(26254321);
46
+
47
+ self::$AO_INVALID_NUMBER = new PhoneNumber();
48
+ self::$AO_INVALID_NUMBER->setCountryCode(244)->setNationalNumber(101234);
49
+
50
+ self::$UK_MOBILE1 = new PhoneNumber();
51
+ self::$UK_MOBILE1->setCountryCode(44)->setNationalNumber(7387654321);
52
+
53
+ self::$UK_MOBILE2 = new PhoneNumber();
54
+ self::$UK_MOBILE2->setCountryCode(44)->setNationalNumber(7487654321);
55
+
56
+ self::$UK_FIXED1 = new PhoneNumber();
57
+ self::$UK_FIXED1->setCountryCode(44)->setNationalNumber(1123456789);
58
+
59
+ self::$UK_FIXED2 = new PhoneNumber();
60
+ self::$UK_FIXED2->setCountryCode(44)->setNationalNumber(2987654321);
61
+
62
+ self::$UK_INVALID_NUMBER = new PhoneNumber();
63
+ self::$UK_INVALID_NUMBER->setCountryCode(44)->setNationalNumber(7301234);
64
+
65
+ self::$UK_PAGER = new PhoneNumber();
66
+ self::$UK_PAGER->setCountryCode(44)->setNationalNumber(7601234567);
67
+
68
+ self::$US_FIXED_OR_MOBILE = new PhoneNumber();
69
+ self::$US_FIXED_OR_MOBILE->setCountryCode(1)->setNationalNumber(6502123456);
70
+
71
+ self::$NUMBER_WITH_INVALID_COUNTRY_CODE = new PhoneNumber();
72
+ self::$NUMBER_WITH_INVALID_COUNTRY_CODE->setCountryCode(999)->setNationalNumber(2423651234);
73
+
74
+ self::$INTERNATIONAL_TOLL_FREE = new PhoneNumber();
75
+ self::$INTERNATIONAL_TOLL_FREE->setCountryCode(800)->setNationalNumber(12345678);
76
+ }
77
+
78
+ public function setUp()
79
+ {
80
+ if(!extension_loaded('intl')) {
81
+ $this->markTestSkipped('The intl extension must be installed');
82
+ }
83
+
84
+ $this->carrierMapper = PhoneNumberToCarrierMapper::getInstance(self::TEST_META_DATA_FILE_PREFIX);
85
+ }
86
+
87
+ public function testGetNameForMobilePortableRegion()
88
+ {
89
+ $this->assertEquals("British carrier", $this->carrierMapper->getNameForNumber(self::$UK_MOBILE1, "en"));
90
+ $this->assertEquals("Brittisk operat" . pack('H*', 'c3b6') . "r", $this->carrierMapper->getNameForNumber(self::$UK_MOBILE1, "sv_SE"));
91
+ $this->assertEquals("British carrier", $this->carrierMapper->getNameForNumber(self::$UK_MOBILE1, "fr"));
92
+ // Returns an empty string because the UK implements mobile number portability.
93
+ $this->assertEquals("", $this->carrierMapper->getSafeDisplayName(self::$UK_MOBILE1, "en"));
94
+ }
95
+
96
+ public function testGetNameForNonMobilePortableRegion()
97
+ {
98
+ $this->assertEquals("Angolan carrier", $this->carrierMapper->getNameForNumber(self::$AO_MOBILE1, "en"));
99
+ $this->assertEquals("Angolan carrier", $this->carrierMapper->getSafeDisplayName(self::$AO_MOBILE1, "en"));
100
+ }
101
+
102
+ public function testGetNameForFixedLineNumber()
103
+ {
104
+ $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$AO_FIXED1, "en"));
105
+ $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$UK_FIXED1, "en"));
106
+ // If the carrier information is present in the files and the method that assumes a valid
107
+ // number is used, a carrier is returned
108
+ $this->assertEquals("Angolan fixed line carrier", $this->carrierMapper->getNameForValidNumber(self::$AO_FIXED2, "en"));
109
+ $this->assertEquals("", $this->carrierMapper->getNameForValidNumber(self::$UK_FIXED2, "en"));
110
+ }
111
+
112
+ public function testGetNameForFixedOrMobileNumber()
113
+ {
114
+ $this->assertEquals("US carrier", $this->carrierMapper->getNameForNumber(self::$US_FIXED_OR_MOBILE, "en"));
115
+ }
116
+
117
+ public function testGetNameForPagerNumber()
118
+ {
119
+ $this->assertEquals("British pager", $this->carrierMapper->getNameForNumber(self::$UK_PAGER, "en"));
120
+ }
121
+
122
+ public function testGetNameForNumberWithNoDataFile()
123
+ {
124
+ $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$NUMBER_WITH_INVALID_COUNTRY_CODE, "en"));
125
+ $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$INTERNATIONAL_TOLL_FREE, "en"));
126
+
127
+ $this->assertEquals("", $this->carrierMapper->getNameForValidNumber(self::$NUMBER_WITH_INVALID_COUNTRY_CODE, "en"));
128
+ $this->assertEquals("", $this->carrierMapper->getNameForValidNumber(self::$INTERNATIONAL_TOLL_FREE, "en"));
129
+ }
130
+
131
+ public function testGetNameForNumberWithMissingPrefix()
132
+ {
133
+ $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$UK_MOBILE2, "en"));
134
+ $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$AO_MOBILE2, "en"));
135
+ }
136
+
137
+ public function testGetNameForInvalidNumber()
138
+ {
139
+ $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$UK_INVALID_NUMBER, "en"));
140
+ $this->assertEquals("", $this->carrierMapper->getNameForNumber(self::$AO_INVALID_NUMBER, "en"));
141
+
142
+ }
143
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/Map.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 'en' =>
9
+ array (
10
+ 0 => 1650,
11
+ 1 => 244,
12
+ 2 => 44,
13
+ ),
14
+ 'sv' =>
15
+ array (
16
+ 0 => 44,
17
+ ),
18
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/en/1650.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1650212 => 'US carrier',
9
+ 1650213 => 'US carrier2',
10
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/en/244.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 244262 => 'Angolan fixed line carrier',
9
+ 244917 => 'Angolan carrier',
10
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/en/44.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 4411 => 'British fixed line carrier',
9
+ 4473 => 'British carrier',
10
+ 44760 => 'British pager',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/carrier/data/sv/44.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 4473 => 'Brittisk operatör',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/ExampleNumbersTest.php ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\core;
4
+
5
+ use libphonenumber\NumberParseException;
6
+ use libphonenumber\PhoneNumberFormat;
7
+ use libphonenumber\PhoneNumberType;
8
+ use libphonenumber\PhoneNumberUtil;
9
+ use libphonenumber\ShortNumberCost;
10
+ use libphonenumber\ShortNumberInfo;
11
+
12
+ /**
13
+ * Verifies all of the example numbers in the metadata are valid and of the correct type. If no
14
+ * example number exists for a particular type, the test still passes.
15
+ */
16
+ class ExampleNumbersTest extends \PHPUnit_Framework_TestCase
17
+ {
18
+
19
+ /**
20
+ * @var PhoneNumberUtil
21
+ */
22
+ private $phoneNumberUtil;
23
+ /**
24
+ * @var ShortNumberInfo
25
+ */
26
+ private $shortNumberInfo;
27
+
28
+ public static function setUpBeforeClass()
29
+ {
30
+ PhoneNumberUtil::resetInstance();
31
+ PhoneNumberUtil::getInstance();
32
+ ShortNumberInfo::resetInstance();
33
+ }
34
+
35
+ public function setUp()
36
+ {
37
+ $this->phoneNumberUtil = PhoneNumberUtil::getInstance();
38
+ $this->shortNumberInfo = ShortNumberInfo::getInstance();
39
+ }
40
+
41
+ public function regionList()
42
+ {
43
+ $returnList = array();
44
+
45
+ PhoneNumberUtil::resetInstance();
46
+ $phoneUtil = PhoneNumberUtil::getInstance();
47
+ foreach ($phoneUtil->getSupportedRegions() as $regionCode) {
48
+ $returnList[] = array($regionCode);
49
+ }
50
+
51
+ return $returnList;
52
+ }
53
+
54
+ /**
55
+ * @dataProvider regionList
56
+ */
57
+ public function testFixedLine($region)
58
+ {
59
+ $fixedLineTypes = array(PhoneNumberType::FIXED_LINE, PhoneNumberType::FIXED_LINE_OR_MOBILE);
60
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::FIXED_LINE, $fixedLineTypes, $region);
61
+ }
62
+
63
+ /**
64
+ * @dataProvider regionList
65
+ */
66
+ public function testFixedLineOrMobile($region)
67
+ {
68
+ $numberTypes = array(PhoneNumberType::FIXED_LINE, PhoneNumberType::FIXED_LINE_OR_MOBILE);
69
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::FIXED_LINE_OR_MOBILE, $numberTypes, $region);
70
+ }
71
+
72
+ private function checkNumbersValidAndCorrectType($exampleNumberRequestedType, $possibleExpectedTypes, $regionCode)
73
+ {
74
+ $exampleNumber = $this->phoneNumberUtil->getExampleNumberForType($regionCode, $exampleNumberRequestedType);
75
+ if ($exampleNumber !== null) {
76
+ $this->assertTrue(
77
+ $this->phoneNumberUtil->isValidNumber($exampleNumber),
78
+ "Failed validation for {$exampleNumber}"
79
+ );
80
+
81
+ // We know the number is valid, now we check the type.
82
+ $exampleNumberType = $this->phoneNumberUtil->getNumberType($exampleNumber);
83
+ $this->assertContains($exampleNumberType, $possibleExpectedTypes, "Wrong type for {$exampleNumber}");
84
+ }
85
+ }
86
+
87
+ /**
88
+ * @dataProvider regionList
89
+ */
90
+ public function testMobile($region)
91
+ {
92
+ $mobileTypes = array(PhoneNumberType::MOBILE, PhoneNumberType::FIXED_LINE_OR_MOBILE);
93
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::MOBILE, $mobileTypes, $region);
94
+ }
95
+
96
+ /**
97
+ * @dataProvider regionList
98
+ */
99
+ public function testTollFree($region)
100
+ {
101
+ $tollFreeTypes = array(PhoneNumberType::TOLL_FREE);
102
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::TOLL_FREE, $tollFreeTypes, $region);
103
+ }
104
+
105
+ /**
106
+ * @dataProvider regionList
107
+ */
108
+ public function testPremiumRate($region)
109
+ {
110
+ $premiumRateTypes = array(PhoneNumberType::PREMIUM_RATE);
111
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::PREMIUM_RATE, $premiumRateTypes, $region);
112
+ }
113
+
114
+ /**
115
+ * @dataProvider regionList
116
+ */
117
+ public function testVoip($region)
118
+ {
119
+ $voipTypes = array(PhoneNumberType::VOIP);
120
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::VOIP, $voipTypes, $region);
121
+ }
122
+
123
+ /**
124
+ * @dataProvider regionList
125
+ */
126
+ public function testPager($region)
127
+ {
128
+ $pagerTypes = array(PhoneNumberType::PAGER);
129
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::PAGER, $pagerTypes, $region);
130
+ }
131
+
132
+ /**
133
+ * @dataProvider regionList
134
+ */
135
+ public function testUan($region)
136
+ {
137
+ $uanTypes = array(PhoneNumberType::UAN);
138
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::UAN, $uanTypes, $region);
139
+ }
140
+
141
+ /**
142
+ * @dataProvider regionList
143
+ */
144
+ public function testVoicemail($region)
145
+ {
146
+ $voicemailTypes = array(PhoneNumberType::VOICEMAIL);
147
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::VOICEMAIL, $voicemailTypes, $region);
148
+ }
149
+
150
+ /**
151
+ * @dataProvider regionList
152
+ */
153
+ public function testPersonalNumber($region)
154
+ {
155
+ $numberTypes = array(PhoneNumberType::PERSONAL_NUMBER);
156
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::PERSONAL_NUMBER, $numberTypes, $region);
157
+ }
158
+
159
+ /**
160
+ * @dataProvider regionList
161
+ */
162
+ public function testSharedCost($region)
163
+ {
164
+ $sharedCostTypes = array(PhoneNumberType::SHARED_COST);
165
+ $this->checkNumbersValidAndCorrectType(PhoneNumberType::SHARED_COST, $sharedCostTypes, $region);
166
+ }
167
+
168
+ /**
169
+ * @dataProvider regionList
170
+ */
171
+ public function testCanBeInternationallyDialled($regionCode)
172
+ {
173
+
174
+ $exampleNumber = null;
175
+ /** @var \libphonenumber\PhoneNumberDesc $desc */
176
+ $desc = $this->phoneNumberUtil->getMetadataForRegion($regionCode)->getNoInternationalDialling();
177
+ try {
178
+ if ($desc->hasExampleNumber()) {
179
+ $exampleNumber = $this->phoneNumberUtil->parse($desc->getExampleNumber(), $regionCode);
180
+ }
181
+ } catch (NumberParseException $e) {
182
+
183
+ }
184
+
185
+ if ($exampleNumber !== null && $this->phoneNumberUtil->canBeInternationallyDialled($exampleNumber)) {
186
+ $this->fail("Number {$exampleNumber} should not be internationally diallable");
187
+ }
188
+ }
189
+
190
+ public function shortNumberRegionList()
191
+ {
192
+ $returnList = array();
193
+
194
+ PhoneNumberUtil::resetInstance();
195
+ ShortNumberInfo::resetInstance();
196
+ $shortNumberInfo = ShortNumberInfo::getInstance();
197
+ foreach ($shortNumberInfo->getSupportedRegions() as $regionCode) {
198
+ $returnList[] = array($regionCode);
199
+ }
200
+
201
+ return $returnList;
202
+ }
203
+
204
+ public function supportedGlobalNetworkCallingCodes()
205
+ {
206
+ $returnList = array();
207
+
208
+ PhoneNumberUtil::resetInstance();
209
+ $phoneUtil = PhoneNumberUtil::getInstance();
210
+ foreach ($phoneUtil->getSupportedGlobalNetworkCallingCodes() as $callingCode) {
211
+ $returnList[] = array($callingCode);
212
+ }
213
+
214
+ return $returnList;
215
+ }
216
+
217
+ /**
218
+ * @dataProvider supportedGlobalNetworkCallingCodes
219
+ */
220
+ public function testGlobalNetworkNumbers($callingCode)
221
+ {
222
+ $exampleNumber = $this->phoneNumberUtil->getExampleNumberForNonGeoEntity($callingCode);
223
+ $this->assertNotNull($exampleNumber, "No example phone number for calling code " . $callingCode);
224
+ if (!$this->phoneNumberUtil->isValidNumber($exampleNumber)) {
225
+ $this->fail("Failed validation for " . $exampleNumber);
226
+ }
227
+ }
228
+
229
+ /**
230
+ * @dataProvider regionList
231
+ * @param string $regionCode
232
+ */
233
+ public function testEveryRegionHasExampleNumber($regionCode)
234
+ {
235
+ $exampleNumber = $this->phoneNumberUtil->getExampleNumber($regionCode);
236
+ $this->assertNotNull($exampleNumber, "None found for region " . $regionCode);
237
+
238
+ /*
239
+ * Check the number is valid
240
+ */
241
+
242
+ $e164 = $this->phoneNumberUtil->format($exampleNumber, PhoneNumberFormat::E164);
243
+
244
+ $phoneObject = $this->phoneNumberUtil->parse($e164, 'ZZ');
245
+
246
+ $this->assertEquals($phoneObject, $exampleNumber);
247
+
248
+ $this->assertTrue($this->phoneNumberUtil->isValidNumber($phoneObject));
249
+ $this->assertTrue($this->phoneNumberUtil->isValidNumberForRegion($phoneObject, $regionCode));
250
+ }
251
+
252
+ /**
253
+ * @dataProvider shortNumberRegionList
254
+ */
255
+ public function testShortNumbersValidAndCorrectCost($regionCode)
256
+ {
257
+ $exampleShortNumber = $this->shortNumberInfo->getExampleShortNumber($regionCode);
258
+ if (!$this->shortNumberInfo->isValidShortNumberForRegion(
259
+ $this->phoneNumberUtil->parse($exampleShortNumber, $regionCode),
260
+ $regionCode
261
+ )
262
+ ) {
263
+ $this->fail(
264
+ "Failed validation for string region_code: {$regionCode}, national_number: {$exampleShortNumber}"
265
+ );
266
+ }
267
+ $phoneNumber = $this->phoneNumberUtil->parse($exampleShortNumber, $regionCode);
268
+ if (!$this->shortNumberInfo->isValidShortNumber($phoneNumber)) {
269
+ $this->fail("Failed validation for " . (string)$phoneNumber);
270
+ }
271
+
272
+ $costArray = array(
273
+ ShortNumberCost::PREMIUM_RATE,
274
+ ShortNumberCost::STANDARD_RATE,
275
+ ShortNumberCost::TOLL_FREE,
276
+ ShortNumberCost::UNKNOWN_COST
277
+ );
278
+
279
+ foreach ($costArray as $cost) {
280
+ $exampleShortNumber = $this->shortNumberInfo->getExampleShortNumberForCost($regionCode, $cost);
281
+ if ($exampleShortNumber != '') {
282
+ $this->assertEquals(
283
+ $cost,
284
+ $this->shortNumberInfo->getExpectedCostForRegion($this->phoneNumberUtil->parse($exampleShortNumber, $regionCode), $regionCode),
285
+ "Wrong cost for " . (string)$phoneNumber
286
+ );
287
+ }
288
+ }
289
+ }
290
+
291
+ /**
292
+ * @dataProvider shortNumberRegionList
293
+ */
294
+ public function testEmergency($regionCode)
295
+ {
296
+ $desc = $this->shortNumberInfo->getMetadataForRegion($regionCode)->getEmergency();
297
+ if ($desc->hasExampleNumber()) {
298
+ $exampleNumber = $desc->getExampleNumber();
299
+ $phoneNumber = $this->phoneNumberUtil->parse($exampleNumber, $regionCode);
300
+
301
+ if (!$this->shortNumberInfo->isPossibleShortNumberForRegion(
302
+ $phoneNumber,
303
+ $regionCode
304
+ ) || !$this->shortNumberInfo->isEmergencyNumber($exampleNumber, $regionCode)
305
+ ) {
306
+ $this->fail("Emergency example number test failed for " . $regionCode);
307
+ } elseif ($this->shortNumberInfo->getExpectedCostForRegion(
308
+ $phoneNumber,
309
+ $regionCode
310
+ ) !== ShortNumberCost::TOLL_FREE
311
+ ) {
312
+ $this->fail("Emergency example number not toll free for " . $regionCode);
313
+ }
314
+ }
315
+ }
316
+
317
+ /**
318
+ * @dataProvider shortNumberRegionList
319
+ */
320
+ public function testCarrierSpecificShortNumbers($regionCode)
321
+ {
322
+ // Test the carrier-specific tag.
323
+ $desc = $this->shortNumberInfo->getMetadataForRegion($regionCode)->getCarrierSpecific();
324
+ if ($desc->hasExampleNumber()) {
325
+ $exampleNumber = $desc->getExampleNumber();
326
+ $carrierSpecificNumber = $this->phoneNumberUtil->parse($exampleNumber, $regionCode);
327
+
328
+ if (!$this->shortNumberInfo->isPossibleShortNumberForRegion(
329
+ $carrierSpecificNumber,
330
+ $regionCode
331
+ ) || !$this->shortNumberInfo->isCarrierSpecific($carrierSpecificNumber)
332
+ ) {
333
+ $this->fail("Carrier-specific test failed for " . $regionCode);
334
+ }
335
+ }
336
+ }
337
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/IntlTest.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\core;
4
+
5
+ use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
6
+ use libphonenumber\PhoneNumberToCarrierMapper;
7
+
8
+ /**
9
+ * Verifies that classes which require the Intl extension cannot be instantiated.
10
+ */
11
+ class IntlTest extends \PHPUnit_Framework_TestCase
12
+ {
13
+ public function setUp()
14
+ {
15
+ if (extension_loaded('intl')) {
16
+ $this->markTestSkipped('The intl extension must not be installed');
17
+ }
18
+ }
19
+
20
+ /**
21
+ * @expectedException \RuntimeException
22
+ * @expectedExceptionMessage The intl extension must be installed
23
+ */
24
+ public function testPhoneNumberOfflineGeocoder()
25
+ {
26
+ PhoneNumberOfflineGeocoder::getInstance();
27
+ }
28
+
29
+ /**
30
+ * @expectedException \RuntimeException
31
+ * @expectedExceptionMessage The intl extension must be installed
32
+ */
33
+ public function testPhoneNumberToCarrierMapper()
34
+ {
35
+ PhoneNumberToCarrierMapper::getInstance();
36
+ }
37
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/MultiFileMetadataSourceImplTest.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\core;
4
+
5
+
6
+ use libphonenumber\DefaultMetadataLoader;
7
+ use libphonenumber\MultiFileMetadataSourceImpl;
8
+ use libphonenumber\PhoneNumberUtil;
9
+
10
+ class MultiFileMetadataSourceImplTest extends \PHPUnit_Framework_TestCase
11
+ {
12
+ /**
13
+ * @var MultiFileMetadataSourceImpl
14
+ */
15
+ private $multiFileMetadataSource;
16
+
17
+ public function setUp()
18
+ {
19
+ $this->multiFileMetadataSource = new MultiFileMetadataSourceImpl(
20
+ new DefaultMetadataLoader(),
21
+ PhoneNumberUtilTest::TEST_META_DATA_FILE_PREFIX
22
+ );
23
+ }
24
+
25
+ public function testMissingMetadataFileThrowsRuntimeException()
26
+ {
27
+ // In normal usage we should never get a state where we are asking to load metadata that doesn't
28
+ // exist. However if the library is packaged incorrectly, this could happen and the best we can
29
+ // do is make sure the exception has the file name in it.
30
+
31
+ try {
32
+ $this->multiFileMetadataSource->loadMetadataFromFile("no/such/file", "XX", -1, new DefaultMetadataLoader());
33
+ $this->fail("Expected Exception");
34
+ } catch (\RuntimeException $e) {
35
+ $this->assertContains('no/such/file_XX', $e->getMessage(), "Unexpected error: " . $e->getMessage());
36
+ }
37
+
38
+ try {
39
+ $this->multiFileMetadataSource->loadMetadataFromFile(
40
+ "no/such/file",
41
+ PhoneNumberUtil::REGION_CODE_FOR_NON_GEO_ENTITY,
42
+ 123,
43
+ new DefaultMetadataLoader()
44
+ );
45
+ $this->fail("Expected Exception");
46
+ } catch (\RuntimeException $e) {
47
+ $this->assertContains('no/such/file_123', $e->getMessage(), "Unexpected error: " . $e->getMessage());
48
+ }
49
+ }
50
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/PhoneNumberTest.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\core;
4
+
5
+ use libphonenumber\CountryCodeSource;
6
+ use libphonenumber\PhoneNumber;
7
+
8
+ /**
9
+ * Tests for the PhoneNumber object itself.
10
+ */
11
+ class PhoneNumberTest extends \PHPUnit_Framework_TestCase
12
+ {
13
+ public function testEqualSimpleNumber()
14
+ {
15
+ $numberA = new PhoneNumber();
16
+ $numberA->setCountryCode(1)->setNationalNumber(6502530000);
17
+
18
+ $numberB = new PhoneNumber();
19
+ $numberB->setCountryCode(1)->setNationalNumber(6502530000);
20
+
21
+ $this->assertEquals($numberA, $numberB);
22
+ }
23
+
24
+ public function testEqualWithItalianLeadingZeroSetToDefault()
25
+ {
26
+ $numberA = new PhoneNumber();
27
+ $numberA->setCountryCode(1)->setNationalNumber(6502530000)->setItalianLeadingZero(false);
28
+
29
+ $numberB = new PhoneNumber();
30
+ $numberB->setCountryCode(1)->setNationalNumber(6502530000);
31
+
32
+ // These should still be equal, since the default value for this field is false.
33
+ $this->assertEquals($numberA, $numberB);
34
+ }
35
+
36
+ public function testEqualWithCountryCodeSourceSet()
37
+ {
38
+ $numberA = new PhoneNumber();
39
+ $numberA->setRawInput("+1 650 253 00 00")->setCountryCode(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN);
40
+
41
+ $numberB = new PhoneNumber();
42
+ $numberB->setRawInput("+1 650 253 00 00")->setCountryCode(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN);
43
+
44
+ $this->assertEquals($numberA, $numberB);
45
+ }
46
+
47
+ public function testNonEqualWithItalianLeadingZeroSetToTrue()
48
+ {
49
+ $numberA = new PhoneNumber();
50
+ $numberA->setCountryCode(1)->setNationalNumber(6502530000)->setItalianLeadingZero(true);
51
+
52
+ $numberB = new PhoneNumber();
53
+ $numberB->setCountryCode(1)->setNationalNumber(6502530000);
54
+
55
+ $this->assertNotEquals($numberA, $numberB);
56
+ $this->assertFalse($numberA->equals($numberB));
57
+ }
58
+
59
+ public function testNonEqualWithDifferingRawInput()
60
+ {
61
+ $numberA = new PhoneNumber();
62
+ $numberA->setCountryCode(1)
63
+ ->setNationalNumber(6502530000)
64
+ ->setRawInput("+1 650 253 00 00")
65
+ ->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN);
66
+
67
+ $numberB = new PhoneNumber();
68
+ $numberB->setCountryCode(1)
69
+ ->setNationalNumber(6502530000)
70
+ ->setRawInput("+1-650-253-00-00")
71
+ ->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN);
72
+
73
+ $this->assertNotEquals($numberA, $numberB);
74
+ $this->assertFalse($numberA->equals($numberB));
75
+ }
76
+
77
+ public function testNonEqualWithPreferredDomesticCarrierCodeSetToDefault()
78
+ {
79
+ $numberA = new PhoneNumber();
80
+ $numberA->setCountryCode(1)->setNationalNumber(6502530000)->setPreferredDomesticCarrierCode("");
81
+
82
+ $numberB = new PhoneNumber();
83
+ $numberB->setCountryCode(1)->setNationalNumber(6502530000);
84
+
85
+ $this->assertNotSame($numberA, $numberB);
86
+ $this->assertFalse($numberA->equals($numberB));
87
+ }
88
+
89
+ public function testEqualWithPreferredDomesticCarrierCodeSetToDefault()
90
+ {
91
+ $numberA = new PhoneNumber();
92
+ $numberA->setCountryCode(1)->setNationalNumber(6502530000)->setPreferredDomesticCarrierCode("");
93
+
94
+ $numberB = new PhoneNumber();
95
+ $numberB->setCountryCode(1)->setNationalNumber(6502530000)->setPreferredDomesticCarrierCode("");
96
+
97
+ $this->assertEquals($numberA, $numberB);
98
+ }
99
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/PhoneNumberUtilTest.php ADDED
@@ -0,0 +1,3314 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\core;
4
+
5
+ use libphonenumber\CountryCodeSource;
6
+ use libphonenumber\CountryCodeToRegionCodeMapForTesting;
7
+ use libphonenumber\MatchType;
8
+ use libphonenumber\NumberFormat;
9
+ use libphonenumber\NumberParseException;
10
+ use libphonenumber\PhoneMetadata;
11
+ use libphonenumber\PhoneNumber;
12
+ use libphonenumber\PhoneNumberDesc;
13
+ use libphonenumber\PhoneNumberFormat;
14
+ use libphonenumber\PhoneNumberType;
15
+ use libphonenumber\PhoneNumberUtil;
16
+ use libphonenumber\RegionCode;
17
+ use libphonenumber\ValidationResult;
18
+
19
+
20
+ class PhoneNumberUtilTest extends \PHPUnit_Framework_TestCase
21
+ {
22
+
23
+ const TEST_META_DATA_FILE_PREFIX = "../../../Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting";
24
+ private static $bsNumber = null;
25
+ private static $internationalTollFree = null;
26
+ private static $sgNumber = null;
27
+ private static $usShortByOneNumber = null;
28
+ private static $usTollFree = null;
29
+ private static $usNumber = null;
30
+ private static $usLocalNumber = null;
31
+ private static $usLongNumber = null;
32
+ private static $nzNumber = null;
33
+ private static $usPremium = null;
34
+ private static $usSpoof = null;
35
+ private static $usSpoofWithRawInput = null;
36
+ private static $gbMobile = null;
37
+ private static $bsMobile = null;
38
+ private static $gbNumber = null;
39
+ private static $deShortNumber = null;
40
+ private static $itMobile = null;
41
+ private static $itNumber = null;
42
+ private static $auNumber = null;
43
+ private static $arMobile = null;
44
+ private static $arNumber = null;
45
+ private static $mxMobile1 = null;
46
+ private static $mxNumber1 = null;
47
+ private static $mxMobile2 = null;
48
+ private static $mxNumber2 = null;
49
+ private static $deNumber = null;
50
+ private static $jpStarNumber = null;
51
+ private static $internationalTollFreeTooLong = null;
52
+ private static $universalPremiumRate = null;
53
+ private static $alphaNumericNumber = null;
54
+ private static $aeUAN = null;
55
+ private static $unknownCountryCodeNoRawInput = null;
56
+ /**
57
+ * @var PhoneNumberUtil
58
+ */
59
+ protected $phoneUtil;
60
+
61
+ public function setUp()
62
+ {
63
+ $this->phoneUtil = self::initializePhoneUtilForTesting();
64
+ }
65
+
66
+ private static function initializePhoneUtilForTesting()
67
+ {
68
+ self::$bsNumber = new PhoneNumber();
69
+ self::$bsNumber->setCountryCode(1)->setNationalNumber(2423651234);
70
+ self::$bsMobile = new PhoneNumber();
71
+ self::$bsMobile->setCountryCode(1)->setNationalNumber(2423591234);
72
+ self::$internationalTollFree = new PhoneNumber();
73
+ self::$internationalTollFree->setCountryCode(800)->setNationalNumber(12345678);
74
+ self::$internationalTollFreeTooLong = new PhoneNumber();
75
+ self::$internationalTollFreeTooLong->setCountryCode(800)->setNationalNumber(123456789);
76
+ self::$universalPremiumRate = new PhoneNumber();
77
+ self::$universalPremiumRate->setCountryCode(979)->setNationalNumber(123456789);
78
+ self::$sgNumber = new PhoneNumber();
79
+ self::$sgNumber->setCountryCode(65)->setNationalNumber(65218000);
80
+ // A too-long and hence invalid US number.
81
+ self::$usLongNumber = new PhoneNumber();
82
+ self::$usLongNumber->setCountryCode(1)->setNationalNumber(65025300001);
83
+ self::$usShortByOneNumber = new PhoneNumber();
84
+ self::$usShortByOneNumber->setCountryCode(1)->setNationalNumber(650253000);
85
+ self::$usTollFree = new PhoneNumber();
86
+ self::$usTollFree->setCountryCode(1)->setNationalNumber(8002530000);
87
+ self::$usNumber = new PhoneNumber();
88
+ self::$usNumber->setCountryCode(1)->setNationalNumber(6502530000);
89
+ self::$usLocalNumber = new PhoneNumber();
90
+ self::$usLocalNumber->setCountryCode(1)->setNationalNumber(2530000);
91
+ self::$nzNumber = new PhoneNumber();
92
+ self::$nzNumber->setCountryCode(64)->setNationalNumber(33316005);
93
+ self::$usPremium = new PhoneNumber();
94
+ self::$usPremium->setCountryCode(1)->setNationalNumber(9002530000);
95
+ self::$usSpoof = new PhoneNumber();
96
+ self::$usSpoof->setCountryCode(1)->setNationalNumber(0);
97
+ self::$usSpoofWithRawInput = new PhoneNumber();
98
+ self::$usSpoofWithRawInput->setCountryCode(1)->setNationalNumber(0)->setRawInput("000-000-0000");
99
+ self::$gbMobile = new PhoneNumber();
100
+ self::$gbMobile->setCountryCode(44)->setNationalNumber(7912345678);
101
+ self::$gbNumber = new PhoneNumber();
102
+ self::$gbNumber->setCountryCode(44)->setNationalNumber(2070313000);
103
+ self::$deShortNumber = new PhoneNumber();
104
+ self::$deShortNumber->setCountryCode(49)->setNationalNumber(1234);
105
+ self::$itMobile = new PhoneNumber();
106
+ self::$itMobile->setCountryCode(39)->setNationalNumber(345678901);
107
+ self::$itNumber = new PhoneNumber();
108
+ self::$itNumber->setCountryCode(39)->setNationalNumber(236618300)->setItalianLeadingZero(true);
109
+ self::$auNumber = new PhoneNumber();
110
+ self::$auNumber->setCountryCode(61)->setNationalNumber(236618300);
111
+ self::$arMobile = new PhoneNumber();
112
+ self::$arMobile->setCountryCode(54)->setNationalNumber(91187654321);
113
+ self::$arNumber = new PhoneNumber();
114
+ self::$arNumber->setCountryCode(54)->setNationalNumber(1187654321);
115
+
116
+ self::$mxMobile1 = new PhoneNumber();
117
+ self::$mxMobile1->setCountryCode(52)->setNationalNumber(12345678900);
118
+ self::$mxNumber1 = new PhoneNumber();
119
+ self::$mxNumber1->setCountryCode(52)->setNationalNumber(3312345678);
120
+ self::$mxMobile2 = new PhoneNumber();
121
+ self::$mxMobile2->setCountryCode(52)->setNationalNumber(15512345678);
122
+ self::$mxNumber2 = new PhoneNumber();
123
+ self::$mxNumber2->setCountryCode(52)->setNationalNumber(8211234567);
124
+ // Note that this is the same as the example number for DE in the metadata.
125
+ self::$deNumber = new PhoneNumber();
126
+ self::$deNumber->setCountryCode(49)->setNationalNumber(30123456);
127
+ self::$jpStarNumber = new PhoneNumber();
128
+ self::$jpStarNumber->setCountryCode(81)->setNationalNumber(2345);
129
+ self::$alphaNumericNumber = new PhoneNumber();
130
+ self::$alphaNumericNumber->setCountryCode(1)->setNationalNumber(80074935247);
131
+ self::$aeUAN = new PhoneNumber();
132
+ self::$aeUAN->setCountryCode(971)->setNationalNumber(600123456);
133
+ self::$unknownCountryCodeNoRawInput = new PhoneNumber();
134
+ self::$unknownCountryCodeNoRawInput->setCountryCode(2)->setNationalNumber(12345);
135
+
136
+ PhoneNumberUtil::resetInstance();
137
+ return PhoneNumberUtil::getInstance(
138
+ self::TEST_META_DATA_FILE_PREFIX,
139
+ CountryCodeToRegionCodeMapForTesting::$countryCodeToRegionCodeMapForTesting
140
+ );
141
+ }
142
+
143
+ public function testGetSupportedRegions()
144
+ {
145
+ $this->assertGreaterThan(0, count($this->phoneUtil->getSupportedRegions()));
146
+ }
147
+
148
+ public function testGetSupportedGlobalNetworkCallingCodes()
149
+ {
150
+ $globalNetworkCallingCodes = $this->phoneUtil->getSupportedGlobalNetworkCallingCodes();
151
+
152
+ $this->assertGreaterThan(0, count($globalNetworkCallingCodes));
153
+
154
+ foreach ($globalNetworkCallingCodes as $callingCode)
155
+ {
156
+ $this->assertGreaterThan(0, $callingCode);
157
+ $this->assertEquals(RegionCode::UN001, $this->phoneUtil->getRegionCodeForCountryCode($callingCode));
158
+ }
159
+ }
160
+
161
+ public function testGetInstanceLoadBadMetadata()
162
+ {
163
+ $this->assertNull($this->phoneUtil->getMetadataForRegion("No Such Region"));
164
+ $this->assertNull($this->phoneUtil->getMetadataForRegion(-1));
165
+ }
166
+
167
+ public function testGetInstanceLoadUSMetadata()
168
+ {
169
+ $metadata = $this->phoneUtil->getMetadataForRegion(RegionCode::US);
170
+ $this->assertEquals("US", $metadata->getId());
171
+ $this->assertEquals(1, $metadata->getCountryCode());
172
+ $this->assertEquals("011", $metadata->getInternationalPrefix());
173
+ $this->assertTrue($metadata->hasNationalPrefix());
174
+ $this->assertEquals(2, $metadata->numberFormatSize());
175
+ $this->assertEquals("(\\d{3})(\\d{3})(\\d{4})", $metadata->getNumberFormat(1)->getPattern());
176
+ $this->assertEquals("$1 $2 $3", $metadata->getNumberFormat(1)->getFormat());
177
+ $this->assertEquals("[13-689]\\d{9}|2[0-35-9]\\d{8}", $metadata->getGeneralDesc()->getNationalNumberPattern());
178
+ $this->assertEquals("\\d{7}(?:\\d{3})?", $metadata->getGeneralDesc()->getPossibleNumberPattern());
179
+ $this->assertTrue($metadata->getGeneralDesc()->exactlySameAs($metadata->getFixedLine()));
180
+ $this->assertEquals("\\d{10}", $metadata->getTollFree()->getPossibleNumberPattern());
181
+ $this->assertEquals("900\\d{7}", $metadata->getPremiumRate()->getNationalNumberPattern());
182
+ // No shared-cost data is available, so it should be initialised to "NA".
183
+ $this->assertEquals("NA", $metadata->getSharedCost()->getNationalNumberPattern());
184
+ $this->assertEquals("NA", $metadata->getSharedCost()->getPossibleNumberPattern());
185
+ }
186
+
187
+ public function testGetInstanceLoadDEMetadata()
188
+ {
189
+ $metadata = $this->phoneUtil->getMetadataForRegion(RegionCode::DE);
190
+ $this->assertEquals("DE", $metadata->getId());
191
+ $this->assertEquals(49, $metadata->getCountryCode());
192
+ $this->assertEquals("00", $metadata->getInternationalPrefix());
193
+ $this->assertEquals("0", $metadata->getNationalPrefix());
194
+ $this->assertEquals(6, $metadata->numberFormatSize());
195
+ $this->assertEquals(1, $metadata->getNumberFormat(5)->leadingDigitsPatternSize());
196
+ $this->assertEquals("900", $metadata->getNumberFormat(5)->getLeadingDigitsPattern(0));
197
+ $this->assertEquals("(\\d{3})(\\d{3,4})(\\d{4})", $metadata->getNumberFormat(5)->getPattern());
198
+ $this->assertEquals("$1 $2 $3", $metadata->getNumberFormat(5)->getFormat());
199
+ $this->assertEquals(
200
+ "(?:[24-6]\\d{2}|3[03-9]\\d|[789](?:[1-9]\\d|0[2-9]))\\d{1,8}",
201
+ $metadata->getFixedLine()->getNationalNumberPattern()
202
+ );
203
+ $this->assertEquals("\\d{2,14}", $metadata->getFixedLine()->getPossibleNumberPattern());
204
+ $this->assertEquals("30123456", $metadata->getFixedLine()->getExampleNumber());
205
+ $this->assertEquals("\\d{10}", $metadata->getTollFree()->getPossibleNumberPattern());
206
+ $this->assertEquals("900([135]\\d{6}|9\\d{7})", $metadata->getPremiumRate()->getNationalNumberPattern());
207
+ }
208
+
209
+ public function testGetInstanceLoadARMetadata()
210
+ {
211
+ $metadata = $this->phoneUtil->getMetadataForRegion(RegionCode::AR);
212
+ $this->assertEquals("AR", $metadata->getId());
213
+ $this->assertEquals(54, $metadata->getCountryCode());
214
+ $this->assertEquals("00", $metadata->getInternationalPrefix());
215
+ $this->assertEquals("0", $metadata->getNationalPrefix());
216
+ $this->assertEquals("0(?:(11|343|3715)15)?", $metadata->getNationalPrefixForParsing());
217
+ $this->assertEquals("9$1", $metadata->getNationalPrefixTransformRule());
218
+ $this->assertEquals("$2 15 $3-$4", $metadata->getNumberFormat(2)->getFormat());
219
+ $this->assertEquals("(9)(\\d{4})(\\d{2})(\\d{4})", $metadata->getNumberFormat(3)->getPattern());
220
+ $this->assertEquals("(9)(\\d{4})(\\d{2})(\\d{4})", $metadata->getIntlNumberFormat(3)->getPattern());
221
+ $this->assertEquals("$1 $2 $3 $4", $metadata->getIntlNumberFormat(3)->getFormat());
222
+ }
223
+
224
+ public function testGetInstanceLoadInternationalTollFreeMetadata()
225
+ {
226
+ $metadata = $this->phoneUtil->getMetadataForNonGeographicalRegion(800);
227
+ $this->assertEquals("001", $metadata->getId());
228
+ $this->assertEquals(800, $metadata->getCountryCode());
229
+ $this->assertEquals("$1 $2", $metadata->getNumberFormat(0)->getFormat());
230
+ $this->assertEquals("(\\d{4})(\\d{4})", $metadata->getNumberFormat(0)->getPattern());
231
+ $this->assertEquals("12345678", $metadata->getGeneralDesc()->getExampleNumber());
232
+ $this->assertEquals("12345678", $metadata->getTollFree()->getExampleNumber());
233
+ }
234
+
235
+ public function testIsNumberGeographical()
236
+ {
237
+ $this->assertFalse($this->phoneUtil->isNumberGeographical(self::$bsMobile)); // Bahamas, mobile phone number.
238
+ $this->assertTrue($this->phoneUtil->isNumberGeographical(self::$auNumber)); // Australian fixed line number.
239
+ $this->assertFalse($this->phoneUtil->isNumberGeographical(self::$internationalTollFree)); // International toll
240
+ // free number
241
+ }
242
+
243
+ public function testIsLeadingZeroPossible()
244
+ {
245
+ $this->assertTrue($this->phoneUtil->isLeadingZeroPossible(39)); // Italy
246
+ $this->assertFalse($this->phoneUtil->isLeadingZeroPossible(1)); // USA
247
+ $this->assertTrue($this->phoneUtil->isLeadingZeroPossible(800)); // International toll free numbers
248
+ $this->assertFalse($this->phoneUtil->isLeadingZeroPossible(979)); // International premium-rate
249
+ $this->assertFalse(
250
+ $this->phoneUtil->isLeadingZeroPossible(888)
251
+ ); // Not in metadata file, just default to false.
252
+ }
253
+
254
+ public function testGetLengthOfGeographicalAreaCode()
255
+ {
256
+ // Google MTV, which has area code "650".
257
+ $this->assertEquals(3, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$usNumber));
258
+
259
+ // A North America toll-free number, which has no area code.
260
+ $this->assertEquals(0, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$usTollFree));
261
+
262
+ // Google London, which has area code "20".
263
+ $this->assertEquals(2, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$gbNumber));
264
+
265
+ // A UK mobile phone, which has no area code.
266
+ $this->assertEquals(0, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$gbMobile));
267
+
268
+ // Google Buenos Aires, which has area code "11".
269
+ $this->assertEquals(2, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$arNumber));
270
+
271
+ // Google Sydney, which has area code "2".
272
+ $this->assertEquals(1, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$auNumber));
273
+
274
+ // Italian numbers - there is no national prefix, but it still has an area code.
275
+ $this->assertEquals(2, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$itNumber));
276
+
277
+ // Google Singapore. Singapore has no area code and no national prefix.
278
+ $this->assertEquals(0, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$sgNumber));
279
+
280
+ // An invalid US number (1 digit shorter), which has no area code.
281
+ $this->assertEquals(0, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$usShortByOneNumber));
282
+
283
+ // An international toll free number, which has no area code.
284
+ $this->assertEquals(0, $this->phoneUtil->getLengthOfGeographicalAreaCode(self::$internationalTollFree));
285
+ }
286
+
287
+ public function testGetLengthOfNationalDestinationCode()
288
+ {
289
+ // Google MTV, which has national destination code (NDC) "650".
290
+ $this->assertEquals(3, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$usNumber));
291
+
292
+ // A North America toll-free number, which has NDC "800".
293
+ $this->assertEquals(3, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$usTollFree));
294
+
295
+ // Google London, which has NDC "20".
296
+ $this->assertEquals(2, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$gbNumber));
297
+
298
+ // A UK mobile phone, which has NDC "7912".
299
+ $this->assertEquals(4, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$gbMobile));
300
+
301
+ // Google Buenos Aires, which has NDC "11".
302
+ $this->assertEquals(2, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$arNumber));
303
+
304
+ // An Argentinian mobile which has NDC "911".
305
+ $this->assertEquals(3, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$arMobile));
306
+
307
+ // Google Sydney, which has NDC "2".
308
+ $this->assertEquals(1, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$auNumber));
309
+
310
+ // Google Singapore, which has NDC "6521".
311
+ $this->assertEquals(4, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$sgNumber));
312
+
313
+ // An invalid US number (1 digit shorter), which has no NDC.
314
+ $this->assertEquals(0, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$usShortByOneNumber));
315
+
316
+ // A number containing an invalid country calling code, which shouldn't have any NDC.
317
+ $number = new PhoneNumber();
318
+ $number->setCountryCode(123)->setNationalNumber(6502530000);
319
+ $this->assertEquals(0, $this->phoneUtil->getLengthOfNationalDestinationCode($number));
320
+
321
+ // An international toll free number, which has NDC "1234".
322
+ $this->assertEquals(4, $this->phoneUtil->getLengthOfNationalDestinationCode(self::$internationalTollFree));
323
+ }
324
+
325
+ public function testGetCountryMobileToken()
326
+ {
327
+ $this->assertEquals(
328
+ "1",
329
+ $this->phoneUtil->getCountryMobileToken($this->phoneUtil->getCountryCodeForRegion(RegionCode::MX))
330
+ );
331
+
332
+ // Country calling code for Sweden, which has no mobile token.
333
+ $this->assertEquals(
334
+ "",
335
+ $this->phoneUtil->getCountryMobileToken($this->phoneUtil->getCountryCodeForRegion(RegionCode::SE))
336
+ );
337
+ }
338
+
339
+ public function testGetNationalSignificantNumber()
340
+ {
341
+ $this->assertEquals("6502530000", $this->phoneUtil->getNationalSignificantNumber(self::$usNumber));
342
+
343
+ // An Italian mobile number.
344
+ $this->assertEquals("345678901", $this->phoneUtil->getNationalSignificantNumber(self::$itMobile));
345
+
346
+ // An Italian fixed line number.
347
+ $this->assertEquals("0236618300", $this->phoneUtil->getNationalSignificantNumber(self::$itNumber));
348
+
349
+ $this->assertEquals("12345678", $this->phoneUtil->getNationalSignificantNumber(self::$internationalTollFree));
350
+ }
351
+
352
+ public function testGetExampleNumber()
353
+ {
354
+ $this->assertEquals(self::$deNumber, $this->phoneUtil->getExampleNumber(RegionCode::DE));
355
+
356
+ $this->assertEquals(
357
+ self::$deNumber,
358
+ $this->phoneUtil->getExampleNumberForType(RegionCode::DE, PhoneNumberType::FIXED_LINE)
359
+ );
360
+ $this->assertEquals(null, $this->phoneUtil->getExampleNumberForType(RegionCode::DE, PhoneNumberType::MOBILE));
361
+ // For the US, the example number is placed under general description, and hence should be used
362
+ // for both fixed line and mobile, so neither of these should return null.
363
+ $this->assertNotNull($this->phoneUtil->getExampleNumberForType(RegionCode::US, PhoneNumberType::FIXED_LINE));
364
+ $this->assertNotNull($this->phoneUtil->getExampleNumberForType(RegionCode::US, PhoneNumberType::MOBILE));
365
+ // CS is an invalid region, so we have no data for it.
366
+ $this->assertNull($this->phoneUtil->getExampleNumberForType(RegionCode::CS, PhoneNumberType::MOBILE));
367
+ // RegionCode 001 is reserved for supporting non-geographical country calling code. We don't
368
+ // support getting an example number for it with this method.
369
+ $this->assertEquals(null, $this->phoneUtil->getExampleNumber(RegionCode::UN001));
370
+ }
371
+
372
+ public function testGetExampleNumberForNonGeoEntity()
373
+ {
374
+ $this->assertEquals(self::$internationalTollFree, $this->phoneUtil->getExampleNumberForNonGeoEntity(800));
375
+ $this->assertEquals(self::$universalPremiumRate, $this->phoneUtil->getExampleNumberForNonGeoEntity(979));
376
+ }
377
+
378
+ public function testConvertAlphaCharactersInNumber()
379
+ {
380
+ $input = "1800-ABC-DEF";
381
+ // Alpha chars are converted to digits; everything else is left untouched.
382
+ $expectedOutput = "1800-222-333";
383
+ $this->assertEquals($expectedOutput, $this->phoneUtil->convertAlphaCharactersInNumber($input));
384
+ }
385
+
386
+ public function testNormaliseRemovePunctuation()
387
+ {
388
+ $inputNumber = "034-56&+#2" . pack('H*', 'c2ad') . "34";
389
+ $expectedOutput = "03456234";
390
+ $this->assertEquals(
391
+ $expectedOutput,
392
+ $this->phoneUtil->normalize($inputNumber),
393
+ "Conversion did not correctly remove punctuation"
394
+ );
395
+ }
396
+
397
+ public function testNormaliseReplaceAlphaCharacters()
398
+ {
399
+ $inputNumber = "034-I-am-HUNGRY";
400
+ $expectedOutput = "034426486479";
401
+ $this->assertEquals(
402
+ $expectedOutput,
403
+ $this->phoneUtil->normalize($inputNumber),
404
+ "Conversion did not correctly replace alpha characters"
405
+ );
406
+ }
407
+
408
+ public function testNormaliseOtherDigits()
409
+ {
410
+ $inputNumber = "\xEF\xBC\x92" . "5\xD9\xA5" /* "25٥" */
411
+ ;
412
+ $expectedOutput = "255";
413
+ $this->assertEquals(
414
+ $expectedOutput,
415
+ $this->phoneUtil->normalize($inputNumber),
416
+ "Conversion did not correctly replace non-latin digits"
417
+ );
418
+ // Eastern-Arabic digits.
419
+ $inputNumber = "\xDB\xB5" . "2\xDB\xB0" /* "۵2۰" */
420
+ ;
421
+ $expectedOutput = "520";
422
+ $this->assertEquals(
423
+ $expectedOutput,
424
+ $this->phoneUtil->normalize($inputNumber),
425
+ "Conversion did not correctly replace non-latin digits"
426
+ );
427
+ }
428
+
429
+ public function testNormaliseStripAlphaCharacters()
430
+ {
431
+ $inputNumber = "034-56&+a#234";
432
+ $expectedOutput = "03456234";
433
+ $this->assertEquals(
434
+ $expectedOutput,
435
+ $this->phoneUtil->normalizeDigitsOnly($inputNumber),
436
+ "Conversion did not correctly remove alpha character"
437
+ );
438
+ }
439
+
440
+ public function testNormaliseStripNonDiallableCharacters()
441
+ {
442
+ $inputNumber = "03*4-56&+a#234";
443
+ $expectedOutput = "03*456+234";
444
+ $this->assertEquals(
445
+ $expectedOutput,
446
+ $this->phoneUtil->normalizeDiallableCharsOnly($inputNumber),
447
+ "Conversion did not correctly remove non-diallable characters"
448
+ );
449
+ }
450
+
451
+ public function testFormatUSNumber()
452
+ {
453
+ $this->assertEquals("650 253 0000", $this->phoneUtil->format(self::$usNumber, PhoneNumberFormat::NATIONAL));
454
+ $this->assertEquals(
455
+ "+1 650 253 0000",
456
+ $this->phoneUtil->format(self::$usNumber, PhoneNumberFormat::INTERNATIONAL)
457
+ );
458
+
459
+ $this->assertEquals("800 253 0000", $this->phoneUtil->format(self::$usTollFree, PhoneNumberFormat::NATIONAL));
460
+ $this->assertEquals(
461
+ "+1 800 253 0000",
462
+ $this->phoneUtil->format(self::$usTollFree, PhoneNumberFormat::INTERNATIONAL)
463
+ );
464
+
465
+ $this->assertEquals("900 253 0000", $this->phoneUtil->format(self::$usPremium, PhoneNumberFormat::NATIONAL));
466
+ $this->assertEquals(
467
+ "+1 900 253 0000",
468
+ $this->phoneUtil->format(self::$usPremium, PhoneNumberFormat::INTERNATIONAL)
469
+ );
470
+ $this->assertEquals(
471
+ "tel:+1-900-253-0000",
472
+ $this->phoneUtil->format(self::$usPremium, PhoneNumberFormat::RFC3966)
473
+ );
474
+ // Numbers with all zeros in the national number part will be formatted by using the raw_input
475
+ // if that is available no matter which format is specified.
476
+ $this->assertEquals(
477
+ "000-000-0000",
478
+ $this->phoneUtil->format(self::$usSpoofWithRawInput, PhoneNumberFormat::NATIONAL)
479
+ );
480
+ $this->assertEquals("0", $this->phoneUtil->format(self::$usSpoof, PhoneNumberFormat::NATIONAL));
481
+ }
482
+
483
+ public function testFormatBSNumber()
484
+ {
485
+ $this->assertEquals("242 365 1234", $this->phoneUtil->format(self::$bsNumber, PhoneNumberFormat::NATIONAL));
486
+ $this->assertEquals(
487
+ "+1 242 365 1234",
488
+ $this->phoneUtil->format(self::$bsNumber, PhoneNumberFormat::INTERNATIONAL)
489
+ );
490
+ }
491
+
492
+ public function testFormatGBNumber()
493
+ {
494
+ $this->assertEquals("(020) 7031 3000", $this->phoneUtil->format(self::$gbNumber, PhoneNumberFormat::NATIONAL));
495
+ $this->assertEquals(
496
+ "+44 20 7031 3000",
497
+ $this->phoneUtil->format(self::$gbNumber, PhoneNumberFormat::INTERNATIONAL)
498
+ );
499
+
500
+ $this->assertEquals("(07912) 345 678", $this->phoneUtil->format(self::$gbMobile, PhoneNumberFormat::NATIONAL));
501
+ $this->assertEquals(
502
+ "+44 7912 345 678",
503
+ $this->phoneUtil->format(self::$gbMobile, PhoneNumberFormat::INTERNATIONAL)
504
+ );
505
+ }
506
+
507
+ public function testFormatDENumber()
508
+ {
509
+ $deNumber = new PhoneNumber();
510
+ $deNumber->setCountryCode(49)->setNationalNumber(301234);
511
+ $this->assertEquals("030/1234", $this->phoneUtil->format($deNumber, PhoneNumberFormat::NATIONAL));
512
+ $this->assertEquals("+49 30/1234", $this->phoneUtil->format($deNumber, PhoneNumberFormat::INTERNATIONAL));
513
+ $this->assertEquals("tel:+49-30-1234", $this->phoneUtil->format($deNumber, PhoneNumberFormat::RFC3966));
514
+
515
+ $deNumber->clear();
516
+ $deNumber->setCountryCode(49)->setNationalNumber(291123);
517
+ $this->assertEquals("0291 123", $this->phoneUtil->format($deNumber, PhoneNumberFormat::NATIONAL));
518
+ $this->assertEquals("+49 291 123", $this->phoneUtil->format($deNumber, PhoneNumberFormat::INTERNATIONAL));
519
+
520
+ $deNumber->clear();
521
+ $deNumber->setCountryCode(49)->setNationalNumber(29112345678);
522
+ $this->assertEquals("0291 12345678", $this->phoneUtil->format($deNumber, PhoneNumberFormat::NATIONAL));
523
+ $this->assertEquals("+49 291 12345678", $this->phoneUtil->format($deNumber, PhoneNumberFormat::INTERNATIONAL));
524
+
525
+ $deNumber->clear();
526
+ $deNumber->setCountryCode(49)->setNationalNumber(912312345);
527
+ $this->assertEquals("09123 12345", $this->phoneUtil->format($deNumber, PhoneNumberFormat::NATIONAL));
528
+ $this->assertEquals("+49 9123 12345", $this->phoneUtil->format($deNumber, PhoneNumberFormat::INTERNATIONAL));
529
+ $deNumber->clear();
530
+ $deNumber->setCountryCode(49)->setNationalNumber(80212345);
531
+ $this->assertEquals("08021 2345", $this->phoneUtil->format($deNumber, PhoneNumberFormat::NATIONAL));
532
+ $this->assertEquals("+49 8021 2345", $this->phoneUtil->format($deNumber, PhoneNumberFormat::INTERNATIONAL));
533
+ // Note this number is correctly formatted without national prefix. Most of the numbers that
534
+ // are treated as invalid numbers by the library are short numbers, and they are usually not
535
+ // dialed with national prefix.
536
+ $this->assertEquals("1234", $this->phoneUtil->format(self::$deShortNumber, PhoneNumberFormat::NATIONAL));
537
+ $this->assertEquals(
538
+ "+49 1234",
539
+ $this->phoneUtil->format(self::$deShortNumber, PhoneNumberFormat::INTERNATIONAL)
540
+ );
541
+
542
+ $deNumber->clear();
543
+ $deNumber->setCountryCode(49)->setNationalNumber(41341234);
544
+ $this->assertEquals("04134 1234", $this->phoneUtil->format($deNumber, PhoneNumberFormat::NATIONAL));
545
+ }
546
+
547
+ public function testFormatITNumber()
548
+ {
549
+ $this->assertEquals("02 3661 8300", $this->phoneUtil->format(self::$itNumber, PhoneNumberFormat::NATIONAL));
550
+ $this->assertEquals(
551
+ "+39 02 3661 8300",
552
+ $this->phoneUtil->format(self::$itNumber, PhoneNumberFormat::INTERNATIONAL)
553
+ );
554
+ $this->assertEquals("+390236618300", $this->phoneUtil->format(self::$itNumber, PhoneNumberFormat::E164));
555
+
556
+ $this->assertEquals("345 678 901", $this->phoneUtil->format(self::$itMobile, PhoneNumberFormat::NATIONAL));
557
+ $this->assertEquals(
558
+ "+39 345 678 901",
559
+ $this->phoneUtil->format(self::$itMobile, PhoneNumberFormat::INTERNATIONAL)
560
+ );
561
+ $this->assertEquals("+39345678901", $this->phoneUtil->format(self::$itMobile, PhoneNumberFormat::E164));
562
+ }
563
+
564
+ public function testFormatAUNumber()
565
+ {
566
+ $this->assertEquals("02 3661 8300", $this->phoneUtil->format(self::$auNumber, PhoneNumberFormat::NATIONAL));
567
+ $this->assertEquals(
568
+ "+61 2 3661 8300",
569
+ $this->phoneUtil->format(self::$auNumber, PhoneNumberFormat::INTERNATIONAL)
570
+ );
571
+ $this->assertEquals("+61236618300", $this->phoneUtil->format(self::$auNumber, PhoneNumberFormat::E164));
572
+
573
+ $auNumber = new PhoneNumber();
574
+ $auNumber->setCountryCode(61)->setNationalNumber(1800123456);
575
+ $this->assertEquals("1800 123 456", $this->phoneUtil->format($auNumber, PhoneNumberFormat::NATIONAL));
576
+ $this->assertEquals("+61 1800 123 456", $this->phoneUtil->format($auNumber, PhoneNumberFormat::INTERNATIONAL));
577
+ $this->assertEquals("+611800123456", $this->phoneUtil->format($auNumber, PhoneNumberFormat::E164));
578
+ }
579
+
580
+ public function testFormatARNumber()
581
+ {
582
+ $this->assertEquals("011 8765-4321", $this->phoneUtil->format(self::$arNumber, PhoneNumberFormat::NATIONAL));
583
+ $this->assertEquals(
584
+ "+54 11 8765-4321",
585
+ $this->phoneUtil->format(self::$arNumber, PhoneNumberFormat::INTERNATIONAL)
586
+ );
587
+ $this->assertEquals("+541187654321", $this->phoneUtil->format(self::$arNumber, PhoneNumberFormat::E164));
588
+
589
+ $this->assertEquals("011 15 8765-4321", $this->phoneUtil->format(self::$arMobile, PhoneNumberFormat::NATIONAL));
590
+ $this->assertEquals(
591
+ "+54 9 11 8765 4321",
592
+ $this->phoneUtil->format(self::$arMobile, PhoneNumberFormat::INTERNATIONAL)
593
+ );
594
+ $this->assertEquals("+5491187654321", $this->phoneUtil->format(self::$arMobile, PhoneNumberFormat::E164));
595
+ }
596
+
597
+ public function testFormatMXNumber()
598
+ {
599
+ $this->assertEquals(
600
+ "045 234 567 8900",
601
+ $this->phoneUtil->format(self::$mxMobile1, PhoneNumberFormat::NATIONAL)
602
+ );
603
+ $this->assertEquals(
604
+ "+52 1 234 567 8900",
605
+ $this->phoneUtil->format(self::$mxMobile1, PhoneNumberFormat::INTERNATIONAL)
606
+ );
607
+ $this->assertEquals("+5212345678900", $this->phoneUtil->format(self::$mxMobile1, PhoneNumberFormat::E164));
608
+
609
+ $this->assertEquals(
610
+ "045 55 1234 5678",
611
+ $this->phoneUtil->format(self::$mxMobile2, PhoneNumberFormat::NATIONAL)
612
+ );
613
+ $this->assertEquals(
614
+ "+52 1 55 1234 5678",
615
+ $this->phoneUtil->format(self::$mxMobile2, PhoneNumberFormat::INTERNATIONAL)
616
+ );
617
+ $this->assertEquals("+5215512345678", $this->phoneUtil->format(self::$mxMobile2, PhoneNumberFormat::E164));
618
+
619
+ $this->assertEquals("01 33 1234 5678", $this->phoneUtil->format(self::$mxNumber1, PhoneNumberFormat::NATIONAL));
620
+ $this->assertEquals(
621
+ "+52 33 1234 5678",
622
+ $this->phoneUtil->format(self::$mxNumber1, PhoneNumberFormat::INTERNATIONAL)
623
+ );
624
+ $this->assertEquals("+523312345678", $this->phoneUtil->format(self::$mxNumber1, PhoneNumberFormat::E164));
625
+
626
+ $this->assertEquals("01 821 123 4567", $this->phoneUtil->format(self::$mxNumber2, PhoneNumberFormat::NATIONAL));
627
+ $this->assertEquals(
628
+ "+52 821 123 4567",
629
+ $this->phoneUtil->format(self::$mxNumber2, PhoneNumberFormat::INTERNATIONAL)
630
+ );
631
+ $this->assertEquals("+528211234567", $this->phoneUtil->format(self::$mxNumber2, PhoneNumberFormat::E164));
632
+ }
633
+
634
+ public function testFormatOutOfCountryCallingNumber()
635
+ {
636
+ $this->assertEquals(
637
+ "00 1 900 253 0000",
638
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$usPremium, RegionCode::DE)
639
+ );
640
+ $this->assertEquals(
641
+ "1 650 253 0000",
642
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$usNumber, RegionCode::BS)
643
+ );
644
+
645
+ $this->assertEquals(
646
+ "00 1 650 253 0000",
647
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$usNumber, RegionCode::PL)
648
+ );
649
+
650
+ $this->assertEquals(
651
+ "011 44 7912 345 678",
652
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$gbMobile, RegionCode::US)
653
+ );
654
+
655
+ $this->assertEquals(
656
+ "00 49 1234",
657
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$deShortNumber, RegionCode::GB)
658
+ );
659
+ // Note this number is correctly formatted without national prefix. Most of the numbers that
660
+ // are treated as invalid numbers by the library are short numbers, and they are usually not
661
+ // dialed with national prefix.
662
+ $this->assertEquals(
663
+ "1234",
664
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$deShortNumber, RegionCode::DE)
665
+ );
666
+
667
+ $this->assertEquals(
668
+ "011 39 02 3661 8300",
669
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$itNumber, RegionCode::US)
670
+ );
671
+ $this->assertEquals(
672
+ "02 3661 8300",
673
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$itNumber, RegionCode::IT)
674
+ );
675
+ $this->assertEquals(
676
+ "+39 02 3661 8300",
677
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$itNumber, RegionCode::SG)
678
+ );
679
+
680
+ $this->assertEquals(
681
+ "6521 8000",
682
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$sgNumber, RegionCode::SG)
683
+ );
684
+
685
+ $this->assertEquals(
686
+ "011 54 9 11 8765 4321",
687
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$arMobile, RegionCode::US)
688
+ );
689
+ $this->assertEquals(
690
+ "011 800 1234 5678",
691
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$internationalTollFree, RegionCode::US)
692
+ );
693
+
694
+ $arNumberWithExtn = new PhoneNumber();
695
+ $arNumberWithExtn->mergeFrom(self::$arMobile)->setExtension("1234");
696
+ $this->assertEquals(
697
+ "011 54 9 11 8765 4321 ext. 1234",
698
+ $this->phoneUtil->formatOutOfCountryCallingNumber($arNumberWithExtn, RegionCode::US)
699
+ );
700
+ $this->assertEquals(
701
+ "0011 54 9 11 8765 4321 ext. 1234",
702
+ $this->phoneUtil->formatOutOfCountryCallingNumber($arNumberWithExtn, RegionCode::AU)
703
+ );
704
+ $this->assertEquals(
705
+ "011 15 8765-4321 ext. 1234",
706
+ $this->phoneUtil->formatOutOfCountryCallingNumber($arNumberWithExtn, RegionCode::AR)
707
+ );
708
+ }
709
+
710
+ public function testFormatOutOfCountryWithInvalidRegion()
711
+ {
712
+ // AQ/Antarctica isn't a valid region code for phone number formatting,
713
+ // so this falls back to intl formatting.
714
+ $this->assertEquals(
715
+ "+1 650 253 0000",
716
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$usNumber, RegionCode::AQ)
717
+ );
718
+ // For region code 001, the out-of-country format always turns into the international format.
719
+ $this->assertEquals(
720
+ "+1 650 253 0000",
721
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$usNumber, RegionCode::UN001)
722
+ );
723
+ }
724
+
725
+ public function testFormatOutOfCountryWithPreferredIntlPrefix()
726
+ {
727
+ // This should use 0011, since that is the preferred international prefix (both 0011 and 0012
728
+ // are accepted as possible international prefixes in our test metadta.)
729
+ $this->assertEquals(
730
+ "0011 39 02 3661 8300",
731
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$itNumber, RegionCode::AU)
732
+ );
733
+ }
734
+
735
+ public function testFormatOutOfCountryKeepingAlphaChars()
736
+ {
737
+ $alphaNumericNumber = new PhoneNumber();
738
+ $alphaNumericNumber->setCountryCode(1)->setNationalNumber(8007493524)->setRawInput("1800 six-flag");
739
+ $this->assertEquals(
740
+ "0011 1 800 SIX-FLAG",
741
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::AU)
742
+ );
743
+
744
+ $alphaNumericNumber->setRawInput("1-800-SIX-flag");
745
+ $this->assertEquals(
746
+ "0011 1 800-SIX-FLAG",
747
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::AU)
748
+ );
749
+
750
+ $alphaNumericNumber->setRawInput("Call us from UK: 00 1 800 SIX-flag");
751
+ $this->assertEquals(
752
+ "0011 1 800 SIX-FLAG",
753
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::AU)
754
+ );
755
+
756
+ $alphaNumericNumber->setRawInput("800 SIX-flag");
757
+ $this->assertEquals(
758
+ "0011 1 800 SIX-FLAG",
759
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::AU)
760
+ );
761
+
762
+ // Formatting from within the NANPA region.
763
+ $this->assertEquals(
764
+ "1 800 SIX-FLAG",
765
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::US)
766
+ );
767
+
768
+ $this->assertEquals(
769
+ "1 800 SIX-FLAG",
770
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::BS)
771
+ );
772
+
773
+ // Testing that if the raw input doesn't exist, it is formatted using
774
+ // formatOutOfCountryCallingNumber.
775
+ $alphaNumericNumber->clearRawInput();
776
+ $this->assertEquals(
777
+ "00 1 800 749 3524",
778
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::DE)
779
+ );
780
+
781
+ // Testing AU alpha number formatted from Australia.
782
+ $alphaNumericNumber->setCountryCode(61)->setNationalNumber(827493524)->setRawInput("+61 82749-FLAG");
783
+ // This number should have the national prefix fixed.
784
+ $this->assertEquals(
785
+ "082749-FLAG",
786
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::AU)
787
+ );
788
+
789
+ $alphaNumericNumber->setRawInput("082749-FLAG");
790
+ $this->assertEquals(
791
+ "082749-FLAG",
792
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::AU)
793
+ );
794
+
795
+ $alphaNumericNumber->setNationalNumber(18007493524)->setRawInput("1-800-SIX-flag");
796
+ // This number should not have the national prefix prefixed, in accordance with the override for
797
+ // this specific formatting rule.
798
+ $this->assertEquals(
799
+ "1-800-SIX-FLAG",
800
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::AU)
801
+ );
802
+
803
+ // The metadata should not be permanently changed, since we copied it before modifying patterns.
804
+ // Here we check this.
805
+ $alphaNumericNumber->setNationalNumber(1800749352);
806
+ $this->assertEquals(
807
+ "1800 749 352",
808
+ $this->phoneUtil->formatOutOfCountryCallingNumber($alphaNumericNumber, RegionCode::AU)
809
+ );
810
+
811
+ // Testing a region with multiple international prefixes.
812
+ $this->assertEquals(
813
+ "+61 1-800-SIX-FLAG",
814
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::SG)
815
+ );
816
+ // Testing the case of calling from a non-supported region.
817
+ $this->assertEquals(
818
+ "+61 1-800-SIX-FLAG",
819
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::AQ)
820
+ );
821
+
822
+ // Testing the case with an invalid country calling code.
823
+ $alphaNumericNumber->setCountryCode(0)->setNationalNumber(18007493524)->setRawInput("1-800-SIX-flag");
824
+ // Uses the raw input only.
825
+ $this->assertEquals(
826
+ "1-800-SIX-flag",
827
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::DE)
828
+ );
829
+
830
+ // Testing the case of an invalid alpha number.
831
+ $alphaNumericNumber->setCountryCode(1)->setNationalNumber(80749)->setRawInput("180-SIX");
832
+ // No country-code stripping can be done.
833
+ $this->assertEquals(
834
+ "00 1 180-SIX",
835
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::DE)
836
+ );
837
+
838
+ // Testing the case of calling from a non-supported region.
839
+ $alphaNumericNumber->setCountryCode(1)->setNationalNumber(80749)->setRawInput("180-SIX");
840
+ // No country-code stripping can be done since the number is invalid.
841
+ $this->assertEquals(
842
+ "+1 180-SIX",
843
+ $this->phoneUtil->formatOutOfCountryKeepingAlphaChars($alphaNumericNumber, RegionCode::AQ)
844
+ );
845
+ }
846
+
847
+ public function testFormatWithCarrierCode()
848
+ {
849
+ // We only support this for AR in our test metadata, and only for mobile numbers starting with
850
+ // certain values.
851
+ $arMobile = new PhoneNumber();
852
+ $arMobile->setCountryCode(54)->setNationalNumber(92234654321);
853
+ $this->assertEquals("02234 65-4321", $this->phoneUtil->format($arMobile, PhoneNumberFormat::NATIONAL));
854
+ // Here we force 14 as the carrier code.
855
+ $this->assertEquals(
856
+ "02234 14 65-4321",
857
+ $this->phoneUtil->formatNationalNumberWithCarrierCode($arMobile, "14")
858
+ );
859
+ // Here we force the number to be shown with no carrier code.
860
+ $this->assertEquals(
861
+ "02234 65-4321",
862
+ $this->phoneUtil->formatNationalNumberWithCarrierCode($arMobile, "")
863
+ );
864
+ // Here the international rule is used, so no carrier code should be present.
865
+ $this->assertEquals("+5492234654321", $this->phoneUtil->format($arMobile, PhoneNumberFormat::E164));
866
+ // We don't support this for the US so there should be no change.
867
+ $this->assertEquals(
868
+ "650 253 0000",
869
+ $this->phoneUtil->formatNationalNumberWithCarrierCode(self::$usNumber, "15")
870
+ );
871
+
872
+ // Invalid country code should just get the NSN.
873
+ $this->assertEquals(
874
+ "12345",
875
+ $this->phoneUtil->formatNationalNumberWithCarrierCode(self::$unknownCountryCodeNoRawInput, "89")
876
+ );
877
+ }
878
+
879
+ public function testFormatWithPreferredCarrierCode()
880
+ {
881
+ // We only support this for AR in our test metadata.
882
+ $arNumber = new PhoneNumber();
883
+ $arNumber->setCountryCode(54)->setNationalNumber(91234125678);
884
+ // Test formatting with no preferred carrier code stored in the number itself.
885
+ $this->assertEquals(
886
+ "01234 15 12-5678",
887
+ $this->phoneUtil->formatNationalNumberWithPreferredCarrierCode($arNumber, "15")
888
+ );
889
+ $this->assertEquals(
890
+ "01234 12-5678",
891
+ $this->phoneUtil->formatNationalNumberWithPreferredCarrierCode($arNumber, "")
892
+ );
893
+ // Test formatting with preferred carrier code present.
894
+ $arNumber->setPreferredDomesticCarrierCode("19");
895
+ $this->assertEquals("01234 12-5678", $this->phoneUtil->format($arNumber, PhoneNumberFormat::NATIONAL));
896
+ $this->assertEquals(
897
+ "01234 19 12-5678",
898
+ $this->phoneUtil->formatNationalNumberWithPreferredCarrierCode($arNumber, "15")
899
+ );
900
+ $this->assertEquals(
901
+ "01234 19 12-5678",
902
+ $this->phoneUtil->formatNationalNumberWithPreferredCarrierCode($arNumber, "")
903
+ );
904
+ // When the preferred_domestic_carrier_code is present (even when it contains an empty string),
905
+ // use it instead of the default carrier code passed in.
906
+ $arNumber->setPreferredDomesticCarrierCode("");
907
+ $this->assertEquals(
908
+ "01234 12-5678",
909
+ $this->phoneUtil->formatNationalNumberWithPreferredCarrierCode($arNumber, "15")
910
+ );
911
+ // We don't support this for the US so there should be no change.
912
+ $usNumber = new PhoneNumber();
913
+ $usNumber->setCountryCode(1)->setNationalNumber(4241231234)->setPreferredDomesticCarrierCode("99");
914
+ $this->assertEquals("424 123 1234", $this->phoneUtil->format($usNumber, PhoneNumberFormat::NATIONAL));
915
+ $this->assertEquals(
916
+ "424 123 1234",
917
+ $this->phoneUtil->formatNationalNumberWithPreferredCarrierCode($usNumber, "15")
918
+ );
919
+ }
920
+
921
+ public function testFormatNumberForMobileDialing()
922
+ {
923
+ // Numbers are normally dialed in national format in-country, and international format from
924
+ // outside the country.
925
+ $this->assertEquals(
926
+ "030123456",
927
+ $this->phoneUtil->formatNumberForMobileDialing(self::$deNumber, RegionCode::DE, false)
928
+ );
929
+ $this->assertEquals(
930
+ "+4930123456",
931
+ $this->phoneUtil->formatNumberForMobileDialing(self::$deNumber, RegionCode::CH, false)
932
+ );
933
+ $this->assertEquals(
934
+ "+4930123456",
935
+ $this->phoneUtil->formatNumberForMobileDialing(self::$deNumber, RegionCode::CH, false)
936
+ );
937
+ $deNumberWithExtn = new PhoneNumber();
938
+ $deNumberWithExtn->mergeFrom(self::$deNumber)->setExtension("1234");
939
+ $this->assertEquals(
940
+ "030123456",
941
+ $this->phoneUtil->formatNumberForMobileDialing($deNumberWithExtn, RegionCode::DE, false)
942
+ );
943
+ $this->assertEquals(
944
+ "+4930123456",
945
+ $this->phoneUtil->formatNumberForMobileDialing($deNumberWithExtn, RegionCode::CH, false)
946
+ );
947
+
948
+ // US toll free numbers are marked as noInternationalDialling in the test metadata for testing
949
+ // purposes. For such numbers, we expect nothing to be returned when the region code is not the
950
+ // same one.
951
+ $this->assertEquals(
952
+ "800 253 0000",
953
+ $this->phoneUtil->formatNumberForMobileDialing(
954
+ self::$usTollFree,
955
+ RegionCode::US,
956
+ true /* keep formatting */
957
+ )
958
+ );
959
+ $this->assertEquals(
960
+ "",
961
+ $this->phoneUtil->formatNumberForMobileDialing(self::$usTollFree, RegionCode::CN, true)
962
+ );
963
+ $this->assertEquals(
964
+ "+1 650 253 0000",
965
+ $this->phoneUtil->formatNumberForMobileDialing(self::$usNumber, RegionCode::US, true)
966
+ );
967
+ $usNumberWithExtn = new PhoneNumber();
968
+ $usNumberWithExtn->mergeFrom(self::$usNumber)->setExtension("1234");
969
+ $this->assertEquals(
970
+ "+1 650 253 0000",
971
+ $this->phoneUtil->formatNumberForMobileDialing($usNumberWithExtn, RegionCode::US, true)
972
+ );
973
+
974
+ $this->assertEquals(
975
+ "8002530000",
976
+ $this->phoneUtil->formatNumberForMobileDialing(
977
+ self::$usTollFree,
978
+ RegionCode::US,
979
+ false /* remove formatting */
980
+ )
981
+ );
982
+ $this->assertEquals(
983
+ "",
984
+ $this->phoneUtil->formatNumberForMobileDialing(self::$usTollFree, RegionCode::CN, false)
985
+ );
986
+ $this->assertEquals(
987
+ "+16502530000",
988
+ $this->phoneUtil->formatNumberForMobileDialing(self::$usNumber, RegionCode::US, false)
989
+ );
990
+ $this->assertEquals(
991
+ "+16502530000",
992
+ $this->phoneUtil->formatNumberForMobileDialing($usNumberWithExtn, RegionCode::US, false)
993
+ );
994
+
995
+ // An invalid US number, which is one digit too long.
996
+ $this->assertEquals(
997
+ "+165025300001",
998
+ $this->phoneUtil->formatNumberForMobileDialing(self::$usLongNumber, RegionCode::US, false)
999
+ );
1000
+ $this->assertEquals(
1001
+ "+1 65025300001",
1002
+ $this->phoneUtil->formatNumberForMobileDialing(self::$usLongNumber, RegionCode::US, true)
1003
+ );
1004
+
1005
+ // Star numbers. In real life they appear in Israel, but we have them in JP in our test
1006
+ // metadata.
1007
+ $this->assertEquals(
1008
+ "*2345",
1009
+ $this->phoneUtil->formatNumberForMobileDialing(self::$jpStarNumber, RegionCode::JP, false)
1010
+ );
1011
+ $this->assertEquals(
1012
+ "*2345",
1013
+ $this->phoneUtil->formatNumberForMobileDialing(self::$jpStarNumber, RegionCode::JP, true)
1014
+ );
1015
+
1016
+ $this->assertEquals(
1017
+ "+80012345678",
1018
+ $this->phoneUtil->formatNumberForMobileDialing(self::$internationalTollFree, RegionCode::JP, false)
1019
+ );
1020
+ $this->assertEquals(
1021
+ "+800 1234 5678",
1022
+ $this->phoneUtil->formatNumberForMobileDialing(self::$internationalTollFree, RegionCode::JP, true)
1023
+ );
1024
+
1025
+ // UAE numbers beginning with 600 (classified as UAN) need to be dialled without +971 locally.
1026
+ $this->assertEquals(
1027
+ "+971600123456",
1028
+ $this->phoneUtil->formatNumberForMobileDialing(self::$aeUAN, RegionCode::JP, false)
1029
+ );
1030
+ $this->assertEquals(
1031
+ "600123456",
1032
+ $this->phoneUtil->formatNumberForMobileDialing(self::$aeUAN, RegionCode::AE, false)
1033
+ );
1034
+
1035
+ $this->assertEquals(
1036
+ "+523312345678",
1037
+ $this->phoneUtil->formatNumberForMobileDialing(self::$mxNumber1, RegionCode::MX, false)
1038
+ );
1039
+ $this->assertEquals(
1040
+ "+523312345678",
1041
+ $this->phoneUtil->formatNumberForMobileDialing(self::$mxNumber1, RegionCode::US, false)
1042
+ );
1043
+
1044
+ // Non-geographical numbers should always be dialed in international format.
1045
+ $this->assertEquals(
1046
+ "+80012345678",
1047
+ $this->phoneUtil->formatNumberForMobileDialing(self::$internationalTollFree, RegionCode::US, false)
1048
+ );
1049
+ $this->assertEquals(
1050
+ "+80012345678",
1051
+ $this->phoneUtil->formatNumberForMobileDialing(self::$internationalTollFree, RegionCode::UN001, false)
1052
+ );
1053
+
1054
+ // Test that a short number is formatted correctly for mobile dialing within the region,
1055
+ // and is not diallable from outside the region.
1056
+ $deShortNumber = new PhoneNumber();
1057
+ $deShortNumber->setCountryCode(49)->setNationalNumber(123);
1058
+ $this->assertEquals(
1059
+ "123",
1060
+ $this->phoneUtil->formatNumberForMobileDialing($deShortNumber, RegionCode::DE, false)
1061
+ );
1062
+ $this->assertEquals("", $this->phoneUtil->formatNumberForMobileDialing($deShortNumber, RegionCode::IT, false));
1063
+
1064
+ // Test the special logic for Hungary, where the national prefix must be added before dialing
1065
+ // from a mobile phone for regular length numbers, but not for short numbers.
1066
+ $huRegularNumber = new PhoneNumber();
1067
+ $huRegularNumber->setCountryCode(36)->setNationalNumber(301234567);
1068
+ $this->assertEquals(
1069
+ "06301234567",
1070
+ $this->phoneUtil->formatNumberForMobileDialing($huRegularNumber, RegionCode::HU, false)
1071
+ );
1072
+ $this->assertEquals(
1073
+ "+36301234567",
1074
+ $this->phoneUtil->formatNumberForMobileDialing($huRegularNumber, RegionCode::JP, false)
1075
+ );
1076
+ $huShortNumber = new PhoneNumber();
1077
+ $huShortNumber->setCountryCode(36)->setNationalNumber(104);
1078
+ $this->assertEquals(
1079
+ "104",
1080
+ $this->phoneUtil->formatNumberForMobileDialing($huShortNumber, RegionCode::HU, false)
1081
+ );
1082
+ $this->assertEquals("", $this->phoneUtil->formatNumberForMobileDialing($huShortNumber, RegionCode::JP, false));
1083
+
1084
+ // Test the special logic for NANPA countries, for which regular length phone numbers are always
1085
+ // output in international format, but short numbers are in national format.
1086
+ $this->assertEquals(
1087
+ "+16502530000",
1088
+ $this->phoneUtil->formatNumberForMobileDialing(self::$usNumber, RegionCode::US, false)
1089
+ );
1090
+ $this->assertEquals(
1091
+ "+16502530000",
1092
+ $this->phoneUtil->formatNumberForMobileDialing(self::$usNumber, RegionCode::CA, false)
1093
+ );
1094
+ $this->assertEquals(
1095
+ "+16502530000",
1096
+ $this->phoneUtil->formatNumberForMobileDialing(self::$usNumber, RegionCode::BR, false)
1097
+ );
1098
+ $usShortNumber = new PhoneNumber();
1099
+ $usShortNumber->setCountryCode(1)->setNationalNumber(911);
1100
+ $this->assertEquals(
1101
+ "911",
1102
+ $this->phoneUtil->formatNumberForMobileDialing($usShortNumber, RegionCode::US, false)
1103
+ );
1104
+ $this->assertEquals("", $this->phoneUtil->formatNumberForMobileDialing($usShortNumber, RegionCode::CA, false));
1105
+ $this->assertEquals("", $this->phoneUtil->formatNumberForMobileDialing($usShortNumber, RegionCode::BR, false));
1106
+
1107
+ // Test that the Australian emergency number 000 is formatted correctly.
1108
+ $auNumber = new PhoneNumber();
1109
+ $auNumber->setCountryCode(61)->setNationalNumber(0)->setItalianLeadingZero(true)->setNumberOfLeadingZeros(2);
1110
+ $this->assertEquals("000", $this->phoneUtil->formatNumberForMobileDialing($auNumber, RegionCode::AU, false));
1111
+ $this->assertEquals("", $this->phoneUtil->formatNumberForMobileDialing($auNumber, RegionCode::NZ, false));
1112
+ }
1113
+
1114
+ public function testFormatByPattern()
1115
+ {
1116
+ $newNumFormat = new NumberFormat();
1117
+ $newNumFormat->setPattern("(\\d{3})(\\d{3})(\\d{4})");
1118
+ $newNumFormat->setFormat("($1) $2-$3");
1119
+ $newNumberFormats = array();
1120
+ $newNumberFormats[] = $newNumFormat;
1121
+
1122
+ $this->assertEquals(
1123
+ "(650) 253-0000",
1124
+ $this->phoneUtil->formatByPattern(
1125
+ self::$usNumber,
1126
+ PhoneNumberFormat::NATIONAL,
1127
+ $newNumberFormats
1128
+ )
1129
+ );
1130
+ $this->assertEquals(
1131
+ "+1 (650) 253-0000",
1132
+ $this->phoneUtil->formatByPattern(
1133
+ self::$usNumber,
1134
+ PhoneNumberFormat::INTERNATIONAL,
1135
+ $newNumberFormats
1136
+ )
1137
+ );
1138
+ $this->assertEquals(
1139
+ "tel:+1-650-253-0000",
1140
+ $this->phoneUtil->formatByPattern(
1141
+ self::$usNumber,
1142
+ PhoneNumberFormat::RFC3966,
1143
+ $newNumberFormats
1144
+ )
1145
+ );
1146
+
1147
+ // $NP is set to '1' for the US. Here we check that for other NANPA countries the US rules are
1148
+ // followed.
1149
+ $newNumFormat->setNationalPrefixFormattingRule('$NP ($FG)');
1150
+ $newNumFormat->setFormat("$1 $2-$3");
1151
+ $this->assertEquals(
1152
+ "1 (242) 365-1234",
1153
+ $this->phoneUtil->formatByPattern(
1154
+ self::$bsNumber,
1155
+ PhoneNumberFormat::NATIONAL,
1156
+ $newNumberFormats
1157
+ )
1158
+ );
1159
+ $this->assertEquals(
1160
+ "+1 242 365-1234",
1161
+ $this->phoneUtil->formatByPattern(
1162
+ self::$bsNumber,
1163
+ PhoneNumberFormat::INTERNATIONAL,
1164
+ $newNumberFormats
1165
+ )
1166
+ );
1167
+
1168
+ $newNumFormat->setPattern("(\\d{2})(\\d{5})(\\d{3})");
1169
+ $newNumFormat->setFormat("$1-$2 $3");
1170
+ $newNumberFormats[0] = $newNumFormat;
1171
+
1172
+ $this->assertEquals(
1173
+ "02-36618 300",
1174
+ $this->phoneUtil->formatByPattern(
1175
+ self::$itNumber,
1176
+ PhoneNumberFormat::NATIONAL,
1177
+ $newNumberFormats
1178
+ )
1179
+ );
1180
+ $this->assertEquals(
1181
+ "+39 02-36618 300",
1182
+ $this->phoneUtil->formatByPattern(
1183
+ self::$itNumber,
1184
+ PhoneNumberFormat::INTERNATIONAL,
1185
+ $newNumberFormats
1186
+ )
1187
+ );
1188
+
1189
+ $newNumFormat->setNationalPrefixFormattingRule('$NP$FG');
1190
+ $newNumFormat->setPattern("(\\d{2})(\\d{4})(\\d{4})");
1191
+ $newNumFormat->setFormat("$1 $2 $3");
1192
+ $newNumberFormats[0] = $newNumFormat;
1193
+ $this->assertEquals(
1194
+ "020 7031 3000",
1195
+ $this->phoneUtil->formatByPattern(
1196
+ self::$gbNumber,
1197
+ PhoneNumberFormat::NATIONAL,
1198
+ $newNumberFormats
1199
+ )
1200
+ );
1201
+
1202
+ $newNumFormat->setNationalPrefixFormattingRule('($NP$FG)');
1203
+ $this->assertEquals(
1204
+ "(020) 7031 3000",
1205
+ $this->phoneUtil->formatByPattern(
1206
+ self::$gbNumber,
1207
+ PhoneNumberFormat::NATIONAL,
1208
+ $newNumberFormats
1209
+ )
1210
+ );
1211
+
1212
+ $newNumFormat->setNationalPrefixFormattingRule("");
1213
+ $this->assertEquals(
1214
+ "20 7031 3000",
1215
+ $this->phoneUtil->formatByPattern(
1216
+ self::$gbNumber,
1217
+ PhoneNumberFormat::NATIONAL,
1218
+ $newNumberFormats
1219
+ )
1220
+ );
1221
+
1222
+ $this->assertEquals(
1223
+ "+44 20 7031 3000",
1224
+ $this->phoneUtil->formatByPattern(
1225
+ self::$gbNumber,
1226
+ PhoneNumberFormat::INTERNATIONAL,
1227
+ $newNumberFormats
1228
+ )
1229
+ );
1230
+ }
1231
+
1232
+ public function testFormatE164Number()
1233
+ {
1234
+ $this->assertEquals("+16502530000", $this->phoneUtil->format(self::$usNumber, PhoneNumberFormat::E164));
1235
+ $this->assertEquals("+4930123456", $this->phoneUtil->format(self::$deNumber, PhoneNumberFormat::E164));
1236
+ $this->assertEquals(
1237
+ "+80012345678",
1238
+ $this->phoneUtil->format(self::$internationalTollFree, PhoneNumberFormat::E164)
1239
+ );
1240
+ }
1241
+
1242
+ public function testFormatNumberWithExtension()
1243
+ {
1244
+ $nzNumber = new PhoneNumber();
1245
+ $nzNumber->mergeFrom(self::$nzNumber)->setExtension("1234");
1246
+ // Uses default extension prefix:
1247
+ $this->assertEquals("03-331 6005 ext. 1234", $this->phoneUtil->format($nzNumber, PhoneNumberFormat::NATIONAL));
1248
+ // Uses RFC 3966 syntax.
1249
+ $this->assertEquals(
1250
+ "tel:+64-3-331-6005;ext=1234",
1251
+ $this->phoneUtil->format($nzNumber, PhoneNumberFormat::RFC3966)
1252
+ );
1253
+ // Extension prefix overridden in the territory information for the US:
1254
+ $usNumberWithExtension = new PhoneNumber();
1255
+ $usNumberWithExtension->mergeFrom(self::$usNumber)->setExtension("4567");
1256
+ $this->assertEquals(
1257
+ "650 253 0000 extn. 4567",
1258
+ $this->phoneUtil->format($usNumberWithExtension, PhoneNumberFormat::NATIONAL)
1259
+ );
1260
+ }
1261
+
1262
+ public function testFormatInOriginalFormat()
1263
+ {
1264
+ $number1 = $this->phoneUtil->parseAndKeepRawInput("+442087654321", RegionCode::GB);
1265
+ $this->assertEquals("+44 20 8765 4321", $this->phoneUtil->formatInOriginalFormat($number1, RegionCode::GB));
1266
+
1267
+ $number2 = $this->phoneUtil->parseAndKeepRawInput("02087654321", RegionCode::GB);
1268
+ $this->assertEquals("(020) 8765 4321", $this->phoneUtil->formatInOriginalFormat($number2, RegionCode::GB));
1269
+
1270
+ $number3 = $this->phoneUtil->parseAndKeepRawInput("011442087654321", RegionCode::US);
1271
+ $this->assertEquals("011 44 20 8765 4321", $this->phoneUtil->formatInOriginalFormat($number3, RegionCode::US));
1272
+
1273
+ $number4 = $this->phoneUtil->parseAndKeepRawInput("442087654321", RegionCode::GB);
1274
+ $this->assertEquals("44 20 8765 4321", $this->phoneUtil->formatInOriginalFormat($number4, RegionCode::GB));
1275
+
1276
+ $number5 = $this->phoneUtil->parse("+442087654321", RegionCode::GB);
1277
+ $this->assertEquals("(020) 8765 4321", $this->phoneUtil->formatInOriginalFormat($number5, RegionCode::GB));
1278
+
1279
+ // Invalid numbers that we have a formatting pattern for should be formatted properly. Note area
1280
+ // codes starting with 7 are intentionally excluded in the test metadata for testing purposes.
1281
+ $number6 = $this->phoneUtil->parseAndKeepRawInput("7345678901", RegionCode::US);
1282
+ $this->assertEquals("734 567 8901", $this->phoneUtil->formatInOriginalFormat($number6, RegionCode::US));
1283
+
1284
+ // US is not a leading zero country, and the presence of the leading zero leads us to format the
1285
+ // number using raw_input.
1286
+ $number7 = $this->phoneUtil->parseAndKeepRawInput("0734567 8901", RegionCode::US);
1287
+ $this->assertEquals("0734567 8901", $this->phoneUtil->formatInOriginalFormat($number7, RegionCode::US));
1288
+
1289
+ // This number is valid, but we don't have a formatting pattern for it. Fall back to the raw
1290
+ // input.
1291
+ $number8 = $this->phoneUtil->parseAndKeepRawInput("02-4567-8900", RegionCode::KR);
1292
+ $this->assertEquals("02-4567-8900", $this->phoneUtil->formatInOriginalFormat($number8, RegionCode::KR));
1293
+
1294
+ $number9 = $this->phoneUtil->parseAndKeepRawInput("01180012345678", RegionCode::US);
1295
+ $this->assertEquals("011 800 1234 5678", $this->phoneUtil->formatInOriginalFormat($number9, RegionCode::US));
1296
+
1297
+ $number10 = $this->phoneUtil->parseAndKeepRawInput("+80012345678", RegionCode::KR);
1298
+ $this->assertEquals("+800 1234 5678", $this->phoneUtil->formatInOriginalFormat($number10, RegionCode::KR));
1299
+
1300
+ // US local numbers are formatted correctly, as we have formatting patterns for them.
1301
+ $localNumberUS = $this->phoneUtil->parseAndKeepRawInput("2530000", RegionCode::US);
1302
+ $this->assertEquals("253 0000", $this->phoneUtil->formatInOriginalFormat($localNumberUS, RegionCode::US));
1303
+
1304
+ $numberWithNationalPrefixUS =
1305
+ $this->phoneUtil->parseAndKeepRawInput("18003456789", RegionCode::US);
1306
+ $this->assertEquals(
1307
+ "1 800 345 6789",
1308
+ $this->phoneUtil->formatInOriginalFormat($numberWithNationalPrefixUS, RegionCode::US)
1309
+ );
1310
+
1311
+ $numberWithoutNationalPrefixGB =
1312
+ $this->phoneUtil->parseAndKeepRawInput("2087654321", RegionCode::GB);
1313
+ $this->assertEquals(
1314
+ "20 8765 4321",
1315
+ $this->phoneUtil->formatInOriginalFormat($numberWithoutNationalPrefixGB, RegionCode::GB)
1316
+ );
1317
+ // Make sure no metadata is modified as a result of the previous function call.
1318
+ $this->assertEquals("(020) 8765 4321", $this->phoneUtil->formatInOriginalFormat($number5, RegionCode::GB));
1319
+
1320
+ $numberWithNationalPrefixMX =
1321
+ $this->phoneUtil->parseAndKeepRawInput("013312345678", RegionCode::MX);
1322
+ $this->assertEquals(
1323
+ "01 33 1234 5678",
1324
+ $this->phoneUtil->formatInOriginalFormat($numberWithNationalPrefixMX, RegionCode::MX)
1325
+ );
1326
+
1327
+ $numberWithoutNationalPrefixMX =
1328
+ $this->phoneUtil->parseAndKeepRawInput("3312345678", RegionCode::MX);
1329
+ $this->assertEquals(
1330
+ "33 1234 5678",
1331
+ $this->phoneUtil->formatInOriginalFormat($numberWithoutNationalPrefixMX, RegionCode::MX)
1332
+ );
1333
+
1334
+ $italianFixedLineNumber =
1335
+ $this->phoneUtil->parseAndKeepRawInput("0212345678", RegionCode::IT);
1336
+ $this->assertEquals(
1337
+ "02 1234 5678",
1338
+ $this->phoneUtil->formatInOriginalFormat($italianFixedLineNumber, RegionCode::IT)
1339
+ );
1340
+
1341
+ $numberWithNationalPrefixJP =
1342
+ $this->phoneUtil->parseAndKeepRawInput("00777012", RegionCode::JP);
1343
+ $this->assertEquals(
1344
+ "0077-7012",
1345
+ $this->phoneUtil->formatInOriginalFormat($numberWithNationalPrefixJP, RegionCode::JP)
1346
+ );
1347
+
1348
+ $numberWithoutNationalPrefixJP =
1349
+ $this->phoneUtil->parseAndKeepRawInput("0777012", RegionCode::JP);
1350
+ $this->assertEquals(
1351
+ "0777012",
1352
+ $this->phoneUtil->formatInOriginalFormat($numberWithoutNationalPrefixJP, RegionCode::JP)
1353
+ );
1354
+
1355
+ $numberWithCarrierCodeBR =
1356
+ $this->phoneUtil->parseAndKeepRawInput("012 3121286979", RegionCode::BR);
1357
+ $this->assertEquals(
1358
+ "012 3121286979",
1359
+ $this->phoneUtil->formatInOriginalFormat($numberWithCarrierCodeBR, RegionCode::BR)
1360
+ );
1361
+
1362
+ // The default national prefix used in this case is 045. When a number with national prefix 044
1363
+ // is entered, we return the raw input as we don't want to change the number entered.
1364
+ $numberWithNationalPrefixMX1 =
1365
+ $this->phoneUtil->parseAndKeepRawInput("044(33)1234-5678", RegionCode::MX);
1366
+ $this->assertEquals(
1367
+ "044(33)1234-5678",
1368
+ $this->phoneUtil->formatInOriginalFormat($numberWithNationalPrefixMX1, RegionCode::MX)
1369
+ );
1370
+
1371
+ $numberWithNationalPrefixMX2 =
1372
+ $this->phoneUtil->parseAndKeepRawInput("045(33)1234-5678", RegionCode::MX);
1373
+ $this->assertEquals(
1374
+ "045 33 1234 5678",
1375
+ $this->phoneUtil->formatInOriginalFormat($numberWithNationalPrefixMX2, RegionCode::MX)
1376
+ );
1377
+
1378
+ // The default international prefix used in this case is 0011. When a number with international
1379
+ // prefix 0012 is entered, we return the raw input as we don't want to change the number
1380
+ // entered.
1381
+ $outOfCountryNumberFromAU1 =
1382
+ $this->phoneUtil->parseAndKeepRawInput("0012 16502530000", RegionCode::AU);
1383
+ $this->assertEquals(
1384
+ "0012 16502530000",
1385
+ $this->phoneUtil->formatInOriginalFormat($outOfCountryNumberFromAU1, RegionCode::AU)
1386
+ );
1387
+
1388
+ $outOfCountryNumberFromAU2 =
1389
+ $this->phoneUtil->parseAndKeepRawInput("0011 16502530000", RegionCode::AU);
1390
+ $this->assertEquals(
1391
+ "0011 1 650 253 0000",
1392
+ $this->phoneUtil->formatInOriginalFormat($outOfCountryNumberFromAU2, RegionCode::AU)
1393
+ );
1394
+
1395
+ // Test the star sign is not removed from or added to the original input by this method.
1396
+ $starNumber = $this->phoneUtil->parseAndKeepRawInput("*1234", RegionCode::JP);
1397
+ $this->assertEquals("*1234", $this->phoneUtil->formatInOriginalFormat($starNumber, RegionCode::JP));
1398
+ $numberWithoutStar = $this->phoneUtil->parseAndKeepRawInput("1234", RegionCode::JP);
1399
+ $this->assertEquals("1234", $this->phoneUtil->formatInOriginalFormat($numberWithoutStar, RegionCode::JP));
1400
+
1401
+ // Test an invalid national number without raw input is just formatted as the national number.
1402
+ $this->assertEquals(
1403
+ "650253000",
1404
+ $this->phoneUtil->formatInOriginalFormat(self::$usShortByOneNumber, RegionCode::US)
1405
+ );
1406
+ }
1407
+
1408
+ public function testIsPremiumRate()
1409
+ {
1410
+ $this->assertEquals(PhoneNumberType::PREMIUM_RATE, $this->phoneUtil->getNumberType(self::$usPremium));
1411
+
1412
+ $premiumRateNumber = new PhoneNumber();
1413
+ $premiumRateNumber->setCountryCode(39)->setNationalNumber(892123);
1414
+ $this->assertEquals(
1415
+ PhoneNumberType::PREMIUM_RATE,
1416
+ $this->phoneUtil->getNumberType($premiumRateNumber)
1417
+ );
1418
+
1419
+ $premiumRateNumber->clear();
1420
+ $premiumRateNumber->setCountryCode(44)->setNationalNumber(9187654321);
1421
+ $this->assertEquals(
1422
+ PhoneNumberType::PREMIUM_RATE,
1423
+ $this->phoneUtil->getNumberType($premiumRateNumber)
1424
+ );
1425
+
1426
+ $premiumRateNumber->clear();
1427
+ $premiumRateNumber->setCountryCode(49)->setNationalNumber(9001654321);
1428
+ $this->assertEquals(
1429
+ PhoneNumberType::PREMIUM_RATE,
1430
+ $this->phoneUtil->getNumberType($premiumRateNumber)
1431
+ );
1432
+
1433
+ $premiumRateNumber->clear();
1434
+ $premiumRateNumber->setCountryCode(49)->setNationalNumber(90091234567);
1435
+ $this->assertEquals(
1436
+ PhoneNumberType::PREMIUM_RATE,
1437
+ $this->phoneUtil->getNumberType($premiumRateNumber)
1438
+ );
1439
+ }
1440
+
1441
+ public function testIsTollFree()
1442
+ {
1443
+ $tollFreeNumber = new PhoneNumber();
1444
+
1445
+ $tollFreeNumber->setCountryCode(1)->setNationalNumber(8881234567);
1446
+ $this->assertEquals(
1447
+ PhoneNumberType::TOLL_FREE,
1448
+ $this->phoneUtil->getNumberType($tollFreeNumber)
1449
+ );
1450
+
1451
+ $tollFreeNumber->clear();
1452
+ $tollFreeNumber->setCountryCode(39)->setNationalNumber(803123);
1453
+ $this->assertEquals(
1454
+ PhoneNumberType::TOLL_FREE,
1455
+ $this->phoneUtil->getNumberType($tollFreeNumber)
1456
+ );
1457
+
1458
+ $tollFreeNumber->clear();
1459
+ $tollFreeNumber->setCountryCode(44)->setNationalNumber(8012345678);
1460
+ $this->assertEquals(
1461
+ PhoneNumberType::TOLL_FREE,
1462
+ $this->phoneUtil->getNumberType($tollFreeNumber)
1463
+ );
1464
+
1465
+ $tollFreeNumber->clear();
1466
+ $tollFreeNumber->setCountryCode(49)->setNationalNumber(8001234567);
1467
+ $this->assertEquals(
1468
+ PhoneNumberType::TOLL_FREE,
1469
+ $this->phoneUtil->getNumberType($tollFreeNumber)
1470
+ );
1471
+
1472
+ $this->assertEquals(
1473
+ PhoneNumberType::TOLL_FREE,
1474
+ $this->phoneUtil->getNumberType(self::$internationalTollFree)
1475
+ );
1476
+ }
1477
+
1478
+ public function testIsMobile()
1479
+ {
1480
+ $this->assertEquals(PhoneNumberType::MOBILE, $this->phoneUtil->getNumberType(self::$bsMobile));
1481
+ $this->assertEquals(PhoneNumberType::MOBILE, $this->phoneUtil->getNumberType(self::$gbMobile));
1482
+ $this->assertEquals(PhoneNumberType::MOBILE, $this->phoneUtil->getNumberType(self::$itMobile));
1483
+ $this->assertEquals(PhoneNumberType::MOBILE, $this->phoneUtil->getNumberType(self::$arMobile));
1484
+
1485
+ $mobileNumber = new PhoneNumber();
1486
+ $mobileNumber->setCountryCode(49)->setNationalNumber(15123456789);
1487
+ $this->assertEquals(PhoneNumberType::MOBILE, $this->phoneUtil->getNumberType($mobileNumber));
1488
+ }
1489
+
1490
+ public function testIsFixedLine()
1491
+ {
1492
+ $this->assertEquals(PhoneNumberType::FIXED_LINE, $this->phoneUtil->getNumberType(self::$bsNumber));
1493
+ $this->assertEquals(PhoneNumberType::FIXED_LINE, $this->phoneUtil->getNumberType(self::$itNumber));
1494
+ $this->assertEquals(PhoneNumberType::FIXED_LINE, $this->phoneUtil->getNumberType(self::$gbNumber));
1495
+ $this->assertEquals(PhoneNumberType::FIXED_LINE, $this->phoneUtil->getNumberType(self::$deNumber));
1496
+ }
1497
+
1498
+ public function testIsFixedLineAndMobile()
1499
+ {
1500
+ $this->assertEquals(PhoneNumberType::FIXED_LINE_OR_MOBILE, $this->phoneUtil->getNumberType(self::$usNumber));
1501
+
1502
+ $fixedLineAndMobileNumber = new PhoneNumber();
1503
+ $fixedLineAndMobileNumber->setCountryCode(54)->setNationalNumber(1987654321);
1504
+ $this->assertEquals(
1505
+ PhoneNumberType::FIXED_LINE_OR_MOBILE,
1506
+ $this->phoneUtil->getNumberType($fixedLineAndMobileNumber)
1507
+ );
1508
+ }
1509
+
1510
+ public function testIsSharedCost()
1511
+ {
1512
+ $gbNumber = new PhoneNumber();
1513
+ $gbNumber->setCountryCode(44)->setNationalNumber(8431231234);
1514
+ $this->assertEquals(PhoneNumberType::SHARED_COST, $this->phoneUtil->getNumberType($gbNumber));
1515
+ }
1516
+
1517
+ public function testIsVoip()
1518
+ {
1519
+ $gbNumber = new PhoneNumber();
1520
+ $gbNumber->setCountryCode(44)->setNationalNumber(5631231234);
1521
+ $this->assertEquals(PhoneNumberType::VOIP, $this->phoneUtil->getNumberType($gbNumber));
1522
+ }
1523
+
1524
+ public function testIsPersonalNumber()
1525
+ {
1526
+ $gbNumber = new PhoneNumber();
1527
+ $gbNumber->setCountryCode(44)->setNationalNumber(7031231234);
1528
+ $this->assertEquals(PhoneNumberType::PERSONAL_NUMBER, $this->phoneUtil->getNumberType($gbNumber));
1529
+ }
1530
+
1531
+ public function testIsUnknown()
1532
+ {
1533
+ // Invalid numbers should be of type UNKNOWN.
1534
+ $this->assertEquals(PhoneNumberType::UNKNOWN, $this->phoneUtil->getNumberType(self::$usLocalNumber));
1535
+ }
1536
+
1537
+ public function testIsValidNumber()
1538
+ {
1539
+ $this->assertTrue($this->phoneUtil->isValidNumber(self::$usNumber));
1540
+ $this->assertTrue($this->phoneUtil->isValidNumber(self::$itNumber));
1541
+ $this->assertTrue($this->phoneUtil->isValidNumber(self::$gbMobile));
1542
+ $this->assertTrue($this->phoneUtil->isValidNumber(self::$internationalTollFree));
1543
+ $this->assertTrue($this->phoneUtil->isValidNumber(self::$universalPremiumRate));
1544
+
1545
+ $nzNumber = new PhoneNumber();
1546
+ $nzNumber->setCountryCode(64)->setNationalNumber(21387835);
1547
+ $this->assertTrue($this->phoneUtil->isValidNumber($nzNumber));
1548
+ }
1549
+
1550
+ public function testIsValidForRegion()
1551
+ {
1552
+ // This number is valid for the Bahamas, but is not a valid US number.
1553
+ $this->assertTrue($this->phoneUtil->isValidNumber(self::$bsNumber));
1554
+ $this->assertTrue($this->phoneUtil->isValidNumberForRegion(self::$bsNumber, RegionCode::BS));
1555
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion(self::$bsNumber, RegionCode::US));
1556
+ $bsInvalidNumber = new PhoneNumber();
1557
+ $bsInvalidNumber->setCountryCode(1)->setNationalNumber(2421232345);
1558
+ // This number is no longer valid.
1559
+ $this->assertFalse($this->phoneUtil->isValidNumber($bsInvalidNumber));
1560
+
1561
+ // La Mayotte and Reunion use 'leadingDigits' to differentiate them.
1562
+ $reNumber = new PhoneNumber();
1563
+ $reNumber->setCountryCode(262)->setNationalNumber(262123456);
1564
+ $this->assertTrue($this->phoneUtil->isValidNumber($reNumber));
1565
+ $this->assertTrue($this->phoneUtil->isValidNumberForRegion($reNumber, RegionCode::RE));
1566
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion($reNumber, RegionCode::YT));
1567
+ // Now change the number to be a number for La Mayotte.
1568
+ $reNumber->setNationalNumber(269601234);
1569
+ $this->assertTrue($this->phoneUtil->isValidNumberForRegion($reNumber, RegionCode::YT));
1570
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion($reNumber, RegionCode::RE));
1571
+ // This number is no longer valid for La Reunion.
1572
+ $reNumber->setNationalNumber(269123456);
1573
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion($reNumber, RegionCode::YT));
1574
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion($reNumber, RegionCode::RE));
1575
+ $this->assertFalse($this->phoneUtil->isValidNumber($reNumber));
1576
+ // However, it should be recognised as from La Mayotte, since it is valid for this region.
1577
+ $this->assertEquals(RegionCode::YT, $this->phoneUtil->getRegionCodeForNumber($reNumber));
1578
+ // This number is valid in both places.
1579
+ $reNumber->setNationalNumber(800123456);
1580
+ $this->assertTrue($this->phoneUtil->isValidNumberForRegion($reNumber, RegionCode::YT));
1581
+ $this->assertTrue($this->phoneUtil->isValidNumberForRegion($reNumber, RegionCode::RE));
1582
+ $this->assertTrue($this->phoneUtil->isValidNumberForRegion(self::$internationalTollFree, RegionCode::UN001));
1583
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion(self::$internationalTollFree, RegionCode::US));
1584
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion(self::$internationalTollFree, RegionCode::ZZ));
1585
+
1586
+ $invalidNumber = new PhoneNumber();
1587
+ // Invalid country calling codes.
1588
+ $invalidNumber->setCountryCode(3923)->setNationalNumber(2366);
1589
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion($invalidNumber, RegionCode::ZZ));
1590
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion($invalidNumber, RegionCode::UN001));
1591
+ $invalidNumber->setCountryCode(0);
1592
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion($invalidNumber, RegionCode::UN001));
1593
+ $this->assertFalse($this->phoneUtil->isValidNumberForRegion($invalidNumber, RegionCode::ZZ));
1594
+ }
1595
+
1596
+ public function testIsNotValidNumber()
1597
+ {
1598
+ $this->assertFalse($this->phoneUtil->isValidNumber(self::$usLocalNumber));
1599
+
1600
+ $invalidNumber = new PhoneNumber();
1601
+ $invalidNumber->setCountryCode(39)->setNationalNumber(23661830000)->setItalianLeadingZero(true);
1602
+ $this->assertFalse($this->phoneUtil->isValidNumber($invalidNumber));
1603
+
1604
+ $invalidNumber->clear();
1605
+ $invalidNumber->setCountryCode(44)->setNationalNumber(791234567);
1606
+ $this->assertFalse($this->phoneUtil->isValidNumber($invalidNumber));
1607
+
1608
+ $invalidNumber->clear();
1609
+ $invalidNumber->setCountryCode(49)->setNationalNumber(1234);
1610
+ $this->assertFalse($this->phoneUtil->isValidNumber($invalidNumber));
1611
+
1612
+ $invalidNumber->clear();
1613
+ $invalidNumber->setCountryCode(64)->setNationalNumber(3316005);
1614
+ $this->assertFalse($this->phoneUtil->isValidNumber($invalidNumber));
1615
+
1616
+ $invalidNumber->clear();
1617
+ // Invalid country calling codes.
1618
+ $invalidNumber->setCountryCode(3923)->setNationalNumber(2366);
1619
+ $this->assertFalse($this->phoneUtil->isValidNumber($invalidNumber));
1620
+ $invalidNumber->setCountryCode(0);
1621
+ $this->assertFalse($this->phoneUtil->isValidNumber($invalidNumber));
1622
+
1623
+ $this->assertFalse($this->phoneUtil->isValidNumber(self::$internationalTollFreeTooLong));
1624
+ }
1625
+
1626
+ public function testGetRegionCodeForCountryCode()
1627
+ {
1628
+ $this->assertEquals(RegionCode::US, $this->phoneUtil->getRegionCodeForCountryCode(1));
1629
+ $this->assertEquals(RegionCode::GB, $this->phoneUtil->getRegionCodeForCountryCode(44));
1630
+ $this->assertEquals(RegionCode::DE, $this->phoneUtil->getRegionCodeForCountryCode(49));
1631
+ $this->assertEquals(RegionCode::UN001, $this->phoneUtil->getRegionCodeForCountryCode(800));
1632
+ $this->assertEquals(RegionCode::UN001, $this->phoneUtil->getRegionCodeForCountryCode(979));
1633
+ }
1634
+
1635
+ public function testGetRegionCodeForNumber()
1636
+ {
1637
+ $this->assertEquals(RegionCode::BS, $this->phoneUtil->getRegionCodeForNumber(self::$bsNumber));
1638
+ $this->assertEquals(RegionCode::US, $this->phoneUtil->getRegionCodeForNumber(self::$usNumber));
1639
+ $this->assertEquals(RegionCode::GB, $this->phoneUtil->getRegionCodeForNumber(self::$gbMobile));
1640
+ $this->assertEquals(RegionCode::UN001, $this->phoneUtil->getRegionCodeForNumber(self::$internationalTollFree));
1641
+ $this->assertEquals(RegionCode::UN001, $this->phoneUtil->getRegionCodeForNumber(self::$universalPremiumRate));
1642
+ }
1643
+
1644
+ public function testGetRegionCodesForCountryCode()
1645
+ {
1646
+ $regionCodesForNANPA = $this->phoneUtil->getRegionCodesForCountryCode(1);
1647
+ $this->assertContains(RegionCode::US, $regionCodesForNANPA);
1648
+ $this->assertContains(RegionCode::BS, $regionCodesForNANPA);
1649
+ $this->assertContains(RegionCode::GB, $this->phoneUtil->getRegionCodesForCountryCode(44));
1650
+ $this->assertContains(RegionCode::DE, $this->phoneUtil->getRegionCodesForCountryCode(49));
1651
+ $this->assertContains(RegionCode::UN001, $this->phoneUtil->getRegionCodesForCountryCode(800));
1652
+ // Test with invalid country calling code.
1653
+ $this->assertEmpty($this->phoneUtil->getRegionCodesForCountryCode(-1));
1654
+ }
1655
+
1656
+ public function testGetCountryCodeForRegion()
1657
+ {
1658
+ $this->assertEquals(1, $this->phoneUtil->getCountryCodeForRegion(RegionCode::US));
1659
+ $this->assertEquals(64, $this->phoneUtil->getCountryCodeForRegion(RegionCode::NZ));
1660
+ $this->assertEquals(0, $this->phoneUtil->getCountryCodeForRegion(null));
1661
+ $this->assertEquals(0, $this->phoneUtil->getCountryCodeForRegion(RegionCode::ZZ));
1662
+ $this->assertEquals(0, $this->phoneUtil->getCountryCodeForRegion(RegionCode::UN001));
1663
+ // CS is already deprecated so the library doesn't support it
1664
+ $this->assertEquals(0, $this->phoneUtil->getCountryCodeForRegion(RegionCode::CS));
1665
+ }
1666
+
1667
+ public function testGetNationalDiallingPrefixForRegion()
1668
+ {
1669
+ $this->assertEquals("1", $this->phoneUtil->getNddPrefixForRegion(RegionCode::US, false));
1670
+ // Test non-main country to see it gets the national dialling prefix for the main country with
1671
+ // that country calling code.
1672
+ $this->assertEquals("1", $this->phoneUtil->getNddPrefixForRegion(RegionCode::BS, false));
1673
+ $this->assertEquals("0", $this->phoneUtil->getNddPrefixForRegion(RegionCode::NZ, false));
1674
+ // Test case with non digit in the national prefix.
1675
+ $this->assertEquals("0~0", $this->phoneUtil->getNddPrefixForRegion(RegionCode::AO, false));
1676
+ $this->assertEquals("00", $this->phoneUtil->getNddPrefixForRegion(RegionCode::AO, true));
1677
+ // Test cases with invalid regions.
1678
+ $this->assertNull($this->phoneUtil->getNddPrefixForRegion(null, false));
1679
+ $this->assertNull($this->phoneUtil->getNddPrefixForRegion(RegionCode::ZZ, false));
1680
+ $this->assertNull($this->phoneUtil->getNddPrefixForRegion(RegionCode::UN001, false));
1681
+ // CS is already deprecated so the library doesn't support it.
1682
+ $this->assertNull($this->phoneUtil->getNddPrefixForRegion(RegionCode::CS, false));
1683
+ }
1684
+
1685
+ public function testIsNANPACountry()
1686
+ {
1687
+ $this->assertTrue($this->phoneUtil->isNANPACountry(RegionCode::US));
1688
+ $this->assertTrue($this->phoneUtil->isNANPACountry(RegionCode::BS));
1689
+ $this->assertFalse($this->phoneUtil->isNANPACountry(RegionCode::DE));
1690
+ $this->assertFalse($this->phoneUtil->isNANPACountry(RegionCode::ZZ));
1691
+ $this->assertFalse($this->phoneUtil->isNANPACountry(RegionCode::UN001));
1692
+ $this->assertFalse($this->phoneUtil->isNANPACountry(null));
1693
+ }
1694
+
1695
+ public function testIsPossibleNumber()
1696
+ {
1697
+ $this->assertTrue($this->phoneUtil->isPossibleNumber(self::$usNumber));
1698
+ $this->assertTrue($this->phoneUtil->isPossibleNumber(self::$usLocalNumber));
1699
+ $this->assertTrue($this->phoneUtil->isPossibleNumber(self::$gbNumber));
1700
+ $this->assertTrue($this->phoneUtil->isPossibleNumber(self::$internationalTollFree));
1701
+
1702
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("+1 650 253 0000", RegionCode::US));
1703
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("+1 650 GOO OGLE", RegionCode::US));
1704
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("(650) 253-0000", RegionCode::US));
1705
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("253-0000", RegionCode::US));
1706
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("+1 650 253 0000", RegionCode::GB));
1707
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("+44 20 7031 3000", RegionCode::GB));
1708
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("(020) 7031 3000", RegionCode::GB));
1709
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("7031 3000", RegionCode::GB));
1710
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("3331 6005", RegionCode::NZ));
1711
+ $this->assertTrue($this->phoneUtil->isPossibleNumber("+800 1234 5678", RegionCode::UN001));
1712
+ }
1713
+
1714
+ public function testIsPossibleNumberWithReason()
1715
+ {
1716
+ // National numbers for country calling code +1 that are within 7 to 10 digits are possible.
1717
+ $this->assertEquals(
1718
+ ValidationResult::IS_POSSIBLE,
1719
+ $this->phoneUtil->isPossibleNumberWithReason(self::$usNumber)
1720
+ );
1721
+
1722
+ $this->assertEquals(
1723
+ ValidationResult::IS_POSSIBLE,
1724
+ $this->phoneUtil->isPossibleNumberWithReason(self::$usLocalNumber)
1725
+ );
1726
+
1727
+ $this->assertEquals(
1728
+ ValidationResult::TOO_LONG,
1729
+ $this->phoneUtil->isPossibleNumberWithReason(self::$usLongNumber)
1730
+ );
1731
+
1732
+ $number = new PhoneNumber();
1733
+ $number->setCountryCode(0)->setNationalNumber(2530000);
1734
+ $this->assertEquals(
1735
+ ValidationResult::INVALID_COUNTRY_CODE,
1736
+ $this->phoneUtil->isPossibleNumberWithReason($number)
1737
+ );
1738
+
1739
+ $number->clear();
1740
+ $number->setCountryCode(1)->setNationalNumber(253000);
1741
+ $this->assertEquals(ValidationResult::TOO_SHORT, $this->phoneUtil->isPossibleNumberWithReason($number));
1742
+
1743
+ $number->clear();
1744
+ $number->setCountryCode(65)->setNationalNumber(1234567890);
1745
+ $this->assertEquals(ValidationResult::IS_POSSIBLE, $this->phoneUtil->isPossibleNumberWithReason($number));
1746
+
1747
+ $this->assertEquals(
1748
+ ValidationResult::TOO_LONG,
1749
+ $this->phoneUtil->isPossibleNumberWithReason(self::$internationalTollFreeTooLong)
1750
+ );
1751
+ }
1752
+
1753
+ public function testIsNotPossibleNumber()
1754
+ {
1755
+ $this->assertFalse($this->phoneUtil->isPossibleNumber(self::$usLongNumber));
1756
+ $this->assertFalse($this->phoneUtil->isPossibleNumber(self::$internationalTollFreeTooLong));
1757
+
1758
+ $number = new PhoneNumber();
1759
+ $number->setCountryCode(1)->setNationalNumber(253000);
1760
+ $this->assertFalse($this->phoneUtil->isPossibleNumber($number));
1761
+
1762
+ $number->clear();
1763
+ $number->setCountryCode(44)->setNationalNumber(300);
1764
+ $this->assertFalse($this->phoneUtil->isPossibleNumber($number));
1765
+ $this->assertFalse($this->phoneUtil->isPossibleNumber("+1 650 253 00000", RegionCode::US));
1766
+ $this->assertFalse($this->phoneUtil->isPossibleNumber("(650) 253-00000", RegionCode::US));
1767
+ $this->assertFalse($this->phoneUtil->isPossibleNumber("I want a Pizza", RegionCode::US));
1768
+ $this->assertFalse($this->phoneUtil->isPossibleNumber("253-000", RegionCode::US));
1769
+ $this->assertFalse($this->phoneUtil->isPossibleNumber("1 3000", RegionCode::GB));
1770
+ $this->assertFalse($this->phoneUtil->isPossibleNumber("+44 300", RegionCode::GB));
1771
+ $this->assertFalse($this->phoneUtil->isPossibleNumber("+800 1234 5678 9", RegionCode::UN001));
1772
+
1773
+ }
1774
+
1775
+ public function testTruncateTooLongNumber()
1776
+ {
1777
+ // GB number 080 1234 5678, but entered with 4 extra digits at the end.
1778
+ $tooLongNumber = new PhoneNumber();
1779
+ $tooLongNumber->setCountryCode(44)->setNationalNumber(80123456780123);
1780
+ $validNumber = new PhoneNumber();
1781
+ $validNumber->setCountryCode(44)->setNationalNumber(8012345678);
1782
+ $this->assertTrue($this->phoneUtil->truncateTooLongNumber($tooLongNumber));
1783
+ $this->assertEquals($validNumber, $tooLongNumber);
1784
+
1785
+ // IT number 022 3456 7890, but entered with 3 extra digits at the end.
1786
+ $tooLongNumber->clear();
1787
+ $tooLongNumber->setCountryCode(39)->setNationalNumber(2234567890123)->setItalianLeadingZero(true);
1788
+ $validNumber->clear();
1789
+ $validNumber->setCountryCode(39)->setNationalNumber(2234567890)->setItalianLeadingZero(true);
1790
+ $this->assertTrue($this->phoneUtil->truncateTooLongNumber($tooLongNumber));
1791
+ $this->assertEquals($validNumber, $tooLongNumber);
1792
+
1793
+ // US number 650-253-0000, but entered with one additional digit at the end.
1794
+ $tooLongNumber->clear();
1795
+ $tooLongNumber->mergeFrom(self::$usLongNumber);
1796
+ $this->assertTrue($this->phoneUtil->truncateTooLongNumber($tooLongNumber));
1797
+ $this->assertEquals(self::$usNumber, $tooLongNumber);
1798
+
1799
+ $tooLongNumber->clear();
1800
+ $tooLongNumber->mergeFrom(self::$internationalTollFreeTooLong);
1801
+ $this->assertTrue($this->phoneUtil->truncateTooLongNumber($tooLongNumber));
1802
+ $this->assertEquals(self::$internationalTollFree, $tooLongNumber);
1803
+
1804
+ // Tests what happens when a valid number is passed in.
1805
+ $validNumberCopy = new PhoneNumber();
1806
+ $validNumberCopy->mergeFrom($validNumber);
1807
+ $this->assertTrue($this->phoneUtil->truncateTooLongNumber($validNumber));
1808
+
1809
+ // Tests the number is not modified.
1810
+ $this->assertEquals($validNumberCopy, $validNumber);
1811
+
1812
+ // Tests what happens when a number with invalid prefix is passed in.
1813
+ $numberWithInvalidPrefix = new PhoneNumber();
1814
+ // The test metadata says US numbers cannot have prefix 240.
1815
+ $numberWithInvalidPrefix->setCountryCode(1)->setNationalNumber(2401234567);
1816
+ $invalidNumberCopy = new PhoneNumber();
1817
+ $invalidNumberCopy->mergeFrom($numberWithInvalidPrefix);
1818
+ $this->assertFalse($this->phoneUtil->truncateTooLongNumber($numberWithInvalidPrefix));
1819
+ // Tests the number is not modified.
1820
+ $this->assertEquals($invalidNumberCopy, $numberWithInvalidPrefix);
1821
+
1822
+ // Tests what happens when a too short number is passed in.
1823
+ $tooShortNumber = new PhoneNumber();
1824
+ $tooShortNumber->setCountryCode(1)->setNationalNumber(1234);
1825
+ $tooShortNumberCopy = new PhoneNumber();
1826
+ $tooShortNumberCopy->mergeFrom($tooShortNumber);
1827
+ $this->assertFalse($this->phoneUtil->truncateTooLongNumber($tooShortNumber));
1828
+ // Tests the number is not modified.
1829
+ $this->assertEquals($tooShortNumberCopy, $tooShortNumber);
1830
+ }
1831
+
1832
+ public function testIsViablePhoneNumber()
1833
+ {
1834
+ $this->assertFalse(PhoneNumberUtil::isViablePhoneNumber("1"));
1835
+ // Only one or two digits before strange non-possible punctuation.
1836
+ $this->assertFalse(PhoneNumberUtil::isViablePhoneNumber("1+1+1"));
1837
+ $this->assertFalse(PhoneNumberUtil::isViablePhoneNumber("80+0"));
1838
+ // Two digits is viable.
1839
+ $this->assertTrue(PhoneNumberUtil::isViablePhoneNumber("00"));
1840
+ $this->assertTrue(PhoneNumberUtil::isViablePhoneNumber("111"));
1841
+ // Alpha numbers.
1842
+ $this->assertTrue(PhoneNumberUtil::isViablePhoneNumber("0800-4-pizza"));
1843
+ $this->assertTrue(PhoneNumberUtil::isViablePhoneNumber("0800-4-PIZZA"));
1844
+
1845
+ // We need at least three digits before any alpha characters.
1846
+ $this->assertFalse(PhoneNumberUtil::isViablePhoneNumber("08-PIZZA"));
1847
+ $this->assertFalse(PhoneNumberUtil::isViablePhoneNumber("8-PIZZA"));
1848
+ $this->assertFalse(PhoneNumberUtil::isViablePhoneNumber("12. March"));
1849
+ }
1850
+
1851
+ public function testIsViablePhoneNumberNonAscii()
1852
+ {
1853
+ // Only one or two digits before possible punctuation followed by more digits.
1854
+ $this->assertTrue(PhoneNumberUtil::isViablePhoneNumber("1" . pack('H*', 'e38080') . "34"));
1855
+ $this->assertFalse(PhoneNumberUtil::isViablePhoneNumber("1" . pack('H*', 'e38080') . "3+4"));
1856
+ // Unicode variants of possible starting character and other allowed punctuation/digits.
1857
+ $this->assertTrue(
1858
+ PhoneNumberUtil::isViablePhoneNumber(
1859
+ pack('H*', 'efbc88') . "1" . pack("H*", 'efbc89') . pack('H*', 'e38080') . "3456789"
1860
+ )
1861
+ );
1862
+ // Testing a leading + is okay.
1863
+ $this->assertTrue(
1864
+ PhoneNumberUtil::isViablePhoneNumber("+1" . pack("H*", 'efbc89') . pack('H*', 'e38080') . "3456789")
1865
+ );
1866
+ }
1867
+
1868
+ public function testExtractPossibleNumber()
1869
+ {
1870
+ // Removes preceding funky punctuation and letters but leaves the rest untouched.
1871
+ $this->assertEquals("0800-345-600", PhoneNumberUtil::extractPossibleNumber("Tel:0800-345-600"));
1872
+ $this->assertEquals("0800 FOR PIZZA", PhoneNumberUtil::extractPossibleNumber("Tel:0800 FOR PIZZA"));
1873
+ // Should not remove plus sign
1874
+ $this->assertEquals("+800-345-600", PhoneNumberUtil::extractPossibleNumber("Tel:+800-345-600"));
1875
+ // Should recognise wide digits as possible start values.
1876
+ $this->assertEquals(
1877
+ pack("H*", 'efbc90') . pack("H*", 'efbc92') . pack("H*", 'efbc93'),
1878
+ PhoneNumberUtil::extractPossibleNumber(pack("H*", 'efbc90') . pack("H*", 'efbc92') . pack("H*", 'efbc93'))
1879
+ );
1880
+ // Dashes are not possible start values and should be removed.
1881
+ $this->assertEquals(
1882
+ pack("H*", 'efbc91') . pack("H*", 'efbc92') . pack("H*", 'efbc93'),
1883
+ PhoneNumberUtil::extractPossibleNumber(
1884
+ "Num-" . pack("H*", 'efbc91') . pack("H*", 'efbc92') . pack("H*", 'efbc93')
1885
+ )
1886
+ );
1887
+ // If not possible number present, return empty string.
1888
+ $this->assertEquals("", PhoneNumberUtil::extractPossibleNumber("Num-...."));
1889
+ // Leading brackets are stripped - these are not used when parsing.
1890
+ $this->assertEquals("650) 253-0000", PhoneNumberUtil::extractPossibleNumber("(650) 253-0000"));
1891
+
1892
+ // Trailing non-alpha-numeric characters should be removed.
1893
+ $this->assertEquals("650) 253-0000", PhoneNumberUtil::extractPossibleNumber("(650) 253-0000..- .."));
1894
+ $this->assertEquals("650) 253-0000", PhoneNumberUtil::extractPossibleNumber("(650) 253-0000."));
1895
+ // This case has a trailing RTL char.
1896
+ $this->assertEquals(
1897
+ "650) 253-0000",
1898
+ PhoneNumberUtil::extractPossibleNumber("(650) 253-0000" . pack("H*", 'e2808f'))
1899
+ );
1900
+ }
1901
+
1902
+ public function testMaybeStripNationalPrefix()
1903
+ {
1904
+ $metadata = new PhoneMetadata();
1905
+ $metadata->setNationalPrefixForParsing("34");
1906
+ $phoneNumberDesc = new PhoneNumberDesc();
1907
+ $phoneNumberDesc->setNationalNumberPattern("\\d{4,8}");
1908
+ $metadata->setGeneralDesc($phoneNumberDesc);
1909
+
1910
+ $numberToStrip = "34356778";
1911
+ $strippedNumber = "356778";
1912
+
1913
+ $carrierCode = null;
1914
+
1915
+ $this->assertTrue(
1916
+ $this->phoneUtil->maybeStripNationalPrefixAndCarrierCode($numberToStrip, $metadata, $carrierCode)
1917
+ );
1918
+ $this->assertEquals($strippedNumber, $numberToStrip, "Should have had national prefix stripped.");
1919
+ // Retry stripping - now the number should not start with the national prefix, so no more
1920
+ // stripping should occur.
1921
+ $carrierCode = null;
1922
+ $this->assertFalse(
1923
+ $this->phoneUtil->maybeStripNationalPrefixAndCarrierCode($numberToStrip, $metadata, $carrierCode)
1924
+ );
1925
+ $this->assertEquals($strippedNumber, $numberToStrip, "Should have had no change - no national prefix present.");
1926
+
1927
+ // Some countries have no national prefix. Repeat test with none specified.
1928
+ $metadata->setNationalPrefixForParsing("");
1929
+ $carrierCode = null;
1930
+ $this->assertFalse(
1931
+ $this->phoneUtil->maybeStripNationalPrefixAndCarrierCode($numberToStrip, $metadata, $carrierCode)
1932
+ );
1933
+ $this->assertEquals($strippedNumber, $numberToStrip, "Should not strip anything with empty national prefix.");
1934
+
1935
+ // If the resultant number doesn't match the national rule, it shouldn't be stripped.
1936
+ $metadata->setNationalPrefixForParsing("3");
1937
+ $numberToStrip = "3123";
1938
+ $strippedNumber = "3123";
1939
+ $carrierCode = null;
1940
+ $this->assertFalse(
1941
+ $this->phoneUtil->maybeStripNationalPrefixAndCarrierCode($numberToStrip, $metadata, $carrierCode)
1942
+ );
1943
+ $this->assertEquals(
1944
+ $strippedNumber,
1945
+ $numberToStrip,
1946
+ "Should have had no change - after stripping, it wouldn't have matched the national rule."
1947
+ );
1948
+
1949
+ // Test extracting carrier selection code.
1950
+ $metadata->setNationalPrefixForParsing("0(81)?");
1951
+ $numberToStrip = "08122123456";
1952
+ $strippedNumber = "22123456";
1953
+ $carrierCode = "";
1954
+ $this->assertTrue(
1955
+ $this->phoneUtil->maybeStripNationalPrefixAndCarrierCode($numberToStrip, $metadata, $carrierCode)
1956
+ );
1957
+ $this->assertEquals("81", $carrierCode);
1958
+ $this->assertEquals(
1959
+ $strippedNumber,
1960
+ $numberToStrip,
1961
+ "Should have had national prefix and carrier code stripped."
1962
+ );
1963
+
1964
+ // If there was a transform rule, check it was applied.
1965
+ $metadata->setNationalPrefixTransformRule("5\${1}5");
1966
+ // Note that a capturing group is present here.
1967
+ $metadata->setNationalPrefixForParsing("0(\\d{2})");
1968
+ $numberToStrip = "031123";
1969
+ $transformedNumber = "5315123";
1970
+ $carrierCode = null;
1971
+ $this->assertTrue(
1972
+ $this->phoneUtil->maybeStripNationalPrefixAndCarrierCode($numberToStrip, $metadata, $carrierCode)
1973
+ );
1974
+ $this->assertEquals($transformedNumber, $numberToStrip, "Should transform the 031 to a 5315.");
1975
+ }
1976
+
1977
+ public function testMaybeStripInternationalPrefix()
1978
+ {
1979
+ $internationalPrefix = "00[39]";
1980
+ $numberToStrip = "0034567700-3898003";
1981
+ // Note the dash is removed as part of the normalization.
1982
+ $strippedNumber = "45677003898003";
1983
+ $this->assertEquals(
1984
+ CountryCodeSource::FROM_NUMBER_WITH_IDD,
1985
+ $this->phoneUtil->maybeStripInternationalPrefixAndNormalize($numberToStrip, $internationalPrefix)
1986
+ );
1987
+ $this->assertEquals(
1988
+ $strippedNumber,
1989
+ $numberToStrip,
1990
+ "The number supplied was not stripped of its international prefix."
1991
+ );
1992
+
1993
+ // Now the number no longer starts with an IDD prefix, so it should now report
1994
+ // FROM_DEFAULT_COUNTRY.
1995
+ $this->assertEquals(
1996
+ CountryCodeSource::FROM_DEFAULT_COUNTRY,
1997
+ $this->phoneUtil->maybeStripInternationalPrefixAndNormalize($numberToStrip, $internationalPrefix)
1998
+ );
1999
+
2000
+ $numberToStrip = "00945677003898003";
2001
+ $this->assertEquals(
2002
+ CountryCodeSource::FROM_NUMBER_WITH_IDD,
2003
+ $this->phoneUtil->maybeStripInternationalPrefixAndNormalize($numberToStrip, $internationalPrefix)
2004
+ );
2005
+ $this->assertEquals(
2006
+ $strippedNumber,
2007
+ $numberToStrip,
2008
+ "The number supplied was not stripped of its international prefix."
2009
+ );
2010
+
2011
+ // Test it works when the international prefix is broken up by spaces.
2012
+ $numberToStrip = "00 9 45677003898003";
2013
+ $this->assertEquals(
2014
+ CountryCodeSource::FROM_NUMBER_WITH_IDD,
2015
+ $this->phoneUtil->maybeStripInternationalPrefixAndNormalize($numberToStrip, $internationalPrefix)
2016
+ );
2017
+ $this->assertEquals(
2018
+ $strippedNumber,
2019
+ $numberToStrip,
2020
+ "The number supplied was not stripped of its international prefix."
2021
+ );
2022
+
2023
+ // Now the number no longer starts with an IDD prefix, so it should now report
2024
+ // FROM_DEFAULT_COUNTRY.
2025
+ $this->assertEquals(
2026
+ CountryCodeSource::FROM_DEFAULT_COUNTRY,
2027
+ $this->phoneUtil->maybeStripInternationalPrefixAndNormalize($numberToStrip, $internationalPrefix)
2028
+ );
2029
+
2030
+ // Test the + symbol is also recognised and stripped.
2031
+ $numberToStrip = "+45677003898003";
2032
+ $strippedNumber = "45677003898003";
2033
+ $this->assertEquals(
2034
+ CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN,
2035
+ $this->phoneUtil->maybeStripInternationalPrefixAndNormalize($numberToStrip, $internationalPrefix)
2036
+ );
2037
+ $this->assertEquals(
2038
+ $strippedNumber,
2039
+ $numberToStrip,
2040
+ "The number supplied was not stripped of the plus symbol."
2041
+ );
2042
+
2043
+ // If the number afterwards is a zero, we should not strip this - no country calling code begins
2044
+ // with 0.
2045
+ $numberToStrip = "0090112-3123";
2046
+ $strippedNumber = "00901123123";
2047
+ $this->assertEquals(
2048
+ CountryCodeSource::FROM_DEFAULT_COUNTRY,
2049
+ $this->phoneUtil->maybeStripInternationalPrefixAndNormalize($numberToStrip, $internationalPrefix)
2050
+ );
2051
+ $this->assertEquals(
2052
+ $strippedNumber,
2053
+ $numberToStrip,
2054
+ "The number supplied had a 0 after the match so shouldn't be stripped."
2055
+ );
2056
+
2057
+ // Here the 0 is separated by a space from the IDD.
2058
+ $numberToStrip = "009 0-112-3123";
2059
+ $this->assertEquals(
2060
+ CountryCodeSource::FROM_DEFAULT_COUNTRY,
2061
+ $this->phoneUtil->maybeStripInternationalPrefixAndNormalize($numberToStrip, $internationalPrefix)
2062
+ );
2063
+ }
2064
+
2065
+ public function testMaybeExtractCountryCode()
2066
+ {
2067
+ $number = new PhoneNumber();
2068
+ $metadata = $this->phoneUtil->getMetadataForRegion(RegionCode::US);
2069
+ // Note that for the US, the IDD is 011.
2070
+ try {
2071
+ $phoneNumber = "011112-3456789";
2072
+ $strippedNumber = "123456789";
2073
+ $countryCallingCode = 1;
2074
+ $numberToFill = "";
2075
+ $this->assertEquals(
2076
+ $countryCallingCode,
2077
+ $this->phoneUtil->maybeExtractCountryCode($phoneNumber, $metadata, $numberToFill, true, $number),
2078
+ "Did not extract country calling code " . $countryCallingCode . " correctly."
2079
+ );
2080
+ $this->assertEquals(
2081
+ CountryCodeSource::FROM_NUMBER_WITH_IDD,
2082
+ $number->getCountryCodeSource(),
2083
+ "Did not figure out CountryCodeSource correctly"
2084
+ );
2085
+ // Should strip and normalize national significant number.
2086
+ $this->assertEquals(
2087
+ $strippedNumber,
2088
+ $numberToFill,
2089
+ "Did not strip off the country calling code correctly."
2090
+ );
2091
+ } catch (NumberParseException $e) {
2092
+ $this->fail("Should not have thrown an exception: " . $e->getMessage());
2093
+ }
2094
+ $number->clear();
2095
+ try {
2096
+ $phoneNumber = "+6423456789";
2097
+ $countryCallingCode = 64;
2098
+ $numberToFill = "";
2099
+ $this->assertEquals(
2100
+ $countryCallingCode,
2101
+ $this->phoneUtil->maybeExtractCountryCode($phoneNumber, $metadata, $numberToFill, true, $number),
2102
+ "Did not extract country calling code " . $countryCallingCode . " correctly."
2103
+ );
2104
+ $this->assertEquals(
2105
+ CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN,
2106
+ $number->getCountryCodeSource(),
2107
+ "Did not figure out CountryCodeSource correctly"
2108
+ );
2109
+ } catch (NumberParseException $e) {
2110
+ $this->fail("Should not have thrown an exception: " . $e->getMessage());
2111
+ }
2112
+ $number->clear();
2113
+ try {
2114
+ $phoneNumber = "+80012345678";
2115
+ $countryCallingCode = 800;
2116
+ $numberToFill = "";
2117
+ $this->assertEquals(
2118
+ $countryCallingCode,
2119
+ $this->phoneUtil->maybeExtractCountryCode($phoneNumber, $metadata, $numberToFill, true, $number),
2120
+ "Did not extract country calling code " . $countryCallingCode . " correctly."
2121
+ );
2122
+ $this->assertEquals(
2123
+ CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN,
2124
+ $number->getCountryCodeSource(),
2125
+ "Did not figure out CountryCodeSource correctly"
2126
+ );
2127
+ } catch (NumberParseException $e) {
2128
+ $this->fail("Should not have thrown an exception: " . $e->getMessage());
2129
+ }
2130
+ $number->clear();
2131
+ try {
2132
+ $phoneNumber = "2345-6789";
2133
+ $numberToFill = "";
2134
+ $this->assertEquals(
2135
+ 0,
2136
+ $this->phoneUtil->maybeExtractCountryCode($phoneNumber, $metadata, $numberToFill, true, $number),
2137
+ "Should not have extracted a country calling code - no international prefix present."
2138
+ );
2139
+ $this->assertEquals(
2140
+ CountryCodeSource::FROM_DEFAULT_COUNTRY,
2141
+ $number->getCountryCodeSource(),
2142
+ "Did not figure out CountryCodeSource correctly"
2143
+ );
2144
+ } catch (NumberParseException $e) {
2145
+ $this->fail("Should not have thrown an exception: " . $e->getMessage());
2146
+ }
2147
+ $number->clear();
2148
+ try {
2149
+ $phoneNumber = "0119991123456789";
2150
+ $numberToFill = "";
2151
+ $this->phoneUtil->maybeExtractCountryCode($phoneNumber, $metadata, $numberToFill, true, $number);
2152
+ $this->fail("Should have thrown an exception, no valid country calling code present.");
2153
+ } catch (NumberParseException $e) {
2154
+ // Expected.
2155
+ $this->assertEquals(
2156
+ NumberParseException::INVALID_COUNTRY_CODE,
2157
+ $e->getErrorType(),
2158
+ "Wrong error type stored in exception."
2159
+ );
2160
+ }
2161
+ $number->clear();
2162
+ try {
2163
+ $phoneNumber = "(1 610) 619 4466";
2164
+ $countryCallingCode = 1;
2165
+ $numberToFill = "";
2166
+ $this->assertEquals(
2167
+ $countryCallingCode,
2168
+ $this->phoneUtil->maybeExtractCountryCode($phoneNumber, $metadata, $numberToFill, true, $number),
2169
+ "Should have extracted the country calling code of the region passed in"
2170
+ );
2171
+ $this->assertEquals(
2172
+ CountryCodeSource::FROM_NUMBER_WITHOUT_PLUS_SIGN,
2173
+ $number->getCountryCodeSource(),
2174
+ "Did not figure out CountryCodeSource correctly"
2175
+ );
2176
+ } catch (NumberParseException $e) {
2177
+ $this->fail("Should not have thrown an exception: " . $e->getMessage());
2178
+ }
2179
+ $number->clear();
2180
+ try {
2181
+ $phoneNumber = "(1 610) 619 4466";
2182
+ $countryCallingCode = 1;
2183
+ $numberToFill = "";
2184
+ $this->assertEquals(
2185
+ $countryCallingCode,
2186
+ $this->phoneUtil->maybeExtractCountryCode($phoneNumber, $metadata, $numberToFill, false, $number),
2187
+ "Should have extracted the country calling code of the region passed in"
2188
+ );
2189
+ $this->assertFalse($number->hasCountryCodeSource(), "Should not contain CountryCodeSource");
2190
+ } catch (NumberParseException $e) {
2191
+ $this->fail("Should not have thrown an exception: " . $e->getMessage());
2192
+ }
2193
+ $number->clear();
2194
+ try {
2195
+ $phoneNumber = "(1 610) 619 446";
2196
+ $numberToFill = "";
2197
+ $this->assertEquals(
2198
+ 0,
2199
+ $this->phoneUtil->maybeExtractCountryCode($phoneNumber, $metadata, $numberToFill, false, $number),
2200
+ "Should not have extracted a country calling code - invalid number after extraction of uncertain country calling code."
2201
+ );
2202
+ $this->assertFalse($number->hasCountryCodeSource(), "Should not contain CountryCodeSource");
2203
+ } catch (NumberParseException $e) {
2204
+ $this->fail("Should not have thrown an exception: " . $e->getMessage());
2205
+ }
2206
+ $number->clear();
2207
+ try {
2208
+ $phoneNumber = "(1 610) 619";
2209
+ $numberToFill = "";
2210
+ $this->assertEquals(
2211
+ 0,
2212
+ $this->phoneUtil->maybeExtractCountryCode($phoneNumber, $metadata, $numberToFill, true, $number),
2213
+ "Should not have extracted a country calling code - too short number both before and after extraction of uncertain country calling code."
2214
+ );
2215
+ $this->assertEquals(
2216
+ CountryCodeSource::FROM_DEFAULT_COUNTRY,
2217
+ $number->getCountryCodeSource(),
2218
+ "Did not figure out CountryCodeSource correctly"
2219
+ );
2220
+ } catch (NumberParseException $e) {
2221
+ $this->fail("Should not have thrown an exception: " . $e->getMessage());
2222
+ }
2223
+ }
2224
+
2225
+ public function testParseNationalNumber()
2226
+ {
2227
+ // National prefix attached.
2228
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("033316005", RegionCode::NZ));
2229
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("33316005", RegionCode::NZ));
2230
+ // National prefix attached and some formatting present.
2231
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("03-331 6005", RegionCode::NZ));
2232
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("03 331 6005", RegionCode::NZ));
2233
+
2234
+ // Test parsing RFC3966 format with a phone context.
2235
+ $this->assertEquals(
2236
+ self::$nzNumber,
2237
+ $this->phoneUtil->parse("tel:03-331-6005;phone-context=+64", RegionCode::NZ)
2238
+ );
2239
+ $this->assertEquals(
2240
+ self::$nzNumber,
2241
+ $this->phoneUtil->parse("tel:331-6005;phone-context=+64-3", RegionCode::NZ)
2242
+ );
2243
+ $this->assertEquals(
2244
+ self::$nzNumber,
2245
+ $this->phoneUtil->parse("tel:331-6005;phone-context=+64-3", RegionCode::US)
2246
+ );
2247
+ $this->assertEquals(
2248
+ self::$nzNumber,
2249
+ $this->phoneUtil->parse("My number is tel:03-331-6005;phone-context=+64", RegionCode::NZ)
2250
+ );
2251
+ // Test parsing RFC3966 format with optional user-defined parameters. The parameters will appear
2252
+ // after the context if present.
2253
+ $this->assertEquals(
2254
+ self::$nzNumber,
2255
+ $this->phoneUtil->parse("tel:03-331-6005;phone-context=+64;a=%A1", RegionCode::NZ)
2256
+ );
2257
+ // Test parsing RFC3966 with an ISDN subaddress.
2258
+ $this->assertEquals(
2259
+ self::$nzNumber,
2260
+ $this->phoneUtil->parse("tel:03-331-6005;isub=12345;phone-context=+64", RegionCode::NZ)
2261
+ );
2262
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("tel:+64-3-331-6005;isub=12345", RegionCode::NZ));
2263
+
2264
+ // Test parsing RFC3966 with "tel:" missing
2265
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("03-331-6005;phone-context=+64", RegionCode::NZ));
2266
+
2267
+ // Testing international prefixes.
2268
+ // Should strip country calling code.
2269
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("0064 3 331 6005", RegionCode::NZ));
2270
+ // Try again, but this time we have an international number with Region Code US. It should
2271
+ // recognise the country calling code and parse accordingly.
2272
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("01164 3 331 6005", RegionCode::US));
2273
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("+64 3 331 6005", RegionCode::US));
2274
+ // We should ignore the leading plus here, since it is not followed by a valid country code but
2275
+ // instead is followed by the IDD for the US.
2276
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("+01164 3 331 6005", RegionCode::US));
2277
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("+0064 3 331 6005", RegionCode::NZ));
2278
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("+ 00 64 3 331 6005", RegionCode::NZ));
2279
+
2280
+ $this->assertEquals(
2281
+ self::$usLocalNumber,
2282
+ $this->phoneUtil->parse("tel:253-0000;phone-context=www.google.com", RegionCode::US)
2283
+ );
2284
+ $this->assertEquals(
2285
+ self::$usLocalNumber,
2286
+ $this->phoneUtil->parse("tel:253-0000;isub=12345;phone-context=www.google.com", RegionCode::US)
2287
+ );
2288
+ // This is invalid because no "+" sign is present as part of phone-context. The phone context
2289
+ // is simply ignored in this case just as if it contains a domain.
2290
+ $this->assertEquals(
2291
+ self::$usLocalNumber,
2292
+ $this->phoneUtil->parse("tel:2530000;isub=12345;phone-context=1-650", RegionCode::US)
2293
+ );
2294
+ $this->assertEquals(
2295
+ self::$usLocalNumber,
2296
+ $this->phoneUtil->parse("tel:2530000;isub=12345;phone-context=1234.com", RegionCode::US)
2297
+ );
2298
+
2299
+ $nzNumber = new PhoneNumber();
2300
+ $nzNumber->setCountryCode(64)->setNationalNumber(64123456);
2301
+ $this->assertEquals($nzNumber, $this->phoneUtil->parse("64(0)64123456", RegionCode::NZ));
2302
+ // Check that using a "/" is fine in a phone number.
2303
+ $this->assertEquals(self::$deNumber, $this->phoneUtil->parse("301/23456", RegionCode::DE));
2304
+
2305
+ $usNumber = new PhoneNumber();
2306
+ // Check it doesn't use the '1' as a country calling code when parsing if the phone number was
2307
+ // already possible.
2308
+ $usNumber->setCountryCode(1)->setNationalNumber(1234567890);
2309
+ $this->assertEquals($usNumber, $this->phoneUtil->parse("123-456-7890", RegionCode::US));
2310
+
2311
+ // Test star numbers. Although this is not strictly valid, we would like to make sure we can
2312
+ // parse the output we produce when formatting the number.
2313
+ $this->assertEquals(self::$jpStarNumber, $this->phoneUtil->parse("+81 *2345", RegionCode::JP));
2314
+
2315
+ $shortNumber = new PhoneNumber();
2316
+ $shortNumber->setCountryCode(64)->setNationalNumber(12);
2317
+ $this->assertEquals($shortNumber, $this->phoneUtil->parse("12", RegionCode::NZ));
2318
+ }
2319
+
2320
+ public function testParseNumberWithAlphaCharacters()
2321
+ {
2322
+ // Test case with alpha characters.
2323
+ $tollFreeNumber = new PhoneNumber();
2324
+ $tollFreeNumber->setCountryCode(64)->setNationalNumber(800332005);
2325
+ $this->assertEquals($tollFreeNumber, $this->phoneUtil->parse("0800 DDA 005", RegionCode::NZ));
2326
+
2327
+ $premiumNumber = new PhoneNumber();
2328
+ $premiumNumber->setCountryCode(64)->setNationalNumber(9003326005);
2329
+ $this->assertEquals($premiumNumber, $this->phoneUtil->parse("0900 DDA 6005", RegionCode::NZ));
2330
+
2331
+ // Not enough alpha characters for them to be considered intentional, so they are stripped.
2332
+ $this->assertEquals($premiumNumber, $this->phoneUtil->parse("0900 332 6005a", RegionCode::NZ));
2333
+ $this->assertEquals($premiumNumber, $this->phoneUtil->parse("0900 332 600a5", RegionCode::NZ));
2334
+ $this->assertEquals($premiumNumber, $this->phoneUtil->parse("0900 332 600A5", RegionCode::NZ));
2335
+ $this->assertEquals($premiumNumber, $this->phoneUtil->parse("0900 a332 600A5", RegionCode::NZ));
2336
+ }
2337
+
2338
+ public function testParseMaliciousInput()
2339
+ {
2340
+ // Lots of leading + signs before the possible number.
2341
+ $maliciousNumber = str_repeat("+", 6000);
2342
+ $maliciousNumber .= "12222-33-244 extensioB 343+";
2343
+
2344
+ try {
2345
+ $this->phoneUtil->parse($maliciousNumber, RegionCode::US);
2346
+ $this->fail("This should not parse without throwing an exception " . $maliciousNumber);
2347
+ } catch (NumberParseException $e) {
2348
+ // Expected this exception.
2349
+ $this->assertEquals(
2350
+ NumberParseException::TOO_LONG,
2351
+ $e->getErrorType(),
2352
+ "Wrong error type stored in exception."
2353
+ );
2354
+ }
2355
+
2356
+ $maliciousNumberWithAlmostExt = str_repeat("200", 350);
2357
+ $maliciousNumberWithAlmostExt .= " extensiOB 345";
2358
+ try {
2359
+ $this->phoneUtil->parse($maliciousNumberWithAlmostExt, RegionCode::US);
2360
+ $this->fail("This should not parse without throwing an exception " . $maliciousNumberWithAlmostExt);
2361
+ } catch (NumberParseException $e) {
2362
+ // Expected this exception.
2363
+ $this->assertEquals(
2364
+ NumberParseException::TOO_LONG,
2365
+ $e->getErrorType(),
2366
+ "Wrong error type stored in exception."
2367
+ );
2368
+ }
2369
+ }
2370
+
2371
+ public function testParseWithInternationalPrefixes()
2372
+ {
2373
+ $this->assertEquals(self::$usNumber, $this->phoneUtil->parse("+1 (650) 253-0000", RegionCode::NZ));
2374
+ $this->assertEquals(self::$internationalTollFree, $this->phoneUtil->parse("011 800 1234 5678", RegionCode::US));
2375
+ $this->assertEquals(self::$usNumber, $this->phoneUtil->parse("1-650-253-0000", RegionCode::US));
2376
+ // Calling the US number from Singapore by using different service providers
2377
+ // 1st test: calling using SingTel IDD service (IDD is 001)
2378
+ $this->assertEquals(self::$usNumber, $this->phoneUtil->parse("0011-650-253-0000", RegionCode::SG));
2379
+ // 2nd test: calling using StarHub IDD service (IDD is 008)
2380
+ $this->assertEquals(self::$usNumber, $this->phoneUtil->parse("0081-650-253-0000", RegionCode::SG));
2381
+ // 3rd test: calling using SingTel V019 service (IDD is 019)
2382
+ $this->assertEquals(self::$usNumber, $this->phoneUtil->parse("0191-650-253-0000", RegionCode::SG));
2383
+ // Calling the US number from Poland
2384
+ $this->assertEquals(self::$usNumber, $this->phoneUtil->parse("0~01-650-253-0000", RegionCode::PL));
2385
+ // Using "++" at the start.
2386
+ $this->assertEquals(self::$usNumber, $this->phoneUtil->parse("++1 (650) 253-0000", RegionCode::PL));
2387
+ }
2388
+
2389
+ public function testParseNonAscii()
2390
+ {
2391
+ // Using a full-width plus sign.
2392
+ $this->assertEquals(
2393
+ self::$usNumber,
2394
+ $this->phoneUtil->parse(pack("H*", 'efbc8b') . "1 (650) 253-0000", RegionCode::SG)
2395
+ );
2396
+ // Using a soft hyphen U+00AD.
2397
+ $this->assertEquals(
2398
+ self::$usNumber,
2399
+ $this->phoneUtil->parse("1 (650) 253" . pack("H*", 'c2ad') . "-0000", RegionCode::US)
2400
+ );
2401
+ // The whole number, including punctuation, is here represented in full-width form.
2402
+ $this->assertEquals(
2403
+ self::$usNumber,
2404
+ $this->phoneUtil->parse(
2405
+ pack("H*", 'efbc8b') . pack("H*", 'efbc91') . pack("H*", 'e38080') .
2406
+ pack("H*", 'efbc88') . pack("H*", 'efbc96') . pack("H*", 'efbc95') . pack("H*", 'efbc90') . pack(
2407
+ "H*",
2408
+ 'efbc89'
2409
+ ) .
2410
+ pack("H*", 'e38080') . pack("H*", 'efbc92') . pack("H*", 'efbc95') . pack("H*", 'efbc93') . pack(
2411
+ "H*",
2412
+ 'efbc8d'
2413
+ ) .
2414
+ pack("H*", 'efbc90') . pack("H*", 'efbc90') . pack("H*", 'efbc90') . pack("H*", 'efbc90'),
2415
+ RegionCode::SG
2416
+ )
2417
+ );
2418
+ // Using U+30FC dash instead.
2419
+ $this->assertEquals(
2420
+ self::$usNumber,
2421
+ $this->phoneUtil->parse(
2422
+ pack("H*", 'efbc8b') . pack("H*", 'efbc91') . pack("H*", 'e38080') .
2423
+ pack("H*", 'efbc88') . pack("H*", 'efbc96') . pack("H*", 'efbc95') . pack("H*", 'efbc90') . pack(
2424
+ "H*",
2425
+ 'efbc89'
2426
+ ) .
2427
+ pack("H*", 'e38080') . pack("H*", 'efbc92') . pack("H*", 'efbc95') . pack("H*", 'efbc93') . pack(
2428
+ "H*",
2429
+ 'e383bc'
2430
+ ) .
2431
+ pack("H*", 'efbc90') . pack("H*", 'efbc90') . pack("H*", 'efbc90') . pack("H*", 'efbc90'),
2432
+ RegionCode::SG
2433
+ )
2434
+ );
2435
+ // Using a very strange decimal digit range (Mongolian digits).
2436
+ $this->assertEquals(
2437
+ self::$usNumber,
2438
+ $this->phoneUtil->parse(
2439
+ pack('H*', 'e1a091') . " "
2440
+ . pack('H*', 'e1a096') . pack('H*', 'e1a095') . pack('H*', 'e1a090') . " "
2441
+ . pack('H*', 'e1a092') . pack('H*', 'e1a095') . pack('H*', 'e1a093') . " "
2442
+ . pack('H*', 'e1a090') . pack('H*', 'e1a090') . pack('H*', 'e1a090') . pack('H*', 'e1a090'),
2443
+ RegionCode::US
2444
+ )
2445
+ );
2446
+ }
2447
+
2448
+ public function testParseWithLeadingZero()
2449
+ {
2450
+ $this->assertEquals(self::$itNumber, $this->phoneUtil->parse("+39 02-36618 300", RegionCode::NZ));
2451
+ $this->assertEquals(self::$itNumber, $this->phoneUtil->parse("02-36618 300", RegionCode::IT));
2452
+
2453
+ $this->assertEquals(self::$itMobile, $this->phoneUtil->parse("345 678 901", RegionCode::IT));
2454
+ }
2455
+
2456
+ public function testParseNationalNumberArgentina()
2457
+ {
2458
+ // Test parsing mobile numbers of Argentina.
2459
+ $arNumber = new PhoneNumber();
2460
+ $arNumber->setCountryCode(54)->setNationalNumber(93435551212);
2461
+ $this->assertEquals($arNumber, $this->phoneUtil->parse("+54 9 343 555 1212", RegionCode::AR));
2462
+ $this->assertEquals($arNumber, $this->phoneUtil->parse("0343 15 555 1212", RegionCode::AR));
2463
+
2464
+ $arNumber->clear();
2465
+ $arNumber->setCountryCode(54)->setNationalNumber(93715654320);
2466
+ $this->assertEquals($arNumber, $this->phoneUtil->parse("+54 9 3715 65 4320", RegionCode::AR));
2467
+ $this->assertEquals($arNumber, $this->phoneUtil->parse("03715 15 65 4320", RegionCode::AR));
2468
+ $this->assertEquals(self::$arMobile, $this->phoneUtil->parse("911 876 54321", RegionCode::AR));
2469
+
2470
+ // Test parsing fixed-line numbers of Argentina.
2471
+ $this->assertEquals(self::$arNumber, $this->phoneUtil->parse("+54 11 8765 4321", RegionCode::AR));
2472
+ $this->assertEquals(self::$arNumber, $this->phoneUtil->parse("011 8765 4321", RegionCode::AR));
2473
+
2474
+ $arNumber->clear();
2475
+ $arNumber->setCountryCode(54)->setNationalNumber(3715654321);
2476
+ $this->assertEquals($arNumber, $this->phoneUtil->parse("+54 3715 65 4321", RegionCode::AR));
2477
+ $this->assertEquals($arNumber, $this->phoneUtil->parse("03715 65 4321", RegionCode::AR));
2478
+
2479
+ $arNumber->clear();
2480
+ $arNumber->setCountryCode(54)->setNationalNumber(2312340000);
2481
+ $this->assertEquals($arNumber, $this->phoneUtil->parse("+54 23 1234 0000", RegionCode::AR));
2482
+ $this->assertEquals($arNumber, $this->phoneUtil->parse("023 1234 0000", RegionCode::AR));
2483
+ }
2484
+
2485
+ public function testParseWithXInNumber()
2486
+ {
2487
+ // Test that having an 'x' in the phone number at the start is ok and that it just gets removed.
2488
+ $this->assertEquals(self::$arNumber, $this->phoneUtil->parse("01187654321", RegionCode::AR));
2489
+ $this->assertEquals(self::$arNumber, $this->phoneUtil->parse("(0) 1187654321", RegionCode::AR));
2490
+ $this->assertEquals(self::$arNumber, $this->phoneUtil->parse("0 1187654321", RegionCode::AR));
2491
+ $this->assertEquals(self::$arNumber, $this->phoneUtil->parse("(0xx) 1187654321", RegionCode::AR));
2492
+
2493
+ $arFromUs = new PhoneNumber();
2494
+ $arFromUs->setCountryCode(54)->setNationalNumber(81429712);
2495
+ // This test is intentionally constructed such that the number of digit after xx is larger than
2496
+ // 7, so that the number won't be mistakenly treated as an extension, as we allow extensions up
2497
+ // to 7 digits. This assumption is okay for now as all the countries where a carrier selection
2498
+ // code is written in the form of xx have a national significant number of length larger than 7.
2499
+ $this->assertEquals($arFromUs, $this->phoneUtil->parse("011xx5481429712", RegionCode::US));
2500
+ }
2501
+
2502
+ public function testParseNumbersMexico()
2503
+ {
2504
+ // Test parsing fixed-line numbers of Mexico.
2505
+ $mxNumber = new PhoneNumber();
2506
+ $mxNumber->setCountryCode(52)->setNationalNumber(4499780001);
2507
+ $this->assertEquals($mxNumber, $this->phoneUtil->parse("+52 (449)978-0001", RegionCode::MX));
2508
+ $this->assertEquals($mxNumber, $this->phoneUtil->parse("01 (449)978-0001", RegionCode::MX));
2509
+ $this->assertEquals($mxNumber, $this->phoneUtil->parse("(449)978-0001", RegionCode::MX));
2510
+
2511
+ // Test parsing mobile numbers of Mexico.
2512
+ $mxNumber->clear();
2513
+ $mxNumber->setCountryCode(52)->setNationalNumber(13312345678);
2514
+ $this->assertEquals($mxNumber, $this->phoneUtil->parse("+52 1 33 1234-5678", RegionCode::MX));
2515
+ $this->assertEquals($mxNumber, $this->phoneUtil->parse("044 (33) 1234-5678", RegionCode::MX));
2516
+ $this->assertEquals($mxNumber, $this->phoneUtil->parse("045 33 1234-5678", RegionCode::MX));
2517
+ }
2518
+
2519
+ public function testFailedParseOnInvalidNumbers()
2520
+ {
2521
+ try {
2522
+ $sentencePhoneNumber = "This is not a phone number";
2523
+ $this->phoneUtil->parse($sentencePhoneNumber, RegionCode::NZ);
2524
+ $this->fail("This should not parse without throwing an exception " . $sentencePhoneNumber);
2525
+ } catch (NumberParseException $e) {
2526
+ // Expected this exception.
2527
+ $this->assertEquals(
2528
+ NumberParseException::NOT_A_NUMBER,
2529
+ $e->getErrorType(),
2530
+ "Wrong error type stored in exception."
2531
+ );
2532
+ }
2533
+
2534
+ try {
2535
+ $sentencePhoneNumber = "1 Still not a number";
2536
+ $this->phoneUtil->parse($sentencePhoneNumber, RegionCode::NZ);
2537
+ $this->fail("This should not parse without throwing an exception " . $sentencePhoneNumber);
2538
+ } catch (NumberParseException $e) {
2539
+ // Expected this exception.
2540
+ $this->assertEquals(
2541
+ NumberParseException::NOT_A_NUMBER,
2542
+ $e->getErrorType(),
2543
+ "Wrong error type stored in exception."
2544
+ );
2545
+ }
2546
+
2547
+ try {
2548
+ $sentencePhoneNumber = "1 MICROSOFT";
2549
+ $this->phoneUtil->parse($sentencePhoneNumber, RegionCode::NZ);
2550
+ $this->fail("This should not parse without throwing an exception " . $sentencePhoneNumber);
2551
+ } catch (NumberParseException $e) {
2552
+ // Expected this exception.
2553
+ $this->assertEquals(
2554
+ NumberParseException::NOT_A_NUMBER,
2555
+ $e->getErrorType(),
2556
+ "Wrong error type stored in exception."
2557
+ );
2558
+ }
2559
+
2560
+ try {
2561
+ $sentencePhoneNumber = "12 MICROSOFT";
2562
+ $this->phoneUtil->parse($sentencePhoneNumber, RegionCode::NZ);
2563
+ $this->fail("This should not parse without throwing an exception " . $sentencePhoneNumber);
2564
+ } catch (NumberParseException $e) {
2565
+ // Expected this exception.
2566
+ $this->assertEquals(
2567
+ NumberParseException::NOT_A_NUMBER,
2568
+ $e->getErrorType(),
2569
+ "Wrong error type stored in exception."
2570
+ );
2571
+ }
2572
+
2573
+ try {
2574
+ $tooLongPhoneNumber = "01495 72553301873 810104";
2575
+ $this->phoneUtil->parse($tooLongPhoneNumber, RegionCode::GB);
2576
+ $this->fail("This should not parse without throwing an exception " . $tooLongPhoneNumber);
2577
+ } catch (NumberParseException $e) {
2578
+ // Expected this exception.
2579
+ $this->assertEquals(
2580
+ NumberParseException::TOO_LONG,
2581
+ $e->getErrorType(),
2582
+ "Wrong error type stored in exception."
2583
+ );
2584
+ }
2585
+
2586
+ try {
2587
+ $plusMinusPhoneNumber = "+---";
2588
+ $this->phoneUtil->parse($plusMinusPhoneNumber, RegionCode::DE);
2589
+ $this->fail("This should not parse without throwing an exception " . $plusMinusPhoneNumber);
2590
+ } catch (NumberParseException $e) {
2591
+ // Expected this exception.
2592
+ $this->assertEquals(
2593
+ NumberParseException::NOT_A_NUMBER,
2594
+ $e->getErrorType(),
2595
+ "Wrong error type stored in exception."
2596
+ );
2597
+ }
2598
+
2599
+ try {
2600
+ $plusStar = "+***";
2601
+ $this->phoneUtil->parse($plusStar, RegionCode::DE);
2602
+ $this->fail("This should not parse without throwing an exception " . $plusStar);
2603
+ } catch (NumberParseException $e) {
2604
+ // Expected this exception.
2605
+ $this->assertEquals(
2606
+ NumberParseException::NOT_A_NUMBER,
2607
+ $e->getErrorType(),
2608
+ "Wrong error type stored in exception."
2609
+ );
2610
+ }
2611
+
2612
+ try {
2613
+ $plusStarPhoneNumber = "+*******91";
2614
+ $this->phoneUtil->parse($plusStarPhoneNumber, RegionCode::DE);
2615
+ $this->fail("This should not parse without throwing an exception " . $plusStarPhoneNumber);
2616
+ } catch (NumberParseException $e) {
2617
+ // Expected this exception.
2618
+ $this->assertEquals(
2619
+ NumberParseException::NOT_A_NUMBER,
2620
+ $e->getErrorType(),
2621
+ "Wrong error type stored in exception."
2622
+ );
2623
+ }
2624
+
2625
+ try {
2626
+ $tooShortPhoneNumber = "+49 0";
2627
+ $this->phoneUtil->parse($tooShortPhoneNumber, RegionCode::DE);
2628
+ $this->fail("This should not parse without throwing an exception " . $tooShortPhoneNumber);
2629
+ } catch (NumberParseException $e) {
2630
+ // Expected this exception.
2631
+ $this->assertEquals(
2632
+ NumberParseException::TOO_SHORT_NSN,
2633
+ $e->getErrorType(),
2634
+ "Wrong error type stored in exception."
2635
+ );
2636
+ }
2637
+
2638
+ try {
2639
+ $invalidCountryCode = "+210 3456 56789";
2640
+ $this->phoneUtil->parse($invalidCountryCode, RegionCode::NZ);
2641
+ $this->fail("This is not a recognised region code: should fail: " . $invalidCountryCode);
2642
+ } catch (NumberParseException $e) {
2643
+ // Expected this exception.
2644
+ $this->assertEquals(
2645
+ NumberParseException::INVALID_COUNTRY_CODE,
2646
+ $e->getErrorType(),
2647
+ "Wrong error type stored in exception."
2648
+ );
2649
+ }
2650
+
2651
+ try {
2652
+ $plusAndIddAndInvalidCountryCode = "+ 00 210 3 331 6005";
2653
+ $this->phoneUtil->parse($plusAndIddAndInvalidCountryCode, RegionCode::NZ);
2654
+ $this->fail("This should not parse without throwing an exception " . $plusAndIddAndInvalidCountryCode);
2655
+ } catch (NumberParseException $e) {
2656
+ // Expected this exception. 00 is a correct IDD, but 210 is not a valid country code.
2657
+ $this->assertEquals(
2658
+ NumberParseException::INVALID_COUNTRY_CODE,
2659
+ $e->getErrorType(),
2660
+ "Wrong error type stored in exception."
2661
+ );
2662
+ }
2663
+
2664
+ try {
2665
+ $someNumber = "123 456 7890";
2666
+ $this->phoneUtil->parse($someNumber, RegionCode::ZZ);
2667
+ $this->fail("'Unknown' region code not allowed: should fail.");
2668
+ } catch (NumberParseException $e) {
2669
+ // Expected this exception.
2670
+ $this->assertEquals(
2671
+ NumberParseException::INVALID_COUNTRY_CODE,
2672
+ $e->getErrorType(),
2673
+ "Wrong error type stored in exception."
2674
+ );
2675
+ }
2676
+
2677
+ try {
2678
+ $someNumber = "123 456 7890";
2679
+ $this->phoneUtil->parse($someNumber, RegionCode::CS);
2680
+ $this->fail("Deprecated region code not allowed: should fail.");
2681
+ } catch (NumberParseException $e) {
2682
+ // Expected this exception.
2683
+ $this->assertEquals(
2684
+ NumberParseException::INVALID_COUNTRY_CODE,
2685
+ $e->getErrorType(),
2686
+ "Wrong error type stored in exception."
2687
+ );
2688
+ }
2689
+
2690
+ try {
2691
+ $someNumber = "123 456 7890";
2692
+ $this->phoneUtil->parse($someNumber, null);
2693
+ $this->fail("Null region code not allowed: should fail.");
2694
+ } catch (NumberParseException $e) {
2695
+ // Expected this exception.
2696
+ $this->assertEquals(
2697
+ NumberParseException::INVALID_COUNTRY_CODE,
2698
+ $e->getErrorType(),
2699
+ "Wrong error type stored in exception."
2700
+ );
2701
+ }
2702
+
2703
+ try {
2704
+ $someNumber = "0044------";
2705
+ $this->phoneUtil->parse($someNumber, RegionCode::GB);
2706
+ $this->fail("No number provided, only region code: should fail");
2707
+ } catch (NumberParseException $e) {
2708
+ // Expected this exception.
2709
+ $this->assertEquals(
2710
+ NumberParseException::TOO_SHORT_AFTER_IDD,
2711
+ $e->getErrorType(),
2712
+ "Wrong error type stored in exception."
2713
+ );
2714
+ }
2715
+
2716
+ try {
2717
+ $someNumber = "0044";
2718
+ $this->phoneUtil->parse($someNumber, RegionCode::GB);
2719
+ $this->fail("No number provided, only region code: should fail");
2720
+ } catch (NumberParseException $e) {
2721
+ // Expected this exception.
2722
+ $this->assertEquals(
2723
+ NumberParseException::TOO_SHORT_AFTER_IDD,
2724
+ $e->getErrorType(),
2725
+ "Wrong error type stored in exception."
2726
+ );
2727
+ }
2728
+
2729
+ try {
2730
+ $someNumber = "011";
2731
+ $this->phoneUtil->parse($someNumber, RegionCode::US);
2732
+ $this->fail("Only IDD provided - should fail.");
2733
+ } catch (NumberParseException $e) {
2734
+ // Expected this exception.
2735
+ $this->assertEquals(
2736
+ NumberParseException::TOO_SHORT_AFTER_IDD,
2737
+ $e->getErrorType(),
2738
+ "Wrong error type stored in exception."
2739
+ );
2740
+ }
2741
+
2742
+ try {
2743
+ $someNumber = "0119";
2744
+ $this->phoneUtil->parse($someNumber, RegionCode::US);
2745
+ $this->fail("Only IDD provided and then 9 - should fail.");
2746
+ } catch (NumberParseException $e) {
2747
+ // Expected this exception.
2748
+ $this->assertEquals(
2749
+ NumberParseException::TOO_SHORT_AFTER_IDD,
2750
+ $e->getErrorType(),
2751
+ "Wrong error type stored in exception."
2752
+ );
2753
+ }
2754
+
2755
+ try {
2756
+ $emptyNumber = "";
2757
+ // Invalid region.
2758
+ $this->phoneUtil->parse($emptyNumber, RegionCode::ZZ);
2759
+ $this->fail("Empty string - should fail.");
2760
+ } catch (NumberParseException $e) {
2761
+ // Expected this exception.
2762
+ $this->assertEquals(
2763
+ NumberParseException::NOT_A_NUMBER,
2764
+ $e->getErrorType(),
2765
+ "Wrong error type stored in exception."
2766
+ );
2767
+ }
2768
+
2769
+ try {
2770
+ $nullNumber = null;
2771
+ // Invalid region.
2772
+ $this->phoneUtil->parse($nullNumber, RegionCode::ZZ);
2773
+ $this->fail("Null string - should fail.");
2774
+ } catch (NumberParseException $e) {
2775
+ // Expected this exception.
2776
+ $this->assertEquals(
2777
+ NumberParseException::NOT_A_NUMBER,
2778
+ $e->getErrorType(),
2779
+ "Wrong error type stored in exception."
2780
+ );
2781
+ }
2782
+
2783
+ try {
2784
+ $nullNumber = null;
2785
+ $this->phoneUtil->parse($nullNumber, RegionCode::US);
2786
+ $this->fail("Null string - should fail.");
2787
+ } catch (NumberParseException $e) {
2788
+ // Expected this exception.
2789
+ $this->assertEquals(
2790
+ NumberParseException::NOT_A_NUMBER,
2791
+ $e->getErrorType(),
2792
+ "Wrong error type stored in exception."
2793
+ );
2794
+ }
2795
+
2796
+ try {
2797
+ $domainRfcPhoneContext = "tel:555-1234;phone-context=www.google.com";
2798
+ $this->phoneUtil->parse($domainRfcPhoneContext, RegionCode::ZZ);
2799
+ $this->fail("'Unknown' region code not allowed: should fail.");
2800
+ } catch (NumberParseException $e) {
2801
+ // Expected this exception.
2802
+ $this->assertEquals(
2803
+ NumberParseException::INVALID_COUNTRY_CODE,
2804
+ $e->getErrorType(),
2805
+ "Wrong error type stored in exception."
2806
+ );
2807
+ }
2808
+
2809
+ try {
2810
+ // This is invalid because no "+" sign is present as part of phone-context. This should not
2811
+ // succeed in being parsed.
2812
+ $invalidRfcPhoneContext = "tel:555-1234;phone-context=1-331";
2813
+ $this->phoneUtil->parse($invalidRfcPhoneContext, RegionCode::ZZ);
2814
+ $this->fail("'Unknown' region code not allowed: should fail.");
2815
+ } catch (NumberParseException $e) {
2816
+ // Expected this exception.
2817
+ $this->assertEquals(
2818
+ NumberParseException::INVALID_COUNTRY_CODE,
2819
+ $e->getErrorType(),
2820
+ "Wrong error type stored in exception."
2821
+ );
2822
+ }
2823
+ }
2824
+
2825
+ public function testParseNumbersWithPlusWithNoRegion()
2826
+ {
2827
+ // RegionCode.ZZ is allowed only if the number starts with a '+' - then the country calling code
2828
+ // can be calculated.
2829
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("+64 3 331 6005", RegionCode::ZZ));
2830
+ // Test with full-width plus.
2831
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("+64 3 331 6005", RegionCode::ZZ));
2832
+ // Test with normal plus but leading characters that need to be stripped.
2833
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("Tel: +64 3 331 6005", RegionCode::ZZ));
2834
+ $this->assertEquals(self::$nzNumber, $this->phoneUtil->parse("+64 3 331 6005", null));
2835
+ $this->assertEquals(self::$internationalTollFree, $this->phoneUtil->parse("+800 1234 5678", null));
2836
+ $this->assertEquals(self::$universalPremiumRate, $this->phoneUtil->parse("+979 123 456 789", null));
2837
+
2838
+ // Test parsing RFC3966 format with a phone context.
2839
+ $this->assertEquals(
2840
+ self::$nzNumber,
2841
+ $this->phoneUtil->parse("tel:03-331-6005;phone-context=+64", RegionCode::ZZ)
2842
+ );
2843
+ $this->assertEquals(
2844
+ self::$nzNumber,
2845
+ $this->phoneUtil->parse(" tel:03-331-6005;phone-context=+64", RegionCode::ZZ)
2846
+ );
2847
+ $this->assertEquals(
2848
+ self::$nzNumber,
2849
+ $this->phoneUtil->parse("tel:03-331-6005;isub=12345;phone-context=+64", RegionCode::ZZ)
2850
+ );
2851
+
2852
+ // It is important that we set the carrier code to an empty string, since we used
2853
+ // ParseAndKeepRawInput and no carrier code was found.
2854
+ $nzNumberWithRawInput = new PhoneNumber();
2855
+ $nzNumberWithRawInput->mergeFrom(self::$nzNumber);
2856
+ $nzNumberWithRawInput->setRawInput("+64 3 331 6005");
2857
+ $nzNumberWithRawInput->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN);
2858
+ $nzNumberWithRawInput->setPreferredDomesticCarrierCode("");
2859
+ $this->assertEquals(
2860
+ $nzNumberWithRawInput,
2861
+ $this->phoneUtil->parseAndKeepRawInput("+64 3 331 6005", RegionCode::ZZ)
2862
+ );
2863
+
2864
+ // Null is also allowed for the region code in these cases.
2865
+ $this->assertEquals($nzNumberWithRawInput, $this->phoneUtil->parseAndKeepRawInput("+64 3 331 6005", null));
2866
+ }
2867
+
2868
+ public function testParseNumberTooShortIfNationalPrefixStripped()
2869
+ {
2870
+ // Test that a number whose first digits happen to coincide with the national prefix does not
2871
+ // get them stripped if doing so would result in a number too short to be a possible (regular
2872
+ // length) phone number for that region.
2873
+ $byNumber = new PhoneNumber();
2874
+ $byNumber->setCountryCode(375)->setNationalNumber(8123);
2875
+ $this->assertEquals($byNumber, $this->phoneUtil->parse("8123", RegionCode::BY));
2876
+ $byNumber->setNationalNumber(81234);
2877
+ $this->assertEquals($byNumber, $this->phoneUtil->parse("81234", RegionCode::BY));
2878
+
2879
+ // The prefix doesn't get stripped, since the input is a viable 6-digit number, whereas the
2880
+ // result of stripping is only 5 digits.
2881
+ $byNumber->setNationalNumber(812345);
2882
+ $this->assertEquals($byNumber, $this->phoneUtil->parse("812345", RegionCode::BY));
2883
+
2884
+ // The prefix gets stripped, since only 6-digit numbers are possible.
2885
+ $byNumber->setNationalNumber(123456);
2886
+ $this->assertEquals($byNumber, $this->phoneUtil->parse("8123456", RegionCode::BY));
2887
+ }
2888
+
2889
+ public function testParseExtensions()
2890
+ {
2891
+ $nzNumber = new PhoneNumber();
2892
+ $nzNumber->setCountryCode(64)->setNationalNumber(33316005)->setExtension("3456");
2893
+ $this->assertEquals($nzNumber, $this->phoneUtil->parse("03 331 6005 ext 3456", RegionCode::NZ));
2894
+ $this->assertEquals($nzNumber, $this->phoneUtil->parse("03-3316005x3456", RegionCode::NZ));
2895
+ $this->assertEquals($nzNumber, $this->phoneUtil->parse("03-3316005 int.3456", RegionCode::NZ));
2896
+ $this->assertEquals($nzNumber, $this->phoneUtil->parse("03 3316005 #3456", RegionCode::NZ));
2897
+ // Test the following do not extract extensions:
2898
+ $this->assertEquals(self::$alphaNumericNumber, $this->phoneUtil->parse("1800 six-flags", RegionCode::US));
2899
+ $this->assertEquals(self::$alphaNumericNumber, $this->phoneUtil->parse("1800 SIX FLAGS", RegionCode::US));
2900
+ $this->assertEquals(self::$alphaNumericNumber, $this->phoneUtil->parse("0~0 1800 7493 5247", RegionCode::PL));
2901
+ $this->assertEquals(self::$alphaNumericNumber, $this->phoneUtil->parse("(1800) 7493.5247", RegionCode::US));
2902
+ // Check that the last instance of an extension token is matched.
2903
+ $extnNumber = new PhoneNumber();
2904
+ $extnNumber->mergeFrom(self::$alphaNumericNumber)->setExtension("1234");
2905
+ $this->assertEquals($extnNumber, $this->phoneUtil->parse("0~0 1800 7493 5247 ~1234", RegionCode::PL));
2906
+ // Verifying bug-fix where the last digit of a number was previously omitted if it was a 0 when
2907
+ // extracting the extension. Also verifying a few different cases of extensions.
2908
+ $ukNumber = new PhoneNumber();
2909
+ $ukNumber->setCountryCode(44)->setNationalNumber(2034567890)->setExtension("456");
2910
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+44 2034567890x456", RegionCode::NZ));
2911
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+44 2034567890x456", RegionCode::GB));
2912
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+44 2034567890 x456", RegionCode::GB));
2913
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+44 2034567890 X456", RegionCode::GB));
2914
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+44 2034567890 X 456", RegionCode::GB));
2915
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+44 2034567890 X 456", RegionCode::GB));
2916
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+44 2034567890 x 456 ", RegionCode::GB));
2917
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+44 2034567890 X 456", RegionCode::GB));
2918
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+44-2034567890;ext=456", RegionCode::GB));
2919
+ $this->assertEquals(
2920
+ $ukNumber,
2921
+ $this->phoneUtil->parse("tel:2034567890;ext=456;phone-context=+44", RegionCode::ZZ)
2922
+ );
2923
+
2924
+ // Full-width extension, "extn" only.
2925
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+442034567890extn456", RegionCode::GB));
2926
+ // "xtn" only.
2927
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+442034567890xtn456", RegionCode::GB));
2928
+ // "xt" only.
2929
+ $this->assertEquals($ukNumber, $this->phoneUtil->parse("+442034567890xt456", RegionCode::GB));
2930
+
2931
+ $usWithExtension = new PhoneNumber();
2932
+ $usWithExtension->setCountryCode(1)->setNationalNumber(8009013355)->setExtension("7246433");
2933
+ $this->assertEquals($usWithExtension, $this->phoneUtil->parse("(800) 901-3355 x 7246433", RegionCode::US));
2934
+ $this->assertEquals($usWithExtension, $this->phoneUtil->parse("(800) 901-3355 , ext 7246433", RegionCode::US));
2935
+ $this->assertEquals(
2936
+ $usWithExtension,
2937
+ $this->phoneUtil->parse("(800) 901-3355 ,extension 7246433", RegionCode::US)
2938
+ );
2939
+ $this->assertEquals(
2940
+ $usWithExtension,
2941
+ $this->phoneUtil->parse("(800) 901-3355 ,extensi" . pack("H*", 'c3b3') . "n 7246433", RegionCode::US)
2942
+ );
2943
+ // Repeat with the small letter o with acute accent created by combining characters.
2944
+ $this->assertEquals(
2945
+ $usWithExtension,
2946
+ $this->phoneUtil->parse("(800) 901-3355 ,extensio" . pack('H*', 'cc81') . "n 7246433", RegionCode::US)
2947
+ );
2948
+ $this->assertEquals($usWithExtension, $this->phoneUtil->parse("(800) 901-3355 , 7246433", RegionCode::US));
2949
+ $this->assertEquals($usWithExtension, $this->phoneUtil->parse("(800) 901-3355 ext: 7246433", RegionCode::US));
2950
+
2951
+ // Test that if a number has two extensions specified, we ignore the second.
2952
+ $usWithTwoExtensionsNumber = new PhoneNumber();
2953
+ $usWithTwoExtensionsNumber->setCountryCode(1)->setNationalNumber(2121231234)->setExtension("508");
2954
+ $this->assertEquals(
2955
+ $usWithTwoExtensionsNumber,
2956
+ $this->phoneUtil->parse("(212)123-1234 x508/x1234", RegionCode::US)
2957
+ );
2958
+ $this->assertEquals(
2959
+ $usWithTwoExtensionsNumber,
2960
+ $this->phoneUtil->parse("(212)123-1234 x508/ x1234", RegionCode::US)
2961
+ );
2962
+ $this->assertEquals(
2963
+ $usWithTwoExtensionsNumber,
2964
+ $this->phoneUtil->parse("(212)123-1234 x508\\x1234", RegionCode::US)
2965
+ );
2966
+
2967
+ // Test parsing numbers in the form (645) 123-1234-910# works, where the last 3 digits before
2968
+ // the # are an extension.
2969
+ $usWithExtension->clear();
2970
+ $usWithExtension->setCountryCode(1)->setNationalNumber(6451231234)->setExtension("910");
2971
+ $this->assertEquals($usWithExtension, $this->phoneUtil->parse("+1 (645) 123 1234-910#", RegionCode::US));
2972
+ // Retry with the same number in a slightly different format.
2973
+ $this->assertEquals($usWithExtension, $this->phoneUtil->parse("+1 (645) 123 1234 ext. 910#", RegionCode::US));
2974
+ }
2975
+
2976
+ public function testParseAndKeepRaw()
2977
+ {
2978
+ $alphaNumericNumber = new PhoneNumber();
2979
+ $alphaNumericNumber->mergeFrom(self::$alphaNumericNumber);
2980
+ $alphaNumericNumber->setRawInput("800 six-flags");
2981
+ $alphaNumericNumber->setCountryCodeSource(CountryCodeSource::FROM_DEFAULT_COUNTRY);
2982
+ $alphaNumericNumber->setPreferredDomesticCarrierCode("");
2983
+ $this->assertEquals(
2984
+ $alphaNumericNumber,
2985
+ $this->phoneUtil->parseAndKeepRawInput("800 six-flags", RegionCode::US)
2986
+ );
2987
+
2988
+ $shorterAlphaNumber = new PhoneNumber();
2989
+ $shorterAlphaNumber->setCountryCode(1)->setNationalNumber(8007493524);
2990
+ $shorterAlphaNumber->setRawInput("1800 six-flag")->setCountryCodeSource(
2991
+ CountryCodeSource::FROM_NUMBER_WITHOUT_PLUS_SIGN
2992
+ )->setPreferredDomesticCarrierCode("");
2993
+ $this->assertEquals(
2994
+ $shorterAlphaNumber,
2995
+ $this->phoneUtil->parseAndKeepRawInput("1800 six-flag", RegionCode::US)
2996
+ );
2997
+
2998
+ $shorterAlphaNumber->setRawInput("+1800 six-flag")->setCountryCodeSource(
2999
+ CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN
3000
+ );
3001
+ $this->assertEquals(
3002
+ $shorterAlphaNumber,
3003
+ $this->phoneUtil->parseAndKeepRawInput("+1800 six-flag", RegionCode::NZ)
3004
+ );
3005
+
3006
+ $shorterAlphaNumber->setRawInput("001800 six-flag")->setCountryCodeSource(
3007
+ CountryCodeSource::FROM_NUMBER_WITH_IDD
3008
+ );
3009
+ $this->assertEquals(
3010
+ $shorterAlphaNumber,
3011
+ $this->phoneUtil->parseAndKeepRawInput("001800 six-flag", RegionCode::NZ)
3012
+ );
3013
+
3014
+ // Invalid region code supplied.
3015
+ try {
3016
+ $this->phoneUtil->parseAndKeepRawInput("123 456 7890", RegionCode::CS);
3017
+ $this->fail("Deprecated region code not allowed: should fail.");
3018
+ } catch (NumberParseException $e) {
3019
+ // Expected this exception.
3020
+ $this->assertEquals(
3021
+ NumberParseException::INVALID_COUNTRY_CODE,
3022
+ $e->getErrorType(),
3023
+ "Wrong error type stored in exception."
3024
+ );
3025
+ }
3026
+
3027
+ $koreanNumber = new PhoneNumber();
3028
+ $koreanNumber->setCountryCode(82)->setNationalNumber(22123456)->setRawInput(
3029
+ "08122123456"
3030
+ )->setCountryCodeSource(CountryCodeSource::FROM_DEFAULT_COUNTRY)->setPreferredDomesticCarrierCode("81");
3031
+ $this->assertEquals($koreanNumber, $this->phoneUtil->parseAndKeepRawInput("08122123456", RegionCode::KR));
3032
+ }
3033
+
3034
+ public function testParseItalianLeadingZeros()
3035
+ {
3036
+ // Test the number "011".
3037
+ $oneZero = new PhoneNumber();
3038
+ $oneZero->setCountryCode(61)->setNationalNumber(11)->setItalianLeadingZero(true);
3039
+ $this->assertEquals($oneZero, $this->phoneUtil->parse("011", RegionCode::AU));
3040
+
3041
+ // Test the number "001".
3042
+ $twoZeros = new PhoneNumber();
3043
+ $twoZeros->setCountryCode(61)->setNationalNumber(1)->setItalianLeadingZero(true)->setNumberOfLeadingZeros(2);
3044
+ $this->assertEquals($twoZeros, $this->phoneUtil->parse("001", RegionCode::AU));
3045
+
3046
+ // Test the number "000". This number has 2 leading zeros.
3047
+ $stillTwoZeros = new PhoneNumber();
3048
+ $stillTwoZeros->setCountryCode(61)->setNationalNumber(0)->setItalianLeadingZero(true)->setNumberOfLeadingZeros(
3049
+ 2
3050
+ );
3051
+ $this->assertEquals($stillTwoZeros, $this->phoneUtil->parse("000", RegionCode::AU));
3052
+
3053
+ // Test the number "0000". This number has 3 leading zeros.
3054
+ $threeZeros = new PhoneNumber();
3055
+ $threeZeros->setCountryCode(61)->setNationalNumber(0)->setItalianLeadingZero(true)->setNumberOfLeadingZeros(3);
3056
+ $this->assertEquals($threeZeros, $this->phoneUtil->parse("0000", RegionCode::AU));
3057
+ }
3058
+
3059
+ public function testCountryWithNoNumberDesc()
3060
+ {
3061
+ // Andorra is a country where we don't have PhoneNumberDesc info in the metadata.
3062
+ $adNumber = new PhoneNumber();
3063
+ $adNumber->setCountryCode(376)->setNationalNumber(12345);
3064
+
3065
+ $this->assertEquals("+376 12345", $this->phoneUtil->format($adNumber, PhoneNumberFormat::INTERNATIONAL));
3066
+ $this->assertEquals("+37612345", $this->phoneUtil->format($adNumber, PhoneNumberFormat::E164));
3067
+ $this->assertEquals("12345", $this->phoneUtil->format($adNumber, PhoneNumberFormat::NATIONAL));
3068
+ $this->assertEquals(PhoneNumberType::UNKNOWN, $this->phoneUtil->getNumberType($adNumber));
3069
+ $this->assertFalse($this->phoneUtil->isValidNumber($adNumber));
3070
+
3071
+ // Test dialing a US number from within Andorra.
3072
+ $this->assertEquals(
3073
+ "00 1 650 253 0000",
3074
+ $this->phoneUtil->formatOutOfCountryCallingNumber(self::$usNumber, RegionCode::AD)
3075
+ );
3076
+ }
3077
+
3078
+ public function testUnknownCountryCallingCode()
3079
+ {
3080
+ $this->assertFalse($this->phoneUtil->isValidNumber(self::$unknownCountryCodeNoRawInput));
3081
+ // It's not very well defined as to what the E164 representation for a number with an invalid
3082
+ // country calling code is, but just prefixing the country code and national number is about
3083
+ // the best we can do.
3084
+ $this->assertEquals(
3085
+ "+212345",
3086
+ $this->phoneUtil->format(self::$unknownCountryCodeNoRawInput, PhoneNumberFormat::E164)
3087
+ );
3088
+ }
3089
+
3090
+ public function testIsNumberMatchMatches()
3091
+ {
3092
+ // Test simple matches where formatting is different, or leading zeros, or country calling code
3093
+ // has been specified.
3094
+ $this->assertEquals(
3095
+ MatchType::EXACT_MATCH,
3096
+ $this->phoneUtil->isNumberMatch("+64 3 331 6005", "+64 03 331 6005")
3097
+ );
3098
+ $this->assertEquals(MatchType::EXACT_MATCH, $this->phoneUtil->isNumberMatch("+800 1234 5678", "+80012345678"));
3099
+ $this->assertEquals(
3100
+ MatchType::EXACT_MATCH,
3101
+ $this->phoneUtil->isNumberMatch("+64 03 331-6005", "+64 03331 6005")
3102
+ );
3103
+ $this->assertEquals(MatchType::EXACT_MATCH, $this->phoneUtil->isNumberMatch("+643 331-6005", "+64033316005"));
3104
+ $this->assertEquals(MatchType::EXACT_MATCH, $this->phoneUtil->isNumberMatch("+643 331-6005", "+6433316005"));
3105
+ $this->assertEquals(MatchType::EXACT_MATCH, $this->phoneUtil->isNumberMatch("+64 3 331-6005", "+6433316005"));
3106
+ $this->assertEquals(
3107
+ MatchType::EXACT_MATCH,
3108
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005", "tel:+64-3-331-6005;isub=123")
3109
+ );
3110
+ // Test alpha numbers.
3111
+ $this->assertEquals(
3112
+ MatchType::EXACT_MATCH,
3113
+ $this->phoneUtil->isNumberMatch("+1800 siX-Flags", "+1 800 7493 5247")
3114
+ );
3115
+ // Test numbers with extensions.
3116
+ $this->assertEquals(
3117
+ MatchType::EXACT_MATCH,
3118
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005 extn 1234", "+6433316005#1234")
3119
+ );
3120
+ // Test proto buffers.
3121
+ $this->assertEquals(MatchType::EXACT_MATCH, $this->phoneUtil->isNumberMatch(self::$nzNumber, "+6403 331 6005"));
3122
+
3123
+ $nzNumber = new PhoneNumber();
3124
+ $nzNumber->mergeFrom(self::$nzNumber)->setExtension("3456");
3125
+ $this->assertEquals(
3126
+ MatchType::EXACT_MATCH,
3127
+ $this->phoneUtil->isNumberMatch($nzNumber, "+643 331 6005 ext 3456")
3128
+ );
3129
+
3130
+ // Check empty extensions are ignored.
3131
+ $nzNumber->setExtension("");
3132
+ $this->assertEquals(MatchType::EXACT_MATCH, $this->phoneUtil->isNumberMatch($nzNumber, "+6403 331 6005"));
3133
+ // Check variant with two proto buffers.
3134
+ $this->assertEquals(
3135
+ MatchType::EXACT_MATCH,
3136
+ $this->phoneUtil->isNumberMatch($nzNumber, self::$nzNumber),
3137
+ "Number " . (string)$nzNumber . " did not match " . (string)self::$nzNumber
3138
+ );
3139
+
3140
+ // Check raw_input, country_code_source and preferred_domestic_carrier_code are ignored.
3141
+ $brNumberOne = new PhoneNumber();
3142
+ $brNumberTwo = new PhoneNumber();
3143
+ $brNumberOne->setCountryCode(55)->setNationalNumber(3121286979)
3144
+ ->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN)
3145
+ ->setPreferredDomesticCarrierCode("12")->setRawInput("012 3121286979");
3146
+ $brNumberTwo->setCountryCode(55)->setNationalNumber(3121286979)
3147
+ ->setCountryCodeSource(CountryCodeSource::FROM_DEFAULT_COUNTRY)
3148
+ ->setPreferredDomesticCarrierCode("14")->setRawInput("143121286979");
3149
+
3150
+ $this->assertEquals(MatchType::EXACT_MATCH, $this->phoneUtil->isNumberMatch($brNumberOne, $brNumberTwo));
3151
+ }
3152
+
3153
+ public function testIsNumberMatchNonMatches()
3154
+ {
3155
+ // Non-matches.
3156
+ $this->assertEquals(MatchType::NO_MATCH, $this->phoneUtil->isNumberMatch("03 331 6005", "03 331 6006"));
3157
+ $this->assertEquals(MatchType::NO_MATCH, $this->phoneUtil->isNumberMatch("+800 1234 5678", "+1 800 1234 5678"));
3158
+ // Different country calling code, partial number match.
3159
+ $this->assertEquals(MatchType::NO_MATCH, $this->phoneUtil->isNumberMatch("+64 3 331-6005", "+16433316005"));
3160
+ // Different country calling code, same number.
3161
+ $this->assertEquals(MatchType::NO_MATCH, $this->phoneUtil->isNumberMatch("+64 3 331-6005", "+6133316005"));
3162
+ // Extension different, all else the same.
3163
+ $this->assertEquals(
3164
+ MatchType::NO_MATCH,
3165
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005 extn 1234", "0116433316005#1235")
3166
+ );
3167
+ $this->assertEquals(
3168
+ MatchType::NO_MATCH,
3169
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005 extn 1234", "tel:+64-3-331-6005;ext=1235")
3170
+ );
3171
+ // NSN matches, but extension is different - not the same number.
3172
+ $this->assertEquals(
3173
+ MatchType::NO_MATCH,
3174
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005 ext.1235", "3 331 6005#1234")
3175
+ );
3176
+
3177
+ // Invalid numbers that can't be parsed.
3178
+ $this->assertEquals(MatchType::NOT_A_NUMBER, $this->phoneUtil->isNumberMatch("4", "3 331 6043"));
3179
+ $this->assertEquals(MatchType::NOT_A_NUMBER, $this->phoneUtil->isNumberMatch("+43", "+64 3 331 6005"));
3180
+ $this->assertEquals(MatchType::NOT_A_NUMBER, $this->phoneUtil->isNumberMatch("+43", "64 3 331 6005"));
3181
+ $this->assertEquals(MatchType::NOT_A_NUMBER, $this->phoneUtil->isNumberMatch("Dog", "64 3 331 6005"));
3182
+ }
3183
+
3184
+ public function testIsNumberMatchNsnMatches()
3185
+ {
3186
+ // NSN matches.
3187
+ $this->assertEquals(MatchType::NSN_MATCH, $this->phoneUtil->isNumberMatch("+64 3 331-6005", "03 331 6005"));
3188
+ $this->assertEquals(
3189
+ MatchType::NSN_MATCH,
3190
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005", "tel:03-331-6005;isub=1234;phone-context=abc.nz")
3191
+ );
3192
+ $this->assertEquals(MatchType::NSN_MATCH, $this->phoneUtil->isNumberMatch(self::$nzNumber, "03 331 6005"));
3193
+ // Here the second number possibly starts with the country calling code for New Zealand,
3194
+ // although we are unsure.
3195
+ $unchangedNzNumber = new PhoneNumber();
3196
+ $unchangedNzNumber->mergeFrom(self::$nzNumber);
3197
+ $this->assertEquals(
3198
+ MatchType::NSN_MATCH,
3199
+ $this->phoneUtil->isNumberMatch($unchangedNzNumber, "(64-3) 331 6005")
3200
+ );
3201
+ // Check the phone number proto was not edited during the method call.
3202
+ $this->assertEquals(self::$nzNumber, $unchangedNzNumber);
3203
+
3204
+ // Here, the 1 might be a national prefix, if we compare it to the US number, so the resultant
3205
+ // match is an NSN match.
3206
+ $this->assertEquals(MatchType::NSN_MATCH, $this->phoneUtil->isNumberMatch(self::$usNumber, "1-650-253-0000"));
3207
+ $this->assertEquals(MatchType::NSN_MATCH, $this->phoneUtil->isNumberMatch(self::$usNumber, "6502530000"));
3208
+ $this->assertEquals(MatchType::NSN_MATCH, $this->phoneUtil->isNumberMatch("+1 650-253 0000", "1 650 253 0000"));
3209
+ $this->assertEquals(MatchType::NSN_MATCH, $this->phoneUtil->isNumberMatch("1 650-253 0000", "1 650 253 0000"));
3210
+ $this->assertEquals(MatchType::NSN_MATCH, $this->phoneUtil->isNumberMatch("1 650-253 0000", "+1 650 253 0000"));
3211
+ // For this case, the match will be a short NSN match, because we cannot assume that the 1 might
3212
+ // be a national prefix, so don't remove it when parsing.
3213
+ $randomNumber = new PhoneNumber();
3214
+ $randomNumber->setCountryCode(41)->setNationalNumber(6502530000);
3215
+ $this->assertEquals(
3216
+ MatchType::SHORT_NSN_MATCH,
3217
+ $this->phoneUtil->isNumberMatch($randomNumber, "1-650-253-0000")
3218
+ );
3219
+ }
3220
+
3221
+ public function testIsNumberMatchShortNsnMatches()
3222
+ {
3223
+ // Short NSN matches with the country not specified for either one or both numbers.
3224
+ $this->assertEquals(MatchType::SHORT_NSN_MATCH, $this->phoneUtil->isNumberMatch("+64 3 331-6005", "331 6005"));
3225
+ $this->assertEquals(
3226
+ MatchType::SHORT_NSN_MATCH,
3227
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005", "tel:331-6005;phone-context=abc.nz")
3228
+ );
3229
+ $this->assertEquals(
3230
+ MatchType::SHORT_NSN_MATCH,
3231
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005", "tel:331-6005;isub=1234;phone-context=abc.nz")
3232
+ );
3233
+ $this->assertEquals(
3234
+ MatchType::SHORT_NSN_MATCH,
3235
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005", "tel:331-6005;isub=1234;phone-context=abc.nz;a=%A1")
3236
+ );
3237
+
3238
+ // We did not know that the "0" was a national prefix since neither number has a country code,
3239
+ // so this is considered a SHORT_NSN_MATCH.
3240
+ $this->assertEquals(MatchType::SHORT_NSN_MATCH, $this->phoneUtil->isNumberMatch("3 331-6005", "03 331 6005"));
3241
+ $this->assertEquals(MatchType::SHORT_NSN_MATCH, $this->phoneUtil->isNumberMatch("3 331-6005", "331 6005"));
3242
+ $this->assertEquals(
3243
+ MatchType::SHORT_NSN_MATCH,
3244
+ $this->phoneUtil->isNumberMatch("3 331-6005", "tel:331-6005;phone-context=abc.nz")
3245
+ );
3246
+ $this->assertEquals(MatchType::SHORT_NSN_MATCH, $this->phoneUtil->isNumberMatch("3 331-6005", "+64 331 6005"));
3247
+
3248
+ // Short NSN match with the country specified.
3249
+ $this->assertEquals(MatchType::SHORT_NSN_MATCH, $this->phoneUtil->isNumberMatch("03 331-6005", "331 6005"));
3250
+ $this->assertEquals(MatchType::SHORT_NSN_MATCH, $this->phoneUtil->isNumberMatch("1 234 345 6789", "345 6789"));
3251
+ $this->assertEquals(
3252
+ MatchType::SHORT_NSN_MATCH,
3253
+ $this->phoneUtil->isNumberMatch("+1 (234) 345 6789", "345 6789")
3254
+ );
3255
+ // NSN matches, country calling code omitted for one number, extension missing for one.
3256
+ $this->assertEquals(
3257
+ MatchType::SHORT_NSN_MATCH,
3258
+ $this->phoneUtil->isNumberMatch("+64 3 331-6005", "3 331 6005#1234")
3259
+ );
3260
+ // One has Italian leading zero, one does not.
3261
+ $italianNumberOne = new PhoneNumber();
3262
+ $italianNumberOne->setCountryCode(39)->setNationalNumber(1234)->setItalianLeadingZero(true);
3263
+ $italianNumberTwo = new PhoneNumber();
3264
+ $italianNumberTwo->setCountryCode(39)->setNationalNumber(1234);
3265
+ $this->assertEquals(
3266
+ MatchType::SHORT_NSN_MATCH,
3267
+ $this->phoneUtil->isNumberMatch($italianNumberOne, $italianNumberTwo)
3268
+ );
3269
+ // One has an extension, the other has an extension of "".
3270
+ $italianNumberOne->setExtension("1234")->clearItalianLeadingZero();
3271
+ $italianNumberTwo->setExtension("");
3272
+ $this->assertEquals(
3273
+ MatchType::SHORT_NSN_MATCH,
3274
+ $this->phoneUtil->isNumberMatch($italianNumberOne, $italianNumberTwo)
3275
+ );
3276
+ }
3277
+
3278
+ public function testCanBeInternationallyDialled()
3279
+ {
3280
+ // We have no-international-dialling rules for the US in our test metadata that say that
3281
+ // toll-free numbers cannot be dialled internationally.
3282
+ $this->assertFalse($this->phoneUtil->canBeInternationallyDialled(self::$usTollFree));
3283
+ // Normal US numbers can be internationally dialled.
3284
+ $this->assertTrue($this->phoneUtil->canBeInternationallyDialled(self::$usNumber));
3285
+
3286
+ // Invalid number.
3287
+ $this->assertTrue($this->phoneUtil->canBeInternationallyDialled(self::$usLocalNumber));
3288
+
3289
+ // We have no data for NZ - should return true.
3290
+ $this->assertTrue($this->phoneUtil->canBeInternationallyDialled(self::$nzNumber));
3291
+ $this->assertTrue($this->phoneUtil->canBeInternationallyDialled(self::$internationalTollFree));
3292
+ }
3293
+
3294
+ public function testIsAlphaNumber()
3295
+ {
3296
+ $this->assertTrue($this->phoneUtil->isAlphaNumber("1800 six-flags"));
3297
+ $this->assertTrue($this->phoneUtil->isAlphaNumber("1800 six-flags ext. 1234"));
3298
+ $this->assertTrue($this->phoneUtil->isAlphaNumber("+800 six-flags"));
3299
+ $this->assertTrue($this->phoneUtil->isAlphaNumber("180 six-flags"));
3300
+ $this->assertFalse($this->phoneUtil->isAlphaNumber("1800 123-1234"));
3301
+ $this->assertFalse($this->phoneUtil->isAlphaNumber("1 six-flags"));
3302
+ $this->assertFalse($this->phoneUtil->isAlphaNumber("18 six-flags"));
3303
+ $this->assertFalse($this->phoneUtil->isAlphaNumber("1800 123-1234 extension: 1234"));
3304
+ $this->assertFalse($this->phoneUtil->isAlphaNumber("+800 1234-1234"));
3305
+ }
3306
+
3307
+ public function testIsMobileNumberPortableRegion()
3308
+ {
3309
+ $this->assertTrue($this->phoneUtil->isMobileNumberPortableRegion(RegionCode::US));
3310
+ $this->assertTrue($this->phoneUtil->isMobileNumberPortableRegion(RegionCode::GB));
3311
+ $this->assertFalse($this->phoneUtil->isMobileNumberPortableRegion(RegionCode::AE));
3312
+ $this->assertFalse($this->phoneUtil->isMobileNumberPortableRegion(RegionCode::BS));
3313
+ }
3314
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/ShortNumberInfoTest.php ADDED
@@ -0,0 +1,435 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\core;
4
+
5
+ use libphonenumber\CountryCodeToRegionCodeMapForTesting;
6
+ use libphonenumber\NumberParseException;
7
+ use libphonenumber\PhoneNumber;
8
+ use libphonenumber\PhoneNumberUtil;
9
+ use libphonenumber\RegionCode;
10
+ use libphonenumber\ShortNumberCost;
11
+ use libphonenumber\ShortNumberInfo;
12
+
13
+ class ShortNumberInfoTest extends \PHPUnit_Framework_TestCase
14
+ {
15
+ private static $plusSymbol;
16
+ /**
17
+ * @var PhoneNumberUtil
18
+ */
19
+ protected $phoneUtil;
20
+ /**
21
+ * @var ShortNumberInfo
22
+ */
23
+ private $shortInfo;
24
+
25
+ public function setUp()
26
+ {
27
+ self::$plusSymbol = pack('H*', 'efbc8b');
28
+
29
+ PhoneNumberUtil::resetInstance();
30
+ ShortNumberInfo::resetInstance();
31
+ $this->phoneUtil = PhoneNumberUtil::getInstance(
32
+ PhoneNumberUtilTest::TEST_META_DATA_FILE_PREFIX,
33
+ CountryCodeToRegionCodeMapForTesting::$countryCodeToRegionCodeMapForTesting
34
+ );
35
+ $this->shortInfo = ShortNumberInfo::getInstance();
36
+ }
37
+
38
+ public function testIsPossibleShortNumber()
39
+ {
40
+ $possibleNumber = new PhoneNumber();
41
+ $possibleNumber->setCountryCode(33)->setNationalNumber(123456);
42
+
43
+ $this->assertTrue($this->shortInfo->isPossibleShortNumber($possibleNumber));
44
+ $this->assertTrue($this->shortInfo->isPossibleShortNumberForRegion($this->parse(123456, RegionCode::FR), RegionCode::FR));
45
+
46
+ $impossibleNumber = new PhoneNumber();
47
+ $impossibleNumber->setCountryCode(33)->setNationalNumber(9);
48
+ $this->assertFalse($this->shortInfo->isPossibleShortNumber($impossibleNumber));
49
+
50
+ // Note that GB and GG share the country calling code 44, and that this number is possible but
51
+ // not valid.
52
+ $gbNumber = new PhoneNumber();
53
+ $gbNumber->setCountryCode(44)->setNationalNumber(11001);
54
+ $this->assertTrue($this->shortInfo->isPossibleShortNumber($gbNumber));
55
+ }
56
+
57
+ public function testIsValidShortNumber()
58
+ {
59
+ $phoneNumberObj = new PhoneNumber();
60
+ $phoneNumberObj->setCountryCode(33)->setNationalNumber(1010);
61
+ $this->assertTrue($this->shortInfo->isValidShortNumber($phoneNumberObj));
62
+ $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse(1010, RegionCode::FR), RegionCode::FR));
63
+
64
+ $phoneNumberObj = new PhoneNumber();
65
+ $phoneNumberObj->setCountryCode(33)->setNationalNumber(123456);
66
+ $this->assertFalse($this->shortInfo->isValidShortNumber($phoneNumberObj));
67
+ $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse(123456, RegionCode::FR), RegionCode::FR));
68
+
69
+ // Note that GB and GG share the country calling code 44
70
+ $phoneNumberObj = new PhoneNumber();
71
+ $phoneNumberObj->setCountryCode(44)->setNationalNumber(18001);
72
+ $this->assertTrue($this->shortInfo->isValidShortNumber($phoneNumberObj));
73
+ }
74
+
75
+ public function testGetExpectedCost()
76
+ {
77
+ $premiumRateExample = $this->shortInfo->getExampleShortNumberForCost(
78
+ RegionCode::FR,
79
+ ShortNumberCost::PREMIUM_RATE
80
+ );
81
+ $this->assertEquals(
82
+ ShortNumberCost::PREMIUM_RATE,
83
+ $this->shortInfo->getExpectedCostForRegion($this->parse($premiumRateExample, RegionCode::FR), RegionCode::FR)
84
+ );
85
+
86
+ $premiumRateNumber = new PhoneNumber();
87
+ $premiumRateNumber->setCountryCode(33)->setNationalNumber($premiumRateExample);
88
+ $this->assertEquals(ShortNumberCost::PREMIUM_RATE, $this->shortInfo->getExpectedCost($premiumRateNumber));
89
+
90
+ $standardRateExample = $this->shortInfo->getExampleShortNumberForCost(
91
+ RegionCode::FR,
92
+ ShortNumberCost::STANDARD_RATE
93
+ );
94
+ $this->assertEquals(
95
+ ShortNumberCost::STANDARD_RATE,
96
+ $this->shortInfo->getExpectedCostForRegion($this->parse($standardRateExample, RegionCode::FR), RegionCode::FR)
97
+ );
98
+
99
+ $standardRateNumber = new PhoneNumber();
100
+ $standardRateNumber->setCountryCode(33)->setNationalNumber($standardRateExample);
101
+ $this->assertEquals(ShortNumberCost::STANDARD_RATE, $this->shortInfo->getExpectedCost($standardRateNumber));
102
+
103
+ $tollFreeExample = $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::TOLL_FREE);
104
+ $this->assertEquals(
105
+ ShortNumberCost::TOLL_FREE,
106
+ $this->shortInfo->getExpectedCostForRegion($this->parse($tollFreeExample, RegionCode::FR), RegionCode::FR)
107
+ );
108
+ $tollFreeNumber = new PhoneNumber();
109
+ $tollFreeNumber->setCountryCode(33)->setNationalNumber($tollFreeExample);
110
+ $this->assertEquals(ShortNumberCost::TOLL_FREE, $this->shortInfo->getExpectedCost($tollFreeNumber));
111
+
112
+ $this->assertEquals(
113
+ ShortNumberCost::UNKNOWN_COST,
114
+ $this->shortInfo->getExpectedCostForRegion($this->parse("12345", RegionCode::FR), RegionCode::FR)
115
+ );
116
+ $unknownCostNumber = new PhoneNumber();
117
+ $unknownCostNumber->setCountryCode(33)->setNationalNumber(12345);
118
+ $this->assertEquals(ShortNumberCost::UNKNOWN_COST, $this->shortInfo->getExpectedCost($unknownCostNumber));
119
+
120
+ // Test that an invalid number may nevertheless have a cost other than UNKNOWN_COST.
121
+ $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse("116123", RegionCode::FR), RegionCode::FR));
122
+ $this->assertEquals(
123
+ ShortNumberCost::TOLL_FREE,
124
+ $this->shortInfo->getExpectedCostForRegion($this->parse("116123", RegionCode::FR), RegionCode::FR)
125
+ );
126
+ $invalidNumber = new PhoneNumber();
127
+ $invalidNumber->setCountryCode(33)->setNationalNumber(116123);
128
+ $this->assertFalse($this->shortInfo->isValidShortNumber($invalidNumber));
129
+ $this->assertEquals(ShortNumberCost::TOLL_FREE, $this->shortInfo->getExpectedCost($invalidNumber));
130
+
131
+ // Test a nonexistent country code.
132
+ $this->assertEquals(
133
+ ShortNumberCost::UNKNOWN_COST,
134
+ $this->shortInfo->getExpectedCostForRegion($this->parse("911", RegionCode::US), RegionCode::ZZ)
135
+ );
136
+ $unknownCostNumber->clear();
137
+ $unknownCostNumber->setCountryCode(123)->setNationalNumber(911);
138
+ $this->assertEquals(ShortNumberCost::UNKNOWN_COST, $this->shortInfo->getExpectedCost($unknownCostNumber));
139
+ }
140
+
141
+ public function testGetExpectedCostForSharedCountryCallingCode()
142
+ {
143
+ // Test some numbers which have different costs in countries sharing the same country calling
144
+ // code. In Australia, 1234 is premium-rate, 1194 is standard-rate, and 733 is toll-free. These
145
+ // are not known to be valid numbers in the Christmas Islands.
146
+ $ambiguousPremiumRateString = "1234";
147
+ $ambiguousPremiumRateNumber = new PhoneNumber();
148
+ $ambiguousPremiumRateNumber->setCountryCode(61)->setNationalNumber(1234);
149
+ $ambiguousStandardRateString = "1194";
150
+ $ambiguousStandardRateNumber = new PhoneNumber();
151
+ $ambiguousStandardRateNumber->setCountryCode(61)->setNationalNumber(1194);
152
+ $ambiguousTollFreeString = "733";
153
+ $ambiguousTollFreeNumber = new PhoneNumber();
154
+ $ambiguousTollFreeNumber->setCountryCode(61)->setNationalNumber(733);
155
+
156
+ $this->assertTrue($this->shortInfo->isValidShortNumber($ambiguousPremiumRateNumber));
157
+ $this->assertTrue($this->shortInfo->isValidShortNumber($ambiguousStandardRateNumber));
158
+ $this->assertTrue($this->shortInfo->isValidShortNumber($ambiguousTollFreeNumber));
159
+
160
+ $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousPremiumRateString, RegionCode::AU), RegionCode::AU));
161
+ $this->assertEquals(
162
+ ShortNumberCost::PREMIUM_RATE,
163
+ $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousPremiumRateString, RegionCode::AU), RegionCode::AU)
164
+ );
165
+ $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousPremiumRateString, RegionCode::CX), RegionCode::CX));
166
+ $this->assertEquals(
167
+ ShortNumberCost::UNKNOWN_COST,
168
+ $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousPremiumRateString, RegionCode::CX), RegionCode::CX)
169
+ );
170
+ // PREMIUM_RATE takes precedence over UNKNOWN_COST.
171
+ $this->assertEquals(
172
+ ShortNumberCost::PREMIUM_RATE,
173
+ $this->shortInfo->getExpectedCost($ambiguousPremiumRateNumber)
174
+ );
175
+
176
+ $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousStandardRateString, RegionCode::AU), RegionCode::AU));
177
+ $this->assertEquals(
178
+ ShortNumberCost::STANDARD_RATE,
179
+ $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousStandardRateString, RegionCode::AU), RegionCode::AU)
180
+ );
181
+ $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousStandardRateString, RegionCode::CX), RegionCode::CX));
182
+ $this->assertEquals(
183
+ ShortNumberCost::UNKNOWN_COST,
184
+ $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousStandardRateString, RegionCode::CX), RegionCode::CX)
185
+ );
186
+ $this->assertEquals(
187
+ ShortNumberCost::UNKNOWN_COST,
188
+ $this->shortInfo->getExpectedCost($ambiguousStandardRateNumber)
189
+ );
190
+
191
+ $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousTollFreeString, RegionCode::AU), RegionCode::AU));
192
+ $this->assertEquals(
193
+ ShortNumberCost::TOLL_FREE,
194
+ $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousTollFreeString, RegionCode::AU), RegionCode::AU)
195
+ );
196
+ $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse($ambiguousTollFreeString, RegionCode::CX), RegionCode::CX));
197
+ $this->assertEquals(
198
+ ShortNumberCost::UNKNOWN_COST,
199
+ $this->shortInfo->getExpectedCostForRegion($this->parse($ambiguousTollFreeString, RegionCode::CX), RegionCode::CX)
200
+ );
201
+ $this->assertEquals(ShortNumberCost::UNKNOWN_COST, $this->shortInfo->getExpectedCost($ambiguousTollFreeNumber));
202
+ }
203
+
204
+ public function testGetExampleShortNumber()
205
+ {
206
+ $this->assertEquals("8711", $this->shortInfo->getExampleShortNumber(RegionCode::AM));
207
+ $this->assertEquals("1010", $this->shortInfo->getExampleShortNumber(RegionCode::FR));
208
+ $this->assertEquals("", $this->shortInfo->getExampleShortNumber(RegionCode::UN001));
209
+ $this->assertEquals("", $this->shortInfo->getExampleShortNumber(null));
210
+ }
211
+
212
+ public function testGetExampleShortNumberForCost()
213
+ {
214
+ $this->assertEquals(
215
+ "3010",
216
+ $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::TOLL_FREE)
217
+ );
218
+ $this->assertEquals(
219
+ "1023",
220
+ $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::STANDARD_RATE)
221
+ );
222
+ $this->assertEquals(
223
+ "42000",
224
+ $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::PREMIUM_RATE)
225
+ );
226
+ $this->assertEquals(
227
+ "",
228
+ $this->shortInfo->getExampleShortNumberForCost(RegionCode::FR, ShortNumberCost::UNKNOWN_COST)
229
+ );
230
+ }
231
+
232
+ public function testConnectsToEmergencyNumber_US()
233
+ {
234
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("911", RegionCode::US));
235
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("112", RegionCode::US));
236
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("999", RegionCode::US));
237
+ }
238
+
239
+ public function testConnectsToEmergencyNumberLongNumber_US()
240
+ {
241
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("9116666666", RegionCode::US));
242
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("1126666666", RegionCode::US));
243
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("9996666666", RegionCode::US));
244
+ }
245
+
246
+ public function testConnectsToEmergencyNumberWithFormatting_US()
247
+ {
248
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("9-1-1", RegionCode::US));
249
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("1-1-2", RegionCode::US));
250
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("9-9-9", RegionCode::US));
251
+ }
252
+
253
+ public function testConnectsToEmergencyNumberWithPlusSign_US()
254
+ {
255
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("+911", RegionCode::US));
256
+ $this->assertFalse(
257
+ $this->shortInfo->connectsToEmergencyNumber(self::$plusSymbol . "911", RegionCode::US)
258
+ );
259
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber(" +911", RegionCode::US));
260
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("+112", RegionCode::US));
261
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("+999", RegionCode::US));
262
+ }
263
+
264
+ public function testConnectsToEmergencyNumber_BR()
265
+ {
266
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("911", RegionCode::BR));
267
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber("190", RegionCode::BR));
268
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("999", RegionCode::BR));
269
+ }
270
+
271
+ public function testConnectsToEmergencyNumberLongNumber_BR()
272
+ {
273
+ // Brazilian emergency numbers don't work when additional digits are appended.
274
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("9111", RegionCode::BR));
275
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("1900", RegionCode::BR));
276
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("9996", RegionCode::BR));
277
+ }
278
+
279
+ public function testConnectsToEmergencyNumber_CL()
280
+ {
281
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber('131', RegionCode::CL));
282
+ $this->assertTrue($this->shortInfo->connectsToEmergencyNumber('133', RegionCode::CL));
283
+ }
284
+
285
+ public function testConnectsToEmergencyNumberLongNumber_CL()
286
+ {
287
+ // Chilean emergency numbers don't work when additional digits are appended.
288
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber('1313', RegionCode::CL));
289
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber('1330', RegionCode::CL));
290
+ }
291
+
292
+ public function testConnectsToEmergencyNumber_AO()
293
+ {
294
+ // Angola doesn't have any metadata for emergency numbers in the test metadata.
295
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("911", RegionCode::AO));
296
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("222123456", RegionCode::BR));
297
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("923123456", RegionCode::BR));
298
+ }
299
+
300
+ public function testConnectsToEmergencyNumber_ZW()
301
+ {
302
+ // Zimbabwe doesn't have any metadata in the test metadata.
303
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("911", RegionCode::ZW));
304
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("01312345", RegionCode::ZW));
305
+ $this->assertFalse($this->shortInfo->connectsToEmergencyNumber("0711234567", RegionCode::ZW));
306
+ }
307
+
308
+ public function testIsEmergencyNumber_US()
309
+ {
310
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("911", RegionCode::US));
311
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("112", RegionCode::US));
312
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("999", RegionCode::US));
313
+ }
314
+
315
+ public function testIsEmergencyNumberLongNumber_US()
316
+ {
317
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("9116666666", RegionCode::US));
318
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("1126666666", RegionCode::US));
319
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("9996666666", RegionCode::US));
320
+ }
321
+
322
+ public function testIsEmergencyNumberWithFormatting_US()
323
+ {
324
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("9-1-1", RegionCode::US));
325
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("*911", RegionCode::US));
326
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("1-1-2", RegionCode::US));
327
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("*112", RegionCode::US));
328
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("9-9-9", RegionCode::US));
329
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("*999", RegionCode::US));
330
+ }
331
+
332
+ public function testIsEmergencyNumberWithPlusSign_US()
333
+ {
334
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("+911", RegionCode::US));
335
+ $this->assertFalse($this->shortInfo->isEmergencyNumber(self::$plusSymbol . "911", RegionCode::US));
336
+ $this->assertFalse($this->shortInfo->isEmergencyNumber(" +911", RegionCode::US));
337
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("+112", RegionCode::US));
338
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("+999", RegionCode::US));
339
+ }
340
+
341
+ public function testIsEmergencyNumber_BR()
342
+ {
343
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("911", RegionCode::BR));
344
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("190", RegionCode::BR));
345
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("999", RegionCode::BR));
346
+ }
347
+
348
+ public function testIsEmergencyNumberLongNumber_BR()
349
+ {
350
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("9111", RegionCode::BR));
351
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("1900", RegionCode::BR));
352
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("9996", RegionCode::BR));
353
+ }
354
+
355
+ public function testIsEmergencyNumber_AO()
356
+ {
357
+ // Angola doesn't have any metadata for emergency numbers in the test metadata.
358
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("911", RegionCode::AO));
359
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("222123456", RegionCode::AO));
360
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("923123456", RegionCode::AO));
361
+ }
362
+
363
+ public function testIsEmergencyNumber_ZW()
364
+ {
365
+ // Zimbabwe doesn't have any metadata in the test metadata.
366
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("911", RegionCode::ZW));
367
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("01312345", RegionCode::ZW));
368
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("0711234567", RegionCode::ZW));
369
+ }
370
+
371
+
372
+ public function testEmergencyNumberForSharedCountryCallingCode()
373
+ {
374
+ // Test the emergency number 112, which is valid in both Australia and the Christmas Islands.
375
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("112", RegionCode::AU));
376
+ $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse("112", RegionCode::AU), RegionCode::AU));
377
+ $this->assertEquals(
378
+ ShortNumberCost::TOLL_FREE,
379
+ $this->shortInfo->getExpectedCostForRegion($this->parse("112", RegionCode::AU), RegionCode::AU)
380
+ );
381
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("112", RegionCode::CX));
382
+ $this->assertTrue($this->shortInfo->isValidShortNumberForRegion($this->parse("112", RegionCode::CX), RegionCode::CX));
383
+ $this->assertEquals(
384
+ ShortNumberCost::TOLL_FREE,
385
+ $this->shortInfo->getExpectedCostForRegion($this->parse("112", RegionCode::CX), RegionCode::CX)
386
+ );
387
+ $sharedEmergencyNumber = new PhoneNumber();
388
+ $sharedEmergencyNumber->setCountryCode(61)->setNationalNumber(112);
389
+ $this->assertTrue($this->shortInfo->isValidShortNumber($sharedEmergencyNumber));
390
+ $this->assertEquals(ShortNumberCost::TOLL_FREE, $this->shortInfo->getExpectedCost($sharedEmergencyNumber));
391
+ }
392
+
393
+ public function testOverlappingNANPANumber()
394
+ {
395
+ // 211 is an emergency number in Barbados, while it is a toll-free information line in Canada
396
+ // and the USA.
397
+ $this->assertTrue($this->shortInfo->isEmergencyNumber("211", RegionCode::BB));
398
+ $this->assertEquals(
399
+ ShortNumberCost::TOLL_FREE,
400
+ $this->shortInfo->getExpectedCostForRegion($this->parse("211", RegionCode::BB), RegionCode::BB)
401
+ );
402
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("211", RegionCode::US));
403
+ $this->assertEquals(
404
+ ShortNumberCost::UNKNOWN_COST,
405
+ $this->shortInfo->getExpectedCostForRegion($this->parse("211", RegionCode::US), RegionCode::US)
406
+ );
407
+ $this->assertFalse($this->shortInfo->isEmergencyNumber("211", RegionCode::CA));
408
+ $this->assertEquals(
409
+ ShortNumberCost::UNKNOWN_COST,
410
+ $this->shortInfo->getExpectedCostForRegion($this->parse("211", RegionCode::CA), RegionCode::CA)
411
+ );
412
+ }
413
+
414
+ public function testCountryCallingCodeIsNotIgnored()
415
+ {
416
+ // +46 is the country calling code for Sweden (SE), and 40404 is a valid short number in the US.
417
+ $this->assertFalse($this->shortInfo->isPossibleShortNumberForRegion($this->parse('+4640404', RegionCode::SE), RegionCode::US));
418
+ $this->assertFalse($this->shortInfo->isValidShortNumberForRegion($this->parse('+4640404', RegionCode::SE), RegionCode::US));
419
+ $this->assertEquals(ShortNumberCost::UNKNOWN_COST, $this->shortInfo->getExpectedCostForRegion($this->parse('+4640404', RegionCode::SE), RegionCode::US));
420
+ }
421
+
422
+ /**
423
+ * @param string $number
424
+ * @param string $regionCode
425
+ * @return PhoneNumber
426
+ */
427
+ private function parse($number, $regionCode)
428
+ {
429
+ try {
430
+ return $this->phoneUtil->parse($number, $regionCode);
431
+ } catch (NumberParseException $e) {
432
+ $this->fail("Test input data should always parse correctly: " . $number . " (" . $regionCode . ")");
433
+ }
434
+ }
435
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/ShortNumberUtilTest.php ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\core;
4
+
5
+ use libphonenumber\CountryCodeToRegionCodeMapForTesting;
6
+ use libphonenumber\PhoneNumberUtil;
7
+ use libphonenumber\RegionCode;
8
+ use libphonenumber\ShortNumberUtil;
9
+
10
+ class ShortNumberUtilTest extends \PHPUnit_Framework_TestCase
11
+ {
12
+ private static $plusSymbol;
13
+ /**
14
+ * @var ShortNumberUtil
15
+ */
16
+ private $shortUtil;
17
+
18
+ public function setUp()
19
+ {
20
+ self::$plusSymbol = pack('H*', 'efbc8b');
21
+
22
+ PhoneNumberUtil::resetInstance();
23
+ $this->shortUtil = new ShortNumberUtil(
24
+ PhoneNumberUtil::getInstance(
25
+ PhoneNumberUtilTest::TEST_META_DATA_FILE_PREFIX,
26
+ CountryCodeToRegionCodeMapForTesting::$countryCodeToRegionCodeMapForTesting
27
+ )
28
+ );
29
+ }
30
+
31
+ public function testConnectsToEmergencyNumber_US()
32
+ {
33
+ $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("911", RegionCode::US));
34
+ $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("112", RegionCode::US));
35
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("999", RegionCode::US));
36
+ }
37
+
38
+ public function testConnectsToEmergencyNumberLongNumber_US()
39
+ {
40
+ $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("9116666666", RegionCode::US));
41
+ $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("1126666666", RegionCode::US));
42
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("9996666666", RegionCode::US));
43
+ }
44
+
45
+ public function testConnectsToEmergencyNumberWithFormatting_US()
46
+ {
47
+ $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("9-1-1", RegionCode::US));
48
+ $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("1-1-2", RegionCode::US));
49
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("9-9-9", RegionCode::US));
50
+ }
51
+
52
+ public function testConnectsToEmergencyNumberWithPlusSign_US()
53
+ {
54
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("+911", RegionCode::US));
55
+ $this->assertFalse(
56
+ $this->shortUtil->connectsToEmergencyNumber(self::$plusSymbol . "911", RegionCode::US)
57
+ );
58
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber(" +911", RegionCode::US));
59
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("+112", RegionCode::US));
60
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("+999", RegionCode::US));
61
+ }
62
+
63
+ public function testConnectsToEmergencyNumber_BR()
64
+ {
65
+ $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("911", RegionCode::BR));
66
+ $this->assertTrue($this->shortUtil->connectsToEmergencyNumber("190", RegionCode::BR));
67
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("999", RegionCode::BR));
68
+ }
69
+
70
+ public function testConnectsToEmergencyNumberLongNumber_BR()
71
+ {
72
+ // Brazilian emergency numbers don't work when additional digits are appended.
73
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("9111", RegionCode::BR));
74
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("1900", RegionCode::BR));
75
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("9996", RegionCode::BR));
76
+ }
77
+
78
+ public function testConnectsToEmergencyNumber_AO()
79
+ {
80
+ // Angola doesn't have any metadata for emergency numbers in the test metadata.
81
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("911", RegionCode::AO));
82
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("222123456", RegionCode::BR));
83
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("923123456", RegionCode::BR));
84
+ }
85
+
86
+ public function testConnectsToEmergencyNumber_ZW()
87
+ {
88
+ // Zimbabwe doesn't have any metadata in the test metadata.
89
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("911", RegionCode::ZW));
90
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("01312345", RegionCode::ZW));
91
+ $this->assertFalse($this->shortUtil->connectsToEmergencyNumber("0711234567", RegionCode::ZW));
92
+ }
93
+
94
+ public function testIsEmergencyNumber_US()
95
+ {
96
+ $this->assertTrue($this->shortUtil->isEmergencyNumber("911", RegionCode::US));
97
+ $this->assertTrue($this->shortUtil->isEmergencyNumber("112", RegionCode::US));
98
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("999", RegionCode::US));
99
+ }
100
+
101
+ public function testIsEmergencyNumberLongNumber_US()
102
+ {
103
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("9116666666", RegionCode::US));
104
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("1126666666", RegionCode::US));
105
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("9996666666", RegionCode::US));
106
+ }
107
+
108
+ public function testIsEmergencyNumberWithFormatting_US()
109
+ {
110
+ $this->assertTrue($this->shortUtil->isEmergencyNumber("9-1-1", RegionCode::US));
111
+ $this->assertTrue($this->shortUtil->isEmergencyNumber("*911", RegionCode::US));
112
+ $this->assertTrue($this->shortUtil->isEmergencyNumber("1-1-2", RegionCode::US));
113
+ $this->assertTrue($this->shortUtil->isEmergencyNumber("*112", RegionCode::US));
114
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("9-9-9", RegionCode::US));
115
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("*999", RegionCode::US));
116
+ }
117
+
118
+ public function testIsEmergencyNumberWithPlusSign_US()
119
+ {
120
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("+911", RegionCode::US));
121
+ $this->assertFalse($this->shortUtil->isEmergencyNumber(self::$plusSymbol . "911", RegionCode::US));
122
+ $this->assertFalse($this->shortUtil->isEmergencyNumber(" +911", RegionCode::US));
123
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("+112", RegionCode::US));
124
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("+999", RegionCode::US));
125
+ }
126
+
127
+ public function testIsEmergencyNumber_BR()
128
+ {
129
+ $this->assertTrue($this->shortUtil->isEmergencyNumber("911", RegionCode::BR));
130
+ $this->assertTrue($this->shortUtil->isEmergencyNumber("190", RegionCode::BR));
131
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("999", RegionCode::BR));
132
+ }
133
+
134
+ public function testIsEmergencyNumberLongNumber_BR()
135
+ {
136
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("9111", RegionCode::BR));
137
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("1900", RegionCode::BR));
138
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("9996", RegionCode::BR));
139
+ }
140
+
141
+ public function testIsEmergencyNumber_AO()
142
+ {
143
+ // Angola doesn't have any metadata for emergency numbers in the test metadata.
144
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("911", RegionCode::AO));
145
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("222123456", RegionCode::AO));
146
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("923123456", RegionCode::AO));
147
+ }
148
+
149
+ public function testIsEmergencyNumber_ZW()
150
+ {
151
+ // Zimbabwe doesn't have any metadata in the test metadata.
152
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("911", RegionCode::ZW));
153
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("01312345", RegionCode::ZW));
154
+ $this->assertFalse($this->shortUtil->isEmergencyNumber("0711234567", RegionCode::ZW));
155
+ }
156
+
157
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_800.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '\\d{8}',
12
+ 'PossibleNumberPattern' => '\\d{8}',
13
+ 'ExampleNumber' => '12345678',
14
+ ),
15
+ 'fixedLine' =>
16
+ array (
17
+ 'NationalNumberPattern' => 'NA',
18
+ 'PossibleNumberPattern' => 'NA',
19
+ 'ExampleNumber' => '12345678',
20
+ ),
21
+ 'mobile' =>
22
+ array (
23
+ 'NationalNumberPattern' => 'NA',
24
+ 'PossibleNumberPattern' => 'NA',
25
+ 'ExampleNumber' => '12345678',
26
+ ),
27
+ 'tollFree' =>
28
+ array (
29
+ 'NationalNumberPattern' => '\\d{8}',
30
+ 'PossibleNumberPattern' => '\\d{8}',
31
+ 'ExampleNumber' => '12345678',
32
+ ),
33
+ 'premiumRate' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'sharedCost' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'personalNumber' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'voip' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'pager' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'uan' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'emergency' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'voicemail' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'shortCode' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'standardRate' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'carrierSpecific' =>
84
+ array (
85
+ 'NationalNumberPattern' => 'NA',
86
+ 'PossibleNumberPattern' => 'NA',
87
+ ),
88
+ 'noInternationalDialling' =>
89
+ array (
90
+ 'NationalNumberPattern' => 'NA',
91
+ 'PossibleNumberPattern' => 'NA',
92
+ ),
93
+ 'id' => '001',
94
+ 'countryCode' => 800,
95
+ 'internationalPrefix' => '',
96
+ 'sameMobileAndFixedLinePattern' => true,
97
+ 'numberFormat' =>
98
+ array (
99
+ 0 =>
100
+ array (
101
+ 'pattern' => '(\\d{4})(\\d{4})',
102
+ 'format' => '$1 $2',
103
+ 'leadingDigitsPatterns' =>
104
+ array (
105
+ ),
106
+ 'nationalPrefixFormattingRule' => '',
107
+ 'domesticCarrierCodeFormattingRule' => '',
108
+ ),
109
+ ),
110
+ 'intlNumberFormat' =>
111
+ array (
112
+ ),
113
+ 'mainCountryForCode' => false,
114
+ 'leadingZeroPossible' => true,
115
+ 'mobileNumberPortableRegion' => false,
116
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_979.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '\\d{9}',
12
+ 'PossibleNumberPattern' => '\\d{9}',
13
+ 'ExampleNumber' => '123456789',
14
+ ),
15
+ 'fixedLine' =>
16
+ array (
17
+ 'NationalNumberPattern' => 'NA',
18
+ 'PossibleNumberPattern' => 'NA',
19
+ 'ExampleNumber' => '123456789',
20
+ ),
21
+ 'mobile' =>
22
+ array (
23
+ 'NationalNumberPattern' => 'NA',
24
+ 'PossibleNumberPattern' => 'NA',
25
+ 'ExampleNumber' => '123456789',
26
+ ),
27
+ 'tollFree' =>
28
+ array (
29
+ 'NationalNumberPattern' => 'NA',
30
+ 'PossibleNumberPattern' => 'NA',
31
+ ),
32
+ 'premiumRate' =>
33
+ array (
34
+ 'NationalNumberPattern' => '\\d{9}',
35
+ 'PossibleNumberPattern' => '\\d{9}',
36
+ 'ExampleNumber' => '123456789',
37
+ ),
38
+ 'sharedCost' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'personalNumber' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'voip' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'pager' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'uan' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'emergency' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'voicemail' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'shortCode' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'standardRate' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'carrierSpecific' =>
84
+ array (
85
+ 'NationalNumberPattern' => 'NA',
86
+ 'PossibleNumberPattern' => 'NA',
87
+ ),
88
+ 'noInternationalDialling' =>
89
+ array (
90
+ 'NationalNumberPattern' => 'NA',
91
+ 'PossibleNumberPattern' => 'NA',
92
+ ),
93
+ 'id' => '001',
94
+ 'countryCode' => 979,
95
+ 'internationalPrefix' => '',
96
+ 'sameMobileAndFixedLinePattern' => true,
97
+ 'numberFormat' =>
98
+ array (
99
+ 0 =>
100
+ array (
101
+ 'pattern' => '(\\d)(\\d{4})(\\d{4})',
102
+ 'format' => '$1 $2 $3',
103
+ 'leadingDigitsPatterns' =>
104
+ array (
105
+ ),
106
+ 'nationalPrefixFormattingRule' => '',
107
+ 'domesticCarrierCodeFormattingRule' => '',
108
+ ),
109
+ ),
110
+ 'intlNumberFormat' =>
111
+ array (
112
+ ),
113
+ 'mainCountryForCode' => false,
114
+ 'leadingZeroPossible' => false,
115
+ 'mobileNumberPortableRegion' => false,
116
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AD.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ ),
12
+ 'fixedLine' =>
13
+ array (
14
+ ),
15
+ 'mobile' =>
16
+ array (
17
+ ),
18
+ 'tollFree' =>
19
+ array (
20
+ 'NationalNumberPattern' => 'NA',
21
+ 'PossibleNumberPattern' => 'NA',
22
+ ),
23
+ 'premiumRate' =>
24
+ array (
25
+ 'NationalNumberPattern' => 'NA',
26
+ 'PossibleNumberPattern' => 'NA',
27
+ ),
28
+ 'sharedCost' =>
29
+ array (
30
+ 'NationalNumberPattern' => 'NA',
31
+ 'PossibleNumberPattern' => 'NA',
32
+ ),
33
+ 'personalNumber' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'voip' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'pager' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'uan' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'emergency' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'voicemail' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'shortCode' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'standardRate' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'carrierSpecific' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'noInternationalDialling' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'id' => 'AD',
84
+ 'countryCode' => 376,
85
+ 'internationalPrefix' => '00',
86
+ 'sameMobileAndFixedLinePattern' => true,
87
+ 'numberFormat' =>
88
+ array (
89
+ ),
90
+ 'intlNumberFormat' =>
91
+ array (
92
+ ),
93
+ 'mainCountryForCode' => false,
94
+ 'leadingZeroPossible' => false,
95
+ 'mobileNumberPortableRegion' => false,
96
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AE.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[1-9]\\d{8}',
12
+ 'PossibleNumberPattern' => '\\d{9}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '[1-9]\\d{8}',
17
+ 'PossibleNumberPattern' => '\\d{9}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '[1-9]\\d{8}',
22
+ 'PossibleNumberPattern' => '\\d{9}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => 'NA',
27
+ 'PossibleNumberPattern' => 'NA',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => 'NA',
32
+ 'PossibleNumberPattern' => 'NA',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => 'NA',
37
+ 'PossibleNumberPattern' => 'NA',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => '600\\d{6}',
57
+ 'PossibleNumberPattern' => '\\d{9}',
58
+ 'ExampleNumber' => '600123456',
59
+ ),
60
+ 'emergency' =>
61
+ array (
62
+ 'NationalNumberPattern' => 'NA',
63
+ 'PossibleNumberPattern' => 'NA',
64
+ ),
65
+ 'voicemail' =>
66
+ array (
67
+ 'NationalNumberPattern' => 'NA',
68
+ 'PossibleNumberPattern' => 'NA',
69
+ ),
70
+ 'shortCode' =>
71
+ array (
72
+ 'NationalNumberPattern' => 'NA',
73
+ 'PossibleNumberPattern' => 'NA',
74
+ ),
75
+ 'standardRate' =>
76
+ array (
77
+ 'NationalNumberPattern' => 'NA',
78
+ 'PossibleNumberPattern' => 'NA',
79
+ ),
80
+ 'carrierSpecific' =>
81
+ array (
82
+ 'NationalNumberPattern' => 'NA',
83
+ 'PossibleNumberPattern' => 'NA',
84
+ ),
85
+ 'noInternationalDialling' =>
86
+ array (
87
+ 'NationalNumberPattern' => 'NA',
88
+ 'PossibleNumberPattern' => 'NA',
89
+ ),
90
+ 'id' => 'AE',
91
+ 'countryCode' => 971,
92
+ 'internationalPrefix' => '00',
93
+ 'sameMobileAndFixedLinePattern' => true,
94
+ 'numberFormat' =>
95
+ array (
96
+ ),
97
+ 'intlNumberFormat' =>
98
+ array (
99
+ ),
100
+ 'mainCountryForCode' => false,
101
+ 'leadingZeroPossible' => false,
102
+ 'mobileNumberPortableRegion' => false,
103
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AO.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[29]\\d{8}',
12
+ 'PossibleNumberPattern' => '\\d{9}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '2\\d(?:[26-9]\\d|\\d[26-9])\\d{5}',
17
+ 'PossibleNumberPattern' => '\\d{9}',
18
+ 'ExampleNumber' => '222123456',
19
+ ),
20
+ 'mobile' =>
21
+ array (
22
+ 'NationalNumberPattern' => '9[1-3]\\d{7}',
23
+ 'PossibleNumberPattern' => '\\d{9}',
24
+ 'ExampleNumber' => '923123456',
25
+ ),
26
+ 'tollFree' =>
27
+ array (
28
+ 'NationalNumberPattern' => 'NA',
29
+ 'PossibleNumberPattern' => 'NA',
30
+ ),
31
+ 'premiumRate' =>
32
+ array (
33
+ 'NationalNumberPattern' => 'NA',
34
+ 'PossibleNumberPattern' => 'NA',
35
+ ),
36
+ 'sharedCost' =>
37
+ array (
38
+ 'NationalNumberPattern' => 'NA',
39
+ 'PossibleNumberPattern' => 'NA',
40
+ ),
41
+ 'personalNumber' =>
42
+ array (
43
+ 'NationalNumberPattern' => 'NA',
44
+ 'PossibleNumberPattern' => 'NA',
45
+ ),
46
+ 'voip' =>
47
+ array (
48
+ 'NationalNumberPattern' => 'NA',
49
+ 'PossibleNumberPattern' => 'NA',
50
+ ),
51
+ 'pager' =>
52
+ array (
53
+ 'NationalNumberPattern' => 'NA',
54
+ 'PossibleNumberPattern' => 'NA',
55
+ ),
56
+ 'uan' =>
57
+ array (
58
+ 'NationalNumberPattern' => 'NA',
59
+ 'PossibleNumberPattern' => 'NA',
60
+ ),
61
+ 'emergency' =>
62
+ array (
63
+ 'NationalNumberPattern' => 'NA',
64
+ 'PossibleNumberPattern' => 'NA',
65
+ ),
66
+ 'voicemail' =>
67
+ array (
68
+ 'NationalNumberPattern' => 'NA',
69
+ 'PossibleNumberPattern' => 'NA',
70
+ ),
71
+ 'shortCode' =>
72
+ array (
73
+ 'NationalNumberPattern' => 'NA',
74
+ 'PossibleNumberPattern' => 'NA',
75
+ ),
76
+ 'standardRate' =>
77
+ array (
78
+ 'NationalNumberPattern' => 'NA',
79
+ 'PossibleNumberPattern' => 'NA',
80
+ ),
81
+ 'carrierSpecific' =>
82
+ array (
83
+ 'NationalNumberPattern' => 'NA',
84
+ 'PossibleNumberPattern' => 'NA',
85
+ ),
86
+ 'noInternationalDialling' =>
87
+ array (
88
+ 'NationalNumberPattern' => 'NA',
89
+ 'PossibleNumberPattern' => 'NA',
90
+ ),
91
+ 'id' => 'AO',
92
+ 'countryCode' => 244,
93
+ 'internationalPrefix' => '00',
94
+ 'nationalPrefix' => '0~0',
95
+ 'nationalPrefixForParsing' => '0~0',
96
+ 'sameMobileAndFixedLinePattern' => false,
97
+ 'numberFormat' =>
98
+ array (
99
+ 0 =>
100
+ array (
101
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
102
+ 'format' => '$1 $2 $3',
103
+ 'leadingDigitsPatterns' =>
104
+ array (
105
+ ),
106
+ 'nationalPrefixFormattingRule' => '',
107
+ 'domesticCarrierCodeFormattingRule' => '',
108
+ ),
109
+ ),
110
+ 'intlNumberFormat' =>
111
+ array (
112
+ ),
113
+ 'mainCountryForCode' => false,
114
+ 'leadingZeroPossible' => false,
115
+ 'mobileNumberPortableRegion' => false,
116
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AR.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[1-3689]\\d{9,10}',
12
+ 'PossibleNumberPattern' => '\\d{6,11}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '[1-3]\\d{9}',
17
+ 'PossibleNumberPattern' => '\\d{6,10}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '9\\d{10}|[1-3]\\d{9}',
22
+ 'PossibleNumberPattern' => '\\d{10,11}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => '80\\d{8}',
27
+ 'PossibleNumberPattern' => '\\d{10}',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => '6(0\\d|10)\\d{7}',
32
+ 'PossibleNumberPattern' => '\\d{10}',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => 'NA',
37
+ 'PossibleNumberPattern' => 'NA',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'emergency' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'voicemail' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'shortCode' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'standardRate' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'carrierSpecific' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'noInternationalDialling' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'id' => 'AR',
90
+ 'countryCode' => 54,
91
+ 'internationalPrefix' => '00',
92
+ 'nationalPrefix' => '0',
93
+ 'nationalPrefixForParsing' => '0(?:(11|343|3715)15)?',
94
+ 'nationalPrefixTransformRule' => '9$1',
95
+ 'sameMobileAndFixedLinePattern' => false,
96
+ 'numberFormat' =>
97
+ array (
98
+ 0 =>
99
+ array (
100
+ 'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
101
+ 'format' => '$1 $2-$3',
102
+ 'leadingDigitsPatterns' =>
103
+ array (
104
+ 0 => '11',
105
+ ),
106
+ 'nationalPrefixFormattingRule' => '0$1',
107
+ 'domesticCarrierCodeFormattingRule' => '',
108
+ ),
109
+ 1 =>
110
+ array (
111
+ 'pattern' => '(\\d{4})(\\d{2})(\\d{4})',
112
+ 'format' => '$1 $2-$3',
113
+ 'leadingDigitsPatterns' =>
114
+ array (
115
+ 0 => '1[02-9]|[23]',
116
+ ),
117
+ 'nationalPrefixFormattingRule' => '0$1',
118
+ 'domesticCarrierCodeFormattingRule' => '',
119
+ ),
120
+ 2 =>
121
+ array (
122
+ 'pattern' => '(9)(11)(\\d{4})(\\d{4})',
123
+ 'format' => '$2 15 $3-$4',
124
+ 'leadingDigitsPatterns' =>
125
+ array (
126
+ 0 => '911',
127
+ ),
128
+ 'nationalPrefixFormattingRule' => '0$1',
129
+ 'domesticCarrierCodeFormattingRule' => '',
130
+ ),
131
+ 3 =>
132
+ array (
133
+ 'pattern' => '(9)(\\d{4})(\\d{2})(\\d{4})',
134
+ 'format' => '$2 $3-$4',
135
+ 'leadingDigitsPatterns' =>
136
+ array (
137
+ 0 => '9(?:1[02-9]|[23])',
138
+ ),
139
+ 'nationalPrefixFormattingRule' => '0$1',
140
+ 'domesticCarrierCodeFormattingRule' => '0$1 $CC',
141
+ ),
142
+ 4 =>
143
+ array (
144
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
145
+ 'format' => '$1-$2-$3',
146
+ 'leadingDigitsPatterns' =>
147
+ array (
148
+ 0 => '[68]',
149
+ ),
150
+ 'nationalPrefixFormattingRule' => '0$1',
151
+ 'domesticCarrierCodeFormattingRule' => '',
152
+ ),
153
+ ),
154
+ 'intlNumberFormat' =>
155
+ array (
156
+ 0 =>
157
+ array (
158
+ 'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
159
+ 'format' => '$1 $2-$3',
160
+ 'leadingDigitsPatterns' =>
161
+ array (
162
+ 0 => '11',
163
+ ),
164
+ 'nationalPrefixFormattingRule' => '0$1',
165
+ 'domesticCarrierCodeFormattingRule' => '',
166
+ ),
167
+ 1 =>
168
+ array (
169
+ 'pattern' => '(\\d{4})(\\d{2})(\\d{4})',
170
+ 'format' => '$1 $2-$3',
171
+ 'leadingDigitsPatterns' =>
172
+ array (
173
+ 0 => '1[02-9]|[23]',
174
+ ),
175
+ 'nationalPrefixFormattingRule' => '0$1',
176
+ 'domesticCarrierCodeFormattingRule' => '',
177
+ ),
178
+ 2 =>
179
+ array (
180
+ 'pattern' => '(9)(11)(\\d{4})(\\d{4})',
181
+ 'format' => '$1 $2 $3 $4',
182
+ 'leadingDigitsPatterns' =>
183
+ array (
184
+ 0 => '911',
185
+ ),
186
+ ),
187
+ 3 =>
188
+ array (
189
+ 'pattern' => '(9)(\\d{4})(\\d{2})(\\d{4})',
190
+ 'format' => '$1 $2 $3 $4',
191
+ 'leadingDigitsPatterns' =>
192
+ array (
193
+ 0 => '9(?:1[02-9]|[23])',
194
+ ),
195
+ ),
196
+ 4 =>
197
+ array (
198
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
199
+ 'format' => '$1-$2-$3',
200
+ 'leadingDigitsPatterns' =>
201
+ array (
202
+ 0 => '[68]',
203
+ ),
204
+ 'nationalPrefixFormattingRule' => '0$1',
205
+ 'domesticCarrierCodeFormattingRule' => '',
206
+ ),
207
+ ),
208
+ 'mainCountryForCode' => false,
209
+ 'leadingZeroPossible' => false,
210
+ 'mobileNumberPortableRegion' => false,
211
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_AU.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[1-578]\\d{4,14}',
12
+ 'PossibleNumberPattern' => '\\d{5,15}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '[2378]\\d{8}',
17
+ 'PossibleNumberPattern' => '\\d{9}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '4\\d{8}',
22
+ 'PossibleNumberPattern' => '\\d{9}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => '1800\\d{6}',
27
+ 'PossibleNumberPattern' => '\\d{10}',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => '190[0126]\\d{6}',
32
+ 'PossibleNumberPattern' => '\\d{10}',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => 'NA',
37
+ 'PossibleNumberPattern' => 'NA',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'emergency' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'voicemail' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'shortCode' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'standardRate' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'carrierSpecific' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'noInternationalDialling' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'id' => 'AU',
90
+ 'countryCode' => 61,
91
+ 'internationalPrefix' => '001[12]',
92
+ 'preferredInternationalPrefix' => '0011',
93
+ 'nationalPrefix' => '0',
94
+ 'nationalPrefixForParsing' => '0',
95
+ 'sameMobileAndFixedLinePattern' => false,
96
+ 'numberFormat' =>
97
+ array (
98
+ 0 =>
99
+ array (
100
+ 'pattern' => '(\\d{4})(\\d{3})(\\d{3})',
101
+ 'format' => '$1 $2 $3',
102
+ 'leadingDigitsPatterns' =>
103
+ array (
104
+ 0 => '1',
105
+ ),
106
+ 'nationalPrefixFormattingRule' => '$1',
107
+ 'domesticCarrierCodeFormattingRule' => '',
108
+ ),
109
+ 1 =>
110
+ array (
111
+ 'pattern' => '(\\d{1})(\\d{4})(\\d{4})',
112
+ 'format' => '$1 $2 $3',
113
+ 'leadingDigitsPatterns' =>
114
+ array (
115
+ 0 => '[2-478]',
116
+ ),
117
+ 'nationalPrefixFormattingRule' => '0$1',
118
+ 'domesticCarrierCodeFormattingRule' => '',
119
+ ),
120
+ ),
121
+ 'intlNumberFormat' =>
122
+ array (
123
+ ),
124
+ 'mainCountryForCode' => false,
125
+ 'leadingZeroPossible' => false,
126
+ 'mobileNumberPortableRegion' => false,
127
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_BB.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ ),
12
+ 'fixedLine' =>
13
+ array (
14
+ ),
15
+ 'mobile' =>
16
+ array (
17
+ ),
18
+ 'tollFree' =>
19
+ array (
20
+ 'NationalNumberPattern' => 'NA',
21
+ 'PossibleNumberPattern' => 'NA',
22
+ ),
23
+ 'premiumRate' =>
24
+ array (
25
+ 'NationalNumberPattern' => 'NA',
26
+ 'PossibleNumberPattern' => 'NA',
27
+ ),
28
+ 'sharedCost' =>
29
+ array (
30
+ 'NationalNumberPattern' => 'NA',
31
+ 'PossibleNumberPattern' => 'NA',
32
+ ),
33
+ 'personalNumber' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'voip' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'pager' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'uan' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'emergency' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'voicemail' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'shortCode' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'standardRate' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'carrierSpecific' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'noInternationalDialling' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'id' => 'BB',
84
+ 'countryCode' => 1,
85
+ 'internationalPrefix' => '011',
86
+ 'sameMobileAndFixedLinePattern' => true,
87
+ 'numberFormat' =>
88
+ array (
89
+ ),
90
+ 'intlNumberFormat' =>
91
+ array (
92
+ ),
93
+ 'mainCountryForCode' => false,
94
+ 'leadingZeroPossible' => false,
95
+ 'mobileNumberPortableRegion' => false,
96
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_BR.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ ),
12
+ 'fixedLine' =>
13
+ array (
14
+ ),
15
+ 'mobile' =>
16
+ array (
17
+ ),
18
+ 'tollFree' =>
19
+ array (
20
+ 'NationalNumberPattern' => 'NA',
21
+ 'PossibleNumberPattern' => 'NA',
22
+ ),
23
+ 'premiumRate' =>
24
+ array (
25
+ 'NationalNumberPattern' => 'NA',
26
+ 'PossibleNumberPattern' => 'NA',
27
+ ),
28
+ 'sharedCost' =>
29
+ array (
30
+ 'NationalNumberPattern' => 'NA',
31
+ 'PossibleNumberPattern' => 'NA',
32
+ ),
33
+ 'personalNumber' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'voip' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'pager' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'uan' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'emergency' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'voicemail' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'shortCode' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'standardRate' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'carrierSpecific' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'noInternationalDialling' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'id' => 'BR',
84
+ 'countryCode' => 55,
85
+ 'internationalPrefix' => '',
86
+ 'sameMobileAndFixedLinePattern' => true,
87
+ 'numberFormat' =>
88
+ array (
89
+ ),
90
+ 'intlNumberFormat' =>
91
+ array (
92
+ ),
93
+ 'mainCountryForCode' => false,
94
+ 'leadingZeroPossible' => false,
95
+ 'mobileNumberPortableRegion' => false,
96
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_BS.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '(242|8(00|66|77|88)|900)\\d{7}',
12
+ 'PossibleNumberPattern' => '\\d{7,10}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ '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}',
17
+ 'PossibleNumberPattern' => '\\d{7,10}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '242(357|359|457|557)\\d{4}',
22
+ 'PossibleNumberPattern' => '\\d{10}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => '8(00|66|77|88)\\d{7}',
27
+ 'PossibleNumberPattern' => '\\d{10}',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => '900\\d{7}',
32
+ 'PossibleNumberPattern' => '\\d{10}',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => 'NA',
37
+ 'PossibleNumberPattern' => 'NA',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'emergency' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'voicemail' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'shortCode' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'standardRate' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'carrierSpecific' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'noInternationalDialling' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'id' => 'BS',
90
+ 'countryCode' => 1,
91
+ 'internationalPrefix' => '011',
92
+ 'nationalPrefix' => '1',
93
+ 'nationalPrefixForParsing' => '1',
94
+ 'sameMobileAndFixedLinePattern' => false,
95
+ 'numberFormat' =>
96
+ array (
97
+ ),
98
+ 'intlNumberFormat' =>
99
+ array (
100
+ ),
101
+ 'mainCountryForCode' => false,
102
+ 'leadingZeroPossible' => false,
103
+ 'mobileNumberPortableRegion' => false,
104
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_BY.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[1-9]\\d{5}',
12
+ 'PossibleNumberPattern' => '\\d{6}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '[1-9]\\d{5}',
17
+ 'PossibleNumberPattern' => '\\d{6}',
18
+ 'ExampleNumber' => '112345',
19
+ ),
20
+ 'mobile' =>
21
+ array (
22
+ 'NationalNumberPattern' => '[1-9]\\d{5}',
23
+ 'PossibleNumberPattern' => '\\d{6}',
24
+ ),
25
+ 'tollFree' =>
26
+ array (
27
+ 'NationalNumberPattern' => 'NA',
28
+ 'PossibleNumberPattern' => 'NA',
29
+ ),
30
+ 'premiumRate' =>
31
+ array (
32
+ 'NationalNumberPattern' => 'NA',
33
+ 'PossibleNumberPattern' => 'NA',
34
+ ),
35
+ 'sharedCost' =>
36
+ array (
37
+ 'NationalNumberPattern' => 'NA',
38
+ 'PossibleNumberPattern' => 'NA',
39
+ ),
40
+ 'personalNumber' =>
41
+ array (
42
+ 'NationalNumberPattern' => 'NA',
43
+ 'PossibleNumberPattern' => 'NA',
44
+ ),
45
+ 'voip' =>
46
+ array (
47
+ 'NationalNumberPattern' => 'NA',
48
+ 'PossibleNumberPattern' => 'NA',
49
+ ),
50
+ 'pager' =>
51
+ array (
52
+ 'NationalNumberPattern' => 'NA',
53
+ 'PossibleNumberPattern' => 'NA',
54
+ ),
55
+ 'uan' =>
56
+ array (
57
+ 'NationalNumberPattern' => 'NA',
58
+ 'PossibleNumberPattern' => 'NA',
59
+ ),
60
+ 'emergency' =>
61
+ array (
62
+ 'NationalNumberPattern' => 'NA',
63
+ 'PossibleNumberPattern' => 'NA',
64
+ ),
65
+ 'voicemail' =>
66
+ array (
67
+ 'NationalNumberPattern' => 'NA',
68
+ 'PossibleNumberPattern' => 'NA',
69
+ ),
70
+ 'shortCode' =>
71
+ array (
72
+ 'NationalNumberPattern' => 'NA',
73
+ 'PossibleNumberPattern' => 'NA',
74
+ ),
75
+ 'standardRate' =>
76
+ array (
77
+ 'NationalNumberPattern' => 'NA',
78
+ 'PossibleNumberPattern' => 'NA',
79
+ ),
80
+ 'carrierSpecific' =>
81
+ array (
82
+ 'NationalNumberPattern' => 'NA',
83
+ 'PossibleNumberPattern' => 'NA',
84
+ ),
85
+ 'noInternationalDialling' =>
86
+ array (
87
+ 'NationalNumberPattern' => 'NA',
88
+ 'PossibleNumberPattern' => 'NA',
89
+ ),
90
+ 'id' => 'BY',
91
+ 'countryCode' => 375,
92
+ 'internationalPrefix' => '810',
93
+ 'nationalPrefix' => '8',
94
+ 'nationalPrefixForParsing' => '80?|99999',
95
+ 'sameMobileAndFixedLinePattern' => true,
96
+ 'numberFormat' =>
97
+ array (
98
+ 0 =>
99
+ array (
100
+ 'pattern' => '(\\d{4})',
101
+ 'format' => '$1',
102
+ 'leadingDigitsPatterns' =>
103
+ array (
104
+ 0 => '[1-8]',
105
+ ),
106
+ 'nationalPrefixFormattingRule' => '8 $1',
107
+ 'domesticCarrierCodeFormattingRule' => '',
108
+ ),
109
+ 1 =>
110
+ array (
111
+ 'pattern' => '(\\d{2})(\\d{3})',
112
+ 'format' => '$1 $2',
113
+ 'leadingDigitsPatterns' =>
114
+ array (
115
+ 0 => '[1-8]',
116
+ ),
117
+ 'nationalPrefixFormattingRule' => '8$1',
118
+ 'domesticCarrierCodeFormattingRule' => '',
119
+ ),
120
+ 2 =>
121
+ array (
122
+ 'pattern' => '(\\d{3})(\\d{3})',
123
+ 'format' => '$1 $2',
124
+ 'leadingDigitsPatterns' =>
125
+ array (
126
+ 0 => '[1-8]',
127
+ ),
128
+ 'nationalPrefixFormattingRule' => '8 $1',
129
+ 'domesticCarrierCodeFormattingRule' => '',
130
+ ),
131
+ ),
132
+ 'intlNumberFormat' =>
133
+ array (
134
+ ),
135
+ 'mainCountryForCode' => false,
136
+ 'leadingZeroPossible' => false,
137
+ 'mobileNumberPortableRegion' => false,
138
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_CA.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ ),
12
+ 'fixedLine' =>
13
+ array (
14
+ ),
15
+ 'mobile' =>
16
+ array (
17
+ ),
18
+ 'tollFree' =>
19
+ array (
20
+ 'NationalNumberPattern' => 'NA',
21
+ 'PossibleNumberPattern' => 'NA',
22
+ ),
23
+ 'premiumRate' =>
24
+ array (
25
+ 'NationalNumberPattern' => 'NA',
26
+ 'PossibleNumberPattern' => 'NA',
27
+ ),
28
+ 'sharedCost' =>
29
+ array (
30
+ 'NationalNumberPattern' => 'NA',
31
+ 'PossibleNumberPattern' => 'NA',
32
+ ),
33
+ 'personalNumber' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'voip' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'pager' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'uan' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'emergency' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'voicemail' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'shortCode' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'standardRate' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'carrierSpecific' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'noInternationalDialling' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'id' => 'CA',
84
+ 'countryCode' => 1,
85
+ 'internationalPrefix' => '011',
86
+ 'sameMobileAndFixedLinePattern' => true,
87
+ 'numberFormat' =>
88
+ array (
89
+ ),
90
+ 'intlNumberFormat' =>
91
+ array (
92
+ ),
93
+ 'mainCountryForCode' => false,
94
+ 'leadingZeroPossible' => false,
95
+ 'mobileNumberPortableRegion' => false,
96
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_CC.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ ),
12
+ 'fixedLine' =>
13
+ array (
14
+ ),
15
+ 'mobile' =>
16
+ array (
17
+ ),
18
+ 'tollFree' =>
19
+ array (
20
+ 'NationalNumberPattern' => 'NA',
21
+ 'PossibleNumberPattern' => 'NA',
22
+ ),
23
+ 'premiumRate' =>
24
+ array (
25
+ 'NationalNumberPattern' => 'NA',
26
+ 'PossibleNumberPattern' => 'NA',
27
+ ),
28
+ 'sharedCost' =>
29
+ array (
30
+ 'NationalNumberPattern' => 'NA',
31
+ 'PossibleNumberPattern' => 'NA',
32
+ ),
33
+ 'personalNumber' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'voip' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'pager' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'uan' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'emergency' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'voicemail' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'shortCode' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'standardRate' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'carrierSpecific' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'noInternationalDialling' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'id' => 'CC',
84
+ 'countryCode' => 61,
85
+ 'internationalPrefix' => '',
86
+ 'sameMobileAndFixedLinePattern' => true,
87
+ 'numberFormat' =>
88
+ array (
89
+ ),
90
+ 'intlNumberFormat' =>
91
+ array (
92
+ ),
93
+ 'mainCountryForCode' => false,
94
+ 'leadingZeroPossible' => false,
95
+ 'mobileNumberPortableRegion' => false,
96
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_CN.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ ),
12
+ 'fixedLine' =>
13
+ array (
14
+ ),
15
+ 'mobile' =>
16
+ array (
17
+ ),
18
+ 'tollFree' =>
19
+ array (
20
+ 'NationalNumberPattern' => 'NA',
21
+ 'PossibleNumberPattern' => 'NA',
22
+ ),
23
+ 'premiumRate' =>
24
+ array (
25
+ 'NationalNumberPattern' => 'NA',
26
+ 'PossibleNumberPattern' => 'NA',
27
+ ),
28
+ 'sharedCost' =>
29
+ array (
30
+ 'NationalNumberPattern' => 'NA',
31
+ 'PossibleNumberPattern' => 'NA',
32
+ ),
33
+ 'personalNumber' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'voip' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'pager' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'uan' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'emergency' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'voicemail' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'shortCode' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'standardRate' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'carrierSpecific' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'noInternationalDialling' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'id' => 'CN',
84
+ 'countryCode' => 86,
85
+ 'internationalPrefix' => '',
86
+ 'sameMobileAndFixedLinePattern' => true,
87
+ 'numberFormat' =>
88
+ array (
89
+ 0 =>
90
+ array (
91
+ 'pattern' => '(\\d{3})(\\d{5,6})',
92
+ 'format' => '$1 $2',
93
+ 'leadingDigitsPatterns' =>
94
+ array (
95
+ 0 => '[3-9]',
96
+ 1 => '[3-9]\\d{2}[19]',
97
+ 2 => '
98
+ [3-9]\\d{2}(?:
99
+ 10|
100
+ 95
101
+ )
102
+ ',
103
+ ),
104
+ 'nationalPrefixFormattingRule' => '$1',
105
+ 'domesticCarrierCodeFormattingRule' => '$CC $1',
106
+ ),
107
+ ),
108
+ 'intlNumberFormat' =>
109
+ array (
110
+ ),
111
+ 'mainCountryForCode' => false,
112
+ 'leadingZeroPossible' => false,
113
+ 'mobileNumberPortableRegion' => false,
114
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_CX.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ ),
12
+ 'fixedLine' =>
13
+ array (
14
+ ),
15
+ 'mobile' =>
16
+ array (
17
+ ),
18
+ 'tollFree' =>
19
+ array (
20
+ 'NationalNumberPattern' => 'NA',
21
+ 'PossibleNumberPattern' => 'NA',
22
+ ),
23
+ 'premiumRate' =>
24
+ array (
25
+ 'NationalNumberPattern' => 'NA',
26
+ 'PossibleNumberPattern' => 'NA',
27
+ ),
28
+ 'sharedCost' =>
29
+ array (
30
+ 'NationalNumberPattern' => 'NA',
31
+ 'PossibleNumberPattern' => 'NA',
32
+ ),
33
+ 'personalNumber' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'voip' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'pager' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'uan' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'emergency' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'voicemail' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'shortCode' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'standardRate' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'carrierSpecific' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'noInternationalDialling' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'id' => 'CX',
84
+ 'countryCode' => 61,
85
+ 'internationalPrefix' => '00',
86
+ 'sameMobileAndFixedLinePattern' => true,
87
+ 'numberFormat' =>
88
+ array (
89
+ ),
90
+ 'intlNumberFormat' =>
91
+ array (
92
+ ),
93
+ 'mainCountryForCode' => false,
94
+ 'leadingZeroPossible' => false,
95
+ 'mobileNumberPortableRegion' => false,
96
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_DE.php ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '\\d{4,14}',
12
+ 'PossibleNumberPattern' => '\\d{2,14}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '(?:[24-6]\\d{2}|3[03-9]\\d|[789](?:[1-9]\\d|0[2-9]))\\d{1,8}',
17
+ 'PossibleNumberPattern' => '\\d{2,14}',
18
+ 'ExampleNumber' => '30123456',
19
+ ),
20
+ 'mobile' =>
21
+ array (
22
+ 'NationalNumberPattern' => '1(5\\d{9}|7\\d{8}|6[02]\\d{8}|63\\d{7})',
23
+ 'PossibleNumberPattern' => '\\d{10,11}',
24
+ ),
25
+ 'tollFree' =>
26
+ array (
27
+ 'NationalNumberPattern' => '800\\d{7}',
28
+ 'PossibleNumberPattern' => '\\d{10}',
29
+ ),
30
+ 'premiumRate' =>
31
+ array (
32
+ 'NationalNumberPattern' => '900([135]\\d{6}|9\\d{7})',
33
+ 'PossibleNumberPattern' => '\\d{10,11}',
34
+ ),
35
+ 'sharedCost' =>
36
+ array (
37
+ 'NationalNumberPattern' => 'NA',
38
+ 'PossibleNumberPattern' => 'NA',
39
+ ),
40
+ 'personalNumber' =>
41
+ array (
42
+ 'NationalNumberPattern' => 'NA',
43
+ 'PossibleNumberPattern' => 'NA',
44
+ ),
45
+ 'voip' =>
46
+ array (
47
+ 'NationalNumberPattern' => 'NA',
48
+ 'PossibleNumberPattern' => 'NA',
49
+ ),
50
+ 'pager' =>
51
+ array (
52
+ 'NationalNumberPattern' => 'NA',
53
+ 'PossibleNumberPattern' => 'NA',
54
+ ),
55
+ 'uan' =>
56
+ array (
57
+ 'NationalNumberPattern' => 'NA',
58
+ 'PossibleNumberPattern' => 'NA',
59
+ ),
60
+ 'emergency' =>
61
+ array (
62
+ 'NationalNumberPattern' => 'NA',
63
+ 'PossibleNumberPattern' => 'NA',
64
+ ),
65
+ 'voicemail' =>
66
+ array (
67
+ 'NationalNumberPattern' => 'NA',
68
+ 'PossibleNumberPattern' => 'NA',
69
+ ),
70
+ 'shortCode' =>
71
+ array (
72
+ 'NationalNumberPattern' => 'NA',
73
+ 'PossibleNumberPattern' => 'NA',
74
+ ),
75
+ 'standardRate' =>
76
+ array (
77
+ 'NationalNumberPattern' => 'NA',
78
+ 'PossibleNumberPattern' => 'NA',
79
+ ),
80
+ 'carrierSpecific' =>
81
+ array (
82
+ 'NationalNumberPattern' => 'NA',
83
+ 'PossibleNumberPattern' => 'NA',
84
+ ),
85
+ 'noInternationalDialling' =>
86
+ array (
87
+ 'NationalNumberPattern' => 'NA',
88
+ 'PossibleNumberPattern' => 'NA',
89
+ ),
90
+ 'id' => 'DE',
91
+ 'countryCode' => 49,
92
+ 'internationalPrefix' => '00',
93
+ 'nationalPrefix' => '0',
94
+ 'nationalPrefixForParsing' => '0',
95
+ 'sameMobileAndFixedLinePattern' => false,
96
+ 'numberFormat' =>
97
+ array (
98
+ 0 =>
99
+ array (
100
+ 'pattern' => '(\\d{3})(\\d{3,8})',
101
+ 'format' => '$1 $2',
102
+ 'leadingDigitsPatterns' =>
103
+ array (
104
+ 0 => '2|3[3-9]|906|[4-9][1-9]1',
105
+ ),
106
+ 'nationalPrefixFormattingRule' => '0$1',
107
+ 'domesticCarrierCodeFormattingRule' => '',
108
+ ),
109
+ 1 =>
110
+ array (
111
+ 'pattern' => '(\\d{2})(\\d{4,11})',
112
+ 'format' => '$1/$2',
113
+ 'leadingDigitsPatterns' =>
114
+ array (
115
+ 0 => '[34]0|[68]9',
116
+ ),
117
+ 'nationalPrefixFormattingRule' => '0$1',
118
+ 'domesticCarrierCodeFormattingRule' => '',
119
+ ),
120
+ 2 =>
121
+ array (
122
+ 'pattern' => '([4-9]\\d)(\\d{2})',
123
+ 'format' => '$1 $2',
124
+ 'leadingDigitsPatterns' =>
125
+ array (
126
+ 0 => '[4-9]',
127
+ 1 => '[4-6]|[7-9](?:\\d[1-9]|[1-9]\\d)',
128
+ ),
129
+ 'nationalPrefixFormattingRule' => '0$1',
130
+ 'domesticCarrierCodeFormattingRule' => '',
131
+ ),
132
+ 3 =>
133
+ array (
134
+ 'pattern' => '([4-9]\\d{3})(\\d{2,7})',
135
+ 'format' => '$1 $2',
136
+ 'leadingDigitsPatterns' =>
137
+ array (
138
+ 0 => '[4-9]',
139
+ 1 => '[4-6]|[7-9](?:\\d[1-9]|[1-9]\\d)',
140
+ ),
141
+ 'nationalPrefixFormattingRule' => '0$1',
142
+ 'domesticCarrierCodeFormattingRule' => '',
143
+ ),
144
+ 4 =>
145
+ array (
146
+ 'pattern' => '(\\d{3})(\\d{1})(\\d{6})',
147
+ 'format' => '$1 $2 $3',
148
+ 'leadingDigitsPatterns' =>
149
+ array (
150
+ 0 => '800',
151
+ ),
152
+ 'nationalPrefixFormattingRule' => '0$1',
153
+ 'domesticCarrierCodeFormattingRule' => '',
154
+ ),
155
+ 5 =>
156
+ array (
157
+ 'pattern' => '(\\d{3})(\\d{3,4})(\\d{4})',
158
+ 'format' => '$1 $2 $3',
159
+ 'leadingDigitsPatterns' =>
160
+ array (
161
+ 0 => '900',
162
+ ),
163
+ 'nationalPrefixFormattingRule' => '0$1',
164
+ 'domesticCarrierCodeFormattingRule' => '',
165
+ ),
166
+ ),
167
+ 'intlNumberFormat' =>
168
+ array (
169
+ ),
170
+ 'mainCountryForCode' => false,
171
+ 'leadingZeroPossible' => false,
172
+ 'mobileNumberPortableRegion' => false,
173
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_FR.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '3\\d{6}',
12
+ 'PossibleNumberPattern' => '\\d{7}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '3\\d{6}',
17
+ 'PossibleNumberPattern' => '\\d{7}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '3\\d{6}',
22
+ 'PossibleNumberPattern' => '\\d{7}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => 'NA',
27
+ 'PossibleNumberPattern' => 'NA',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => 'NA',
32
+ 'PossibleNumberPattern' => 'NA',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => 'NA',
37
+ 'PossibleNumberPattern' => 'NA',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'emergency' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'voicemail' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'shortCode' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'standardRate' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'carrierSpecific' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'noInternationalDialling' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'id' => 'FR',
90
+ 'countryCode' => 33,
91
+ 'internationalPrefix' => '00',
92
+ 'nationalPrefix' => '0',
93
+ 'nationalPrefixForParsing' => '0',
94
+ 'sameMobileAndFixedLinePattern' => true,
95
+ 'numberFormat' =>
96
+ array (
97
+ 0 =>
98
+ array (
99
+ 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})',
100
+ 'format' => '$1 $2 $3 $4',
101
+ 'leadingDigitsPatterns' =>
102
+ array (
103
+ 0 => '3',
104
+ ),
105
+ 'nationalPrefixFormattingRule' => '0$1',
106
+ 'domesticCarrierCodeFormattingRule' => '',
107
+ ),
108
+ ),
109
+ 'intlNumberFormat' =>
110
+ array (
111
+ ),
112
+ 'mainCountryForCode' => false,
113
+ 'leadingZeroPossible' => false,
114
+ 'mobileNumberPortableRegion' => false,
115
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_GB.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '\\d{10}',
12
+ 'PossibleNumberPattern' => '\\d{6,10}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '[1-6]\\d{9}',
17
+ 'PossibleNumberPattern' => '\\d{6,10}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '7[1-57-9]\\d{8}',
22
+ 'PossibleNumberPattern' => '\\d{10}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => '80\\d{8}',
27
+ 'PossibleNumberPattern' => '\\d{10}',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => '9[018]\\d{8}',
32
+ 'PossibleNumberPattern' => '\\d{10}',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => '8(?:4[3-5]|7[0-2])\\d{7}',
37
+ 'PossibleNumberPattern' => '\\d{10}',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => '70\\d{8}',
42
+ 'PossibleNumberPattern' => '\\d{10}',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => '56\\d{8}',
47
+ 'PossibleNumberPattern' => '\\d{10}',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => '76\\d{8}',
52
+ 'PossibleNumberPattern' => '\\d{10}',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'emergency' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'voicemail' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'shortCode' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'standardRate' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'carrierSpecific' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'noInternationalDialling' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'id' => 'GB',
90
+ 'countryCode' => 44,
91
+ 'internationalPrefix' => '00',
92
+ 'nationalPrefix' => '0',
93
+ 'nationalPrefixForParsing' => '0',
94
+ 'sameMobileAndFixedLinePattern' => false,
95
+ 'numberFormat' =>
96
+ array (
97
+ 0 =>
98
+ array (
99
+ 'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
100
+ 'format' => '$1 $2 $3',
101
+ 'leadingDigitsPatterns' =>
102
+ array (
103
+ 0 => '[1-59]|[78]0',
104
+ ),
105
+ 'nationalPrefixFormattingRule' => '(0$1)',
106
+ 'domesticCarrierCodeFormattingRule' => '',
107
+ ),
108
+ 1 =>
109
+ array (
110
+ 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})',
111
+ 'format' => '$1 $2 $3 $4',
112
+ 'leadingDigitsPatterns' =>
113
+ array (
114
+ 0 => '6',
115
+ ),
116
+ 'nationalPrefixFormattingRule' => '(0$1)',
117
+ 'domesticCarrierCodeFormattingRule' => '',
118
+ ),
119
+ 2 =>
120
+ array (
121
+ 'pattern' => '(\\d{4})(\\d{3})(\\d{3})',
122
+ 'format' => '$1 $2 $3',
123
+ 'leadingDigitsPatterns' =>
124
+ array (
125
+ 0 => '7[1-57-9]',
126
+ ),
127
+ 'nationalPrefixFormattingRule' => '(0$1)',
128
+ 'domesticCarrierCodeFormattingRule' => '',
129
+ ),
130
+ 3 =>
131
+ array (
132
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
133
+ 'format' => '$1 $2 $3',
134
+ 'leadingDigitsPatterns' =>
135
+ array (
136
+ 0 => '8[47]',
137
+ ),
138
+ 'nationalPrefixFormattingRule' => '(0$1)',
139
+ 'domesticCarrierCodeFormattingRule' => '',
140
+ ),
141
+ ),
142
+ 'intlNumberFormat' =>
143
+ array (
144
+ ),
145
+ 'mainCountryForCode' => false,
146
+ 'leadingZeroPossible' => false,
147
+ 'mobileNumberPortableRegion' => true,
148
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_GG.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ ),
12
+ 'fixedLine' =>
13
+ array (
14
+ ),
15
+ 'mobile' =>
16
+ array (
17
+ ),
18
+ 'tollFree' =>
19
+ array (
20
+ 'NationalNumberPattern' => 'NA',
21
+ 'PossibleNumberPattern' => 'NA',
22
+ ),
23
+ 'premiumRate' =>
24
+ array (
25
+ 'NationalNumberPattern' => 'NA',
26
+ 'PossibleNumberPattern' => 'NA',
27
+ ),
28
+ 'sharedCost' =>
29
+ array (
30
+ 'NationalNumberPattern' => 'NA',
31
+ 'PossibleNumberPattern' => 'NA',
32
+ ),
33
+ 'personalNumber' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'voip' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'pager' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'uan' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'emergency' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'voicemail' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'shortCode' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'standardRate' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'carrierSpecific' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'noInternationalDialling' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'id' => 'GG',
84
+ 'countryCode' => 44,
85
+ 'internationalPrefix' => '',
86
+ 'sameMobileAndFixedLinePattern' => true,
87
+ 'numberFormat' =>
88
+ array (
89
+ ),
90
+ 'intlNumberFormat' =>
91
+ array (
92
+ ),
93
+ 'mainCountryForCode' => false,
94
+ 'leadingZeroPossible' => false,
95
+ 'mobileNumberPortableRegion' => false,
96
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_HU.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '30\\d{7}',
12
+ 'PossibleNumberPattern' => '\\d{9}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '30\\d{7}',
17
+ 'PossibleNumberPattern' => '\\d{9}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '30\\d{7}',
22
+ 'PossibleNumberPattern' => '\\d{9}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => 'NA',
27
+ 'PossibleNumberPattern' => 'NA',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => 'NA',
32
+ 'PossibleNumberPattern' => 'NA',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => 'NA',
37
+ 'PossibleNumberPattern' => 'NA',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'emergency' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'voicemail' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'shortCode' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'standardRate' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'carrierSpecific' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'noInternationalDialling' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'id' => 'HU',
90
+ 'countryCode' => 36,
91
+ 'internationalPrefix' => '',
92
+ 'nationalPrefix' => '06',
93
+ 'nationalPrefixForParsing' => '06',
94
+ 'sameMobileAndFixedLinePattern' => true,
95
+ 'numberFormat' =>
96
+ array (
97
+ ),
98
+ 'intlNumberFormat' =>
99
+ array (
100
+ ),
101
+ 'mainCountryForCode' => false,
102
+ 'leadingZeroPossible' => false,
103
+ 'mobileNumberPortableRegion' => false,
104
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_IT.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[0389]\\d{5,10}',
12
+ 'PossibleNumberPattern' => '\\d{6,11}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '0\\d{9,10}',
17
+ 'PossibleNumberPattern' => '\\d{10,11}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '3\\d{8,9}',
22
+ 'PossibleNumberPattern' => '\\d{9,10}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => '80(?:0\\d{6}|3\\d{3})',
27
+ 'PossibleNumberPattern' => '\\d{6,9}',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => '89(?:2\\d{3}|9\\d{6})',
32
+ 'PossibleNumberPattern' => '\\d{6,9}',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => 'NA',
37
+ 'PossibleNumberPattern' => 'NA',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'emergency' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'voicemail' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'shortCode' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'standardRate' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'carrierSpecific' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'noInternationalDialling' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'id' => 'IT',
90
+ 'countryCode' => 39,
91
+ 'internationalPrefix' => '00',
92
+ 'sameMobileAndFixedLinePattern' => false,
93
+ 'numberFormat' =>
94
+ array (
95
+ 0 =>
96
+ array (
97
+ 'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
98
+ 'format' => '$1 $2 $3',
99
+ 'leadingDigitsPatterns' =>
100
+ array (
101
+ 0 => '0[26]',
102
+ ),
103
+ 'nationalPrefixFormattingRule' => '',
104
+ 'domesticCarrierCodeFormattingRule' => '',
105
+ ),
106
+ 1 =>
107
+ array (
108
+ 'pattern' => '(\\d{3})(\\d{4})(\\d{3,4})',
109
+ 'format' => '$1 $2 $3',
110
+ 'leadingDigitsPatterns' =>
111
+ array (
112
+ 0 => '0[13-57-9]',
113
+ ),
114
+ 'nationalPrefixFormattingRule' => '',
115
+ 'domesticCarrierCodeFormattingRule' => '',
116
+ ),
117
+ 2 =>
118
+ array (
119
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})',
120
+ 'format' => '$1 $2 $3',
121
+ 'leadingDigitsPatterns' =>
122
+ array (
123
+ 0 => '3',
124
+ ),
125
+ 'nationalPrefixFormattingRule' => '',
126
+ 'domesticCarrierCodeFormattingRule' => '',
127
+ ),
128
+ 3 =>
129
+ array (
130
+ 'pattern' => '(\\d{3})(\\d{3,6})',
131
+ 'format' => '$1 $2',
132
+ 'leadingDigitsPatterns' =>
133
+ array (
134
+ 0 => '8',
135
+ ),
136
+ 'nationalPrefixFormattingRule' => '',
137
+ 'domesticCarrierCodeFormattingRule' => '',
138
+ ),
139
+ ),
140
+ 'intlNumberFormat' =>
141
+ array (
142
+ ),
143
+ 'mainCountryForCode' => false,
144
+ 'leadingZeroPossible' => true,
145
+ 'mobileNumberPortableRegion' => false,
146
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_JP.php ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '07\\d{5}|[1-357-9]\\d{3,10}',
12
+ 'PossibleNumberPattern' => '\\d{4,11}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '07\\d{5}|[1-357-9]\\d{3,10}',
17
+ 'PossibleNumberPattern' => '\\d{4,11}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '07\\d{5}|[1-357-9]\\d{3,10}',
22
+ 'PossibleNumberPattern' => '\\d{4,11}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => '0777[01]\\d{2}',
27
+ 'PossibleNumberPattern' => '\\d{7}',
28
+ 'ExampleNumber' => '0777012',
29
+ ),
30
+ 'premiumRate' =>
31
+ array (
32
+ 'NationalNumberPattern' => 'NA',
33
+ 'PossibleNumberPattern' => 'NA',
34
+ ),
35
+ 'sharedCost' =>
36
+ array (
37
+ 'NationalNumberPattern' => 'NA',
38
+ 'PossibleNumberPattern' => 'NA',
39
+ ),
40
+ 'personalNumber' =>
41
+ array (
42
+ 'NationalNumberPattern' => 'NA',
43
+ 'PossibleNumberPattern' => 'NA',
44
+ ),
45
+ 'voip' =>
46
+ array (
47
+ 'NationalNumberPattern' => 'NA',
48
+ 'PossibleNumberPattern' => 'NA',
49
+ ),
50
+ 'pager' =>
51
+ array (
52
+ 'NationalNumberPattern' => 'NA',
53
+ 'PossibleNumberPattern' => 'NA',
54
+ ),
55
+ 'uan' =>
56
+ array (
57
+ 'NationalNumberPattern' => 'NA',
58
+ 'PossibleNumberPattern' => 'NA',
59
+ ),
60
+ 'emergency' =>
61
+ array (
62
+ 'NationalNumberPattern' => 'NA',
63
+ 'PossibleNumberPattern' => 'NA',
64
+ ),
65
+ 'voicemail' =>
66
+ array (
67
+ 'NationalNumberPattern' => 'NA',
68
+ 'PossibleNumberPattern' => 'NA',
69
+ ),
70
+ 'shortCode' =>
71
+ array (
72
+ 'NationalNumberPattern' => 'NA',
73
+ 'PossibleNumberPattern' => 'NA',
74
+ ),
75
+ 'standardRate' =>
76
+ array (
77
+ 'NationalNumberPattern' => 'NA',
78
+ 'PossibleNumberPattern' => 'NA',
79
+ ),
80
+ 'carrierSpecific' =>
81
+ array (
82
+ 'NationalNumberPattern' => 'NA',
83
+ 'PossibleNumberPattern' => 'NA',
84
+ ),
85
+ 'noInternationalDialling' =>
86
+ array (
87
+ 'NationalNumberPattern' => '[23]\\d{3}',
88
+ 'PossibleNumberPattern' => '\\d{4}',
89
+ ),
90
+ 'id' => 'JP',
91
+ 'countryCode' => 81,
92
+ 'internationalPrefix' => '010',
93
+ 'nationalPrefix' => '0',
94
+ 'nationalPrefixForParsing' => '0',
95
+ 'sameMobileAndFixedLinePattern' => true,
96
+ 'numberFormat' =>
97
+ array (
98
+ 0 =>
99
+ array (
100
+ 'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
101
+ 'format' => '$1 $2 $3',
102
+ 'leadingDigitsPatterns' =>
103
+ array (
104
+ 0 => '[57-9]0',
105
+ ),
106
+ 'nationalPrefixFormattingRule' => '0$1',
107
+ 'domesticCarrierCodeFormattingRule' => '',
108
+ ),
109
+ 1 =>
110
+ array (
111
+ 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{4})',
112
+ 'format' => '$1 $2 $3 $4',
113
+ 'leadingDigitsPatterns' =>
114
+ array (
115
+ 0 => '[57-9]0',
116
+ ),
117
+ 'nationalPrefixFormattingRule' => '0$1',
118
+ 'domesticCarrierCodeFormattingRule' => '',
119
+ ),
120
+ 2 =>
121
+ array (
122
+ 'pattern' => '(\\d{2})(\\d{3})(\\d{4})',
123
+ 'format' => '$1 $2 $3',
124
+ 'leadingDigitsPatterns' =>
125
+ array (
126
+ 0 => '111|222|333',
127
+ 1 => '(?:111|222|333)1',
128
+ 2 => '(?:111|222|333)11',
129
+ ),
130
+ 'nationalPrefixFormattingRule' => '0$1',
131
+ 'domesticCarrierCodeFormattingRule' => '',
132
+ ),
133
+ 3 =>
134
+ array (
135
+ 'pattern' => '(\\d{4})(\\d)(\\d{4})',
136
+ 'format' => '$1 $2 $3',
137
+ 'leadingDigitsPatterns' =>
138
+ array (
139
+ 0 => '222|333',
140
+ 1 => '2221|3332',
141
+ 2 => '22212|3332',
142
+ 3 => '222120|3332',
143
+ ),
144
+ 'nationalPrefixFormattingRule' => '0$1',
145
+ 'domesticCarrierCodeFormattingRule' => '',
146
+ ),
147
+ 4 =>
148
+ array (
149
+ 'pattern' => '(\\d{3})(\\d{2})(\\d{4})',
150
+ 'format' => '$1 $2 $3',
151
+ 'leadingDigitsPatterns' =>
152
+ array (
153
+ 0 => '[23]',
154
+ ),
155
+ 'nationalPrefixFormattingRule' => '0$1',
156
+ 'domesticCarrierCodeFormattingRule' => '',
157
+ ),
158
+ 5 =>
159
+ array (
160
+ 'pattern' => '(\\d{3})(\\d{4})',
161
+ 'format' => '$1-$2',
162
+ 'leadingDigitsPatterns' =>
163
+ array (
164
+ 0 => '077',
165
+ ),
166
+ 'nationalPrefixFormattingRule' => '0$1',
167
+ 'domesticCarrierCodeFormattingRule' => '',
168
+ ),
169
+ 6 =>
170
+ array (
171
+ 'pattern' => '(\\d{4})',
172
+ 'format' => '*$1',
173
+ 'leadingDigitsPatterns' =>
174
+ array (
175
+ 0 => '[23]',
176
+ ),
177
+ 'nationalPrefixFormattingRule' => '$1',
178
+ 'domesticCarrierCodeFormattingRule' => '',
179
+ ),
180
+ ),
181
+ 'intlNumberFormat' =>
182
+ array (
183
+ ),
184
+ 'mainCountryForCode' => false,
185
+ 'leadingZeroPossible' => true,
186
+ 'mobileNumberPortableRegion' => false,
187
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_KR.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[1-7]\\d{3,9}|8\\d{8}',
12
+ 'PossibleNumberPattern' => '\\d{4,10}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '(?:2|[34][1-3]|5[1-5]|6[1-4])(?:1\\d{2,3}|[2-9]\\d{6,7})',
17
+ 'PossibleNumberPattern' => '\\d{4,10}',
18
+ 'ExampleNumber' => '22123456',
19
+ ),
20
+ 'mobile' =>
21
+ array (
22
+ 'NationalNumberPattern' => '1[0-25-9]\\d{7,8}',
23
+ 'PossibleNumberPattern' => '\\d{9,10}',
24
+ 'ExampleNumber' => '1023456789',
25
+ ),
26
+ 'tollFree' =>
27
+ array (
28
+ 'NationalNumberPattern' => '80\\d{7}',
29
+ 'PossibleNumberPattern' => '\\d{9}',
30
+ 'ExampleNumber' => '801234567',
31
+ ),
32
+ 'premiumRate' =>
33
+ array (
34
+ 'NationalNumberPattern' => '60[2-9]\\d{6}',
35
+ 'PossibleNumberPattern' => '\\d{9}',
36
+ 'ExampleNumber' => '602345678',
37
+ ),
38
+ 'sharedCost' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'personalNumber' =>
44
+ array (
45
+ 'NationalNumberPattern' => '50\\d{8}',
46
+ 'PossibleNumberPattern' => '\\d{10}',
47
+ 'ExampleNumber' => '5012345678',
48
+ ),
49
+ 'voip' =>
50
+ array (
51
+ 'NationalNumberPattern' => '70\\d{8}',
52
+ 'PossibleNumberPattern' => '\\d{10}',
53
+ 'ExampleNumber' => '7012345678',
54
+ ),
55
+ 'pager' =>
56
+ array (
57
+ 'NationalNumberPattern' => 'NA',
58
+ 'PossibleNumberPattern' => 'NA',
59
+ ),
60
+ 'uan' =>
61
+ array (
62
+ 'NationalNumberPattern' => 'NA',
63
+ 'PossibleNumberPattern' => 'NA',
64
+ ),
65
+ 'emergency' =>
66
+ array (
67
+ 'NationalNumberPattern' => 'NA',
68
+ 'PossibleNumberPattern' => 'NA',
69
+ ),
70
+ 'voicemail' =>
71
+ array (
72
+ 'NationalNumberPattern' => 'NA',
73
+ 'PossibleNumberPattern' => 'NA',
74
+ ),
75
+ 'shortCode' =>
76
+ array (
77
+ 'NationalNumberPattern' => 'NA',
78
+ 'PossibleNumberPattern' => 'NA',
79
+ ),
80
+ 'standardRate' =>
81
+ array (
82
+ 'NationalNumberPattern' => 'NA',
83
+ 'PossibleNumberPattern' => 'NA',
84
+ ),
85
+ 'carrierSpecific' =>
86
+ array (
87
+ 'NationalNumberPattern' => 'NA',
88
+ 'PossibleNumberPattern' => 'NA',
89
+ ),
90
+ 'noInternationalDialling' =>
91
+ array (
92
+ 'NationalNumberPattern' => 'NA',
93
+ 'PossibleNumberPattern' => 'NA',
94
+ ),
95
+ 'id' => 'KR',
96
+ 'countryCode' => 82,
97
+ 'internationalPrefix' => '00(?:[124-68]|[37]\\d{2})',
98
+ 'nationalPrefix' => '0',
99
+ 'nationalPrefixForParsing' => '0(8[1-46-8]|85\\d{2})?',
100
+ 'sameMobileAndFixedLinePattern' => false,
101
+ 'numberFormat' =>
102
+ array (
103
+ 0 =>
104
+ array (
105
+ 'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
106
+ 'format' => '$1-$2-$3',
107
+ 'leadingDigitsPatterns' =>
108
+ array (
109
+ 0 => '1(?:0|1[19]|[69]9|5[458])|[57]0',
110
+ 1 => '1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0',
111
+ ),
112
+ 'nationalPrefixFormattingRule' => '0$1',
113
+ 'domesticCarrierCodeFormattingRule' => '',
114
+ ),
115
+ 1 =>
116
+ array (
117
+ 'pattern' => '(\\d{2})(\\d{3})(\\d{4})',
118
+ 'format' => '$1-$2-$3',
119
+ 'leadingDigitsPatterns' =>
120
+ array (
121
+ 0 => '1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-6][1-9][2-9]',
122
+ 1 => '1(?:[169][2-8]|[78]|5(?:[1-3]|4[56]))|[68]0|[3-6][1-9][2-9]',
123
+ ),
124
+ 'nationalPrefixFormattingRule' => '0$1',
125
+ 'domesticCarrierCodeFormattingRule' => '',
126
+ ),
127
+ 2 =>
128
+ array (
129
+ 'pattern' => '(\\d{3})(\\d)(\\d{4})',
130
+ 'format' => '$1-$2-$3',
131
+ 'leadingDigitsPatterns' =>
132
+ array (
133
+ 0 => '131',
134
+ 1 => '1312',
135
+ ),
136
+ 'nationalPrefixFormattingRule' => '0$1',
137
+ 'domesticCarrierCodeFormattingRule' => '',
138
+ ),
139
+ 3 =>
140
+ array (
141
+ 'pattern' => '(\\d{3})(\\d{2})(\\d{4})',
142
+ 'format' => '$1-$2-$3',
143
+ 'leadingDigitsPatterns' =>
144
+ array (
145
+ 0 => '131',
146
+ 1 => '131[13-9]',
147
+ ),
148
+ 'nationalPrefixFormattingRule' => '0$1',
149
+ 'domesticCarrierCodeFormattingRule' => '',
150
+ ),
151
+ 4 =>
152
+ array (
153
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
154
+ 'format' => '$1-$2-$3',
155
+ 'leadingDigitsPatterns' =>
156
+ array (
157
+ 0 => '13[2-9]',
158
+ ),
159
+ 'nationalPrefixFormattingRule' => '0$1',
160
+ 'domesticCarrierCodeFormattingRule' => '',
161
+ ),
162
+ 5 =>
163
+ array (
164
+ 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{4})',
165
+ 'format' => '$1-$2-$3-$4',
166
+ 'leadingDigitsPatterns' =>
167
+ array (
168
+ 0 => '30',
169
+ ),
170
+ 'nationalPrefixFormattingRule' => '0$1',
171
+ 'domesticCarrierCodeFormattingRule' => '',
172
+ ),
173
+ 6 =>
174
+ array (
175
+ 'pattern' => '(\\d)(\\d{4})(\\d{4})',
176
+ 'format' => '$1-$2-$3',
177
+ 'leadingDigitsPatterns' =>
178
+ array (
179
+ 0 => '2(?:[26]|3[0-467])',
180
+ 1 => '2(?:[26]|3(?:01|1[45]|2[17-9]|39|4|6[67]|7[078]))',
181
+ ),
182
+ 'nationalPrefixFormattingRule' => '0$1',
183
+ 'domesticCarrierCodeFormattingRule' => '',
184
+ ),
185
+ 7 =>
186
+ array (
187
+ 'pattern' => '(\\d)(\\d{3})(\\d{4})',
188
+ 'format' => '$1-$2-$3',
189
+ 'leadingDigitsPatterns' =>
190
+ array (
191
+ 0 => '2(?:3[0-35-9]|[457-9])',
192
+ 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])',
193
+ ),
194
+ 'nationalPrefixFormattingRule' => '0$1',
195
+ 'domesticCarrierCodeFormattingRule' => '',
196
+ ),
197
+ 8 =>
198
+ array (
199
+ 'pattern' => '(\\d)(\\d{3})',
200
+ 'format' => '$1-$2',
201
+ 'leadingDigitsPatterns' =>
202
+ array (
203
+ 0 => '21[0-46-9]',
204
+ 1 => '21(?:[0-247-9]|3[124]|6[1269])',
205
+ ),
206
+ 'nationalPrefixFormattingRule' => '0$1',
207
+ 'domesticCarrierCodeFormattingRule' => '',
208
+ ),
209
+ 9 =>
210
+ array (
211
+ 'pattern' => '(\\d)(\\d{4})',
212
+ 'format' => '$1-$2',
213
+ 'leadingDigitsPatterns' =>
214
+ array (
215
+ 0 => '21[36]',
216
+ 1 => '21(?:3[035-9]|6[03-578])',
217
+ ),
218
+ 'nationalPrefixFormattingRule' => '0$1',
219
+ 'domesticCarrierCodeFormattingRule' => '',
220
+ ),
221
+ 10 =>
222
+ array (
223
+ 'pattern' => '(\\d{2})(\\d{3})',
224
+ 'format' => '$1-$2',
225
+ 'leadingDigitsPatterns' =>
226
+ array (
227
+ 0 => '[3-6][1-9]1',
228
+ 1 => '[3-6][1-9]1(?:[0-46-9])',
229
+ 2 => '[3-6][1-9]1(?:[0-247-9]|3[124]|6[1269])',
230
+ ),
231
+ 'nationalPrefixFormattingRule' => '0$1',
232
+ 'domesticCarrierCodeFormattingRule' => '',
233
+ ),
234
+ 11 =>
235
+ array (
236
+ 'pattern' => '(\\d{2})(\\d{4})',
237
+ 'format' => '$1-$2',
238
+ 'leadingDigitsPatterns' =>
239
+ array (
240
+ 0 => '[3-6][1-9]1',
241
+ 1 => '[3-6][1-9]1[36]',
242
+ 2 => '[3-6][1-9]1(?:3[035-9]|6[03-578])',
243
+ ),
244
+ 'nationalPrefixFormattingRule' => '0$1',
245
+ 'domesticCarrierCodeFormattingRule' => '',
246
+ ),
247
+ ),
248
+ 'intlNumberFormat' =>
249
+ array (
250
+ ),
251
+ 'mainCountryForCode' => false,
252
+ 'leadingZeroPossible' => false,
253
+ 'mobileNumberPortableRegion' => false,
254
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_MX.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[1-9]\\d{9,10}',
12
+ 'PossibleNumberPattern' => '\\d{7,11}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '[2-9]\\d{9}',
17
+ 'PossibleNumberPattern' => '\\d{7,10}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '1\\d{10}',
22
+ 'PossibleNumberPattern' => '\\d{11}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => '800\\d{7}',
27
+ 'PossibleNumberPattern' => '\\d{10}',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => '900\\d{7}',
32
+ 'PossibleNumberPattern' => '\\d{10}',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => 'NA',
37
+ 'PossibleNumberPattern' => 'NA',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'emergency' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'voicemail' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'shortCode' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'standardRate' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'carrierSpecific' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'noInternationalDialling' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'id' => 'MX',
90
+ 'countryCode' => 52,
91
+ 'internationalPrefix' => '00',
92
+ 'nationalPrefix' => '01',
93
+ 'nationalPrefixForParsing' => '01|04[45](\\d{10})',
94
+ 'nationalPrefixTransformRule' => '1$1',
95
+ 'sameMobileAndFixedLinePattern' => false,
96
+ 'numberFormat' =>
97
+ array (
98
+ 0 =>
99
+ array (
100
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
101
+ 'format' => '$1 $2 $3',
102
+ 'leadingDigitsPatterns' =>
103
+ array (
104
+ 0 => '[89]00',
105
+ ),
106
+ 'nationalPrefixFormattingRule' => '01 $1',
107
+ 'domesticCarrierCodeFormattingRule' => '',
108
+ ),
109
+ 1 =>
110
+ array (
111
+ 'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
112
+ 'format' => '$1 $2 $3',
113
+ 'leadingDigitsPatterns' =>
114
+ array (
115
+ 0 => '33|55|81',
116
+ ),
117
+ 'nationalPrefixFormattingRule' => '01 $1',
118
+ 'domesticCarrierCodeFormattingRule' => '',
119
+ ),
120
+ 2 =>
121
+ array (
122
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
123
+ 'format' => '$1 $2 $3',
124
+ 'leadingDigitsPatterns' =>
125
+ array (
126
+ 0 => '[2467]|3[0-24-9]|5[0-46-9]|8[2-9]|9[1-9]',
127
+ ),
128
+ 'nationalPrefixFormattingRule' => '01 $1',
129
+ 'domesticCarrierCodeFormattingRule' => '',
130
+ ),
131
+ 3 =>
132
+ array (
133
+ 'pattern' => '(1)(\\d{2})(\\d{4})(\\d{4})',
134
+ 'format' => '045 $2 $3 $4',
135
+ 'leadingDigitsPatterns' =>
136
+ array (
137
+ 0 => '1(?:33|55|81)',
138
+ ),
139
+ 'nationalPrefixFormattingRule' => '$1',
140
+ 'domesticCarrierCodeFormattingRule' => '',
141
+ ),
142
+ 4 =>
143
+ array (
144
+ 'pattern' => '(1)(\\d{3})(\\d{3})(\\d{4})',
145
+ 'format' => '045 $2 $3 $4',
146
+ 'leadingDigitsPatterns' =>
147
+ array (
148
+ 0 => '1(?:[124579]|3[0-24-9]|5[0-46-9]|8[02-9])',
149
+ ),
150
+ 'nationalPrefixFormattingRule' => '$1',
151
+ 'domesticCarrierCodeFormattingRule' => '',
152
+ ),
153
+ ),
154
+ 'intlNumberFormat' =>
155
+ array (
156
+ 0 =>
157
+ array (
158
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
159
+ 'format' => '$1 $2 $3',
160
+ 'leadingDigitsPatterns' =>
161
+ array (
162
+ 0 => '[89]00',
163
+ ),
164
+ 'nationalPrefixFormattingRule' => '01 $1',
165
+ 'domesticCarrierCodeFormattingRule' => '',
166
+ ),
167
+ 1 =>
168
+ array (
169
+ 'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
170
+ 'format' => '$1 $2 $3',
171
+ 'leadingDigitsPatterns' =>
172
+ array (
173
+ 0 => '33|55|81',
174
+ ),
175
+ 'nationalPrefixFormattingRule' => '01 $1',
176
+ 'domesticCarrierCodeFormattingRule' => '',
177
+ ),
178
+ 2 =>
179
+ array (
180
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
181
+ 'format' => '$1 $2 $3',
182
+ 'leadingDigitsPatterns' =>
183
+ array (
184
+ 0 => '[2467]|3[0-24-9]|5[0-46-9]|8[2-9]|9[1-9]',
185
+ ),
186
+ 'nationalPrefixFormattingRule' => '01 $1',
187
+ 'domesticCarrierCodeFormattingRule' => '',
188
+ ),
189
+ 3 =>
190
+ array (
191
+ 'pattern' => '(1)(\\d{2})(\\d{4})(\\d{4})',
192
+ 'format' => '$1 $2 $3 $4',
193
+ 'leadingDigitsPatterns' =>
194
+ array (
195
+ 0 => '1(?:33|55|81)',
196
+ ),
197
+ ),
198
+ 4 =>
199
+ array (
200
+ 'pattern' => '(1)(\\d{3})(\\d{3})(\\d{4})',
201
+ 'format' => '$1 $2 $3 $4',
202
+ 'leadingDigitsPatterns' =>
203
+ array (
204
+ 0 => '1(?:[124579]|3[0-24-9]|5[0-46-9]|8[02-9])',
205
+ ),
206
+ ),
207
+ ),
208
+ 'mainCountryForCode' => false,
209
+ 'leadingZeroPossible' => false,
210
+ 'mobileNumberPortableRegion' => false,
211
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_NZ.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '
12
+ [289]\\d{7,9}|
13
+ [3-7]\\d{7}
14
+ ',
15
+ 'PossibleNumberPattern' => '\\d{7,10}',
16
+ ),
17
+ 'fixedLine' =>
18
+ array (
19
+ 'NationalNumberPattern' => '24099\\d{3}|(?:3[2-79]|[479][2-689]|6[235-9])\\d{6}',
20
+ 'PossibleNumberPattern' => '\\d{7,8}',
21
+ ),
22
+ 'mobile' =>
23
+ array (
24
+ '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})',
25
+ 'PossibleNumberPattern' => '\\d{8,10}',
26
+ ),
27
+ 'tollFree' =>
28
+ array (
29
+ 'NationalNumberPattern' => '800\\d{6,7}',
30
+ 'PossibleNumberPattern' => '\\d{9,10}',
31
+ ),
32
+ 'premiumRate' =>
33
+ array (
34
+ 'NationalNumberPattern' => '900\\d{6,7}',
35
+ 'PossibleNumberPattern' => '\\d{9,10}',
36
+ ),
37
+ 'sharedCost' =>
38
+ array (
39
+ 'NationalNumberPattern' => 'NA',
40
+ 'PossibleNumberPattern' => 'NA',
41
+ ),
42
+ 'personalNumber' =>
43
+ array (
44
+ 'NationalNumberPattern' => 'NA',
45
+ 'PossibleNumberPattern' => 'NA',
46
+ ),
47
+ 'voip' =>
48
+ array (
49
+ 'NationalNumberPattern' => 'NA',
50
+ 'PossibleNumberPattern' => 'NA',
51
+ ),
52
+ 'pager' =>
53
+ array (
54
+ 'NationalNumberPattern' => 'NA',
55
+ 'PossibleNumberPattern' => 'NA',
56
+ ),
57
+ 'uan' =>
58
+ array (
59
+ 'NationalNumberPattern' => 'NA',
60
+ 'PossibleNumberPattern' => 'NA',
61
+ ),
62
+ 'emergency' =>
63
+ array (
64
+ 'NationalNumberPattern' => 'NA',
65
+ 'PossibleNumberPattern' => 'NA',
66
+ ),
67
+ 'voicemail' =>
68
+ array (
69
+ 'NationalNumberPattern' => 'NA',
70
+ 'PossibleNumberPattern' => 'NA',
71
+ ),
72
+ 'shortCode' =>
73
+ array (
74
+ 'NationalNumberPattern' => 'NA',
75
+ 'PossibleNumberPattern' => 'NA',
76
+ ),
77
+ 'standardRate' =>
78
+ array (
79
+ 'NationalNumberPattern' => 'NA',
80
+ 'PossibleNumberPattern' => 'NA',
81
+ ),
82
+ 'carrierSpecific' =>
83
+ array (
84
+ 'NationalNumberPattern' => 'NA',
85
+ 'PossibleNumberPattern' => 'NA',
86
+ ),
87
+ 'noInternationalDialling' =>
88
+ array (
89
+ 'NationalNumberPattern' => 'NA',
90
+ 'PossibleNumberPattern' => 'NA',
91
+ ),
92
+ 'id' => 'NZ',
93
+ 'countryCode' => 64,
94
+ 'internationalPrefix' => '00',
95
+ 'nationalPrefix' => '0',
96
+ 'nationalPrefixForParsing' => '0',
97
+ 'sameMobileAndFixedLinePattern' => false,
98
+ 'numberFormat' =>
99
+ array (
100
+ 0 =>
101
+ array (
102
+ 'pattern' => '(\\d)(\\d{3})(\\d{4})',
103
+ 'format' => '$1-$2 $3',
104
+ 'leadingDigitsPatterns' =>
105
+ array (
106
+ 0 => '24|[34679]',
107
+ ),
108
+ 'nationalPrefixFormattingRule' => '0$1',
109
+ 'domesticCarrierCodeFormattingRule' => '',
110
+ ),
111
+ 1 =>
112
+ array (
113
+ 'pattern' => '(\\d)(\\d{3})(\\d{3,5})',
114
+ 'format' => '$1-$2 $3',
115
+ 'leadingDigitsPatterns' =>
116
+ array (
117
+ 0 => '2[179]',
118
+ ),
119
+ 'nationalPrefixFormattingRule' => '0$1',
120
+ 'domesticCarrierCodeFormattingRule' => '',
121
+ ),
122
+ 2 =>
123
+ array (
124
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})',
125
+ 'format' => '$1 $2 $3',
126
+ 'leadingDigitsPatterns' =>
127
+ array (
128
+ 0 => '[89]',
129
+ ),
130
+ 'nationalPrefixFormattingRule' => '0$1',
131
+ 'domesticCarrierCodeFormattingRule' => '',
132
+ ),
133
+ ),
134
+ 'intlNumberFormat' =>
135
+ array (
136
+ ),
137
+ 'mainCountryForCode' => false,
138
+ 'leadingZeroPossible' => false,
139
+ 'mobileNumberPortableRegion' => false,
140
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_PL.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[1-9]\\d{8}',
12
+ 'PossibleNumberPattern' => '\\d{9}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '[1-9]\\d{8}',
17
+ 'PossibleNumberPattern' => '\\d{9}',
18
+ ),
19
+ 'mobile' =>
20
+ array (
21
+ 'NationalNumberPattern' => '(?:5[01]|6[069]|7[289]|88)\\d{7}',
22
+ 'PossibleNumberPattern' => '\\d{9}',
23
+ ),
24
+ 'tollFree' =>
25
+ array (
26
+ 'NationalNumberPattern' => '800\\d{6}',
27
+ 'PossibleNumberPattern' => '\\d{9}',
28
+ ),
29
+ 'premiumRate' =>
30
+ array (
31
+ 'NationalNumberPattern' => '70\\d{7}',
32
+ 'PossibleNumberPattern' => '\\d{9}',
33
+ ),
34
+ 'sharedCost' =>
35
+ array (
36
+ 'NationalNumberPattern' => 'NA',
37
+ 'PossibleNumberPattern' => 'NA',
38
+ ),
39
+ 'personalNumber' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'voip' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'pager' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'uan' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'emergency' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'voicemail' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'shortCode' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'standardRate' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'carrierSpecific' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'noInternationalDialling' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'id' => 'PL',
90
+ 'countryCode' => 48,
91
+ 'internationalPrefix' => '00',
92
+ 'nationalPrefix' => '0',
93
+ 'nationalPrefixForParsing' => '0',
94
+ 'sameMobileAndFixedLinePattern' => false,
95
+ 'numberFormat' =>
96
+ array (
97
+ 0 =>
98
+ array (
99
+ 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})',
100
+ 'format' => '$1 $2 $3 $4',
101
+ 'leadingDigitsPatterns' =>
102
+ array (
103
+ ),
104
+ 'nationalPrefixFormattingRule' => '0$1',
105
+ 'domesticCarrierCodeFormattingRule' => '',
106
+ ),
107
+ ),
108
+ 'intlNumberFormat' =>
109
+ array (
110
+ ),
111
+ 'mainCountryForCode' => false,
112
+ 'leadingZeroPossible' => false,
113
+ 'mobileNumberPortableRegion' => false,
114
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_RE.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[268]\\d{8}',
12
+ 'PossibleNumberPattern' => '\\d{9}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '262\\d{6}',
17
+ 'PossibleNumberPattern' => '\\d{9}',
18
+ 'ExampleNumber' => '262161234',
19
+ ),
20
+ 'mobile' =>
21
+ array (
22
+ 'NationalNumberPattern' => '6(?:9[23]|47)\\d{6}',
23
+ 'PossibleNumberPattern' => '\\d{9}',
24
+ 'ExampleNumber' => '692123456',
25
+ ),
26
+ 'tollFree' =>
27
+ array (
28
+ 'NationalNumberPattern' => '80\\d{7}',
29
+ 'PossibleNumberPattern' => '\\d{9}',
30
+ 'ExampleNumber' => '801234567',
31
+ ),
32
+ 'premiumRate' =>
33
+ array (
34
+ 'NationalNumberPattern' => '8(?:1[01]|2[0156]|84|9[0-37-9])\\d{6}',
35
+ 'PossibleNumberPattern' => '\\d{9}',
36
+ 'ExampleNumber' => '810123456',
37
+ ),
38
+ 'sharedCost' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'personalNumber' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'voip' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'pager' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'uan' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'emergency' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'voicemail' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'shortCode' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'standardRate' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'carrierSpecific' =>
84
+ array (
85
+ 'NationalNumberPattern' => 'NA',
86
+ 'PossibleNumberPattern' => 'NA',
87
+ ),
88
+ 'noInternationalDialling' =>
89
+ array (
90
+ 'NationalNumberPattern' => 'NA',
91
+ 'PossibleNumberPattern' => 'NA',
92
+ ),
93
+ 'id' => 'RE',
94
+ 'countryCode' => 262,
95
+ 'internationalPrefix' => '00',
96
+ 'nationalPrefix' => '0',
97
+ 'nationalPrefixForParsing' => '0',
98
+ 'sameMobileAndFixedLinePattern' => false,
99
+ 'numberFormat' =>
100
+ array (
101
+ 0 =>
102
+ array (
103
+ 'pattern' => '([268]\\d{2})(\\d{2})(\\d{2})(\\d{2})',
104
+ 'format' => '$1 $2 $3 $4',
105
+ 'leadingDigitsPatterns' =>
106
+ array (
107
+ ),
108
+ 'nationalPrefixFormattingRule' => '0$1',
109
+ 'domesticCarrierCodeFormattingRule' => '',
110
+ ),
111
+ ),
112
+ 'intlNumberFormat' =>
113
+ array (
114
+ ),
115
+ 'mainCountryForCode' => false,
116
+ 'leadingDigits' => '262|6(?:9[23]|47)|8',
117
+ 'leadingZeroPossible' => false,
118
+ 'mobileNumberPortableRegion' => false,
119
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_SE.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ ),
12
+ 'fixedLine' =>
13
+ array (
14
+ ),
15
+ 'mobile' =>
16
+ array (
17
+ ),
18
+ 'tollFree' =>
19
+ array (
20
+ 'NationalNumberPattern' => 'NA',
21
+ 'PossibleNumberPattern' => 'NA',
22
+ ),
23
+ 'premiumRate' =>
24
+ array (
25
+ 'NationalNumberPattern' => 'NA',
26
+ 'PossibleNumberPattern' => 'NA',
27
+ ),
28
+ 'sharedCost' =>
29
+ array (
30
+ 'NationalNumberPattern' => 'NA',
31
+ 'PossibleNumberPattern' => 'NA',
32
+ ),
33
+ 'personalNumber' =>
34
+ array (
35
+ 'NationalNumberPattern' => 'NA',
36
+ 'PossibleNumberPattern' => 'NA',
37
+ ),
38
+ 'voip' =>
39
+ array (
40
+ 'NationalNumberPattern' => 'NA',
41
+ 'PossibleNumberPattern' => 'NA',
42
+ ),
43
+ 'pager' =>
44
+ array (
45
+ 'NationalNumberPattern' => 'NA',
46
+ 'PossibleNumberPattern' => 'NA',
47
+ ),
48
+ 'uan' =>
49
+ array (
50
+ 'NationalNumberPattern' => 'NA',
51
+ 'PossibleNumberPattern' => 'NA',
52
+ ),
53
+ 'emergency' =>
54
+ array (
55
+ 'NationalNumberPattern' => 'NA',
56
+ 'PossibleNumberPattern' => 'NA',
57
+ ),
58
+ 'voicemail' =>
59
+ array (
60
+ 'NationalNumberPattern' => 'NA',
61
+ 'PossibleNumberPattern' => 'NA',
62
+ ),
63
+ 'shortCode' =>
64
+ array (
65
+ 'NationalNumberPattern' => 'NA',
66
+ 'PossibleNumberPattern' => 'NA',
67
+ ),
68
+ 'standardRate' =>
69
+ array (
70
+ 'NationalNumberPattern' => 'NA',
71
+ 'PossibleNumberPattern' => 'NA',
72
+ ),
73
+ 'carrierSpecific' =>
74
+ array (
75
+ 'NationalNumberPattern' => 'NA',
76
+ 'PossibleNumberPattern' => 'NA',
77
+ ),
78
+ 'noInternationalDialling' =>
79
+ array (
80
+ 'NationalNumberPattern' => 'NA',
81
+ 'PossibleNumberPattern' => 'NA',
82
+ ),
83
+ 'id' => 'SE',
84
+ 'countryCode' => 46,
85
+ 'internationalPrefix' => '00',
86
+ 'sameMobileAndFixedLinePattern' => true,
87
+ 'numberFormat' =>
88
+ array (
89
+ ),
90
+ 'intlNumberFormat' =>
91
+ array (
92
+ ),
93
+ 'mainCountryForCode' => false,
94
+ 'leadingZeroPossible' => false,
95
+ 'mobileNumberPortableRegion' => false,
96
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_SG.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[13689]\\d{7,10}',
12
+ 'PossibleNumberPattern' => '
13
+ \\d{8}|
14
+ \\d{10,11}
15
+ ',
16
+ ),
17
+ 'fixedLine' =>
18
+ array (
19
+ 'NationalNumberPattern' => '[36]\\d{7}',
20
+ 'PossibleNumberPattern' => '\\d{8}',
21
+ ),
22
+ 'mobile' =>
23
+ array (
24
+ 'NationalNumberPattern' => '[89]\\d{7}',
25
+ 'PossibleNumberPattern' => '\\d{8}',
26
+ ),
27
+ 'tollFree' =>
28
+ array (
29
+ 'NationalNumberPattern' => '1?800\\d{7}',
30
+ 'PossibleNumberPattern' => '\\d{10,11}',
31
+ ),
32
+ 'premiumRate' =>
33
+ array (
34
+ 'NationalNumberPattern' => '1900\\d{7}',
35
+ 'PossibleNumberPattern' => '\\d{11}',
36
+ ),
37
+ 'sharedCost' =>
38
+ array (
39
+ 'NationalNumberPattern' => 'NA',
40
+ 'PossibleNumberPattern' => 'NA',
41
+ ),
42
+ 'personalNumber' =>
43
+ array (
44
+ 'NationalNumberPattern' => 'NA',
45
+ 'PossibleNumberPattern' => 'NA',
46
+ ),
47
+ 'voip' =>
48
+ array (
49
+ 'NationalNumberPattern' => 'NA',
50
+ 'PossibleNumberPattern' => 'NA',
51
+ ),
52
+ 'pager' =>
53
+ array (
54
+ 'NationalNumberPattern' => 'NA',
55
+ 'PossibleNumberPattern' => 'NA',
56
+ ),
57
+ 'uan' =>
58
+ array (
59
+ 'NationalNumberPattern' => 'NA',
60
+ 'PossibleNumberPattern' => 'NA',
61
+ ),
62
+ 'emergency' =>
63
+ array (
64
+ 'NationalNumberPattern' => 'NA',
65
+ 'PossibleNumberPattern' => 'NA',
66
+ ),
67
+ 'voicemail' =>
68
+ array (
69
+ 'NationalNumberPattern' => 'NA',
70
+ 'PossibleNumberPattern' => 'NA',
71
+ ),
72
+ 'shortCode' =>
73
+ array (
74
+ 'NationalNumberPattern' => 'NA',
75
+ 'PossibleNumberPattern' => 'NA',
76
+ ),
77
+ 'standardRate' =>
78
+ array (
79
+ 'NationalNumberPattern' => 'NA',
80
+ 'PossibleNumberPattern' => 'NA',
81
+ ),
82
+ 'carrierSpecific' =>
83
+ array (
84
+ 'NationalNumberPattern' => 'NA',
85
+ 'PossibleNumberPattern' => 'NA',
86
+ ),
87
+ 'noInternationalDialling' =>
88
+ array (
89
+ 'NationalNumberPattern' => 'NA',
90
+ 'PossibleNumberPattern' => 'NA',
91
+ ),
92
+ 'id' => 'SG',
93
+ 'countryCode' => 65,
94
+ 'internationalPrefix' => '0[0-3][0-9]',
95
+ 'nationalPrefixForParsing' => '777777',
96
+ 'sameMobileAndFixedLinePattern' => false,
97
+ 'numberFormat' =>
98
+ array (
99
+ 0 =>
100
+ array (
101
+ 'pattern' => '(\\d{4})(\\d{4})',
102
+ 'format' => '$1 $2',
103
+ 'leadingDigitsPatterns' =>
104
+ array (
105
+ 0 => '[369]|8[1-9]',
106
+ ),
107
+ 'nationalPrefixFormattingRule' => '',
108
+ 'domesticCarrierCodeFormattingRule' => '',
109
+ ),
110
+ 1 =>
111
+ array (
112
+ 'pattern' => '(\\d{4})(\\d{3})(\\d{4})',
113
+ 'format' => '$1 $2 $3',
114
+ 'leadingDigitsPatterns' =>
115
+ array (
116
+ 0 => '1[89]',
117
+ ),
118
+ 'nationalPrefixFormattingRule' => '',
119
+ 'domesticCarrierCodeFormattingRule' => '',
120
+ ),
121
+ 2 =>
122
+ array (
123
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
124
+ 'format' => '$1 $2 $3',
125
+ 'leadingDigitsPatterns' =>
126
+ array (
127
+ 0 => '800',
128
+ ),
129
+ 'nationalPrefixFormattingRule' => '',
130
+ 'domesticCarrierCodeFormattingRule' => '',
131
+ ),
132
+ ),
133
+ 'intlNumberFormat' =>
134
+ array (
135
+ ),
136
+ 'mainCountryForCode' => false,
137
+ 'leadingZeroPossible' => false,
138
+ 'mobileNumberPortableRegion' => false,
139
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_US.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[13-689]\\d{9}|2[0-35-9]\\d{8}',
12
+ 'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?',
13
+ 'ExampleNumber' => '1234567890',
14
+ ),
15
+ 'fixedLine' =>
16
+ array (
17
+ 'NationalNumberPattern' => '[13-689]\\d{9}|2[0-35-9]\\d{8}',
18
+ 'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?',
19
+ 'ExampleNumber' => '1234567890',
20
+ ),
21
+ 'mobile' =>
22
+ array (
23
+ 'NationalNumberPattern' => '[13-689]\\d{9}|2[0-35-9]\\d{8}',
24
+ 'PossibleNumberPattern' => '\\d{7}(?:\\d{3})?',
25
+ 'ExampleNumber' => '1234567890',
26
+ ),
27
+ 'tollFree' =>
28
+ array (
29
+ 'NationalNumberPattern' => '8(?:00|66|77|88)\\d{7}',
30
+ 'PossibleNumberPattern' => '\\d{10}',
31
+ 'ExampleNumber' => '1234567890',
32
+ ),
33
+ 'premiumRate' =>
34
+ array (
35
+ 'NationalNumberPattern' => '900\\d{7}',
36
+ 'PossibleNumberPattern' => '\\d{10}',
37
+ 'ExampleNumber' => '1234567890',
38
+ ),
39
+ 'sharedCost' =>
40
+ array (
41
+ 'NationalNumberPattern' => 'NA',
42
+ 'PossibleNumberPattern' => 'NA',
43
+ ),
44
+ 'personalNumber' =>
45
+ array (
46
+ 'NationalNumberPattern' => 'NA',
47
+ 'PossibleNumberPattern' => 'NA',
48
+ ),
49
+ 'voip' =>
50
+ array (
51
+ 'NationalNumberPattern' => 'NA',
52
+ 'PossibleNumberPattern' => 'NA',
53
+ ),
54
+ 'pager' =>
55
+ array (
56
+ 'NationalNumberPattern' => 'NA',
57
+ 'PossibleNumberPattern' => 'NA',
58
+ ),
59
+ 'uan' =>
60
+ array (
61
+ 'NationalNumberPattern' => 'NA',
62
+ 'PossibleNumberPattern' => 'NA',
63
+ ),
64
+ 'emergency' =>
65
+ array (
66
+ 'NationalNumberPattern' => 'NA',
67
+ 'PossibleNumberPattern' => 'NA',
68
+ ),
69
+ 'voicemail' =>
70
+ array (
71
+ 'NationalNumberPattern' => 'NA',
72
+ 'PossibleNumberPattern' => 'NA',
73
+ ),
74
+ 'shortCode' =>
75
+ array (
76
+ 'NationalNumberPattern' => 'NA',
77
+ 'PossibleNumberPattern' => 'NA',
78
+ ),
79
+ 'standardRate' =>
80
+ array (
81
+ 'NationalNumberPattern' => 'NA',
82
+ 'PossibleNumberPattern' => 'NA',
83
+ ),
84
+ 'carrierSpecific' =>
85
+ array (
86
+ 'NationalNumberPattern' => 'NA',
87
+ 'PossibleNumberPattern' => 'NA',
88
+ ),
89
+ 'noInternationalDialling' =>
90
+ array (
91
+ 'NationalNumberPattern' => '800\\d{7}',
92
+ 'PossibleNumberPattern' => '\\d{10}',
93
+ 'ExampleNumber' => '1234567890',
94
+ ),
95
+ 'id' => 'US',
96
+ 'countryCode' => 1,
97
+ 'internationalPrefix' => '011',
98
+ 'nationalPrefix' => '1',
99
+ 'preferredExtnPrefix' => ' extn. ',
100
+ 'nationalPrefixForParsing' => '1',
101
+ 'sameMobileAndFixedLinePattern' => true,
102
+ 'numberFormat' =>
103
+ array (
104
+ 0 =>
105
+ array (
106
+ 'pattern' => '(\\d{3})(\\d{4})',
107
+ 'format' => '$1 $2',
108
+ 'leadingDigitsPatterns' =>
109
+ array (
110
+ ),
111
+ 'nationalPrefixFormattingRule' => '',
112
+ 'domesticCarrierCodeFormattingRule' => '',
113
+ ),
114
+ 1 =>
115
+ array (
116
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
117
+ 'format' => '$1 $2 $3',
118
+ 'leadingDigitsPatterns' =>
119
+ array (
120
+ ),
121
+ 'nationalPrefixFormattingRule' => '',
122
+ 'domesticCarrierCodeFormattingRule' => '',
123
+ ),
124
+ ),
125
+ 'intlNumberFormat' =>
126
+ array (
127
+ 0 =>
128
+ array (
129
+ 'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
130
+ 'format' => '$1 $2 $3',
131
+ 'leadingDigitsPatterns' =>
132
+ array (
133
+ ),
134
+ 'nationalPrefixFormattingRule' => '',
135
+ 'domesticCarrierCodeFormattingRule' => '',
136
+ ),
137
+ ),
138
+ 'mainCountryForCode' => true,
139
+ 'leadingZeroPossible' => false,
140
+ 'mobileNumberPortableRegion' => true,
141
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/core/data/PhoneNumberMetadataForTesting_YT.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ return array (
9
+ 'generalDesc' =>
10
+ array (
11
+ 'NationalNumberPattern' => '[268]\\d{8}',
12
+ 'PossibleNumberPattern' => '\\d{9}',
13
+ ),
14
+ 'fixedLine' =>
15
+ array (
16
+ 'NationalNumberPattern' => '2696[0-4]\\d{4}',
17
+ 'PossibleNumberPattern' => '\\d{9}',
18
+ 'ExampleNumber' => '269601234',
19
+ ),
20
+ 'mobile' =>
21
+ array (
22
+ 'NationalNumberPattern' => '639\\d{6}',
23
+ 'PossibleNumberPattern' => '\\d{9}',
24
+ 'ExampleNumber' => '639123456',
25
+ ),
26
+ 'tollFree' =>
27
+ array (
28
+ 'NationalNumberPattern' => '80\\d{7}',
29
+ 'PossibleNumberPattern' => '\\d{9}',
30
+ 'ExampleNumber' => '801234567',
31
+ ),
32
+ 'premiumRate' =>
33
+ array (
34
+ 'NationalNumberPattern' => 'NA',
35
+ 'PossibleNumberPattern' => 'NA',
36
+ ),
37
+ 'sharedCost' =>
38
+ array (
39
+ 'NationalNumberPattern' => 'NA',
40
+ 'PossibleNumberPattern' => 'NA',
41
+ ),
42
+ 'personalNumber' =>
43
+ array (
44
+ 'NationalNumberPattern' => 'NA',
45
+ 'PossibleNumberPattern' => 'NA',
46
+ ),
47
+ 'voip' =>
48
+ array (
49
+ 'NationalNumberPattern' => 'NA',
50
+ 'PossibleNumberPattern' => 'NA',
51
+ ),
52
+ 'pager' =>
53
+ array (
54
+ 'NationalNumberPattern' => 'NA',
55
+ 'PossibleNumberPattern' => 'NA',
56
+ ),
57
+ 'uan' =>
58
+ array (
59
+ 'NationalNumberPattern' => 'NA',
60
+ 'PossibleNumberPattern' => 'NA',
61
+ ),
62
+ 'emergency' =>
63
+ array (
64
+ 'NationalNumberPattern' => 'NA',
65
+ 'PossibleNumberPattern' => 'NA',
66
+ ),
67
+ 'voicemail' =>
68
+ array (
69
+ 'NationalNumberPattern' => 'NA',
70
+ 'PossibleNumberPattern' => 'NA',
71
+ ),
72
+ 'shortCode' =>
73
+ array (
74
+ 'NationalNumberPattern' => 'NA',
75
+ 'PossibleNumberPattern' => 'NA',
76
+ ),
77
+ 'standardRate' =>
78
+ array (
79
+ 'NationalNumberPattern' => 'NA',
80
+ 'PossibleNumberPattern' => 'NA',
81
+ ),
82
+ 'carrierSpecific' =>
83
+ array (
84
+ 'NationalNumberPattern' => 'NA',
85
+ 'PossibleNumberPattern' => 'NA',
86
+ ),
87
+ 'noInternationalDialling' =>
88
+ array (
89
+ 'NationalNumberPattern' => 'NA',
90
+ 'PossibleNumberPattern' => 'NA',
91
+ ),
92
+ 'id' => 'YT',
93
+ 'countryCode' => 262,
94
+ 'internationalPrefix' => '00',
95
+ 'nationalPrefix' => '0',
96
+ 'nationalPrefixForParsing' => '0',
97
+ 'sameMobileAndFixedLinePattern' => false,
98
+ 'numberFormat' =>
99
+ array (
100
+ ),
101
+ 'intlNumberFormat' =>
102
+ array (
103
+ ),
104
+ 'mainCountryForCode' => false,
105
+ 'leadingDigits' => '269|639',
106
+ 'leadingZeroPossible' => false,
107
+ 'mobileNumberPortableRegion' => false,
108
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/geocoding/PhoneNumberOfflineGeocoderTest.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\geocoding;
4
+
5
+ use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
6
+ use libphonenumber\PhoneNumber;
7
+
8
+
9
+ class PhoneNumberOfflineGeocoderTest extends \PHPUnit_Framework_TestCase
10
+ {
11
+ const TEST_META_DATA_FILE_PREFIX = "/../../../Tests/libphonenumber/Tests/prefixmapper/data/";
12
+ private static $KO_Number1;
13
+ private static $KO_Number2;
14
+ private static $KO_Number3;
15
+ private static $KO_InvalidNumber;
16
+ private static $US_Number1;
17
+ private static $US_Number2;
18
+ private static $US_Number3;
19
+ private static $US_Number4;
20
+ private static $US_InvalidNumber;
21
+ private static $NANPA_TollFree;
22
+ private static $BS_Number1;
23
+ private static $AU_Number;
24
+ private static $AR_MobileNumber;
25
+ private static $numberWithInvalidCountryCode;
26
+ private static $internationalTollFree;
27
+ /**
28
+ * @var PhoneNumberOfflineGeocoder
29
+ */
30
+ protected $geocoder;
31
+
32
+ public static function setUpBeforeClass()
33
+ {
34
+ self::$KO_Number1 = new PhoneNumber();
35
+ self::$KO_Number1->setCountryCode(82)->setNationalNumber(22123456);
36
+
37
+ self::$KO_Number2 = new PhoneNumber();
38
+ self::$KO_Number2->setCountryCode(82)->setNationalNumber(322123456);
39
+
40
+ self::$KO_Number3 = new PhoneNumber();
41
+ self::$KO_Number3->setCountryCode(82)->setNationalNumber(6421234567);
42
+
43
+ self::$KO_InvalidNumber = new PhoneNumber();
44
+ self::$KO_InvalidNumber->setCountryCode(82)->setNationalNumber(1234);
45
+
46
+ self::$US_Number1 = new PhoneNumber();
47
+ self::$US_Number1->setCountryCode(1)->setNationalNumber(6502530000);
48
+
49
+ self::$US_Number2 = new PhoneNumber();
50
+ self::$US_Number2->setCountryCode(1)->setNationalNumber(6509600000);
51
+
52
+ self::$US_Number3 = new PhoneNumber();
53
+ self::$US_Number3->setCountryCode(1)->setNationalNumber(2128120000);
54
+
55
+ self::$US_Number4 = new PhoneNumber();
56
+ self::$US_Number4->setCountryCode(1)->setNationalNumber(6174240000);
57
+
58
+ self::$US_InvalidNumber = new PhoneNumber();
59
+ self::$US_InvalidNumber->setCountryCode(1)->setNationalNumber(123456789);
60
+
61
+ self::$NANPA_TollFree = new PhoneNumber();
62
+ self::$NANPA_TollFree->setCountryCode(1)->setNationalNumber(8002431234);
63
+
64
+ self::$BS_Number1 = new PhoneNumber();
65
+ self::$BS_Number1->setCountryCode(1)->setNationalNumber(2423651234);
66
+
67
+ self::$AU_Number = new PhoneNumber();
68
+ self::$AU_Number->setCountryCode(61)->setNationalNumber(236618300);
69
+
70
+ self::$AR_MobileNumber = new PhoneNumber();
71
+ self::$AR_MobileNumber->setCountryCode(54)->setNationalNumber(92214000000);
72
+
73
+ self::$numberWithInvalidCountryCode = new PhoneNumber();
74
+ self::$numberWithInvalidCountryCode->setCountryCode(999)->setNationalNumber(2423651234);
75
+
76
+ self::$internationalTollFree = new PhoneNumber();
77
+ self::$internationalTollFree->setCountryCode(800)->setNationalNumber(12345678);
78
+
79
+ }
80
+
81
+ public function setUp()
82
+ {
83
+ if(!extension_loaded('intl')) {
84
+ $this->markTestSkipped('The intl extension must be installed');
85
+ }
86
+
87
+ PhoneNumberOfflineGeocoder::resetInstance();
88
+ $this->geocoder = PhoneNumberOfflineGeocoder::getInstance(self::TEST_META_DATA_FILE_PREFIX);
89
+ }
90
+
91
+ public function testGetDescriptionForNumberWithNoDataFile()
92
+ {
93
+ // No data file containing mappings for US numbers is available in Chinese for the unittests. As
94
+ // a result, the country name of United States in simplified Chinese is returned.
95
+
96
+ $this->assertEquals(
97
+ pack('H*', 'e7be8e') . pack('H*', 'e59bbd'),
98
+ $this->geocoder->getDescriptionForNumber(self::$US_Number1, "zh_CN")
99
+ );
100
+ $this->assertEquals("Bahamas", $this->geocoder->getDescriptionForNumber(self::$BS_Number1, "en_US"));
101
+ $this->assertEquals("Australia", $this->geocoder->getDescriptionForNumber(self::$AU_Number, "en_US"));
102
+ $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$numberWithInvalidCountryCode, "en_US"));
103
+ $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$internationalTollFree, "en_US"));
104
+ }
105
+
106
+ public function testGetDescriptionForNumberWithMissingPrefix()
107
+ {
108
+ // Test that the name of the country is returned when the number passed in is valid but not
109
+ // covered by the geocoding data file.
110
+
111
+ $this->assertEquals("United States", $this->geocoder->getDescriptionForNumber(self::$US_Number4, "en_US"));
112
+ }
113
+
114
+ public function testGetDescriptionForNumberBelongingToMultipleCountriesIsEmpty()
115
+ {
116
+ // Test that nothing is returned when the number passed in is valid but not
117
+ // covered by the geocoding data file and belongs to multiple countries
118
+ $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$NANPA_TollFree, 'en_US'));
119
+ }
120
+
121
+ public function testGetDescriptionForNumber_en_US()
122
+ {
123
+ $ca = $this->geocoder->getDescriptionForNumber(self::$US_Number1, "en_US");
124
+ $this->assertEquals("CA", $ca);
125
+ $this->assertEquals("Mountain View, CA", $this->geocoder->getDescriptionForNumber(self::$US_Number2, "en_US"));
126
+ $this->assertEquals("New York, NY", $this->geocoder->getDescriptionForNumber(self::$US_Number3, "en_US"));
127
+ }
128
+
129
+ public function testGetDescriptionForKoreanNumber()
130
+ {
131
+ $this->assertEquals("Seoul", $this->geocoder->getDescriptionForNumber(self::$KO_Number1, "en"));
132
+ $this->assertEquals("Incheon", $this->geocoder->getDescriptionForNumber(self::$KO_Number2, "en"));
133
+ $this->assertEquals("Jeju", $this->geocoder->getDescriptionForNumber(self::$KO_Number3, "en"));
134
+
135
+ $this->assertEquals(
136
+ pack('H*', 'ec849c') . pack('H*', 'ec9ab8'),
137
+ $this->geocoder->getDescriptionForNumber(self::$KO_Number1, "ko")
138
+ );
139
+ $this->assertEquals(
140
+ pack('H*', 'ec9db8') . pack('H*', 'ecb29c'),
141
+ $this->geocoder->getDescriptionForNumber(self::$KO_Number2, "ko")
142
+ );
143
+ }
144
+
145
+ public function testGetDescriptionForArgentinianMobileNumber()
146
+ {
147
+ $this->assertEquals("La Plata", $this->geocoder->getDescriptionForNumber(self::$AR_MobileNumber, "en"));
148
+ }
149
+
150
+ public function testGetDescriptionForFallBack()
151
+ {
152
+ // No fallback, as the location name for the given phone number is available in the requested
153
+ // language.
154
+
155
+ $this->assertEquals("Kalifornien", $this->geocoder->getDescriptionForNumber(self::$US_Number1, "de"));
156
+
157
+ // German falls back to English.
158
+ $this->assertEquals("New York, NY", $this->geocoder->getDescriptionForNumber(self::$US_Number3, "de"));
159
+
160
+ // Italian fals back to English.
161
+ $this->assertEquals("CA", $this->geocoder->getDescriptionForNumber(self::$US_Number1, "it"));
162
+
163
+ // Korean doesn't fall back to English. -
164
+ $this->assertEquals(
165
+ pack('H*', 'eb8c80') . pack('H*', 'ed959c') . pack('H*', 'ebafbc') . pack('H*', 'eab5ad'),
166
+ $this->geocoder->getDescriptionForNumber(self::$KO_Number3, "ko")
167
+ );
168
+ }
169
+
170
+ public function testGetDescriptionForNumberWithUserRegion()
171
+ {
172
+ // User in Italy, American number. We should just show United States, in Spanish, and not more
173
+ // detailed information.
174
+ $this->assertEquals(
175
+ "Estados Unidos",
176
+ $this->geocoder->getDescriptionForNumber(self::$US_Number1, "es_ES", "IT")
177
+ );
178
+
179
+ // Unknown region - should just show country name.
180
+ $this->assertEquals(
181
+ "Estados Unidos",
182
+ $this->geocoder->getDescriptionForNumber(self::$US_Number1, "es_ES", "ZZ")
183
+ );
184
+
185
+ // User in the States, language German, should show detailed data.
186
+ $this->assertEquals("Kalifornien", $this->geocoder->getDescriptionForNumber(self::$US_Number1, "de", "US"));
187
+
188
+ // User in the States, language French, no data for French, so we fallback to English detailed
189
+ // data.
190
+ $this->assertEquals("CA", $this->geocoder->getDescriptionForNumber(self::$US_Number1, "fr", "US"));
191
+
192
+ // Invalid number - return an empty string.
193
+ $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$US_InvalidNumber, "en", "US"));
194
+ }
195
+
196
+ public function testGetDescriptionForInvalidNumber()
197
+ {
198
+ $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$KO_InvalidNumber, "en"));
199
+ $this->assertEquals("", $this->geocoder->getDescriptionForNumber(self::$US_InvalidNumber, "en"));
200
+ }
201
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/PrefixFileReaderTest.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\prefixmapper;
4
+
5
+ use libphonenumber\PhoneNumber;
6
+ use libphonenumber\prefixmapper\PrefixFileReader;
7
+
8
+
9
+ class PrefixFileReaderTest extends \PHPUnit_Framework_TestCase
10
+ {
11
+ const TEST_META_DATA_FILE_PREFIX = "/data/";
12
+ private static $KO_NUMBER;
13
+ private static $US_NUMBER1;
14
+ private static $US_NUMBER2;
15
+ private static $US_NUMBER3;
16
+ private static $SE_NUMBER;
17
+ /**
18
+ * @var PrefixFileReader
19
+ */
20
+ protected $reader;
21
+
22
+ public static function setUpBeforeClass()
23
+ {
24
+ self::$KO_NUMBER = new PhoneNumber();
25
+ self::$KO_NUMBER->setCountryCode(82)->setNationalNumber(22123456);
26
+
27
+ self::$US_NUMBER1 = new PhoneNumber();
28
+ self::$US_NUMBER1->setCountryCode(1)->setNationalNumber(6502530000);
29
+
30
+ self::$US_NUMBER2 = new PhoneNumber();
31
+ self::$US_NUMBER2->setCountryCode(1)->setNationalNumber(2128120000);
32
+
33
+ self::$US_NUMBER3 = new PhoneNumber();
34
+ self::$US_NUMBER3->setCountryCode(1)->setNationalNumber(6174240000);
35
+
36
+ self::$SE_NUMBER = new PhoneNumber();
37
+ self::$SE_NUMBER->setCountryCode(46)->setNationalNumber(81234567);
38
+ }
39
+
40
+ public function setUp()
41
+ {
42
+ $this->reader = new PrefixFileReader(__DIR__ . DIRECTORY_SEPARATOR . self::TEST_META_DATA_FILE_PREFIX);
43
+ }
44
+
45
+ public function testGetDescriptionForNumberWithMapping()
46
+ {
47
+ $this->assertEquals("Kalifornien", $this->reader->getDescriptionForNumber(self::$US_NUMBER1, "de", "", "CH"));
48
+ $this->assertEquals("CA", $this->reader->getDescriptionForNumber(self::$US_NUMBER1, "en", "", "AU"));
49
+ $this->assertEquals(
50
+ pack('H*', 'ec849c') . pack('H*', 'ec9ab8'),
51
+ $this->reader->getDescriptionForNumber(self::$KO_NUMBER, "ko", "", "")
52
+ );
53
+ $this->assertEquals("Seoul", $this->reader->getDescriptionForNumber(self::$KO_NUMBER, "en", "", ""));
54
+ }
55
+
56
+ public function testGetDescriptionForNumberWithMissingMapping()
57
+ {
58
+ $this->assertEquals("", $this->reader->getDescriptionForNumber(self::$US_NUMBER3, "en", "", ""));
59
+ }
60
+
61
+ public function testGetDescriptionUsingFallbackLanguage()
62
+ {
63
+ // Mapping file exists but the number isn't present, causing it to fallback.
64
+ $this->assertEquals("New York, NY", $this->reader->getDescriptionForNumber(self::$US_NUMBER2, "de", "", "CH"));
65
+ // No mapping file exists, causing it to fallback.
66
+ $this->assertEquals("New York, NY", $this->reader->getDescriptionForNumber(self::$US_NUMBER2, "sv", "", ""));
67
+ }
68
+
69
+ public function testGetDescriptionForNonFallbackLanguage()
70
+ {
71
+ $this->assertEquals("", $this->reader->getDescriptionForNumber(self::$US_NUMBER2, "ko", "", ""));
72
+ }
73
+
74
+ public function testGetDescriptionForNumberWithoutMappingFile()
75
+ {
76
+ $this->assertEquals("", $this->reader->getDescriptionForNumber(self::$SE_NUMBER, "sv", "", ""));
77
+ $this->assertEquals("", $this->reader->getDescriptionForNumber(self::$SE_NUMBER, "en", "", ""));
78
+ }
79
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/Map.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 'de' =>
9
+ array (
10
+ 0 => 1201,
11
+ 1 => 1650,
12
+ ),
13
+ 'en' =>
14
+ array (
15
+ 0 => 1201,
16
+ 1 => 1212,
17
+ 2 => 1617,
18
+ 3 => 1650,
19
+ 4 => 1989,
20
+ 5 => 54,
21
+ 6 => 82,
22
+ ),
23
+ 'ko' =>
24
+ array (
25
+ 0 => 82,
26
+ ),
27
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/de/1201.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1201 => 'New Jersey',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/de/1650.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1650 => 'Kalifornien',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1201.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1201 => 'NJ',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1212.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1212 => 'NY',
9
+ 1212812 => 'New York, NY',
10
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1617.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1617423 => 'Boston, MA',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1650.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1650 => 'CA',
9
+ 1650960 => 'Mountain View, CA',
10
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/1989.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1989 => 'MA',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/54.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 542214 => 'La Plata',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/en/82.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 822 => 'Seoul',
9
+ 8231 => 'Gyeonggi',
10
+ 8232 => 'Incheon',
11
+ 8233 => 'Gangwon',
12
+ 8241 => 'Chungnam',
13
+ 8242 => 'Daejeon',
14
+ 8243 => 'Chungbuk',
15
+ 8251 => 'Busan',
16
+ 8252 => 'Ulsan',
17
+ 8253 => 'Daegu',
18
+ 8254 => 'Gyeongbuk',
19
+ 8255 => 'Gyeongnam',
20
+ 8261 => 'Jeonnam',
21
+ 8262 => 'Gwangju',
22
+ 8263 => 'Jeonbuk',
23
+ 8264 => 'Jeju',
24
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/prefixmapper/data/ko/82.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 822 => '서울',
9
+ 8231 => '경기',
10
+ 8232 => '인천',
11
+ 8233 => '강원',
12
+ 8241 => '충남',
13
+ 8242 => '대전',
14
+ 8243 => '충북',
15
+ 8251 => '부산',
16
+ 8252 => '울산',
17
+ 8253 => '대구',
18
+ 8254 => '경북',
19
+ 8255 => '경남',
20
+ 8261 => '전남',
21
+ 8262 => '광주',
22
+ 8263 => '전북',
23
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/timezone/PrefixTimeZonesMapTest.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\timezone;
4
+
5
+
6
+ use libphonenumber\PhoneNumber;
7
+ use libphonenumber\prefixmapper\PrefixTimeZonesMap;
8
+
9
+ class PrefixTimeZonesMapTest extends \PHPUnit_Framework_TestCase
10
+ {
11
+ // US time zones
12
+ const CHICAGO_TZ = "America/Chicago";
13
+ const DENVER_TZ = "America/Denver";
14
+ const LOS_ANGELES_TZ = "America/Los_Angeles";
15
+ const NEW_YORK_TZ = "America/New_York";
16
+
17
+ // Russian time zones
18
+ const IRKUTSK_TZ = "Asia/Irkutsk";
19
+ const MOSCOW_TZ = "Europe/Moscow";
20
+ const VLADIVOSTOK_TZ = "Asia/Vladivostok";
21
+ const YEKATERINBURG_TZ = "Asia/Yekaterinburg";
22
+ /**
23
+ * @var PrefixTimeZonesMap
24
+ */
25
+ private static $prefixTimeZonesMapForUS;
26
+ /**
27
+ * @var PrefixTimeZonesMap
28
+ */
29
+ private static $prefixTimeZonesMapForRU;
30
+
31
+ public static function setUpBeforeClass()
32
+ {
33
+ $sortedMapForUS = array();
34
+ $sortedMapForUS[1] = self::NEW_YORK_TZ . "&" . self::CHICAGO_TZ . "&" . self::LOS_ANGELES_TZ . "&" . self::DENVER_TZ;
35
+ $sortedMapForUS[1201] = self::NEW_YORK_TZ;
36
+ $sortedMapForUS[1205] = self::CHICAGO_TZ;
37
+ $sortedMapForUS[1208292] = self::LOS_ANGELES_TZ;
38
+ $sortedMapForUS[1208234] = self::DENVER_TZ;
39
+ $sortedMapForUS[1541367] = self::LOS_ANGELES_TZ;
40
+ $sortedMapForUS[1423843] = self::NEW_YORK_TZ;
41
+ $sortedMapForUS[1402721] = self::CHICAGO_TZ;
42
+ $sortedMapForUS[1208888] = self::DENVER_TZ;
43
+
44
+ self::$prefixTimeZonesMapForUS = new PrefixTimeZonesMap($sortedMapForUS);
45
+
46
+ $sortedMapForRU = array();
47
+ $sortedMapForRU[7421] = self::VLADIVOSTOK_TZ;
48
+ $sortedMapForRU[7879] = self::MOSCOW_TZ;
49
+ $sortedMapForRU[7342] = self::YEKATERINBURG_TZ;
50
+ $sortedMapForRU[7395] = self::IRKUTSK_TZ;
51
+
52
+ self::$prefixTimeZonesMapForRU = new PrefixTimeZonesMap($sortedMapForRU);
53
+ }
54
+
55
+ public function testLookupTimeZonesForNumberCountryLevel_US()
56
+ {
57
+ $number = new PhoneNumber();
58
+ $number->setCountryCode(1)->setNationalNumber(1000000000);
59
+
60
+ $this->assertEquals(
61
+ array(
62
+ self::NEW_YORK_TZ,
63
+ self::CHICAGO_TZ,
64
+ self::LOS_ANGELES_TZ,
65
+ self::DENVER_TZ,
66
+ ),
67
+ self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number)
68
+ );
69
+ }
70
+
71
+ public function testLookupTimeZonesForNumber_ValidNumber_Chicago()
72
+ {
73
+ $number = new PhoneNumber();
74
+ $number->setCountryCode(1)->setNationalNumber(2051235458);
75
+
76
+ $this->assertEquals(array(self::CHICAGO_TZ), self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number));
77
+ }
78
+
79
+ public function testLookupTimeZonesForNumber_LA()
80
+ {
81
+ $number = new PhoneNumber();
82
+ $number->setCountryCode(1)->setNationalNumber(2082924565);
83
+
84
+ $this->assertEquals(array(self::LOS_ANGELES_TZ), self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number));
85
+ }
86
+
87
+ public function testLookupTimeZonesForNumber_NY()
88
+ {
89
+ $number = new PhoneNumber();
90
+ $number->setCountryCode(1)->setNationalNumber(2016641234);
91
+
92
+ $this->assertEquals(array(self::NEW_YORK_TZ), self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number));
93
+ }
94
+
95
+ public function testLookupTimeZonesForNumber_CH()
96
+ {
97
+ $number = new PhoneNumber();
98
+ $number->setCountryCode(41)->setNationalNumber(446681300);
99
+
100
+ $this->assertEquals(array(), self::$prefixTimeZonesMapForUS->lookupTimeZonesForNumber($number));
101
+ }
102
+
103
+ public function testLookupTimeZonesForNumber_RU()
104
+ {
105
+ $number = new PhoneNumber();
106
+ $number->setCountryCode(7)->setNationalNumber(87945154);
107
+
108
+ $this->assertEquals(array(self::MOSCOW_TZ), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number));
109
+
110
+ $number->setNationalNumber(421548578);
111
+ $this->assertEquals(array(self::VLADIVOSTOK_TZ), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number));
112
+
113
+ $number->setNationalNumber(342457897);
114
+ $this->assertEquals(array(self::YEKATERINBURG_TZ), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number));
115
+
116
+ // A mobile number
117
+ $number->setNationalNumber(9342457897);
118
+ $this->assertEquals(array(), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number));
119
+
120
+ // An invalid number (too short)
121
+ $number->setNationalNumber(3951);
122
+ $this->assertEquals(array(self::IRKUTSK_TZ), self::$prefixTimeZonesMapForRU->lookupTimeZonesForNumber($number));
123
+ }
124
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/timezone/UKTest.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\Tests\timezone;
4
+
5
+ use libphonenumber\PhoneNumber;
6
+ use libphonenumber\PhoneNumberToTimeZonesMapper;
7
+ use libphonenumber\PhoneNumberUtil;
8
+
9
+ class UKTest extends \PHPUnit_Framework_TestCase
10
+ {
11
+ public function setUp()
12
+ {
13
+ PhoneNumberUtil::resetInstance();
14
+ }
15
+
16
+ public function testGBNumber()
17
+ {
18
+ $number = new PhoneNumber();
19
+ $number->setCountryCode(44)->setNationalNumber(1614960000);
20
+
21
+ $timeZone = PhoneNumberToTimeZonesMapper::getInstance();
22
+ $this->assertEquals(array("Europe/London"), $timeZone->getTimeZonesForNumber($number));
23
+ }
24
+
25
+ public function testNonGeocodableNumber()
26
+ {
27
+ $number = new PhoneNumber();
28
+ $number->setCountryCode(44)->setNationalNumber(8001111);
29
+
30
+ $timeZone = PhoneNumberToTimeZonesMapper::getInstance();
31
+ $this->assertEquals(array("Europe/London"), $timeZone->getTimeZonesForNumber($number));
32
+ }
33
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/Tests/libphonenumber/Tests/timezone/data/map_data.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1 => 'America/New_York&America/Chicago&America/Winnipeg&America/Los_Angeles',
9
+ 1201 => 'America/New_York',
10
+ 1212812 => 'America/New_York',
11
+ 1234 => 'America/New_York',
12
+ 1604 => 'America/Winnipeg',
13
+ 1617423 => 'America/Chicago',
14
+ 1650960 => 'America/Los_Angeles',
15
+ 1989 => 'Ameriac/Los_Angeles',
16
+ 612 => 'Australia/Sydney',
17
+ 82 => 'Asia/Seoul',
18
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build.xml ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project name="libphonenumber-for-php" default="test">
3
+
4
+ <property name="build.script" value="build/build.php"/>
5
+
6
+ <property name="git.url" value="https://github.com/googlei18n/libphonenumber.git"/>
7
+ <property name="git.path" value="libphonenumber-data-dir"/>
8
+
9
+ <loadfile property="metadata.version" file="METADATA-VERSION.txt">
10
+ <filterchain>
11
+ <striplinecomments>
12
+ <comment value="#" />
13
+ </striplinecomments>
14
+ <striplinebreaks />
15
+ </filterchain>
16
+ </loadfile>
17
+
18
+ <property name="data.testCoreData" value="Tests/libphonenumber/Tests/core/data/"/>
19
+ <property name="data.testPrefixMapperData" value="Tests/libphonenumber/Tests/prefixmapper/data/"/>
20
+ <property name="data.testCarrierData" value="Tests/libphonenumber/Tests/carrier/data/"/>
21
+ <property name="data.testTimezoneData" value="Tests/libphonenumber/Tests/timezone/data/"/>
22
+
23
+ <property name="data.coreData" value="src/libphonenumber/data/"/>
24
+ <property name="data.carrierData" value="src/libphonenumber/carrier/data/"/>
25
+ <property name="data.geocodingData" value="src/libphonenumber/geocoding/data/"/>
26
+ <property name="data.timezoneData" value="src/libphonenumber/timezone/data/"/>
27
+
28
+
29
+ <target name="test" description="Run unit tests" depends="compile-test-data">
30
+ <exec passthru="true" command="vendor/bin/phpunit"/>
31
+ </target>
32
+
33
+ <target name="compile-test-data" description="Build Test Data"
34
+ depends="cleanup-test-data,build-test-metadata,build-geo-test-data,build-carrier-test-data,build-timezones-test-data">
35
+ </target>
36
+
37
+ <target name="compile" description="Build all Data"
38
+ depends="cleanup-data,compile-test-data,build-phone-metadata,build-short-metadata,build-alternate-metadata,build-carrier-data,build-timezones-data,build-geo-data">
39
+ </target>
40
+
41
+ <target name="cleanup-test-data" description="Cleanup old built test data"
42
+ depends="delete-test-carrierdata,delete-test-prefixmapper,delete-test-coredata,delete-test-timezone"/>
43
+
44
+ <target name="cleanup-data" description="Cleanup built data"
45
+ depends="cleanup-test-data,delete-coredata,delete-carrierdata,delete-geocoding,delete-timezone"/>
46
+
47
+ <target name="delete-test-coredata">
48
+ <delete dir="${data.testCoreData}"/>
49
+ <mkdir dir="${data.testCoreData}"/>
50
+ </target>
51
+
52
+ <target name="delete-test-carrierdata">
53
+ <delete dir="${data.testCarrierData}"/>
54
+ <mkdir dir="${data.testCarrierData}"/>
55
+ </target>
56
+
57
+ <target name="delete-test-prefixmapper">
58
+ <delete dir="${data.testPrefixMapperData}"/>
59
+ <mkdir dir="${data.testPrefixMapperData}"/>
60
+ </target>
61
+
62
+ <target name="delete-test-timezone">
63
+ <delete dir="${data.testTimezoneData}"/>
64
+ <mkdir dir="${data.testTimezoneData}"/>
65
+ </target>
66
+
67
+ <target name="delete-coredata">
68
+ <delete dir="${data.coreData}"/>
69
+ <mkdir dir="${data.coreData}"/>
70
+ </target>
71
+
72
+ <target name="delete-carrierdata">
73
+ <delete dir="${data.carrierData}"/>
74
+ <mkdir dir="${data.carrierData}"/>
75
+ </target>
76
+
77
+ <target name="delete-geocoding">
78
+ <delete dir="${data.geocodingData}"/>
79
+ <mkdir dir="${data.geocodingData}"/>
80
+ </target>
81
+
82
+ <target name="delete-timezone">
83
+ <delete dir="${data.timezoneData}"/>
84
+ <mkdir dir="${data.timezoneData}"/>
85
+ </target>
86
+
87
+ <target name="git-pull">
88
+ <available file="${git.path}" type="dir" property="git.path.exists" />
89
+ <if>
90
+ <or>
91
+ <not>
92
+ <isset property="git.path.exists" />
93
+ </not>
94
+ <isfalse value="${git.path.exists}"/>
95
+ </or>
96
+ <then>
97
+ <echo>Cloning repository</echo>
98
+ <gitclone
99
+ repository="${git.url}"
100
+ targetPath="${git.path}"/>
101
+ </then>
102
+ </if>
103
+
104
+ <gitfetch repository="${git.path}" all="true"/>
105
+ <echo message="Pulling Git project @ ${metadata.version}"/>
106
+
107
+ <gitcheckout
108
+ repository="${git.path}"
109
+ branchname="${metadata.version}" quiet="false" force="true" />
110
+
111
+ <foreach param="filename" absparam="absfilename" target="apply-data-patch">
112
+ <fileset dir="build/data-patches">
113
+ <include name="*.patch" />
114
+ </fileset>
115
+ </foreach>
116
+ </target>
117
+
118
+ <target name="apply-data-patch">
119
+ <echo>Applying patch ${filename}</echo>
120
+ <resolvepath propertyName="fullpath" file="${absfilename}"/>
121
+ <patch patchfile="${fullpath}" dir="${git.path}/" strip="1" />
122
+ </target>
123
+
124
+ <target name="build-test-metadata" description="Build test Phone Metadata" depends="git-pull">
125
+ <exec executable="${build.script}" passthru="true">
126
+ <arg value="BuildMetadataPHPFromXML"/>
127
+ <arg value="${git.path}/resources/PhoneNumberMetadataForTesting.xml"/>
128
+ <arg value="${data.testCoreData}"/>
129
+ <arg value="PhoneNumberMetadataForTesting"/>
130
+ <arg value="CountryCodeToRegionCodeMapForTesting"/>
131
+ <arg value="src/libphonenumber/"/>
132
+ <arg value="false"/>
133
+ </exec>
134
+ </target>
135
+
136
+ <target name="build-geo-test-data" depends="git-pull">
137
+ <exec executable="${build.script}" passthru="true">
138
+ <arg value="GeneratePhonePrefixData"/>
139
+ <arg value="${git.path}/resources/test/geocoding/"/>
140
+ <arg value="${data.testPrefixMapperData}"/>
141
+ </exec>
142
+ </target>
143
+
144
+ <target name="build-carrier-test-data" depends="git-pull">
145
+ <exec executable="${build.script}" passthru="true">
146
+ <arg value="GeneratePhonePrefixData"/>
147
+ <arg value="${git.path}/resources/test/carrier/"/>
148
+ <arg value="${data.testCarrierData}"/>
149
+ </exec>
150
+ </target>
151
+
152
+
153
+ <target name="build-phone-metadata" depends="git-pull">
154
+ <exec executable="${build.script}" passthru="true">
155
+ <arg value="BuildMetadataPHPFromXML"/>
156
+ <arg value="${git.path}/resources/PhoneNumberMetadata.xml"/>
157
+ <arg value="${data.coreData}"/>
158
+ <arg value="PhoneNumberMetadata"/>
159
+ <arg value="CountryCodeToRegionCodeMap"/>
160
+ <arg value="src/libphonenumber/"/>
161
+ <arg value="false"/>
162
+ </exec>
163
+ </target>
164
+
165
+ <target name="build-short-metadata" depends="git-pull">
166
+ <exec executable="${build.script}" passthru="true">
167
+ <arg value="BuildMetadataPHPFromXML"/>
168
+ <arg value="${git.path}/resources/ShortNumberMetadata.xml"/>
169
+ <arg value="${data.coreData}"/>
170
+ <arg value="ShortNumberMetadata"/>
171
+ <arg value="ShortNumbersRegionCodeSet"/>
172
+ <arg value="src/libphonenumber/"/>
173
+ <arg value="false"/>
174
+ </exec>
175
+ </target>
176
+
177
+ <target name="build-alternate-metadata" depends="git-pull">
178
+ <exec executable="${build.script}" passthru="true">
179
+ <arg value="BuildMetadataPHPFromXML"/>
180
+ <arg value="${git.path}/resources/PhoneNumberAlternateFormats.xml"/>
181
+ <arg value="${data.coreData}"/>
182
+ <arg value="PhoneNumberAlternateFormats"/>
183
+ <arg value="AlternateFormatsCountryCodeSet"/>
184
+ <arg value="src/libphonenumber/"/>
185
+ <arg value="false"/>
186
+ </exec>
187
+ </target>
188
+
189
+ <target name="build-carrier-data" depends="git-pull">
190
+ <exec executable="${build.script}" passthru="true">
191
+ <arg value="GeneratePhonePrefixData"/>
192
+ <arg value="${git.path}/resources/carrier/"/>
193
+ <arg value="${data.carrierData}"/>
194
+ </exec>
195
+ </target>
196
+
197
+ <target name="build-geo-data" depends="git-pull">
198
+ <exec executable="${build.script}" passthru="true">
199
+ <arg value="GeneratePhonePrefixData"/>
200
+ <arg value="${git.path}/resources/geocoding/"/>
201
+ <arg value="${data.geocodingData}"/>
202
+ </exec>
203
+ </target>
204
+
205
+ <target name="build-timezones-data" depends="git-pull">
206
+ <exec executable="${build.script}" passthru="true">
207
+ <arg value="GenerateTimeZonesMapData"/>
208
+ <arg value="${git.path}/resources/timezones/map_data.txt"/>
209
+ <arg value="${data.timezoneData}"/>
210
+ </exec>
211
+ </target>
212
+
213
+ <target name="build-timezones-test-data" depends="git-pull">
214
+ <exec executable="${build.script}" passthru="true">
215
+ <arg value="GenerateTimeZonesMapData"/>
216
+ <arg value="${git.path}/resources/test/timezones/map_data.txt"/>
217
+ <arg value="${data.testTimezoneData}"/>
218
+ </exec>
219
+ </target>
220
+
221
+ </project>
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/build.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ #!/usr/bin/env php
2
+ <?php
3
+
4
+ require __DIR__ . '/../vendor/autoload.php';
5
+
6
+ $app = new \libphonenumber\buildtools\BuildApplication();
7
+ $app->run();
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/data-patches/.gitkeep ADDED
File without changes
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/data-patches/001-PHP7-PL.patch ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/resources/PhoneNumberMetadata.xml b/resources/PhoneNumberMetadata.xml
2
+ index a53b48d..820598c 100644
3
+ --- a/resources/PhoneNumberMetadata.xml
4
+ +++ b/resources/PhoneNumberMetadata.xml
5
+ @@ -19031,7 +19031,7 @@
6
+ <generalDesc>
7
+ <nationalNumberPattern>
8
+ [12]\d{6,8}|
9
+ - [3-57-9]\d{8}|
10
+ + (?:[3-5]|[7-9])\d{8}|
11
+ 6\d{5,8}
12
+ </nationalNumberPattern>
13
+ <possibleNumberPattern>\d{6,9}</possibleNumberPattern>
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/BuildApplication.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\buildtools;
4
+
5
+ use libphonenumber\buildtools\Commands\BuildMetadataPHPFromXMLCommand;
6
+ use libphonenumber\buildtools\Commands\GeneratePhonePrefixDataCommand;
7
+ use libphonenumber\buildtools\Commands\GenerateTimeZonesMapDataCommand;
8
+ use Symfony\Component\Console\Application;
9
+
10
+ class BuildApplication extends Application
11
+ {
12
+ const VERSION = '5';
13
+
14
+ public function __construct()
15
+ {
16
+ parent::__construct('libphonenumber Data Builder', self::VERSION);
17
+
18
+ $this->addCommands(
19
+ array(
20
+ new BuildMetadataPHPFromXMLCommand(),
21
+ new GeneratePhonePrefixDataCommand(),
22
+ new GenerateTimeZonesMapDataCommand(),
23
+ )
24
+ );
25
+ }
26
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/BuildMetadataFromXml.php ADDED
@@ -0,0 +1,463 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\buildtools;
4
+
5
+ use libphonenumber\NumberFormat;
6
+ use libphonenumber\PhoneMetadata;
7
+ use libphonenumber\PhoneNumberDesc;
8
+
9
+ /**
10
+ * Library to build phone number metadata from the XML format.
11
+ *
12
+ * @author Davide Mendolia
13
+ */
14
+ class BuildMetadataFromXml
15
+ {
16
+ // String constants used to fetch the XML nodes and attributes.
17
+ const CARRIER_CODE_FORMATTING_RULE = "carrierCodeFormattingRule";
18
+ const COUNTRY_CODE = "countryCode";
19
+ const EMERGENCY = "emergency";
20
+ const EXAMPLE_NUMBER = "exampleNumber";
21
+ const FIXED_LINE = "fixedLine";
22
+ const FORMAT = "format";
23
+ const GENERAL_DESC = "generalDesc";
24
+ const INTERNATIONAL_PREFIX = "internationalPrefix";
25
+ const INTL_FORMAT = "intlFormat";
26
+ const LEADING_DIGITS = "leadingDigits";
27
+ const LEADING_ZERO_POSSIBLE = "leadingZeroPossible";
28
+ const MOBILE_NUMBER_PORTABLE_REGION = "mobileNumberPortableRegion";
29
+ const MAIN_COUNTRY_FOR_CODE = "mainCountryForCode";
30
+ const MOBILE = "mobile";
31
+ const NATIONAL_NUMBER_PATTERN = "nationalNumberPattern";
32
+ const NATIONAL_PREFIX = "nationalPrefix";
33
+ const NATIONAL_PREFIX_FORMATTING_RULE = "nationalPrefixFormattingRule";
34
+ const NATIONAL_PREFIX_OPTIONAL_WHEN_FORMATTING = "nationalPrefixOptionalWhenFormatting";
35
+ const NATIONAL_PREFIX_FOR_PARSING = "nationalPrefixForParsing";
36
+ const NATIONAL_PREFIX_TRANSFORM_RULE = "nationalPrefixTransformRule";
37
+ const NO_INTERNATIONAL_DIALLING = "noInternationalDialling";
38
+ const NUMBER_FORMAT = "numberFormat";
39
+ const PAGER = "pager";
40
+ const CARRIER_SPECIFIC = 'carrierSpecific';
41
+ const PATTERN = "pattern";
42
+ const PERSONAL_NUMBER = "personalNumber";
43
+ const POSSIBLE_NUMBER_PATTERN = "possibleNumberPattern";
44
+ const PREFERRED_EXTN_PREFIX = "preferredExtnPrefix";
45
+ const PREFERRED_INTERNATIONAL_PREFIX = "preferredInternationalPrefix";
46
+ const PREMIUM_RATE = "premiumRate";
47
+ const SHARED_COST = "sharedCost";
48
+ const SHORT_CODE = "shortCode";
49
+ const STANDARD_RATE = "standardRate";
50
+ const TOLL_FREE = "tollFree";
51
+ const UAN = "uan";
52
+ const VOICEMAIL = "voicemail";
53
+ const VOIP = "voip";
54
+ /**
55
+ * @var boolean
56
+ */
57
+ private static $liteBuild;
58
+
59
+ /**
60
+ *
61
+ * @param string $inputXmlFile
62
+ * @param boolean $liteBuild
63
+ * @return PhoneMetadata[]
64
+ */
65
+ public static function buildPhoneMetadataCollection($inputXmlFile, $liteBuild)
66
+ {
67
+ self::$liteBuild = $liteBuild;
68
+ $document = new \DOMDocument();
69
+ $document->load($inputXmlFile);
70
+ $territories = $document->getElementsByTagName("territory");
71
+ $metadataCollection = array();
72
+ foreach ($territories as $territory) {
73
+ if ($territory->hasAttribute("id")) {
74
+ $regionCode = $territory->getAttribute("id");
75
+ } else {
76
+ $regionCode = "";
77
+ }
78
+ $metadata = self::loadCountryMetadata($regionCode, $territory);
79
+ $metadataCollection[] = $metadata;
80
+ }
81
+ return $metadataCollection;
82
+ }
83
+
84
+ /**
85
+ * @param string $regionCode
86
+ * @param \DOMElement $element
87
+ * @return PhoneMetadata
88
+ */
89
+ public static function loadCountryMetadata($regionCode, \DOMElement $element)
90
+ {
91
+ $nationalPrefix = self::getNationalPrefix($element);
92
+ $nationalPrefixFormattingRule = self::getNationalPrefixFormattingRuleFromElement($element, $nationalPrefix);
93
+ $metadata = self::loadTerritoryTagMetadata(
94
+ $regionCode,
95
+ $element,
96
+ $nationalPrefix,
97
+ $nationalPrefixFormattingRule
98
+ );
99
+
100
+ self::loadAvailableFormats($metadata, $regionCode, $element, $nationalPrefix, $nationalPrefixFormattingRule);
101
+ self::loadGeneralDesc($metadata, $element);
102
+ return $metadata;
103
+ }
104
+
105
+ /**
106
+ * Returns the national prefix of the provided country element.
107
+ * @param \DOMElement $element
108
+ * @return string
109
+ */
110
+ private static function getNationalPrefix(\DOMElement $element)
111
+ {
112
+ return $element->hasAttribute(self::NATIONAL_PREFIX) ? $element->getAttribute(self::NATIONAL_PREFIX) : "";
113
+ }
114
+
115
+ /**
116
+ *
117
+ * @param \DOMElement $element
118
+ * @param string $nationalPrefix
119
+ * @return string
120
+ */
121
+ private static function getNationalPrefixFormattingRuleFromElement(\DOMElement $element, $nationalPrefix)
122
+ {
123
+ $nationalPrefixFormattingRule = $element->getAttribute(self::NATIONAL_PREFIX_FORMATTING_RULE);
124
+ // Replace $NP with national prefix and $FG with the first group ($1).
125
+ $nationalPrefixFormattingRule = str_replace('$NP', $nationalPrefix, $nationalPrefixFormattingRule);
126
+ $nationalPrefixFormattingRule = str_replace('$FG', '$1', $nationalPrefixFormattingRule);
127
+ return $nationalPrefixFormattingRule;
128
+ }
129
+
130
+ /**
131
+ *
132
+ * @param string $regionCode
133
+ * @param \DOMElement $element
134
+ * @param string $nationalPrefix
135
+ * @param string $nationalPrefixFormattingRule
136
+ * @return PhoneMetadata
137
+ */
138
+ private static function loadTerritoryTagMetadata(
139
+ $regionCode,
140
+ \DOMElement $element,
141
+ $nationalPrefix,
142
+ $nationalPrefixFormattingRule
143
+ ) {
144
+ $metadata = new PhoneMetadata();
145
+ $metadata->setId($regionCode);
146
+ $metadata->setCountryCode((int)$element->getAttribute(self::COUNTRY_CODE));
147
+ if ($element->hasAttribute(self::LEADING_DIGITS)) {
148
+ $metadata->setLeadingDigits($element->getAttribute(self::LEADING_DIGITS));
149
+ }
150
+ $metadata->setInternationalPrefix($element->getAttribute(self::INTERNATIONAL_PREFIX));
151
+ if ($element->hasAttribute(self::PREFERRED_INTERNATIONAL_PREFIX)) {
152
+ $preferredInternationalPrefix = $element->getAttribute(self::PREFERRED_INTERNATIONAL_PREFIX);
153
+ $metadata->setPreferredInternationalPrefix($preferredInternationalPrefix);
154
+ }
155
+ if ($element->hasAttribute(self::NATIONAL_PREFIX_FOR_PARSING)) {
156
+ $metadata->setNationalPrefixForParsing(
157
+ $element->getAttribute(self::NATIONAL_PREFIX_FOR_PARSING)
158
+ );
159
+ if ($element->hasAttribute(self::NATIONAL_PREFIX_TRANSFORM_RULE)) {
160
+ $metadata->setNationalPrefixTransformRule($element->getAttribute(self::NATIONAL_PREFIX_TRANSFORM_RULE));
161
+ }
162
+ }
163
+ if ($nationalPrefix != '') {
164
+ $metadata->setNationalPrefix($nationalPrefix);
165
+ if (!$metadata->hasNationalPrefixForParsing()) {
166
+ $metadata->setNationalPrefixForParsing($nationalPrefix);
167
+ }
168
+ }
169
+ if ($element->hasAttribute(self::PREFERRED_EXTN_PREFIX)) {
170
+ $metadata->setPreferredExtnPrefix($element->getAttribute(self::PREFERRED_EXTN_PREFIX));
171
+ }
172
+ if ($element->hasAttribute(self::MAIN_COUNTRY_FOR_CODE)) {
173
+ $metadata->setMainCountryForCode(true);
174
+ }
175
+ if ($element->hasAttribute(self::LEADING_ZERO_POSSIBLE)) {
176
+ $metadata->setLeadingZeroPossible(true);
177
+ }
178
+ if ($element->hasAttribute(self::MOBILE_NUMBER_PORTABLE_REGION)) {
179
+ $metadata->setMobileNumberPortableRegion(true);
180
+ }
181
+ return $metadata;
182
+ }
183
+
184
+ /**
185
+ * Extracts the available formats from the provided DOM element. If it does not contain any
186
+ * nationalPrefixFormattingRule, the one passed-in is retained.
187
+ * @param PhoneMetadata $metadata
188
+ * @param string $regionCode
189
+ * @param \DOMElement $element
190
+ * @param string $nationalPrefix
191
+ * @param string $nationalPrefixFormattingRule
192
+ */
193
+ private static function loadAvailableFormats(
194
+ PhoneMetadata $metadata,
195
+ $regionCode,
196
+ \DOMElement $element,
197
+ $nationalPrefix,
198
+ $nationalPrefixFormattingRule
199
+ ) {
200
+
201
+ $carrierCodeFormattingRule = "";
202
+ if ($element->hasAttribute(self::CARRIER_CODE_FORMATTING_RULE)) {
203
+ $carrierCodeFormattingRule = self::getDomesticCarrierCodeFormattingRuleFromElement(
204
+ $element,
205
+ $nationalPrefix
206
+ );
207
+ }
208
+ $numberFormatElements = $element->getElementsByTagName(self::NUMBER_FORMAT);
209
+ $hasExplicitIntlFormatDefined = false;
210
+
211
+ $numOfFormatElements = $numberFormatElements->length;
212
+ if ($numOfFormatElements > 0) {
213
+ for ($i = 0; $i < $numOfFormatElements; $i++) {
214
+ $numberFormatElement = $numberFormatElements->item($i);
215
+ $format = new NumberFormat();
216
+
217
+ if ($numberFormatElement->hasAttribute(self::NATIONAL_PREFIX_FORMATTING_RULE)) {
218
+ $format->setNationalPrefixFormattingRule(
219
+ self::getNationalPrefixFormattingRuleFromElement($numberFormatElement, $nationalPrefix)
220
+ );
221
+ } else {
222
+ $format->setNationalPrefixFormattingRule($nationalPrefixFormattingRule);
223
+ }
224
+ if ($numberFormatElement->hasAttribute(self::CARRIER_CODE_FORMATTING_RULE)) {
225
+ $format->setDomesticCarrierCodeFormattingRule(
226
+ self::getDomesticCarrierCodeFormattingRuleFromElement($numberFormatElement, $nationalPrefix)
227
+ );
228
+ } else {
229
+ $format->setDomesticCarrierCodeFormattingRule($carrierCodeFormattingRule);
230
+ }
231
+ self::loadNationalFormat($metadata, $numberFormatElement, $format);
232
+ $metadata->addNumberFormat($format);
233
+
234
+ if (self::loadInternationalFormat($metadata, $numberFormatElement, $format)) {
235
+ $hasExplicitIntlFormatDefined = true;
236
+ }
237
+ }
238
+ // Only a small number of regions need to specify the intlFormats in the xml. For the majority
239
+ // of countries the intlNumberFormat metadata is an exact copy of the national NumberFormat
240
+ // metadata. To minimize the size of the metadata file, we only keep intlNumberFormats that
241
+ // actually differ in some way to the national formats.
242
+ if (!$hasExplicitIntlFormatDefined) {
243
+ $metadata->clearIntlNumberFormat();
244
+ }
245
+ }
246
+ }
247
+
248
+ private static function getDomesticCarrierCodeFormattingRuleFromElement(\DOMElement $element, $nationalPrefix)
249
+ {
250
+ $carrierCodeFormattingRule = $element->getAttribute(self::CARRIER_CODE_FORMATTING_RULE);
251
+ // Replace $FG with the first group ($1) and $NP with the national prefix.
252
+ $carrierCodeFormattingRule = str_replace('$NP', $nationalPrefix, $carrierCodeFormattingRule);
253
+ $carrierCodeFormattingRule = str_replace('$FG', '$1', $carrierCodeFormattingRule);
254
+ return $carrierCodeFormattingRule;
255
+ }
256
+
257
+ /**
258
+ * Extracts the pattern for the national format.
259
+ *
260
+ * @param PhoneMetadata $metadata
261
+ * @param \DOMElement $numberFormatElement
262
+ * @param NumberFormat $format
263
+ * @throws \RuntimeException if multiple or no formats have been encountered.
264
+ */
265
+ private static function loadNationalFormat(
266
+ PhoneMetadata $metadata,
267
+ \DOMElement $numberFormatElement,
268
+ NumberFormat $format
269
+ ) {
270
+ self::setLeadingDigitsPatterns($numberFormatElement, $format);
271
+ $format->setPattern($numberFormatElement->getAttribute(self::PATTERN));
272
+
273
+ $formatPattern = $numberFormatElement->getElementsByTagName(self::FORMAT);
274
+ if ($formatPattern->length != 1) {
275
+ $countryId = strlen($metadata->getId()) > 0 ? $metadata->getId() : $metadata->getCountryCode();
276
+ throw new \RuntimeException("Invalid number of format patterns for country: " . $countryId);
277
+ }
278
+ $nationalFormat = $formatPattern->item(0)->firstChild->nodeValue;
279
+ $format->setFormat($nationalFormat);
280
+ }
281
+
282
+ public static function setLeadingDigitsPatterns(\DOMElement $numberFormatElement, NumberFormat $format)
283
+ {
284
+ $leadingDigitsPatternNodes = $numberFormatElement->getElementsByTagName(self::LEADING_DIGITS);
285
+ $numOfLeadingDigitsPatterns = $leadingDigitsPatternNodes->length;
286
+ if ($numOfLeadingDigitsPatterns > 0) {
287
+ for ($i = 0; $i < $numOfLeadingDigitsPatterns; $i++) {
288
+ $elt = $leadingDigitsPatternNodes->item($i);
289
+ $format->addLeadingDigitsPattern(
290
+ $elt->firstChild->nodeValue,
291
+ true
292
+ );
293
+ }
294
+ }
295
+ }
296
+
297
+ /**
298
+ * Extracts the pattern for international format. If there is no intlFormat, default to using the
299
+ * national format. If the intlFormat is set to "NA" the intlFormat should be ignored.
300
+ *
301
+ * @param PhoneMetadata $metadata
302
+ * @param \DOMElement $numberFormatElement
303
+ * @param NumberFormat $nationalFormat
304
+ * @throws \RuntimeException if multiple intlFormats have been encountered.
305
+ * @return bool whether an international number format is defined.
306
+ */
307
+ private static function loadInternationalFormat(
308
+ PhoneMetadata $metadata,
309
+ \DOMElement $numberFormatElement,
310
+ NumberFormat $nationalFormat
311
+ ) {
312
+ $intlFormat = new NumberFormat();
313
+ $intlFormatPattern = $numberFormatElement->getElementsByTagName(self::INTL_FORMAT);
314
+ $hasExplicitIntlFormatDefined = false;
315
+
316
+ if ($intlFormatPattern->length > 1) {
317
+ $countryId = strlen($metadata->getId()) > 0 ? $metadata->getId() : $metadata->getCountryCode();
318
+ throw new \RuntimeException("Invalid number of intlFormat patterns for country: " . $countryId);
319
+ } elseif ($intlFormatPattern->length == 0) {
320
+ // Default to use the same as the national pattern if none is defined.
321
+ $intlFormat->mergeFrom($nationalFormat);
322
+ } else {
323
+ $intlFormat->setPattern($numberFormatElement->getAttribute(self::PATTERN));
324
+ self::setLeadingDigitsPatterns($numberFormatElement, $intlFormat);
325
+ $intlFormatPatternValue = $intlFormatPattern->item(0)->firstChild->nodeValue;
326
+ if ($intlFormatPatternValue !== "NA") {
327
+ $intlFormat->setFormat($intlFormatPatternValue);
328
+ }
329
+ $hasExplicitIntlFormatDefined = true;
330
+ }
331
+
332
+ if ($intlFormat->hasFormat()) {
333
+ $metadata->addIntlNumberFormat($intlFormat);
334
+ }
335
+ return $hasExplicitIntlFormatDefined;
336
+ }
337
+
338
+ private static function loadGeneralDesc(PhoneMetadata $metadata, \DOMElement $element)
339
+ {
340
+ $generalDesc = new PhoneNumberDesc();
341
+ $generalDesc = self::processPhoneNumberDescElement($generalDesc, $element, self::GENERAL_DESC);
342
+ $metadata->setGeneralDesc($generalDesc);
343
+ $metadata->setFixedLine(self::processPhoneNumberDescElement($generalDesc, $element, self::FIXED_LINE));
344
+ $metadata->setMobile(self::processPhoneNumberDescElement($generalDesc, $element, self::MOBILE));
345
+ $metadata->setStandardRate(self::processPhoneNumberDescElement($generalDesc, $element, self::STANDARD_RATE));
346
+ $metadata->setPremiumRate(self::processPhoneNumberDescElement($generalDesc, $element, self::PREMIUM_RATE));
347
+ $metadata->setShortCode(self::processPhoneNumberDescElement($generalDesc, $element, self::SHORT_CODE));
348
+ $metadata->setTollFree(self::processPhoneNumberDescElement($generalDesc, $element, self::TOLL_FREE));
349
+ $metadata->setSharedCost(self::processPhoneNumberDescElement($generalDesc, $element, self::SHARED_COST));
350
+
351
+
352
+ $metadata->setVoip(self::processPhoneNumberDescElement($generalDesc, $element, self::VOIP));
353
+ $metadata->setPersonalNumber(
354
+ self::processPhoneNumberDescElement($generalDesc, $element, self::PERSONAL_NUMBER)
355
+ );
356
+ $metadata->setPager(self::processPhoneNumberDescElement($generalDesc, $element, self::PAGER));
357
+ $metadata->setUan(self::processPhoneNumberDescElement($generalDesc, $element, self::UAN));
358
+ $metadata->setEmergency(self::processPhoneNumberDescElement($generalDesc, $element, self::EMERGENCY));
359
+ $metadata->setVoicemail(self::processPhoneNumberDescElement($generalDesc, $element, self::VOICEMAIL));
360
+ $metadata->setCarrierSpecific(
361
+ self::processPhoneNumberDescElement($generalDesc, $element, self::CARRIER_SPECIFIC)
362
+ );
363
+
364
+
365
+ $metadata->setNoInternationalDialling(
366
+ self::processPhoneNumberDescElement($generalDesc, $element, self::NO_INTERNATIONAL_DIALLING)
367
+ );
368
+ $metadata->setSameMobileAndFixedLinePattern(
369
+ $metadata->getMobile()->getNationalNumberPattern() === $metadata->getFixedLine()->getNationalNumberPattern()
370
+ );
371
+ }
372
+
373
+ /**
374
+ * Processes a phone number description element from the XML file and returns it as a
375
+ * PhoneNumberDesc. If the description element is a fixed line or mobile number, the general
376
+ * description will be used to fill in the whole element if necessary, or any components that are
377
+ * missing. For all other types, the general description will only be used to fill in missing
378
+ * components if the type has a partial definition. For example, if no "tollFree" element exists,
379
+ * we assume there are no toll free numbers for that locale, and return a phone number description
380
+ * with "NA" for both the national and possible number patterns.
381
+ *
382
+ * @param PhoneNumberDesc $generalDesc generic phone number description that will be used to fill in missing
383
+ * parts of the description
384
+ * @param \DOMElement $countryElement XML element representing all the country information
385
+ * @param string $numberType name of the number type, corresponding to the appropriate tag in the XML
386
+ * file with information about that type
387
+ * @return PhoneNumberDesc complete description of that phone number type
388
+ */
389
+ private static function processPhoneNumberDescElement(
390
+ PhoneNumberDesc $generalDesc,
391
+ \DOMElement $countryElement,
392
+ $numberType
393
+ ) {
394
+ $phoneNumberDescList = $countryElement->getElementsByTagName($numberType);
395
+ $numberDesc = new PhoneNumberDesc();
396
+ if ($phoneNumberDescList->length == 0 && !self::isValidNumberType($numberType)) {
397
+ $numberDesc->setNationalNumberPattern("NA");
398
+ $numberDesc->setPossibleNumberPattern("NA");
399
+ return $numberDesc;
400
+ }
401
+ $numberDesc->mergeFrom($generalDesc);
402
+ if ($phoneNumberDescList->length > 0) {
403
+ $element = $phoneNumberDescList->item(0);
404
+ $possiblePattern = $element->getElementsByTagName(self::POSSIBLE_NUMBER_PATTERN);
405
+ if ($possiblePattern->length > 0) {
406
+ $numberDesc->setPossibleNumberPattern($possiblePattern->item(0)->firstChild->nodeValue);
407
+ }
408
+
409
+ $validPattern = $element->getElementsByTagName(self::NATIONAL_NUMBER_PATTERN);
410
+ if ($validPattern->length > 0) {
411
+ $numberDesc->setNationalNumberPattern($validPattern->item(0)->firstChild->nodeValue);
412
+ }
413
+
414
+ if (!self::$liteBuild) {
415
+ $exampleNumber = $element->getElementsByTagName(self::EXAMPLE_NUMBER);
416
+ if ($exampleNumber->length > 0) {
417
+ $numberDesc->setExampleNumber($exampleNumber->item(0)->firstChild->nodeValue);
418
+ }
419
+ }
420
+ }
421
+ return $numberDesc;
422
+ }
423
+
424
+ /**
425
+ * @param string $numberType
426
+ * @return bool
427
+ */
428
+ private static function isValidNumberType($numberType)
429
+ {
430
+ return $numberType == self::FIXED_LINE || $numberType == self::MOBILE || $numberType == self::GENERAL_DESC;
431
+ }
432
+
433
+ /**
434
+ * @param $metadataCollection PhoneMetadata[]
435
+ * @return array
436
+ */
437
+ public static function buildCountryCodeToRegionCodeMap($metadataCollection)
438
+ {
439
+ $countryCodeToRegionCodeMap = array();
440
+
441
+ foreach ($metadataCollection as $metadata) {
442
+ $regionCode = $metadata->getId();
443
+ $countryCode = $metadata->getCountryCode();
444
+ if (array_key_exists($countryCode, $countryCodeToRegionCodeMap)) {
445
+ if ($metadata->getMainCountryForCode()) {
446
+ array_unshift($countryCodeToRegionCodeMap[$countryCode], $regionCode);
447
+ } else {
448
+ $countryCodeToRegionCodeMap[$countryCode][] = $regionCode;
449
+ }
450
+ } else {
451
+ // For most countries, there will be only one region code for the country calling code.
452
+ $listWithRegionCode = array();
453
+ if ($regionCode != '') { // For alternate formats, there are no region codes at all.
454
+ $listWithRegionCode[] = $regionCode;
455
+ }
456
+ $countryCodeToRegionCodeMap[$countryCode] = $listWithRegionCode;
457
+ }
458
+ }
459
+
460
+ return $countryCodeToRegionCodeMap;
461
+ }
462
+
463
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/BuildMetadataPHPFromXml.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace libphonenumber\buildtools;
3
+
4
+ use libphonenumber\PhoneMetadata;
5
+
6
+ /**
7
+ * Tool to convert phone number metadata from the XML format to protocol buffer format.
8
+ *
9
+ * @author Davide Mendolia
10
+ */
11
+ class BuildMetadataPHPFromXml
12
+ {
13
+ const GENERATION_COMMENT = <<<'EOT'
14
+ /**
15
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
16
+ * Please don't modify it directly.
17
+ */
18
+
19
+
20
+ EOT;
21
+ const MAP_COMMENT = <<<'EOT'
22
+ // A mapping from a country code to the region codes which denote the
23
+ // country/region represented by that country code. In the case of multiple
24
+ // countries sharing a calling code, such as the NANPA countries, the one
25
+ // indicated with "isMainCountryForCode" in the metadata should be first.
26
+
27
+ EOT;
28
+ const COUNTRY_CODE_SET_COMMENT =
29
+ " // A set of all country codes for which data is available.\n";
30
+ const REGION_CODE_SET_COMMENT =
31
+ " // A set of all region codes for which data is available.\n";
32
+
33
+ public function start($inputFile, $outputDir, $filePrefix, $mappingClass, $mappingClassLocation, $liteBuild)
34
+ {
35
+ $savePath = $outputDir . $filePrefix;
36
+
37
+ $metadataCollection = BuildMetadataFromXml::buildPhoneMetadataCollection($inputFile, $liteBuild);
38
+
39
+ $this->writeMetadataToFile($metadataCollection, $savePath);
40
+
41
+
42
+ $countryCodeToRegionCodeMap = BuildMetadataFromXml::buildCountryCodeToRegionCodeMap($metadataCollection);
43
+
44
+ // Sort $countryCodeToRegionCodeMap just to have the regions in order
45
+
46
+ ksort($countryCodeToRegionCodeMap);
47
+
48
+ $this->writeCountryCallingCodeMappingToFile($countryCodeToRegionCodeMap, $mappingClassLocation, $mappingClass);
49
+ }
50
+
51
+ /**
52
+ * @param $metadataCollection PhoneMetadata[]
53
+ * @param $filePrefix
54
+ */
55
+ private function writeMetadataToFile($metadataCollection, $filePrefix)
56
+ {
57
+ foreach ($metadataCollection as $metadata) {
58
+ /** @var $phoneMetadata PhoneMetadata */
59
+ $regionCode = $metadata->getId();
60
+ // For non-geographical country calling codes (e.g. +800), use the country calling codes
61
+ // instead of the region code to form the file name.
62
+ if ($regionCode === '001' || $regionCode == '') {
63
+ $regionCode = $metadata->getCountryCode();
64
+ }
65
+
66
+ $data = '<?php' . PHP_EOL . self::GENERATION_COMMENT . PHP_EOL . 'return ' . var_export(
67
+ $metadata->toArray(),
68
+ true
69
+ ) . ';' . PHP_EOL;
70
+
71
+ file_put_contents($filePrefix . "_" . $regionCode . '.php', $data);
72
+ }
73
+ }
74
+
75
+ private function writeCountryCallingCodeMappingToFile($countryCodeToRegionCodeMap, $outputDir, $mappingClass)
76
+ {
77
+ // Find out whether the countryCodeToRegionCodeMap has any region codes or country
78
+ // calling codes listed in it.
79
+ $hasRegionCodes = false;
80
+ foreach ($countryCodeToRegionCodeMap as $key => $listWithRegionCode) {
81
+ if (count($listWithRegionCode) > 0) {
82
+ $hasRegionCodes = true;
83
+ break;
84
+ }
85
+ }
86
+
87
+ $hasCountryCodes = (count($countryCodeToRegionCodeMap) > 1);
88
+
89
+ $variableName = lcfirst($mappingClass);
90
+
91
+ $data = '<?php' . PHP_EOL .
92
+ self::GENERATION_COMMENT . PHP_EOL .
93
+ "namespace libphonenumber;" . PHP_EOL .
94
+ "class {$mappingClass} {" . PHP_EOL .
95
+ PHP_EOL;
96
+
97
+ if ($hasRegionCodes && $hasCountryCodes) {
98
+ $data .= self::MAP_COMMENT . PHP_EOL;
99
+ $data .= " public static \${$variableName} = " . var_export(
100
+ $countryCodeToRegionCodeMap,
101
+ true
102
+ ) . ";" . PHP_EOL;
103
+ } elseif ($hasCountryCodes) {
104
+ $data .= self::COUNTRY_CODE_SET_COMMENT . PHP_EOL;
105
+ $data .= " public static \${$variableName} = " . var_export(
106
+ array_keys($countryCodeToRegionCodeMap),
107
+ true
108
+ ) . ";" . PHP_EOL;
109
+ } else {
110
+ $data .= self::REGION_CODE_SET_COMMENT . PHP_EOL;
111
+ $data .= " public static \${$variableName} = " . var_export(
112
+ $countryCodeToRegionCodeMap[0],
113
+ true
114
+ ) . ";" . PHP_EOL;
115
+ }
116
+
117
+ $data .= PHP_EOL .
118
+ "}" . PHP_EOL;
119
+
120
+ file_put_contents($outputDir . $mappingClass . '.php', $data);
121
+ }
122
+
123
+
124
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/Commands/BuildMetadataPHPFromXMLCommand.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\buildtools\Commands;
4
+
5
+
6
+ use libphonenumber\buildtools\BuildMetadataPHPFromXml;
7
+ use Symfony\Component\Console\Command\Command;
8
+ use Symfony\Component\Console\Input\InputArgument;
9
+ use Symfony\Component\Console\Input\InputInterface;
10
+ use Symfony\Component\Console\Output\OutputInterface;
11
+
12
+ class BuildMetadataPHPFromXMLCommand extends Command
13
+ {
14
+ protected function configure()
15
+ {
16
+ $this->setName('BuildMetadataPHPFromXML');
17
+ $this->setDescription('Generate phone metadata data files');
18
+ $this->setDefinition(
19
+ array(
20
+ new InputArgument('InputFile', InputArgument::REQUIRED, 'The input file containing phone number metadata in XML format.'),
21
+ new InputArgument('OutputDirectory', InputArgument::REQUIRED, 'The output source directory to store phone number metadata (one file per region) and the country code to region code mapping file'),
22
+ new InputArgument('DataPrefix', InputArgument::REQUIRED, 'The start of the filename to store the files (e.g. dataPrefix_GB.php'),
23
+ new InputArgument('MappingClass', InputArgument::REQUIRED, 'The name of the mapping class generated'),
24
+ new InputArgument('MappingClassLocation', InputArgument::REQUIRED, 'The directory where the mapping class is stored'),
25
+ new InputArgument('LiteBuild', InputArgument::OPTIONAL, 'Whether to generate the lite-version of the metadata. When set to true, certain metadata will be omitted. AT this moment, example numbers information is omitted', false),
26
+ )
27
+ );
28
+ }
29
+
30
+ protected function execute(InputInterface $input, OutputInterface $output)
31
+ {
32
+ $build = new BuildMetadataPHPFromXml();
33
+ $build->start(
34
+ $input->getArgument('InputFile'),
35
+ $input->getArgument('OutputDirectory'),
36
+ $input->getArgument('DataPrefix'),
37
+ $input->getArgument('MappingClass'),
38
+ $input->getArgument('MappingClassLocation'),
39
+ ($input->getArgument('LiteBuild') == 'true') ? true : false
40
+ );
41
+ }
42
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/Commands/GeneratePhonePrefixDataCommand.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\buildtools\Commands;
4
+
5
+
6
+ use libphonenumber\buildtools\GeneratePhonePrefixData;
7
+ use Symfony\Component\Console\Command\Command;
8
+ use Symfony\Component\Console\Helper\ProgressHelper;
9
+ use Symfony\Component\Console\Input\InputArgument;
10
+ use Symfony\Component\Console\Input\InputInterface;
11
+ use Symfony\Component\Console\Output\OutputInterface;
12
+
13
+ class GeneratePhonePrefixDataCommand extends Command
14
+ {
15
+ protected function configure()
16
+ {
17
+ $this->setName('GeneratePhonePrefixData');
18
+ $this->setDescription('Generate phone prefix data files');
19
+ $this->setDefinition(
20
+ array(
21
+ new InputArgument('InputDirectory', InputArgument::REQUIRED, 'The input directory containing the locale/region.txt files'),
22
+ new InputArgument('OutputDirectory', InputArgument::REQUIRED, 'The output source directory'),
23
+ )
24
+ );
25
+ }
26
+
27
+ protected function execute(InputInterface $input, OutputInterface $output)
28
+ {
29
+ /** @var ProgressHelper $progress */
30
+ $progress = $this->getHelperSet()->get('progress');
31
+ $generatePhonePrefixData = new GeneratePhonePrefixData();
32
+ $generatePhonePrefixData->start(
33
+ $input->getArgument('InputDirectory'),
34
+ $input->getArgument('OutputDirectory'),
35
+ $output,
36
+ $progress
37
+ );
38
+ }
39
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/Commands/GenerateTimeZonesMapDataCommand.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\buildtools\Commands;
4
+
5
+
6
+ use libphonenumber\buildtools\GenerateTimeZonesMapData;
7
+ use Symfony\Component\Console\Command\Command;
8
+ use Symfony\Component\Console\Input\InputArgument;
9
+ use Symfony\Component\Console\Input\InputInterface;
10
+ use Symfony\Component\Console\Output\OutputInterface;
11
+
12
+ class GenerateTimeZonesMapDataCommand extends Command
13
+ {
14
+ protected function configure()
15
+ {
16
+ $this->setName('GenerateTimeZonesMapData');
17
+ $this->setDescription('Generate time zone data files');
18
+ $this->setDefinition(
19
+ array(
20
+ new InputArgument('InputFile', InputArgument::REQUIRED, 'The input file containing the timezone map data'),
21
+ new InputArgument('OutputDirectory', InputArgument::REQUIRED, 'The output directory to save the file'),
22
+ )
23
+ );
24
+ }
25
+
26
+ protected function execute(InputInterface $input, OutputInterface $output)
27
+ {
28
+ new GenerateTimeZonesMapData($input->getArgument('InputFile'), $input->getArgument('OutputDirectory'));
29
+ }
30
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/GeneratePhonePrefixData.php ADDED
@@ -0,0 +1,406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\buildtools;
4
+
5
+ use Symfony\Component\Console\Helper\ProgressHelper;
6
+ use Symfony\Component\Console\Output\OutputInterface;
7
+
8
+ class GeneratePhonePrefixData
9
+ {
10
+ const NANPA_COUNTRY_CODE = 1;
11
+ const DATA_FILE_EXTENSION = '.txt';
12
+ const GENERATION_COMMENT = <<<'EOT'
13
+ /**
14
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
15
+ * Please don't modify it directly.
16
+ */
17
+
18
+
19
+ EOT;
20
+
21
+ public $inputDir;
22
+ private $filesToIgnore = array('.', '..', '.svn', '.git');
23
+ private $outputDir;
24
+ private $englishMaps = array();
25
+ /**
26
+ * @var OutputInterface
27
+ */
28
+ private static $consoleOutput;
29
+
30
+ public function start($inputDir, $outputDir, OutputInterface $consoleOutput, ProgressHelper $progress)
31
+ {
32
+ $this->inputDir = $inputDir;
33
+ $this->outputDir = $outputDir;
34
+ self::$consoleOutput = $consoleOutput;
35
+
36
+ $inputOutputMappings = $this->createInputOutputMappings();
37
+ $availableDataFiles = array();
38
+
39
+ $progress->start($consoleOutput, count($inputOutputMappings));
40
+ foreach ($inputOutputMappings as $textFile => $outputFiles) {
41
+ $mappings = $this->readMappingsFromFile($textFile);
42
+
43
+ $language = $this->getLanguageFromTextFile($textFile);
44
+
45
+ $this->removeEmptyEnglishMappings($mappings, $language);
46
+ $this->makeDataFallbackToEnglish($textFile, $mappings);
47
+ $mappingForFiles = $this->splitMap($mappings, $outputFiles);
48
+
49
+ foreach ($mappingForFiles as $outputFile => $value) {
50
+ $this->writeMappingFile($language, $outputFile, $value);
51
+ $this->addConfigurationMapping($availableDataFiles, $language, $outputFile);
52
+ }
53
+ $progress->advance();
54
+ }
55
+
56
+ $this->writeConfigMap($availableDataFiles);
57
+ $progress->finish();
58
+ }
59
+
60
+ private function createInputOutputMappings()
61
+ {
62
+ $topLevel = scandir($this->inputDir);
63
+
64
+ $mappings = array();
65
+
66
+ foreach ($topLevel as $languageDirectory) {
67
+ if (in_array($languageDirectory, $this->filesToIgnore)) {
68
+ continue;
69
+ }
70
+
71
+ $fileLocation = $this->inputDir . DIRECTORY_SEPARATOR . $languageDirectory;
72
+
73
+ if (is_dir($fileLocation)) {
74
+ // Will contain files
75
+
76
+ $countryCodeFiles = scandir($fileLocation);
77
+
78
+ foreach ($countryCodeFiles as $countryCodeFileName) {
79
+ if (in_array($countryCodeFileName, $this->filesToIgnore)) {
80
+ continue;
81
+ }
82
+
83
+
84
+ $outputFiles = $this->createOutputFileNames(
85
+ $countryCodeFileName,
86
+ $this->getCountryCodeFromTextFileName($countryCodeFileName),
87
+ $languageDirectory
88
+ );
89
+
90
+ $mappings[$languageDirectory . DIRECTORY_SEPARATOR . $countryCodeFileName] = $outputFiles;
91
+ }
92
+ }
93
+ }
94
+
95
+ return $mappings;
96
+ }
97
+
98
+ /**
99
+ * Method used by {@code #createInputOutputMappings()} to generate the list of output binary files
100
+ * from the provided input text file. For the data files expected to be large (currently only
101
+ * NANPA is supported), this method generates a list containing one output file for each area
102
+ * code. Otherwise, a single file is added to the list.
103
+ */
104
+
105
+ private function createOutputFileNames($file, $countryCode, $language)
106
+ {
107
+ $outputFiles = array();
108
+
109
+ if ($countryCode == self::NANPA_COUNTRY_CODE) {
110
+ // Fetch the 4-digit prefixes stored in the file.
111
+ $phonePrefixes = array();
112
+
113
+ $this->parseTextFile(
114
+ $this->getFilePathFromLanguageAndCountryCode($language, $countryCode),
115
+ function ($prefix, $location) use (&$phonePrefixes) {
116
+ $shortPrefix = substr($prefix, 0, 4);
117
+ if (!in_array($shortPrefix, $phonePrefixes)) {
118
+ $phonePrefixes[] = $shortPrefix;
119
+ }
120
+ }
121
+ );
122
+
123
+ foreach ($phonePrefixes as $prefix) {
124
+ $outputFiles[] = $this->generateFilename($prefix, $language);
125
+ }
126
+ } elseif ($countryCode == 86) {
127
+
128
+ /*
129
+ * Reduce memory usage for China numbers
130
+ * @see https://github.com/giggsey/libphonenumber-for-php/issues/44
131
+ */
132
+
133
+ // Fetch the 5-digit prefixes stored in the file.
134
+ $phonePrefixes = array();
135
+
136
+ $this->parseTextFile(
137
+ $this->getFilePathFromLanguageAndCountryCode($language, $countryCode),
138
+ function ($prefix, $location) use (&$phonePrefixes) {
139
+ $shortPrefix = substr($prefix, 0, 5);
140
+ if (!in_array($shortPrefix, $phonePrefixes)) {
141
+ $phonePrefixes[] = $shortPrefix;
142
+ }
143
+ }
144
+ );
145
+
146
+ foreach ($phonePrefixes as $prefix) {
147
+ $outputFiles[] = $this->generateFilename($prefix, $language);
148
+ }
149
+ } else {
150
+ $outputFiles[] = $this->generateFilename($countryCode, $language);
151
+ }
152
+
153
+ return $outputFiles;
154
+ }
155
+
156
+ /**
157
+ * Reads phone prefix data from the provides file path and invokes the given handler for each
158
+ * mapping read.
159
+ *
160
+ * @param $filePath
161
+ * @param $handler
162
+ * @return array
163
+ * @throws \InvalidArgumentException
164
+ */
165
+ private function parseTextFile($filePath, \Closure $handler)
166
+ {
167
+
168
+ if (!file_exists($filePath) || !is_readable($filePath)) {
169
+ throw new \InvalidArgumentException("File '{$filePath}' does not exist");
170
+ }
171
+
172
+ $data = file($filePath);
173
+
174
+ $countryData = array();
175
+
176
+ foreach ($data as $line) {
177
+ // Remove \n
178
+ $line = str_replace("\n", "", $line);
179
+ $line = str_replace("\r", "", $line);
180
+ $line = trim($line);
181
+
182
+ if (strlen($line) == 0 || substr($line, 0, 1) == '#') {
183
+ continue;
184
+ }
185
+ if (strpos($line, '|')) {
186
+ // Valid line
187
+ $parts = explode('|', $line);
188
+
189
+
190
+ $prefix = $parts[0];
191
+ $location = $parts[1];
192
+
193
+ $handler($prefix, $location);
194
+ }
195
+
196
+ }
197
+
198
+ return $countryData;
199
+
200
+ }
201
+
202
+ private function getFilePathFromLanguageAndCountryCode($language, $code)
203
+ {
204
+ return $this->getFilePath($language . DIRECTORY_SEPARATOR . $code . self::DATA_FILE_EXTENSION);
205
+ }
206
+
207
+ private function getFilePath($fileName)
208
+ {
209
+ $path = $this->inputDir . $fileName;
210
+
211
+ return $path;
212
+ }
213
+
214
+ private function generateFilename($prefix, $language)
215
+ {
216
+ return $language . DIRECTORY_SEPARATOR . $prefix . self::DATA_FILE_EXTENSION;
217
+ }
218
+
219
+ private function getCountryCodeFromTextFileName($countryCodeFileName)
220
+ {
221
+ return str_replace(self::DATA_FILE_EXTENSION, '', $countryCodeFileName);
222
+ }
223
+
224
+ private function readMappingsFromFile($inputFile)
225
+ {
226
+ $areaCodeMap = array();
227
+
228
+ $this->parseTextFile(
229
+ $this->inputDir . $inputFile,
230
+ function ($prefix, $location) use (&$areaCodeMap) {
231
+ $areaCodeMap[$prefix] = $location;
232
+ }
233
+ );
234
+
235
+ return $areaCodeMap;
236
+ }
237
+
238
+ private function getLanguageFromTextFile($textFile)
239
+ {
240
+ $parts = explode(DIRECTORY_SEPARATOR, $textFile);
241
+
242
+ return $parts[0];
243
+ }
244
+
245
+ private function removeEmptyEnglishMappings(&$mappings, $language)
246
+ {
247
+ if ($language != "en") {
248
+ return;
249
+ }
250
+
251
+ foreach ($mappings as $k => $v) {
252
+ if ($v == "") {
253
+ unset($mappings[$k]);
254
+ }
255
+ }
256
+ }
257
+
258
+ /**
259
+ * Compress the provided mappings according to the English data file if any.
260
+ * @param string $textFile
261
+ * @param array $mappings
262
+ */
263
+ private function makeDataFallbackToEnglish($textFile, &$mappings)
264
+ {
265
+ $englishPath = $this->getEnglishDataPath($textFile);
266
+
267
+ if ($textFile == $englishPath || !file_exists($this->getFilePath($englishPath))) {
268
+ return;
269
+ }
270
+
271
+ $countryCode = substr($textFile, 3, 2);
272
+
273
+ if (!array_key_exists($countryCode, $this->englishMaps)) {
274
+ $englishMap = $this->readMappingsFromFile($englishPath);
275
+
276
+ $this->englishMaps[$countryCode] = $englishMap;
277
+ }
278
+
279
+ $this->compressAccordingToEnglishData($this->englishMaps[$countryCode], $mappings);
280
+ }
281
+
282
+ private function getEnglishDataPath($textFile)
283
+ {
284
+ return "en" . DIRECTORY_SEPARATOR . substr($textFile, 3, 2) . self::DATA_FILE_EXTENSION;
285
+ }
286
+
287
+ private function compressAccordingToEnglishData($englishMap, &$nonEnglishMap)
288
+ {
289
+ foreach ($nonEnglishMap as $prefix => $value) {
290
+
291
+ if (array_key_exists($prefix, $englishMap)) {
292
+ $englishDescription = $englishMap[$prefix];
293
+ if ($englishDescription == $value) {
294
+ if (!$this->hasOverlappingPrefix($prefix, $nonEnglishMap)) {
295
+ unset($nonEnglishMap[$prefix]);
296
+ } else {
297
+ $nonEnglishMap[$prefix] = "";
298
+ }
299
+ }
300
+ }
301
+ }
302
+ }
303
+
304
+ private function hasOverlappingPrefix($number, $mappings)
305
+ {
306
+ while (strlen($number) > 0) {
307
+ $number = substr($number, 0, -1);
308
+
309
+ if (array_key_exists($number, $mappings)) {
310
+ return true;
311
+ }
312
+ }
313
+
314
+ return false;
315
+ }
316
+
317
+ private function splitMap($mappings, $outputFiles)
318
+ {
319
+ $mappingForFiles = array();
320
+
321
+ foreach ($mappings as $prefix => $location) {
322
+ $targetFile = null;
323
+
324
+ foreach ($outputFiles as $k => $outputFile) {
325
+ $outputFilePrefix = $this->getPhonePrefixLanguagePairFromFilename($outputFile)->prefix;
326
+ if (self::startsWith($prefix, $outputFilePrefix)) {
327
+ $targetFile = $outputFilePrefix;
328
+ break;
329
+ }
330
+ }
331
+
332
+
333
+ if (!array_key_exists($targetFile, $mappingForFiles)) {
334
+ $mappingForFiles[$targetFile] = array();
335
+ }
336
+ $mappingForFiles[$targetFile][$prefix] = $location;
337
+ }
338
+
339
+ return $mappingForFiles;
340
+ }
341
+
342
+ /**
343
+ * Extracts the phone prefix and the language code contained in the provided file name.
344
+ */
345
+ private function getPhonePrefixLanguagePairFromFilename($outputFile)
346
+ {
347
+ $parts = explode(DIRECTORY_SEPARATOR, $outputFile);
348
+
349
+ $returnObj = new \stdClass();
350
+ $returnObj->language = $parts[0];
351
+
352
+ $returnObj->prefix = $this->getCountryCodeFromTextFileName($parts[1]);
353
+
354
+ return $returnObj;
355
+ }
356
+
357
+ /**
358
+ *
359
+ * @link http://stackoverflow.com/a/834355/403165
360
+ * @param $haystack
361
+ * @param $needle
362
+ * @return bool
363
+ */
364
+ private static function startsWith($haystack, $needle)
365
+ {
366
+ return !strncmp($haystack, $needle, strlen($needle));
367
+ }
368
+
369
+ private function writeMappingFile($language, $outputFile, $data)
370
+ {
371
+
372
+ if (!file_exists($this->outputDir . $language)) {
373
+ mkdir($this->outputDir . $language);
374
+ }
375
+
376
+ $phpSource = '<?php' . PHP_EOL
377
+ . self::GENERATION_COMMENT
378
+ . 'return ' . var_export($data, true) . ';'
379
+ . PHP_EOL;
380
+
381
+ $outputPath = $this->outputDir . $language . DIRECTORY_SEPARATOR . $outputFile . '.php';
382
+
383
+ file_put_contents($outputPath, $phpSource);
384
+ }
385
+
386
+ public function addConfigurationMapping(&$availableDataFiles, $language, $prefix)
387
+ {
388
+ if (!array_key_exists($language, $availableDataFiles)) {
389
+ $availableDataFiles[$language] = array();
390
+ }
391
+
392
+ $availableDataFiles[$language][] = $prefix;
393
+ }
394
+
395
+ private function writeConfigMap($availableDataFiles)
396
+ {
397
+ $phpSource = '<?php' . PHP_EOL
398
+ . self::GENERATION_COMMENT
399
+ . 'return ' . var_export($availableDataFiles, true) . ';'
400
+ . PHP_EOL;
401
+
402
+ $outputPath = $this->outputDir . 'Map.php';
403
+
404
+ file_put_contents($outputPath, $phpSource);
405
+ }
406
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/build/libphonenumber/buildtools/GenerateTimeZonesMapData.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber\buildtools;
4
+
5
+
6
+ use libphonenumber\PhoneNumberToTimeZonesMapper;
7
+
8
+ class GenerateTimeZonesMapData
9
+ {
10
+ const GENERATION_COMMENT = <<<'EOT'
11
+ /**
12
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
13
+ * Please don't modify it directly.
14
+ */
15
+
16
+
17
+ EOT;
18
+ private $inputTextFile;
19
+
20
+ public function __construct($inputFile, $outputDir)
21
+ {
22
+ $this->inputTextFile = $inputFile;
23
+
24
+ if (!is_readable($this->inputTextFile)) {
25
+ throw new \RuntimeException("The provided input text file does not exist.");
26
+ }
27
+
28
+ $data = $this->parseTextFile();
29
+ $this->writeMappingFile($outputDir, $data);
30
+ }
31
+
32
+ /**
33
+ * Reads phone prefix data from the provided input stream and returns a SortedMap with the
34
+ * prefix to time zones mappings.
35
+ */
36
+ private function parseTextFile()
37
+ {
38
+ $data = file($this->inputTextFile);
39
+
40
+ $timeZoneMap = array();
41
+
42
+ foreach ($data as $line) {
43
+ // Remove \n
44
+ $line = str_replace("\n", "", $line);
45
+ $line = str_replace("\r", "", $line);
46
+ $line = trim($line);
47
+
48
+ if (strlen($line) == 0 || substr($line, 0, 1) == '#') {
49
+ continue;
50
+ }
51
+ if (strpos($line, '|')) {
52
+ // Valid line
53
+ $parts = explode('|', $line);
54
+
55
+
56
+ $prefix = $parts[0];
57
+ $timezone = $parts[1];
58
+
59
+ $timeZoneMap[$prefix] = $timezone;
60
+ }
61
+ }
62
+
63
+ return $timeZoneMap;
64
+ }
65
+
66
+ private function writeMappingFile($outputFile, $data)
67
+ {
68
+ $phpSource = '<?php' . PHP_EOL
69
+ . self::GENERATION_COMMENT
70
+ . 'return ' . var_export($data, true) . ';'
71
+ . PHP_EOL;
72
+
73
+ $outputPath = $outputFile . DIRECTORY_SEPARATOR . PhoneNumberToTimeZonesMapper::MAPPING_DATA_FILE_NAME;
74
+
75
+ file_put_contents($outputPath, $phpSource);
76
+ }
77
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/composer.json ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "giggsey/libphonenumber-for-php",
3
+ "type": "library",
4
+ "description": "PHP Port of Google's libphonenumber",
5
+ "keywords": ["phonenumber", "libphonenumber", "mobile", "validation", "geocoding", "geolocation"],
6
+ "homepage": "https://github.com/giggsey/libphonenumber-for-php",
7
+ "license": "Apache-2.0",
8
+ "support": {
9
+ "irc": "irc://irc.appliedirc.com/lobby",
10
+ "source": "https://github.com/giggsey/libphonenumber-for-php",
11
+ "issues": "https://github.com/giggsey/libphonenumber-for-php/issues"
12
+ },
13
+ "authors": [
14
+ {
15
+ "name": "Joshua Gigg",
16
+ "email": "giggsey@gmail.com",
17
+ "homepage": "http://giggsey.com/"
18
+ }
19
+ ],
20
+ "autoload": {
21
+ "psr-0": {
22
+ "libphonenumber": "src/"
23
+ }
24
+ },
25
+ "autoload-dev": {
26
+ "psr-0": {
27
+ "libphonenumber\\buildtools": "build/",
28
+ "libphonenumber\\Tests": "Tests/"
29
+ }
30
+ },
31
+ "archive": {
32
+ "exclude": ["Tests/", "build/", "/.travis.yml", "/build.xml", "phpunit.xml.dist", "libphonenumber-for-php.spec"]
33
+ },
34
+ "require": {
35
+ "ext-mbstring": "*"
36
+ },
37
+ "require-dev": {
38
+ "phing/phing": "~2.7",
39
+ "pear/versioncontrol_git": "dev-master",
40
+ "pear/pear-core-minimal": "^1.9",
41
+ "pear/pear_exception": "*",
42
+ "phpunit/phpunit": "~4.0",
43
+ "symfony/console": "~2.4",
44
+ "satooshi/php-coveralls": "~0.6"
45
+ },
46
+ "suggest": {
47
+ "ext-intl": "To use the geocoder and carrier mapping"
48
+ },
49
+ "extra": {
50
+ "branch-alias": {
51
+ "dev-master": "7.x-dev"
52
+ }
53
+ }
54
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/libphonenumber-for-php.spec ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Define version and release number
2
+ %define version @PACKAGE_VERSION@
3
+ %define release 1
4
+ %define php_version 53
5
+
6
+ Name: libphonenumber-for-php
7
+ Version: %{version}
8
+ Release: %{release}.php%{php_version}%{?dist}
9
+ Summary: libphonenumber for PHP
10
+ # See https://github.com/giggsey/libphonenumber-for-php/blob/master/LICENSE
11
+ License: Apache 2.0
12
+ Group: Development/Libraries
13
+ URL: https://github.com/giggsey/libphonenumber-for-php
14
+ # Get the source files from https://github.com/giggsey/libphonenumber-for-php/tags
15
+ Source: %{name}-%{version}.tar.gz
16
+ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
17
+
18
+ %description
19
+ A PHP library for parsing, formatting, storing and validating international phone numbers.
20
+ This library is based on Google's libphonenumber and forked from a version by Davide Mendolia.
21
+
22
+ %prep
23
+ %setup -q
24
+ %build
25
+
26
+ # Clean the buildroot so that it does not contain any stuff from previous builds
27
+ [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
28
+
29
+ # Install the extension
30
+ install -d %{buildroot}
31
+
32
+ # Prepare files
33
+ mkdir -p %{buildroot}/usr/share/php
34
+ cp -a src/libphonenumber/ %{buildroot}/usr/share/php
35
+
36
+ %clean
37
+ [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
38
+
39
+ %files
40
+ %defattr(-,root,root,-)
41
+ /usr/share/php/libphonenumber
42
+
43
+ %changelog
44
+ * Wed Apr 16 2014 Adrian Siminiceanu <adrian.siminiceanu@gmail.com>
45
+ - Initial spec file
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/phpunit.xml.dist ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <phpunit bootstrap="./Tests/bootstrap.php"
3
+ colors="true">
4
+
5
+ <testsuites>
6
+ <testsuite>
7
+ <directory>./Tests/</directory>
8
+ </testsuite>
9
+ </testsuites>
10
+
11
+ <filter>
12
+ <whitelist>
13
+ <directory suffix=".php">./src/</directory>
14
+ <exclude>
15
+ <!-- Exclude data directories, and files -->
16
+ <directory suffix=".php">./src/libphonenumber/data/</directory>
17
+ <directory suffix=".php">./src/libphonenumber/carrier/data/</directory>
18
+ <directory suffix=".php">./src/libphonenumber/geocoding/data/</directory>
19
+ <directory suffix=".php">./src/libphonenumber/timezone/data/</directory>
20
+ <file>./src/libphonenumber/AlternateFormatsCountryCodeSet.php</file>
21
+ <file>./src/libphonenumber/CountryCodeToRegionCodeMap.php</file>
22
+ <file>./src/libphonenumber/CountryCodeToRegionCodeMapForTesting.php</file>
23
+ <file>./src/libphonenumber/RegionCode.php</file>
24
+ </exclude>
25
+ </whitelist>
26
+ </filter>
27
+
28
+ </phpunit>
29
+
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/AlternateFormatsCountryCodeSet.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ namespace libphonenumber;
9
+ class AlternateFormatsCountryCodeSet {
10
+
11
+ // A set of all country codes for which data is available.
12
+
13
+ public static $alternateFormatsCountryCodeSet = array (
14
+ 0 => 7,
15
+ 1 => 27,
16
+ 2 => 30,
17
+ 3 => 31,
18
+ 4 => 34,
19
+ 5 => 36,
20
+ 6 => 43,
21
+ 7 => 44,
22
+ 8 => 49,
23
+ 9 => 54,
24
+ 10 => 55,
25
+ 11 => 58,
26
+ 12 => 61,
27
+ 13 => 62,
28
+ 14 => 63,
29
+ 15 => 66,
30
+ 16 => 81,
31
+ 17 => 84,
32
+ 18 => 90,
33
+ 19 => 91,
34
+ 20 => 94,
35
+ 21 => 95,
36
+ 22 => 255,
37
+ 23 => 350,
38
+ 24 => 351,
39
+ 25 => 352,
40
+ 26 => 358,
41
+ 27 => 359,
42
+ 28 => 372,
43
+ 29 => 373,
44
+ 30 => 380,
45
+ 31 => 381,
46
+ 32 => 385,
47
+ 33 => 505,
48
+ 34 => 506,
49
+ 35 => 595,
50
+ 36 => 675,
51
+ 37 => 676,
52
+ 38 => 679,
53
+ 39 => 855,
54
+ 40 => 971,
55
+ 41 => 972,
56
+ 42 => 995,
57
+ );
58
+
59
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/CountryCodeSource.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Country code source from number
7
+ */
8
+ class CountryCodeSource
9
+ {
10
+ const FROM_NUMBER_WITH_PLUS_SIGN = 0;
11
+ const FROM_NUMBER_WITH_IDD = 1;
12
+ const FROM_NUMBER_WITHOUT_PLUS_SIGN = 2;
13
+ const FROM_DEFAULT_COUNTRY = 3;
14
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/CountryCodeToRegionCodeMap.php ADDED
@@ -0,0 +1,914 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ namespace libphonenumber;
9
+ class CountryCodeToRegionCodeMap {
10
+
11
+ // A mapping from a country code to the region codes which denote the
12
+ // country/region represented by that country code. In the case of multiple
13
+ // countries sharing a calling code, such as the NANPA countries, the one
14
+ // indicated with "isMainCountryForCode" in the metadata should be first.
15
+
16
+ public static $countryCodeToRegionCodeMap = array (
17
+ 1 =>
18
+ array (
19
+ 0 => 'US',
20
+ 1 => 'AG',
21
+ 2 => 'AI',
22
+ 3 => 'AS',
23
+ 4 => 'BB',
24
+ 5 => 'BM',
25
+ 6 => 'BS',
26
+ 7 => 'CA',
27
+ 8 => 'DM',
28
+ 9 => 'DO',
29
+ 10 => 'GD',
30
+ 11 => 'GU',
31
+ 12 => 'JM',
32
+ 13 => 'KN',
33
+ 14 => 'KY',
34
+ 15 => 'LC',
35
+ 16 => 'MP',
36
+ 17 => 'MS',
37
+ 18 => 'PR',
38
+ 19 => 'SX',
39
+ 20 => 'TC',
40
+ 21 => 'TT',
41
+ 22 => 'VC',
42
+ 23 => 'VG',
43
+ 24 => 'VI',
44
+ ),
45
+ 7 =>
46
+ array (
47
+ 0 => 'RU',
48
+ 1 => 'KZ',
49
+ ),
50
+ 20 =>
51
+ array (
52
+ 0 => 'EG',
53
+ ),
54
+ 27 =>
55
+ array (
56
+ 0 => 'ZA',
57
+ ),
58
+ 30 =>
59
+ array (
60
+ 0 => 'GR',
61
+ ),
62
+ 31 =>
63
+ array (
64
+ 0 => 'NL',
65
+ ),
66
+ 32 =>
67
+ array (
68
+ 0 => 'BE',
69
+ ),
70
+ 33 =>
71
+ array (
72
+ 0 => 'FR',
73
+ ),
74
+ 34 =>
75
+ array (
76
+ 0 => 'ES',
77
+ ),
78
+ 36 =>
79
+ array (
80
+ 0 => 'HU',
81
+ ),
82
+ 39 =>
83
+ array (
84
+ 0 => 'IT',
85
+ 1 => 'VA',
86
+ ),
87
+ 40 =>
88
+ array (
89
+ 0 => 'RO',
90
+ ),
91
+ 41 =>
92
+ array (
93
+ 0 => 'CH',
94
+ ),
95
+ 43 =>
96
+ array (
97
+ 0 => 'AT',
98
+ ),
99
+ 44 =>
100
+ array (
101
+ 0 => 'GB',
102
+ 1 => 'GG',
103
+ 2 => 'IM',
104
+ 3 => 'JE',
105
+ ),
106
+ 45 =>
107
+ array (
108
+ 0 => 'DK',
109
+ ),
110
+ 46 =>
111
+ array (
112
+ 0 => 'SE',
113
+ ),
114
+ 47 =>
115
+ array (
116
+ 0 => 'NO',
117
+ 1 => 'SJ',
118
+ ),
119
+ 48 =>
120
+ array (
121
+ 0 => 'PL',
122
+ ),
123
+ 49 =>
124
+ array (
125
+ 0 => 'DE',
126
+ ),
127
+ 51 =>
128
+ array (
129
+ 0 => 'PE',
130
+ ),
131
+ 52 =>
132
+ array (
133
+ 0 => 'MX',
134
+ ),
135
+ 53 =>
136
+ array (
137
+ 0 => 'CU',
138
+ ),
139
+ 54 =>
140
+ array (
141
+ 0 => 'AR',
142
+ ),
143
+ 55 =>
144
+ array (
145
+ 0 => 'BR',
146
+ ),
147
+ 56 =>
148
+ array (
149
+ 0 => 'CL',
150
+ ),
151
+ 57 =>
152
+ array (
153
+ 0 => 'CO',
154
+ ),
155
+ 58 =>
156
+ array (
157
+ 0 => 'VE',
158
+ ),
159
+ 60 =>
160
+ array (
161
+ 0 => 'MY',
162
+ ),
163
+ 61 =>
164
+ array (
165
+ 0 => 'AU',
166
+ 1 => 'CC',
167
+ 2 => 'CX',
168
+ ),
169
+ 62 =>
170
+ array (
171
+ 0 => 'ID',
172
+ ),
173
+ 63 =>
174
+ array (
175
+ 0 => 'PH',
176
+ ),
177
+ 64 =>
178
+ array (
179
+ 0 => 'NZ',
180
+ ),
181
+ 65 =>
182
+ array (
183
+ 0 => 'SG',
184
+ ),
185
+ 66 =>
186
+ array (
187
+ 0 => 'TH',
188
+ ),
189
+ 81 =>
190
+ array (
191
+ 0 => 'JP',
192
+ ),
193
+ 82 =>
194
+ array (
195
+ 0 => 'KR',
196
+ ),
197
+ 84 =>
198
+ array (
199
+ 0 => 'VN',
200
+ ),
201
+ 86 =>
202
+ array (
203
+ 0 => 'CN',
204
+ ),
205
+ 90 =>
206
+ array (
207
+ 0 => 'TR',
208
+ ),
209
+ 91 =>
210
+ array (
211
+ 0 => 'IN',
212
+ ),
213
+ 92 =>
214
+ array (
215
+ 0 => 'PK',
216
+ ),
217
+ 93 =>
218
+ array (
219
+ 0 => 'AF',
220
+ ),
221
+ 94 =>
222
+ array (
223
+ 0 => 'LK',
224
+ ),
225
+ 95 =>
226
+ array (
227
+ 0 => 'MM',
228
+ ),
229
+ 98 =>
230
+ array (
231
+ 0 => 'IR',
232
+ ),
233
+ 211 =>
234
+ array (
235
+ 0 => 'SS',
236
+ ),
237
+ 212 =>
238
+ array (
239
+ 0 => 'MA',
240
+ 1 => 'EH',
241
+ ),
242
+ 213 =>
243
+ array (
244
+ 0 => 'DZ',
245
+ ),
246
+ 216 =>
247
+ array (
248
+ 0 => 'TN',
249
+ ),
250
+ 218 =>
251
+ array (
252
+ 0 => 'LY',
253
+ ),
254
+ 220 =>
255
+ array (
256
+ 0 => 'GM',
257
+ ),
258
+ 221 =>
259
+ array (
260
+ 0 => 'SN',
261
+ ),
262
+ 222 =>
263
+ array (
264
+ 0 => 'MR',
265
+ ),
266
+ 223 =>
267
+ array (
268
+ 0 => 'ML',
269
+ ),
270
+ 224 =>
271
+ array (
272
+ 0 => 'GN',
273
+ ),
274
+ 225 =>
275
+ array (
276
+ 0 => 'CI',
277
+ ),
278
+ 226 =>
279
+ array (
280
+ 0 => 'BF',
281
+ ),
282
+ 227 =>
283
+ array (
284
+ 0 => 'NE',
285
+ ),
286
+ 228 =>
287
+ array (
288
+ 0 => 'TG',
289
+ ),
290
+ 229 =>
291
+ array (
292
+ 0 => 'BJ',
293
+ ),
294
+ 230 =>
295
+ array (
296
+ 0 => 'MU',
297
+ ),
298
+ 231 =>
299
+ array (
300
+ 0 => 'LR',
301
+ ),
302
+ 232 =>
303
+ array (
304
+ 0 => 'SL',
305
+ ),
306
+ 233 =>
307
+ array (
308
+ 0 => 'GH',
309
+ ),
310
+ 234 =>
311
+ array (
312
+ 0 => 'NG',
313
+ ),
314
+ 235 =>
315
+ array (
316
+ 0 => 'TD',
317
+ ),
318
+ 236 =>
319
+ array (
320
+ 0 => 'CF',
321
+ ),
322
+ 237 =>
323
+ array (
324
+ 0 => 'CM',
325
+ ),
326
+ 238 =>
327
+ array (
328
+ 0 => 'CV',
329
+ ),
330
+ 239 =>
331
+ array (
332
+ 0 => 'ST',
333
+ ),
334
+ 240 =>
335
+ array (
336
+ 0 => 'GQ',
337
+ ),
338
+ 241 =>
339
+ array (
340
+ 0 => 'GA',
341
+ ),
342
+ 242 =>
343
+ array (
344
+ 0 => 'CG',
345
+ ),
346
+ 243 =>
347
+ array (
348
+ 0 => 'CD',
349
+ ),
350
+ 244 =>
351
+ array (
352
+ 0 => 'AO',
353
+ ),
354
+ 245 =>
355
+ array (
356
+ 0 => 'GW',
357
+ ),
358
+ 246 =>
359
+ array (
360
+ 0 => 'IO',
361
+ ),
362
+ 247 =>
363
+ array (
364
+ 0 => 'AC',
365
+ ),
366
+ 248 =>
367
+ array (
368
+ 0 => 'SC',
369
+ ),
370
+ 249 =>
371
+ array (
372
+ 0 => 'SD',
373
+ ),
374
+ 250 =>
375
+ array (
376
+ 0 => 'RW',
377
+ ),
378
+ 251 =>
379
+ array (
380
+ 0 => 'ET',
381
+ ),
382
+ 252 =>
383
+ array (
384
+ 0 => 'SO',
385
+ ),
386
+ 253 =>
387
+ array (
388
+ 0 => 'DJ',
389
+ ),
390
+ 254 =>
391
+ array (
392
+ 0 => 'KE',
393
+ ),
394
+ 255 =>
395
+ array (
396
+ 0 => 'TZ',
397
+ ),
398
+ 256 =>
399
+ array (
400
+ 0 => 'UG',
401
+ ),
402
+ 257 =>
403
+ array (
404
+ 0 => 'BI',
405
+ ),
406
+ 258 =>
407
+ array (
408
+ 0 => 'MZ',
409
+ ),
410
+ 260 =>
411
+ array (
412
+ 0 => 'ZM',
413
+ ),
414
+ 261 =>
415
+ array (
416
+ 0 => 'MG',
417
+ ),
418
+ 262 =>
419
+ array (
420
+ 0 => 'RE',
421
+ 1 => 'YT',
422
+ ),
423
+ 263 =>
424
+ array (
425
+ 0 => 'ZW',
426
+ ),
427
+ 264 =>
428
+ array (
429
+ 0 => 'NA',
430
+ ),
431
+ 265 =>
432
+ array (
433
+ 0 => 'MW',
434
+ ),
435
+ 266 =>
436
+ array (
437
+ 0 => 'LS',
438
+ ),
439
+ 267 =>
440
+ array (
441
+ 0 => 'BW',
442
+ ),
443
+ 268 =>
444
+ array (
445
+ 0 => 'SZ',
446
+ ),
447
+ 269 =>
448
+ array (
449
+ 0 => 'KM',
450
+ ),
451
+ 290 =>
452
+ array (
453
+ 0 => 'SH',
454
+ 1 => 'TA',
455
+ ),
456
+ 291 =>
457
+ array (
458
+ 0 => 'ER',
459
+ ),
460
+ 297 =>
461
+ array (
462
+ 0 => 'AW',
463
+ ),
464
+ 298 =>
465
+ array (
466
+ 0 => 'FO',
467
+ ),
468
+ 299 =>
469
+ array (
470
+ 0 => 'GL',
471
+ ),
472
+ 350 =>
473
+ array (
474
+ 0 => 'GI',
475
+ ),
476
+ 351 =>
477
+ array (
478
+ 0 => 'PT',
479
+ ),
480
+ 352 =>
481
+ array (
482
+ 0 => 'LU',
483
+ ),
484
+ 353 =>
485
+ array (
486
+ 0 => 'IE',
487
+ ),
488
+ 354 =>
489
+ array (
490
+ 0 => 'IS',
491
+ ),
492
+ 355 =>
493
+ array (
494
+ 0 => 'AL',
495
+ ),
496
+ 356 =>
497
+ array (
498
+ 0 => 'MT',
499
+ ),
500
+ 357 =>
501
+ array (
502
+ 0 => 'CY',
503
+ ),
504
+ 358 =>
505
+ array (
506
+ 0 => 'FI',
507
+ 1 => 'AX',
508
+ ),
509
+ 359 =>
510
+ array (
511
+ 0 => 'BG',
512
+ ),
513
+ 370 =>
514
+ array (
515
+ 0 => 'LT',
516
+ ),
517
+ 371 =>
518
+ array (
519
+ 0 => 'LV',
520
+ ),
521
+ 372 =>
522
+ array (
523
+ 0 => 'EE',
524
+ ),
525
+ 373 =>
526
+ array (
527
+ 0 => 'MD',
528
+ ),
529
+ 374 =>
530
+ array (
531
+ 0 => 'AM',
532
+ ),
533
+ 375 =>
534
+ array (
535
+ 0 => 'BY',
536
+ ),
537
+ 376 =>
538
+ array (
539
+ 0 => 'AD',
540
+ ),
541
+ 377 =>
542
+ array (
543
+ 0 => 'MC',
544
+ ),
545
+ 378 =>
546
+ array (
547
+ 0 => 'SM',
548
+ ),
549
+ 380 =>
550
+ array (
551
+ 0 => 'UA',
552
+ ),
553
+ 381 =>
554
+ array (
555
+ 0 => 'RS',
556
+ ),
557
+ 382 =>
558
+ array (
559
+ 0 => 'ME',
560
+ ),
561
+ 385 =>
562
+ array (
563
+ 0 => 'HR',
564
+ ),
565
+ 386 =>
566
+ array (
567
+ 0 => 'SI',
568
+ ),
569
+ 387 =>
570
+ array (
571
+ 0 => 'BA',
572
+ ),
573
+ 389 =>
574
+ array (
575
+ 0 => 'MK',
576
+ ),
577
+ 420 =>
578
+ array (
579
+ 0 => 'CZ',
580
+ ),
581
+ 421 =>
582
+ array (
583
+ 0 => 'SK',
584
+ ),
585
+ 423 =>
586
+ array (
587
+ 0 => 'LI',
588
+ ),
589
+ 500 =>
590
+ array (
591
+ 0 => 'FK',
592
+ ),
593
+ 501 =>
594
+ array (
595
+ 0 => 'BZ',
596
+ ),
597
+ 502 =>
598
+ array (
599
+ 0 => 'GT',
600
+ ),
601
+ 503 =>
602
+ array (
603
+ 0 => 'SV',
604
+ ),
605
+ 504 =>
606
+ array (
607
+ 0 => 'HN',
608
+ ),
609
+ 505 =>
610
+ array (
611
+ 0 => 'NI',
612
+ ),
613
+ 506 =>
614
+ array (
615
+ 0 => 'CR',
616
+ ),
617
+ 507 =>
618
+ array (
619
+ 0 => 'PA',
620
+ ),
621
+ 508 =>
622
+ array (
623
+ 0 => 'PM',
624
+ ),
625
+ 509 =>
626
+ array (
627
+ 0 => 'HT',
628
+ ),
629
+ 590 =>
630
+ array (
631
+ 0 => 'GP',
632
+ 1 => 'BL',
633
+ 2 => 'MF',
634
+ ),
635
+ 591 =>
636
+ array (
637
+ 0 => 'BO',
638
+ ),
639
+ 592 =>
640
+ array (
641
+ 0 => 'GY',
642
+ ),
643
+ 593 =>
644
+ array (
645
+ 0 => 'EC',
646
+ ),
647
+ 594 =>
648
+ array (
649
+ 0 => 'GF',
650
+ ),
651
+ 595 =>
652
+ array (
653
+ 0 => 'PY',
654
+ ),
655
+ 596 =>
656
+ array (
657
+ 0 => 'MQ',
658
+ ),
659
+ 597 =>
660
+ array (
661
+ 0 => 'SR',
662
+ ),
663
+ 598 =>
664
+ array (
665
+ 0 => 'UY',
666
+ ),
667
+ 599 =>
668
+ array (
669
+ 0 => 'CW',
670
+ 1 => 'BQ',
671
+ ),
672
+ 670 =>
673
+ array (
674
+ 0 => 'TL',
675
+ ),
676
+ 672 =>
677
+ array (
678
+ 0 => 'NF',
679
+ ),
680
+ 673 =>
681
+ array (
682
+ 0 => 'BN',
683
+ ),
684
+ 674 =>
685
+ array (
686
+ 0 => 'NR',
687
+ ),
688
+ 675 =>
689
+ array (
690
+ 0 => 'PG',
691
+ ),
692
+ 676 =>
693
+ array (
694
+ 0 => 'TO',
695
+ ),
696
+ 677 =>
697
+ array (
698
+ 0 => 'SB',
699
+ ),
700
+ 678 =>
701
+ array (
702
+ 0 => 'VU',
703
+ ),
704
+ 679 =>
705
+ array (
706
+ 0 => 'FJ',
707
+ ),
708
+ 680 =>
709
+ array (
710
+ 0 => 'PW',
711
+ ),
712
+ 681 =>
713
+ array (
714
+ 0 => 'WF',
715
+ ),
716
+ 682 =>
717
+ array (
718
+ 0 => 'CK',
719
+ ),
720
+ 683 =>
721
+ array (
722
+ 0 => 'NU',
723
+ ),
724
+ 685 =>
725
+ array (
726
+ 0 => 'WS',
727
+ ),
728
+ 686 =>
729
+ array (
730
+ 0 => 'KI',
731
+ ),
732
+ 687 =>
733
+ array (
734
+ 0 => 'NC',
735
+ ),
736
+ 688 =>
737
+ array (
738
+ 0 => 'TV',
739
+ ),
740
+ 689 =>
741
+ array (
742
+ 0 => 'PF',
743
+ ),
744
+ 690 =>
745
+ array (
746
+ 0 => 'TK',
747
+ ),
748
+ 691 =>
749
+ array (
750
+ 0 => 'FM',
751
+ ),
752
+ 692 =>
753
+ array (
754
+ 0 => 'MH',
755
+ ),
756
+ 800 =>
757
+ array (
758
+ 0 => '001',
759
+ ),
760
+ 808 =>
761
+ array (
762
+ 0 => '001',
763
+ ),
764
+ 850 =>
765
+ array (
766
+ 0 => 'KP',
767
+ ),
768
+ 852 =>
769
+ array (
770
+ 0 => 'HK',
771
+ ),
772
+ 853 =>
773
+ array (
774
+ 0 => 'MO',
775
+ ),
776
+ 855 =>
777
+ array (
778
+ 0 => 'KH',
779
+ ),
780
+ 856 =>
781
+ array (
782
+ 0 => 'LA',
783
+ ),
784
+ 870 =>
785
+ array (
786
+ 0 => '001',
787
+ ),
788
+ 878 =>
789
+ array (
790
+ 0 => '001',
791
+ ),
792
+ 880 =>
793
+ array (
794
+ 0 => 'BD',
795
+ ),
796
+ 881 =>
797
+ array (
798
+ 0 => '001',
799
+ ),
800
+ 882 =>
801
+ array (
802
+ 0 => '001',
803
+ ),
804
+ 883 =>
805
+ array (
806
+ 0 => '001',
807
+ ),
808
+ 886 =>
809
+ array (
810
+ 0 => 'TW',
811
+ ),
812
+ 888 =>
813
+ array (
814
+ 0 => '001',
815
+ ),
816
+ 960 =>
817
+ array (
818
+ 0 => 'MV',
819
+ ),
820
+ 961 =>
821
+ array (
822
+ 0 => 'LB',
823
+ ),
824
+ 962 =>
825
+ array (
826
+ 0 => 'JO',
827
+ ),
828
+ 963 =>
829
+ array (
830
+ 0 => 'SY',
831
+ ),
832
+ 964 =>
833
+ array (
834
+ 0 => 'IQ',
835
+ ),
836
+ 965 =>
837
+ array (
838
+ 0 => 'KW',
839
+ ),
840
+ 966 =>
841
+ array (
842
+ 0 => 'SA',
843
+ ),
844
+ 967 =>
845
+ array (
846
+ 0 => 'YE',
847
+ ),
848
+ 968 =>
849
+ array (
850
+ 0 => 'OM',
851
+ ),
852
+ 970 =>
853
+ array (
854
+ 0 => 'PS',
855
+ ),
856
+ 971 =>
857
+ array (
858
+ 0 => 'AE',
859
+ ),
860
+ 972 =>
861
+ array (
862
+ 0 => 'IL',
863
+ ),
864
+ 973 =>
865
+ array (
866
+ 0 => 'BH',
867
+ ),
868
+ 974 =>
869
+ array (
870
+ 0 => 'QA',
871
+ ),
872
+ 975 =>
873
+ array (
874
+ 0 => 'BT',
875
+ ),
876
+ 976 =>
877
+ array (
878
+ 0 => 'MN',
879
+ ),
880
+ 977 =>
881
+ array (
882
+ 0 => 'NP',
883
+ ),
884
+ 979 =>
885
+ array (
886
+ 0 => '001',
887
+ ),
888
+ 992 =>
889
+ array (
890
+ 0 => 'TJ',
891
+ ),
892
+ 993 =>
893
+ array (
894
+ 0 => 'TM',
895
+ ),
896
+ 994 =>
897
+ array (
898
+ 0 => 'AZ',
899
+ ),
900
+ 995 =>
901
+ array (
902
+ 0 => 'GE',
903
+ ),
904
+ 996 =>
905
+ array (
906
+ 0 => 'KG',
907
+ ),
908
+ 998 =>
909
+ array (
910
+ 0 => 'UZ',
911
+ ),
912
+ );
913
+
914
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/CountryCodeToRegionCodeMapForTesting.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ namespace libphonenumber;
9
+ class CountryCodeToRegionCodeMapForTesting {
10
+
11
+ // A mapping from a country code to the region codes which denote the
12
+ // country/region represented by that country code. In the case of multiple
13
+ // countries sharing a calling code, such as the NANPA countries, the one
14
+ // indicated with "isMainCountryForCode" in the metadata should be first.
15
+
16
+ public static $countryCodeToRegionCodeMapForTesting = array (
17
+ 1 =>
18
+ array (
19
+ 0 => 'US',
20
+ 1 => 'BB',
21
+ 2 => 'BS',
22
+ 3 => 'CA',
23
+ ),
24
+ 33 =>
25
+ array (
26
+ 0 => 'FR',
27
+ ),
28
+ 36 =>
29
+ array (
30
+ 0 => 'HU',
31
+ ),
32
+ 39 =>
33
+ array (
34
+ 0 => 'IT',
35
+ ),
36
+ 44 =>
37
+ array (
38
+ 0 => 'GB',
39
+ 1 => 'GG',
40
+ ),
41
+ 46 =>
42
+ array (
43
+ 0 => 'SE',
44
+ ),
45
+ 48 =>
46
+ array (
47
+ 0 => 'PL',
48
+ ),
49
+ 49 =>
50
+ array (
51
+ 0 => 'DE',
52
+ ),
53
+ 52 =>
54
+ array (
55
+ 0 => 'MX',
56
+ ),
57
+ 54 =>
58
+ array (
59
+ 0 => 'AR',
60
+ ),
61
+ 55 =>
62
+ array (
63
+ 0 => 'BR',
64
+ ),
65
+ 61 =>
66
+ array (
67
+ 0 => 'AU',
68
+ 1 => 'CC',
69
+ 2 => 'CX',
70
+ ),
71
+ 64 =>
72
+ array (
73
+ 0 => 'NZ',
74
+ ),
75
+ 65 =>
76
+ array (
77
+ 0 => 'SG',
78
+ ),
79
+ 81 =>
80
+ array (
81
+ 0 => 'JP',
82
+ ),
83
+ 82 =>
84
+ array (
85
+ 0 => 'KR',
86
+ ),
87
+ 86 =>
88
+ array (
89
+ 0 => 'CN',
90
+ ),
91
+ 244 =>
92
+ array (
93
+ 0 => 'AO',
94
+ ),
95
+ 262 =>
96
+ array (
97
+ 0 => 'RE',
98
+ 1 => 'YT',
99
+ ),
100
+ 375 =>
101
+ array (
102
+ 0 => 'BY',
103
+ ),
104
+ 376 =>
105
+ array (
106
+ 0 => 'AD',
107
+ ),
108
+ 800 =>
109
+ array (
110
+ 0 => '001',
111
+ ),
112
+ 971 =>
113
+ array (
114
+ 0 => 'AE',
115
+ ),
116
+ 979 =>
117
+ array (
118
+ 0 => '001',
119
+ ),
120
+ );
121
+
122
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/DefaultMetadataLoader.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+
6
+ class DefaultMetadataLoader implements MetadataLoaderInterface
7
+ {
8
+ public function loadMetadata($metadataFileName)
9
+ {
10
+ return include $metadataFileName;
11
+ }
12
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MatchType.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Types of phone number matches
7
+ * See detailed description beside the isNumberMatch() method
8
+ */
9
+ class MatchType
10
+ {
11
+ const NOT_A_NUMBER = 0;
12
+ const NO_MATCH = 1;
13
+ const SHORT_NSN_MATCH = 2;
14
+ const NSN_MATCH = 3;
15
+ const EXACT_MATCH = 4;
16
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/Matcher.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Matcher for various regex matching
7
+ *
8
+ * Note that this is NOT the same as google's java PhoneNumberMatcher class.
9
+ * This class is a minimal port of java's built-in matcher class, whereas PhoneNumberMatcher
10
+ * is designed to recognize phone numbers embedded in any text.
11
+ */
12
+ class Matcher
13
+ {
14
+ /**
15
+ * @var string
16
+ */
17
+ private $pattern;
18
+
19
+ /**
20
+ * @var string
21
+ */
22
+ private $subject;
23
+
24
+ /**
25
+ * @var array
26
+ */
27
+ private $groups = array();
28
+
29
+ /**
30
+ * @param string $pattern
31
+ * @param string $subject
32
+ */
33
+ public function __construct($pattern, $subject)
34
+ {
35
+ $this->pattern = str_replace('/', '\/', $pattern);
36
+ $this->subject = $subject;
37
+ }
38
+
39
+ private function doMatch($type = 'find')
40
+ {
41
+ $final_pattern = '(?:' . $this->pattern . ')';
42
+ switch ($type) {
43
+ case 'matches':
44
+ $final_pattern = '^' . $final_pattern . '$';
45
+ break;
46
+ case 'lookingAt':
47
+ $final_pattern = '^' . $final_pattern;
48
+ break;
49
+ case 'find':
50
+ default:
51
+ // no changes
52
+ break;
53
+ }
54
+ $final_pattern = '/' . $final_pattern . '/x';
55
+ return (preg_match($final_pattern, $this->subject, $this->groups, PREG_OFFSET_CAPTURE) == 1) ? true : false;
56
+ }
57
+
58
+ /**
59
+ * @return bool
60
+ */
61
+ public function matches()
62
+ {
63
+ return $this->doMatch('matches');
64
+ }
65
+
66
+ /**
67
+ * @return bool
68
+ */
69
+ public function lookingAt()
70
+ {
71
+ return $this->doMatch('lookingAt');
72
+ }
73
+
74
+ /**
75
+ * @return bool
76
+ */
77
+ public function find()
78
+ {
79
+ return $this->doMatch('find');
80
+ }
81
+
82
+ /**
83
+ * @return int
84
+ */
85
+ public function groupCount()
86
+ {
87
+ if (empty($this->groups)) {
88
+ return null;
89
+ } else {
90
+ return count($this->groups) - 1;
91
+ }
92
+ }
93
+
94
+ /**
95
+ * @param int $group
96
+ * @return string
97
+ */
98
+ public function group($group = null)
99
+ {
100
+ if (!isset($group)) {
101
+ $group = 0;
102
+ }
103
+ return (isset($this->groups[$group][0])) ? $this->groups[$group][0] : null;
104
+ }
105
+
106
+ /**
107
+ * @param int|null $group
108
+ * @return int
109
+ */
110
+ public function end($group = null)
111
+ {
112
+ if (!isset($group) || $group === null) {
113
+ $group = 0;
114
+ }
115
+ if (!isset($this->groups[$group])) {
116
+ return null;
117
+ }
118
+ return $this->groups[$group][1] + strlen($this->groups[$group][0]);
119
+ }
120
+
121
+ public function start($group = null)
122
+ {
123
+ if (isset($group) || $group === null) {
124
+ $group = 0;
125
+ }
126
+ if (!isset($this->groups[$group])) {
127
+ return null;
128
+ }
129
+
130
+ return $this->groups[$group][1];
131
+ }
132
+
133
+ /**
134
+ * @param string $replacement
135
+ * @return string
136
+ */
137
+ public function replaceFirst($replacement)
138
+ {
139
+ return preg_replace('/' . $this->pattern . '/x', $replacement, $this->subject, 1);
140
+ }
141
+
142
+ /**
143
+ * @param string $replacement
144
+ * @return string
145
+ */
146
+ public function replaceAll($replacement)
147
+ {
148
+ return preg_replace('/' . $this->pattern . '/x', $replacement, $this->subject);
149
+ }
150
+
151
+ /**
152
+ * @param string $input
153
+ * @return Matcher
154
+ */
155
+ public function reset($input = "")
156
+ {
157
+ $this->subject = $input;
158
+
159
+ return $this;
160
+ }
161
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MatcherAPIInterface.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+
6
+ /**
7
+ * Interface MatcherAPIInterface
8
+ *
9
+ * Internal phonenumber matching API used to isolate the underlying implementation of the
10
+ * matcher and allow different implementations to be swapped in easily.
11
+ *
12
+ * @package libphonenumber
13
+ */
14
+ interface MatcherAPIInterface
15
+ {
16
+ /**
17
+ * Returns whether the given national number (a string containing only decimal digits) matches
18
+ * the national number pattern defined in the given {@code PhoneNumberDesc} message.
19
+ *
20
+ * @param string $nationalNumber
21
+ * @param PhoneNumberDesc $numberDesc
22
+ * @param boolean $allowPrefixMatch
23
+ * @return boolean
24
+ */
25
+ public function matchesNationalNumber($nationalNumber, PhoneNumberDesc $numberDesc, $allowPrefixMatch);
26
+
27
+ /**
28
+ * Returns whether the given national number (a string containing only decimal digits) matches
29
+ * the possible number pattern defined in the given {@code PhoneNumberDesc} message.
30
+ *
31
+ * @param string $nationalNumber
32
+ * @param PhoneNumberDesc $numberDesc
33
+ * @return boolean
34
+ */
35
+ public function matchesPossibleNumber($nationalNumber, PhoneNumberDesc $numberDesc);
36
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MetadataLoaderInterface.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+
6
+ interface MetadataLoaderInterface
7
+ {
8
+ /**
9
+ * @param string $metadataFileName File name (including path) of metadata to load.
10
+ * @return mixed
11
+ */
12
+ public function loadMetadata($metadataFileName);
13
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MetadataSourceInterface.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+
6
+ interface MetadataSourceInterface
7
+ {
8
+ /**
9
+ * Gets phone metadata for a region.
10
+ * @param string $regionCode the region code.
11
+ * @return PhoneMetadata the phone metadata for that region, or null if there is none.
12
+ */
13
+ public function getMetadataForRegion($regionCode);
14
+
15
+ /**
16
+ * Gets phone metadata for a non-geographical region.
17
+ * @param int $countryCallingCode the country calling code.
18
+ * @return PhoneMetadata the phone metadata for that region, or null if there is none.
19
+ */
20
+ public function getMetadataForNonGeographicalRegion($countryCallingCode);
21
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/MultiFileMetadataSourceImpl.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ *
5
+ * @author joshuag
6
+ * @created: 04/08/2015 09:03
7
+ * @project libphonenumber-for-php
8
+ */
9
+
10
+ namespace libphonenumber;
11
+
12
+
13
+ class MultiFileMetadataSourceImpl implements MetadataSourceInterface
14
+ {
15
+ private static $metaDataFilePrefix = PhoneNumberUtil::META_DATA_FILE_PREFIX;
16
+
17
+ /**
18
+ * A mapping from a region code to the PhoneMetadata for that region.
19
+ * @var PhoneMetadata[]
20
+ */
21
+ private $regionToMetadataMap = array();
22
+
23
+ /**
24
+ * A mapping from a country calling code for a non-geographical entity to the PhoneMetadata for
25
+ * that country calling code. Examples of the country calling codes include 800 (International
26
+ * Toll Free Service) and 808 (International Shared Cost Service).
27
+ * @var PhoneMetadata[]
28
+ */
29
+ private $countryCodeToNonGeographicalMetadataMap = array();
30
+
31
+ /**
32
+ * The prefix of the metadata files from which region data is loaded.
33
+ * @var String
34
+ */
35
+ private $currentFilePrefix;
36
+
37
+
38
+ /**
39
+ * The metadata loader used to inject alternative metadata sources.
40
+ * @var MetadataLoaderInterface
41
+ */
42
+ private $metadataLoader;
43
+
44
+ /**
45
+ * @param MetadataLoaderInterface $metadataLoader
46
+ * @param string|null $currentFilePrefix
47
+ */
48
+ public function __construct(MetadataLoaderInterface $metadataLoader, $currentFilePrefix = null)
49
+ {
50
+ if ($currentFilePrefix === null) {
51
+ $currentFilePrefix = self::$metaDataFilePrefix;
52
+ }
53
+
54
+ $this->currentFilePrefix = $currentFilePrefix;
55
+ $this->metadataLoader = $metadataLoader;
56
+ }
57
+
58
+ /**
59
+ * @inheritdoc
60
+ */
61
+ public function getMetadataForRegion($regionCode)
62
+ {
63
+ if (!array_key_exists($regionCode, $this->regionToMetadataMap)) {
64
+ // The regionCode here will be valid and won't be '001', so we don't need to worry about
65
+ // what to pass in for the country calling code.
66
+ $this->loadMetadataFromFile($this->currentFilePrefix, $regionCode, 0, $this->metadataLoader);
67
+ }
68
+
69
+ return $this->regionToMetadataMap[$regionCode];
70
+ }
71
+
72
+ /**
73
+ * @inheritdoc
74
+ */
75
+ public function getMetadataForNonGeographicalRegion($countryCallingCode)
76
+ {
77
+ if (!array_key_exists($countryCallingCode, $this->countryCodeToNonGeographicalMetadataMap)) {
78
+ $this->loadMetadataFromFile($this->currentFilePrefix, PhoneNumberUtil::REGION_CODE_FOR_NON_GEO_ENTITY, $countryCallingCode, $this->metadataLoader);
79
+ }
80
+
81
+ return $this->countryCodeToNonGeographicalMetadataMap[$countryCallingCode];
82
+ }
83
+
84
+ /**
85
+ * @param string $filePrefix
86
+ * @param string $regionCode
87
+ * @param int $countryCallingCode
88
+ * @param MetadataLoaderInterface $metadataLoader
89
+ * @throws \RuntimeException
90
+ */
91
+ public function loadMetadataFromFile($filePrefix, $regionCode, $countryCallingCode, MetadataLoaderInterface $metadataLoader)
92
+ {
93
+ $isNonGeoRegion = PhoneNumberUtil::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCode;
94
+ $fileName = $filePrefix . '_' . ($isNonGeoRegion ? $countryCallingCode : $regionCode) . '.php';
95
+ if (!is_readable($fileName)) {
96
+ throw new \RuntimeException('missing metadata: ' . $fileName);
97
+ } else {
98
+ $data = $metadataLoader->loadMetadata($fileName);
99
+ $metadata = new PhoneMetadata();
100
+ $metadata->fromArray($data);
101
+ if ($isNonGeoRegion) {
102
+ $this->countryCodeToNonGeographicalMetadataMap[$countryCallingCode] = $metadata;
103
+ } else {
104
+ $this->regionToMetadataMap[$regionCode] = $metadata;
105
+ }
106
+ }
107
+ }
108
+
109
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/NumberFormat.php ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Number Format
7
+ */
8
+ class NumberFormat
9
+ {
10
+ private $pattern = null;
11
+ private $format = null;
12
+ private $leadingDigitsPattern = array();
13
+ private $nationalPrefixFormattingRule = null;
14
+ private $domesticCarrierCodeFormattingRule = null;
15
+
16
+ /**
17
+ * @return boolean
18
+ */
19
+ public function hasPattern()
20
+ {
21
+ return isset($this->pattern);
22
+ }
23
+
24
+ /**
25
+ * @return string
26
+ */
27
+ public function getPattern()
28
+ {
29
+ return $this->pattern;
30
+ }
31
+
32
+ /**
33
+ * @param string $value
34
+ * @return NumberFormat
35
+ */
36
+ public function setPattern($value)
37
+ {
38
+ $this->pattern = $value;
39
+
40
+ return $this;
41
+ }
42
+
43
+ /**
44
+ * @return boolean
45
+ */
46
+ public function hasFormat()
47
+ {
48
+ return isset($this->format);
49
+ }
50
+
51
+ /**
52
+ * @return string
53
+ */
54
+ public function getFormat()
55
+ {
56
+ return $this->format;
57
+ }
58
+
59
+ /**
60
+ * @param string $value
61
+ * @return NumberFormat
62
+ */
63
+ public function setFormat($value)
64
+ {
65
+ $this->format = $value;
66
+
67
+ return $this;
68
+ }
69
+
70
+ /**
71
+ * @return string
72
+ */
73
+ public function leadingDigitPatterns()
74
+ {
75
+ return $this->leadingDigitsPattern;
76
+ }
77
+
78
+ /**
79
+ * @return int
80
+ */
81
+ public function leadingDigitsPatternSize()
82
+ {
83
+ return count($this->leadingDigitsPattern);
84
+ }
85
+
86
+ /**
87
+ * @param int $index
88
+ * @return string
89
+ */
90
+ public function getLeadingDigitsPattern($index)
91
+ {
92
+ return $this->leadingDigitsPattern[$index];
93
+ }
94
+
95
+ /**
96
+ * @param string $value
97
+ * @return NumberFormat
98
+ */
99
+ public function addLeadingDigitsPattern($value)
100
+ {
101
+ $this->leadingDigitsPattern[] = $value;
102
+
103
+ return $this;
104
+ }
105
+
106
+ /**
107
+ * @return boolean
108
+ */
109
+ public function hasNationalPrefixFormattingRule()
110
+ {
111
+ return isset($this->nationalPrefixFormattingRule);
112
+ }
113
+
114
+ /**
115
+ * @return string
116
+ */
117
+ public function getNationalPrefixFormattingRule()
118
+ {
119
+ return $this->nationalPrefixFormattingRule;
120
+ }
121
+
122
+ /**
123
+ * @param string $value
124
+ * @return NumberFormat
125
+ */
126
+ public function setNationalPrefixFormattingRule($value)
127
+ {
128
+ $this->nationalPrefixFormattingRule = $value;
129
+
130
+ return $this;
131
+ }
132
+
133
+ /**
134
+ * @return NumberFormat
135
+ */
136
+ public function clearNationalPrefixFormattingRule()
137
+ {
138
+ $this->nationalPrefixFormattingRule = null;
139
+
140
+ return $this;
141
+ }
142
+
143
+ /**
144
+ * @return boolean
145
+ */
146
+ public function hasDomesticCarrierCodeFormattingRule()
147
+ {
148
+ return isset($this->domesticCarrierCodeFormattingRule);
149
+ }
150
+
151
+ /**
152
+ * @return string
153
+ */
154
+ public function getDomesticCarrierCodeFormattingRule()
155
+ {
156
+ return $this->domesticCarrierCodeFormattingRule;
157
+ }
158
+
159
+ /**
160
+ * @param string $value
161
+ * @return NumberFormat
162
+ */
163
+ public function setDomesticCarrierCodeFormattingRule($value)
164
+ {
165
+ $this->domesticCarrierCodeFormattingRule = $value;
166
+
167
+ return $this;
168
+ }
169
+
170
+ /**
171
+ * @param NumberFormat $other
172
+ * @return NumberFormat
173
+ */
174
+ public function mergeFrom(NumberFormat $other)
175
+ {
176
+ if ($other->hasPattern()) {
177
+ $this->setPattern($other->getPattern());
178
+ }
179
+ if ($other->hasFormat()) {
180
+ $this->setFormat($other->getFormat());
181
+ }
182
+ $leadingDigitsPatternSize = $other->leadingDigitsPatternSize();
183
+ for ($i = 0; $i < $leadingDigitsPatternSize; $i++) {
184
+ $this->addLeadingDigitsPattern($other->getLeadingDigitsPattern($i));
185
+ }
186
+ if ($other->hasNationalPrefixFormattingRule()) {
187
+ $this->setNationalPrefixFormattingRule($other->getNationalPrefixFormattingRule());
188
+ }
189
+ if ($other->hasDomesticCarrierCodeFormattingRule()) {
190
+ $this->setDomesticCarrierCodeFormattingRule($other->getDomesticCarrierCodeFormattingRule());
191
+ }
192
+ return $this;
193
+ }
194
+
195
+ /**
196
+ * @return array
197
+ */
198
+ public function toArray()
199
+ {
200
+ $output = array();
201
+ $output['pattern'] = $this->getPattern();
202
+ $output['format'] = $this->getFormat();
203
+
204
+ $output['leadingDigitsPatterns'] = $this->leadingDigitPatterns();
205
+
206
+ if ($this->hasNationalPrefixFormattingRule()) {
207
+ $output['nationalPrefixFormattingRule'] = $this->getNationalPrefixFormattingRule();
208
+ }
209
+
210
+ if ($this->hasDomesticCarrierCodeFormattingRule()) {
211
+ $output['domesticCarrierCodeFormattingRule'] = $this->getDomesticCarrierCodeFormattingRule();
212
+ }
213
+ return $output;
214
+ }
215
+
216
+ /**
217
+ * @param array $input
218
+ */
219
+ public function fromArray(array $input)
220
+ {
221
+ $this->setPattern($input['pattern']);
222
+ $this->setFormat($input['format']);
223
+ foreach ($input['leadingDigitsPatterns'] as $leadingDigitsPattern) {
224
+ $this->addLeadingDigitsPattern($leadingDigitsPattern);
225
+ }
226
+
227
+ if (isset($input['nationalPrefixFormattingRule'])) {
228
+ $this->setNationalPrefixFormattingRule($input['nationalPrefixFormattingRule']);
229
+ }
230
+ if (isset($input['domesticCarrierCodeFormattingRule'])) {
231
+ $this->setDomesticCarrierCodeFormattingRule($input['domesticCarrierCodeFormattingRule']);
232
+ }
233
+ }
234
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/NumberParseException.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Generic exception class for errors encountered when parsing phone numbers.
7
+ * @author Lara Rennie
8
+ */
9
+ class NumberParseException extends \Exception
10
+ {
11
+
12
+ const INVALID_COUNTRY_CODE = 0;
13
+ // This generally indicates the string passed in had less than 3 digits in it. More
14
+ // specifically, the number failed to match the regular expression VALID_PHONE_NUMBER in
15
+ // PhoneNumberUtil.
16
+ const NOT_A_NUMBER = 1;
17
+ // This indicates the string started with an international dialing prefix, but after this was
18
+ // stripped from the number, had less digits than any valid phone number (including country
19
+ // code) could have.
20
+ const TOO_SHORT_AFTER_IDD = 2;
21
+ // This indicates the string, after any country code has been stripped, had less digits than any
22
+ // valid phone number could have.
23
+ const TOO_SHORT_NSN = 3;
24
+ // This indicates the string had more digits than any valid phone number could have.
25
+ const TOO_LONG = 4;
26
+
27
+ private $errorType;
28
+
29
+ public function __construct($errorType, $message, $previous = null)
30
+ {
31
+ parent::__construct($message, $errorType, $previous);
32
+ $this->message = $message;
33
+ $this->errorType = $errorType;
34
+ }
35
+
36
+ /**
37
+ * Returns the error type of the exception that has been thrown.
38
+ */
39
+ public function getErrorType()
40
+ {
41
+ return $this->errorType;
42
+ }
43
+
44
+ public function __toString()
45
+ {
46
+ return "Error type: " . $this->errorType . ". " . $this->message;
47
+ }
48
+
49
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneMetadata.php ADDED
@@ -0,0 +1,937 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ class PhoneMetadata
6
+ {
7
+
8
+ /**
9
+ * @var string
10
+ */
11
+ private $id = null;
12
+
13
+ /**
14
+ * @return boolean
15
+ */
16
+ public function hasId()
17
+ {
18
+ return isset($this->id);
19
+ }
20
+
21
+ /**
22
+ * @return string
23
+ */
24
+ public function getId()
25
+ {
26
+ return $this->id;
27
+ }
28
+
29
+ /**
30
+ * @param string $value
31
+ * @return PhoneMetadata
32
+ */
33
+ public function setId($value)
34
+ {
35
+ $this->id = $value;
36
+ return $this;
37
+ }
38
+
39
+ /**
40
+ * @var int
41
+ */
42
+ private $countryCode = null;
43
+
44
+ /**
45
+ * @return boolean
46
+ */
47
+ public function hasCountryCode()
48
+ {
49
+ return isset($this->countryCode);
50
+ }
51
+
52
+ /**
53
+ * @return int
54
+ */
55
+ public function getCountryCode()
56
+ {
57
+ return $this->countryCode;
58
+ }
59
+
60
+ /**
61
+ * @param int $value
62
+ * @return PhoneMetadata
63
+ */
64
+ public function setCountryCode($value)
65
+ {
66
+ $this->countryCode = $value;
67
+ return $this;
68
+ }
69
+
70
+ private $leadingDigits = null;
71
+
72
+ /**
73
+ * @return bool
74
+ */
75
+ public function hasLeadingDigits()
76
+ {
77
+ return isset($this->leadingDigits);
78
+ }
79
+
80
+ public function getLeadingDigits()
81
+ {
82
+ return $this->leadingDigits;
83
+ }
84
+
85
+ public function setLeadingDigits($value)
86
+ {
87
+ $this->leadingDigits = $value;
88
+ return $this;
89
+ }
90
+
91
+ private $internationalPrefix = null;
92
+
93
+ public function hasInternationalPrefix()
94
+ {
95
+ return isset($this->internationalPrefix);
96
+ }
97
+
98
+ public function getInternationalPrefix()
99
+ {
100
+ return $this->internationalPrefix;
101
+ }
102
+
103
+ public function setInternationalPrefix($value)
104
+ {
105
+ $this->internationalPrefix = $value;
106
+ return $this;
107
+ }
108
+
109
+ private $preferredInternationalPrefix = null;
110
+
111
+ public function hasPreferredInternationalPrefix()
112
+ {
113
+ return isset($this->preferredInternationalPrefix);
114
+ }
115
+
116
+ public function getPreferredInternationalPrefix()
117
+ {
118
+ return $this->preferredInternationalPrefix;
119
+ }
120
+
121
+ public function setPreferredInternationalPrefix($value)
122
+ {
123
+ $this->preferredInternationalPrefix = $value;
124
+ return $this;
125
+ }
126
+
127
+ private $nationalPrefixForParsing = null;
128
+
129
+ public function hasNationalPrefixForParsing()
130
+ {
131
+ return isset($this->nationalPrefixForParsing);
132
+ }
133
+
134
+ public function getNationalPrefixForParsing()
135
+ {
136
+ return $this->nationalPrefixForParsing;
137
+ }
138
+
139
+ public function setNationalPrefixForParsing($value)
140
+ {
141
+ $this->nationalPrefixForParsing = $value;
142
+ return $this;
143
+ }
144
+
145
+ private $nationalPrefixTransformRule = null;
146
+
147
+ public function hasNationalPrefixTransformRule()
148
+ {
149
+ return isset($this->nationalPrefixTransformRule);
150
+ }
151
+
152
+ public function getNationalPrefixTransformRule()
153
+ {
154
+ return $this->nationalPrefixTransformRule;
155
+ }
156
+
157
+ public function setNationalPrefixTransformRule($value)
158
+ {
159
+ $this->nationalPrefixTransformRule = $value;
160
+ return $this;
161
+ }
162
+
163
+ private $nationalPrefix = null;
164
+
165
+ public function hasNationalPrefix()
166
+ {
167
+ return isset($this->nationalPrefix);
168
+ }
169
+
170
+ public function getNationalPrefix()
171
+ {
172
+ return $this->nationalPrefix;
173
+ }
174
+
175
+ public function setNationalPrefix($value)
176
+ {
177
+ $this->nationalPrefix = $value;
178
+ return $this;
179
+ }
180
+
181
+ private $preferredExtnPrefix = null;
182
+
183
+ public function hasPreferredExtnPrefix()
184
+ {
185
+ return isset($this->preferredExtnPrefix);
186
+ }
187
+
188
+ public function getPreferredExtnPrefix()
189
+ {
190
+ return $this->preferredExtnPrefix;
191
+ }
192
+
193
+ public function setPreferredExtnPrefix($value)
194
+ {
195
+ $this->preferredExtnPrefix = $value;
196
+ return $this;
197
+ }
198
+
199
+ private $mainCountryForCode = false;
200
+
201
+ public function hasMainCountryForCode()
202
+ {
203
+ return isset($this->mainCountryForCode);
204
+ }
205
+
206
+ public function isMainCountryForCode()
207
+ {
208
+ return $this->mainCountryForCode;
209
+ }
210
+
211
+ public function getMainCountryForCode()
212
+ {
213
+ return $this->mainCountryForCode;
214
+ }
215
+
216
+ public function setMainCountryForCode($value)
217
+ {
218
+ $this->mainCountryForCode = $value;
219
+ return $this;
220
+ }
221
+
222
+ private $leadingZeroPossible = false;
223
+
224
+ public function hasLeadingZeroPossible()
225
+ {
226
+ return isset($this->leadingZeroPossible);
227
+ }
228
+
229
+ public function isLeadingZeroPossible()
230
+ {
231
+ return $this->leadingZeroPossible;
232
+ }
233
+
234
+ public function setLeadingZeroPossible($value)
235
+ {
236
+ $this->leadingZeroPossible = $value;
237
+ return $this;
238
+ }
239
+
240
+ private $mobileNumberPortableRegion = false;
241
+
242
+ public function hasMobileNumberPortableRegion()
243
+ {
244
+ return isset($this->mobileNumberPortableRegion);
245
+ }
246
+
247
+ public function isMobileNumberPortableRegion()
248
+ {
249
+ return $this->mobileNumberPortableRegion;
250
+ }
251
+
252
+ public function setMobileNumberPortableRegion($value)
253
+ {
254
+ $this->mobileNumberPortableRegion = $value;
255
+ return $this;
256
+ }
257
+
258
+ private $generalDesc = null;
259
+
260
+ public function hasGeneralDesc()
261
+ {
262
+ return isset($this->generalDesc);
263
+ }
264
+
265
+ /**
266
+ * @return PhoneNumberDesc
267
+ */
268
+ public function getGeneralDesc()
269
+ {
270
+ return $this->generalDesc;
271
+ }
272
+
273
+ public function setGeneralDesc(PhoneNumberDesc $value)
274
+ {
275
+ $this->generalDesc = $value;
276
+ return $this;
277
+ }
278
+
279
+ /**
280
+ * @var PhoneNumberDesc
281
+ */
282
+ private $mobile = null;
283
+
284
+ public function hasMobile()
285
+ {
286
+ return isset($this->mobile);
287
+ }
288
+
289
+ /**
290
+ * @return PhoneNumberDesc
291
+ */
292
+ public function getMobile()
293
+ {
294
+ return $this->mobile;
295
+ }
296
+
297
+ public function setMobile(PhoneNumberDesc $value)
298
+ {
299
+ $this->mobile = $value;
300
+ return $this;
301
+ }
302
+
303
+ private $premiumRate = null;
304
+
305
+ public function hasPremiumRate()
306
+ {
307
+ return isset($this->premiumRate);
308
+ }
309
+
310
+ /**
311
+ * @return PhoneNumberDesc
312
+ */
313
+ public function getPremiumRate()
314
+ {
315
+ return $this->premiumRate;
316
+ }
317
+
318
+ public function setPremiumRate(PhoneNumberDesc $value)
319
+ {
320
+ $this->premiumRate = $value;
321
+ return $this;
322
+ }
323
+
324
+ private $fixedLine = null;
325
+
326
+ public function hasFixedLine()
327
+ {
328
+ return isset($this->fixedLine);
329
+ }
330
+
331
+ /**
332
+ * @return PhoneNumberDesc
333
+ */
334
+ public function getFixedLine()
335
+ {
336
+ return $this->fixedLine;
337
+ }
338
+
339
+ public function setFixedLine(PhoneNumberDesc $value)
340
+ {
341
+ $this->fixedLine = $value;
342
+ return $this;
343
+ }
344
+
345
+ private $sameMobileAndFixedLinePattern = false;
346
+
347
+ public function hasSameMobileAndFixedLinePattern()
348
+ {
349
+ return isset($this->sameMobileAndFixedLinePattern);
350
+ }
351
+
352
+ public function isSameMobileAndFixedLinePattern()
353
+ {
354
+ return $this->sameMobileAndFixedLinePattern;
355
+ }
356
+
357
+ public function setSameMobileAndFixedLinePattern($value)
358
+ {
359
+ $this->sameMobileAndFixedLinePattern = $value;
360
+ return $this;
361
+ }
362
+
363
+ private $numberFormat = array();
364
+
365
+ /**
366
+ * @return NumberFormat[]
367
+ */
368
+ public function numberFormats()
369
+ {
370
+ return $this->numberFormat;
371
+ }
372
+
373
+ public function numberFormatSize()
374
+ {
375
+ return count($this->numberFormat);
376
+ }
377
+
378
+ /**
379
+ * @param int $index
380
+ * @return NumberFormat
381
+ */
382
+ public function getNumberFormat($index)
383
+ {
384
+ return $this->numberFormat[$index];
385
+ }
386
+
387
+ public function addNumberFormat(NumberFormat $value)
388
+ {
389
+ $this->numberFormat[] = $value;
390
+ return $this;
391
+ }
392
+
393
+ private $tollFree = null;
394
+
395
+ public function hasTollFree()
396
+ {
397
+ return isset($this->tollFree);
398
+ }
399
+
400
+ /**
401
+ * @return PhoneNumberDesc
402
+ */
403
+ public function getTollFree()
404
+ {
405
+ return $this->tollFree;
406
+ }
407
+
408
+ public function setTollFree(PhoneNumberDesc $value)
409
+ {
410
+ $this->tollFree = $value;
411
+ return $this;
412
+ }
413
+
414
+ private $sharedCost = null;
415
+
416
+ public function hasSharedCost()
417
+ {
418
+ return isset($this->sharedCost);
419
+ }
420
+
421
+ /**
422
+ * @return PhoneNumberDesc
423
+ */
424
+ public function getSharedCost()
425
+ {
426
+ return $this->sharedCost;
427
+ }
428
+
429
+ public function setSharedCost(PhoneNumberDesc $value)
430
+ {
431
+ $this->sharedCost = $value;
432
+ return $this;
433
+ }
434
+
435
+ private $personalNumber;
436
+
437
+ public function hasPersonalNumber()
438
+ {
439
+ return isset($this->personalNumber);
440
+ }
441
+
442
+ /**
443
+ * @return PhoneNumberDesc
444
+ */
445
+ public function getPersonalNumber()
446
+ {
447
+ return $this->personalNumber;
448
+ }
449
+
450
+ public function setPersonalNumber(PhoneNumberDesc $value)
451
+ {
452
+ $this->personalNumber = $value;
453
+ return $this;
454
+ }
455
+
456
+ private $voip;
457
+
458
+ public function hasVoip()
459
+ {
460
+ return isset($this->voip);
461
+ }
462
+
463
+ /**
464
+ * @return PhoneNumberDesc
465
+ */
466
+ public function getVoip()
467
+ {
468
+ return $this->voip;
469
+ }
470
+
471
+ public function setVoip(PhoneNumberDesc $value)
472
+ {
473
+ $this->voip = $value;
474
+ return $this;
475
+ }
476
+
477
+ private $pager;
478
+
479
+ public function hasPager()
480
+ {
481
+ return isset($this->pager);
482
+ }
483
+
484
+ /**
485
+ * @return PhoneNumberDesc
486
+ */
487
+ public function getPager()
488
+ {
489
+ return $this->pager;
490
+ }
491
+
492
+ public function setPager(PhoneNumberDesc $value)
493
+ {
494
+ $this->pager = $value;
495
+ return $this;
496
+ }
497
+
498
+ private $uan;
499
+
500
+ public function hasUan()
501
+ {
502
+ return isset($this->uan);
503
+ }
504
+
505
+ /**
506
+ * @return PhoneNumberDesc
507
+ */
508
+ public function getUan()
509
+ {
510
+ return $this->uan;
511
+ }
512
+
513
+ public function setUan(PhoneNumberDesc $value)
514
+ {
515
+ $this->uan = $value;
516
+ return $this;
517
+ }
518
+
519
+ private $emergency;
520
+
521
+ public function hasEmergency()
522
+ {
523
+ return isset($this->emergency);
524
+ }
525
+
526
+ /**
527
+ * @return PhoneNumberDesc
528
+ */
529
+ public function getEmergency()
530
+ {
531
+ return $this->emergency;
532
+ }
533
+
534
+ public function setEmergency(PhoneNumberDesc $value)
535
+ {
536
+ $this->emergency = $value;
537
+ return $this;
538
+ }
539
+
540
+ private $voicemail;
541
+
542
+ public function hasVoicemail()
543
+ {
544
+ return isset($this->voicemail);
545
+ }
546
+
547
+ /**
548
+ * @return PhoneNumberDesc
549
+ */
550
+ public function getVoicemail()
551
+ {
552
+ return $this->voicemail;
553
+ }
554
+
555
+ public function setVoicemail(PhoneNumberDesc $value)
556
+ {
557
+ $this->voicemail = $value;
558
+ return $this;
559
+ }
560
+
561
+ /**
562
+ * @var PhoneNumberDesc
563
+ */
564
+ private $short_code;
565
+
566
+ public function hasShortCode()
567
+ {
568
+ return isset($this->short_code);
569
+ }
570
+
571
+ public function getShortCode()
572
+ {
573
+ return $this->short_code;
574
+ }
575
+
576
+ public function setShortCode(PhoneNumberDesc $value)
577
+ {
578
+ $this->short_code = $value;
579
+ return $this;
580
+ }
581
+
582
+ /**
583
+ * @var PhoneNumberDesc
584
+ */
585
+ private $standard_rate;
586
+
587
+ public function hasStandardRate()
588
+ {
589
+ return isset($this->standard_rate);
590
+ }
591
+
592
+ public function getStandardRate()
593
+ {
594
+ return $this->standard_rate;
595
+ }
596
+
597
+ public function setStandardRate(PhoneNumberDesc $value)
598
+ {
599
+ $this->standard_rate = $value;
600
+ return $this;
601
+ }
602
+
603
+ /**
604
+ * @var PhoneNumberDesc
605
+ */
606
+ private $carrierSpecific;
607
+
608
+ public function hasCarrierSpecific()
609
+ {
610
+ return isset($this->carrierSpecific);
611
+ }
612
+
613
+ public function getCarrierSpecific()
614
+ {
615
+ return $this->carrierSpecific;
616
+ }
617
+
618
+ public function setCarrierSpecific(PhoneNumberDesc $value)
619
+ {
620
+ $this->carrierSpecific = $value;
621
+ return $this;
622
+ }
623
+
624
+ /**
625
+ * @var PhoneNumberDesc
626
+ */
627
+ private $noInternationalDialling = null;
628
+
629
+ public function hasNoInternationalDialling()
630
+ {
631
+ return isset($this->noInternationalDialling);
632
+ }
633
+
634
+ public function getNoInternationalDialling()
635
+ {
636
+ return $this->noInternationalDialling;
637
+ }
638
+
639
+ public function setNoInternationalDialling(PhoneNumberDesc $value)
640
+ {
641
+ $this->noInternationalDialling = $value;
642
+ return $this;
643
+ }
644
+
645
+ /**
646
+ *
647
+ * @var NumberFormat[]
648
+ */
649
+ private $intlNumberFormat = array();
650
+
651
+ public function intlNumberFormats()
652
+ {
653
+ return $this->intlNumberFormat;
654
+ }
655
+
656
+ public function intlNumberFormatSize()
657
+ {
658
+ return count($this->intlNumberFormat);
659
+ }
660
+
661
+ public function getIntlNumberFormat($index)
662
+ {
663
+ return $this->intlNumberFormat[$index];
664
+ }
665
+
666
+ public function addIntlNumberFormat(NumberFormat $value)
667
+ {
668
+ $this->intlNumberFormat[] = $value;
669
+ return $this;
670
+ }
671
+
672
+ public function clearIntlNumberFormat()
673
+ {
674
+ $this->intlNumberFormat = array();
675
+ return $this;
676
+ }
677
+
678
+ public function toArray()
679
+ {
680
+ $output = array();
681
+
682
+ if ($this->hasGeneralDesc()) {
683
+ $output['generalDesc'] = $this->getGeneralDesc()->toArray();
684
+ }
685
+
686
+ if ($this->hasFixedLine()) {
687
+ $output['fixedLine'] = $this->getFixedLine()->toArray();
688
+ }
689
+
690
+ if ($this->hasMobile()) {
691
+ $output['mobile'] = $this->getMobile()->toArray();
692
+ }
693
+
694
+ if ($this->hasTollFree()) {
695
+ $output['tollFree'] = $this->getTollFree()->toArray();
696
+ }
697
+
698
+ if ($this->hasPremiumRate()) {
699
+ $output['premiumRate'] = $this->getPremiumRate()->toArray();
700
+ }
701
+
702
+ if ($this->hasPremiumRate()) {
703
+ $output['premiumRate'] = $this->getPremiumRate()->toArray();
704
+ }
705
+
706
+ if ($this->hasSharedCost()) {
707
+ $output['sharedCost'] = $this->getSharedCost()->toArray();
708
+ }
709
+
710
+ if ($this->hasPersonalNumber()) {
711
+ $output['personalNumber'] = $this->getPersonalNumber()->toArray();
712
+ }
713
+
714
+ if ($this->hasVoip()) {
715
+ $output['voip'] = $this->getVoip()->toArray();
716
+ }
717
+
718
+ if ($this->hasPager()) {
719
+ $output['pager'] = $this->getPager()->toArray();
720
+ }
721
+
722
+ if ($this->hasUan()) {
723
+ $output['uan'] = $this->getUan()->toArray();
724
+ }
725
+
726
+ if ($this->hasEmergency()) {
727
+ $output['emergency'] = $this->getEmergency()->toArray();
728
+ }
729
+
730
+ if ($this->hasVoicemail()) {
731
+ $output['voicemail'] = $this->getVoicemail()->toArray();
732
+ }
733
+
734
+ if ($this->hasShortCode()) {
735
+ $output['shortCode'] = $this->getShortCode()->toArray();
736
+ }
737
+
738
+ if ($this->hasStandardRate()) {
739
+ $output['standardRate'] = $this->getStandardRate()->toArray();
740
+ }
741
+
742
+ if ($this->hasCarrierSpecific()) {
743
+ $output['carrierSpecific'] = $this->getCarrierSpecific()->toArray();
744
+ }
745
+
746
+ if ($this->hasNoInternationalDialling()) {
747
+ $output['noInternationalDialling'] = $this->getNoInternationalDialling()->toArray();
748
+ }
749
+
750
+ $output['id'] = $this->getId();
751
+ $output['countryCode'] = $this->getCountryCode();
752
+ $output['internationalPrefix'] = $this->getInternationalPrefix();
753
+
754
+ if ($this->hasPreferredInternationalPrefix()) {
755
+ $output['preferredInternationalPrefix'] = $this->getPreferredInternationalPrefix();
756
+ }
757
+
758
+ if ($this->hasNationalPrefix()) {
759
+ $output['nationalPrefix'] = $this->getNationalPrefix();
760
+ }
761
+
762
+ if ($this->hasPreferredExtnPrefix()) {
763
+ $output['preferredExtnPrefix'] = $this->getPreferredExtnPrefix();
764
+ }
765
+
766
+ if ($this->hasNationalPrefixForParsing()) {
767
+ $output['nationalPrefixForParsing'] = $this->getNationalPrefixForParsing();
768
+ }
769
+
770
+ if ($this->hasNationalPrefixTransformRule()) {
771
+ $output['nationalPrefixTransformRule'] = $this->getNationalPrefixTransformRule();
772
+ }
773
+
774
+ $output['sameMobileAndFixedLinePattern'] = $this->isSameMobileAndFixedLinePattern();
775
+
776
+ $output['numberFormat'] = array();
777
+ foreach ($this->numberFormats() as $numberFormat) {
778
+ $output['numberFormat'][] = $numberFormat->toArray();
779
+ }
780
+
781
+ $output['intlNumberFormat'] = array();
782
+ foreach ($this->intlNumberFormats() as $intlNumberFormat) {
783
+ $output['intlNumberFormat'][] = $intlNumberFormat->toArray();
784
+ }
785
+
786
+ $output['mainCountryForCode'] = $this->getMainCountryForCode();
787
+
788
+ if ($this->hasLeadingDigits()) {
789
+ $output['leadingDigits'] = $this->getLeadingDigits();
790
+ }
791
+
792
+ $output['leadingZeroPossible'] = $this->isLeadingZeroPossible();
793
+
794
+ $output['mobileNumberPortableRegion'] = $this->isMobileNumberPortableRegion();
795
+
796
+ return $output;
797
+ }
798
+
799
+ /**
800
+ * @param array $input
801
+ * @return PhoneMetadata
802
+ */
803
+ public function fromArray(array $input)
804
+ {
805
+
806
+ if (isset($input['generalDesc'])) {
807
+ $desc = new PhoneNumberDesc();
808
+ $this->setGeneralDesc($desc->fromArray($input['generalDesc']));
809
+ }
810
+
811
+ if (isset($input['fixedLine'])) {
812
+ $desc = new PhoneNumberDesc();
813
+ $this->setFixedLine($desc->fromArray($input['fixedLine']));
814
+ }
815
+
816
+ if (isset($input['mobile'])) {
817
+ $desc = new PhoneNumberDesc();
818
+ $this->setMobile($desc->fromArray($input['mobile']));
819
+ }
820
+
821
+ if (isset($input['tollFree'])) {
822
+ $desc = new PhoneNumberDesc();
823
+ $this->setTollFree($desc->fromArray($input['tollFree']));
824
+ }
825
+
826
+ if (isset($input['premiumRate'])) {
827
+ $desc = new PhoneNumberDesc();
828
+ $this->setPremiumRate($desc->fromArray($input['premiumRate']));
829
+ }
830
+
831
+ if (isset($input['sharedCost'])) {
832
+ $desc = new PhoneNumberDesc();
833
+ $this->setSharedCost($desc->fromArray($input['sharedCost']));
834
+ }
835
+
836
+ if (isset($input['personalNumber'])) {
837
+ $desc = new PhoneNumberDesc();
838
+ $this->setPersonalNumber($desc->fromArray($input['personalNumber']));
839
+ }
840
+
841
+ if (isset($input['voip'])) {
842
+ $desc = new PhoneNumberDesc();
843
+ $this->setVoip($desc->fromArray($input['voip']));
844
+ }
845
+
846
+ if (isset($input['pager'])) {
847
+ $desc = new PhoneNumberDesc();
848
+ $this->setPager($desc->fromArray($input['pager']));
849
+ }
850
+
851
+ if (isset($input['uan'])) {
852
+ $desc = new PhoneNumberDesc();
853
+ $this->setUan($desc->fromArray($input['uan']));
854
+ }
855
+
856
+ if (isset($input['emergency'])) {
857
+ $desc = new PhoneNumberDesc();
858
+ $this->setEmergency($desc->fromArray($input['emergency']));
859
+ }
860
+
861
+ if (isset($input['voicemail'])) {
862
+ $desc = new PhoneNumberDesc();
863
+ $this->setVoicemail($desc->fromArray($input['voicemail']));
864
+ }
865
+
866
+ if (isset($input['shortCode'])) {
867
+ $desc = new PhoneNumberDesc();
868
+ $this->setShortCode(($desc->fromArray($input['shortCode'])));
869
+ }
870
+
871
+ if (isset($input['standardRate'])) {
872
+ $desc = new PhoneNumberDesc();
873
+ $this->setStandardRate($desc->fromArray($input['standardRate']));
874
+ }
875
+
876
+ if (isset($input['carrierSpecific'])) {
877
+ $desc = new PhoneNumberDesc();
878
+ $this->setCarrierSpecific($desc->fromArray($input['carrierSpecific']));
879
+ }
880
+
881
+ if (isset($input['noInternationalDialling'])) {
882
+ $desc = new PhoneNumberDesc();
883
+ $this->setNoInternationalDialling($desc->fromArray($input['noInternationalDialling']));
884
+ }
885
+
886
+ $this->setId($input['id']);
887
+ $this->setCountryCode($input['countryCode']);
888
+ $this->setInternationalPrefix($input['internationalPrefix']);
889
+
890
+ if (isset($input['preferredInternationalPrefix'])) {
891
+ $this->setPreferredInternationalPrefix($input['preferredInternationalPrefix']);
892
+ }
893
+ if (isset($input['nationalPrefix'])) {
894
+ $this->setNationalPrefix($input['nationalPrefix']);
895
+ }
896
+ if (isset($input['nationalPrefix'])) {
897
+ $this->setNationalPrefix($input['nationalPrefix']);
898
+ }
899
+
900
+ if (isset($input['preferredExtnPrefix'])) {
901
+ $this->setPreferredExtnPrefix($input['preferredExtnPrefix']);
902
+ }
903
+
904
+ if (isset($input['nationalPrefixForParsing'])) {
905
+ $this->setNationalPrefixForParsing($input['nationalPrefixForParsing']);
906
+ }
907
+
908
+ if (isset($input['nationalPrefixTransformRule'])) {
909
+ $this->setNationalPrefixTransformRule($input['nationalPrefixTransformRule']);
910
+ }
911
+
912
+ foreach ($input['numberFormat'] as $numberFormatElt) {
913
+ $numberFormat = new NumberFormat();
914
+ $numberFormat->fromArray($numberFormatElt);
915
+ $this->addNumberFormat($numberFormat);
916
+ }
917
+
918
+ foreach ($input['intlNumberFormat'] as $intlNumberFormatElt) {
919
+ $numberFormat = new NumberFormat();
920
+ $numberFormat->fromArray($intlNumberFormatElt);
921
+ $this->addIntlNumberFormat($numberFormat);
922
+ }
923
+
924
+ $this->setMainCountryForCode($input['mainCountryForCode']);
925
+
926
+ if (isset($input['leadingDigits'])) {
927
+ $this->setLeadingDigits($input['leadingDigits']);
928
+ }
929
+
930
+ $this->setLeadingZeroPossible($input['leadingZeroPossible']);
931
+
932
+ $this->setMobileNumberPortableRegion($input['mobileNumberPortableRegion']);
933
+
934
+ return $this;
935
+ }
936
+
937
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumber.php ADDED
@@ -0,0 +1,578 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ class PhoneNumber implements \Serializable
6
+ {
7
+ /**
8
+ * The country code.
9
+ *
10
+ * @var int|null
11
+ */
12
+ private $countryCode = null;
13
+
14
+ /**
15
+ * Returns whether this phone number has a country code set.
16
+ *
17
+ * @return bool True if a country code is set, false otherwise.
18
+ */
19
+ public function hasCountryCode()
20
+ {
21
+ return isset($this->countryCode);
22
+ }
23
+
24
+ /**
25
+ * Returns the country code of this phone number.
26
+ *
27
+ * @return int|null The country code, or null if not set.
28
+ */
29
+ public function getCountryCode()
30
+ {
31
+ return $this->countryCode;
32
+ }
33
+
34
+ /**
35
+ * Sets the country code of this phone number.
36
+ *
37
+ * @param int $value The country code.
38
+ *
39
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
40
+ */
41
+ public function setCountryCode($value)
42
+ {
43
+ $this->countryCode = (int) $value;
44
+ return $this;
45
+ }
46
+
47
+ /**
48
+ * Clears the country code of this phone number.
49
+ *
50
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
51
+ */
52
+ public function clearCountryCode()
53
+ {
54
+ $this->countryCode = null;
55
+ return $this;
56
+ }
57
+
58
+ /**
59
+ * The national number.
60
+ *
61
+ * @var string|null
62
+ */
63
+ private $nationalNumber = null;
64
+
65
+ /**
66
+ * Returns whether this phone number has a national number set.
67
+ *
68
+ * @return bool True if a national number is set, false otherwise.
69
+ */
70
+ public function hasNationalNumber()
71
+ {
72
+ return isset($this->nationalNumber);
73
+ }
74
+
75
+ /**
76
+ * Returns the country code of this phone number.
77
+ *
78
+ * @return string|null The national number, or null if not set.
79
+ */
80
+ public function getNationalNumber()
81
+ {
82
+ return $this->nationalNumber;
83
+ }
84
+
85
+ /**
86
+ * Sets the national number of this phone number.
87
+ *
88
+ * @param string $value The national number.
89
+ *
90
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
91
+ */
92
+ public function setNationalNumber($value)
93
+ {
94
+ $this->nationalNumber = (string) $value;
95
+ return $this;
96
+ }
97
+
98
+ /**
99
+ * Clears the national number of this phone number.
100
+ *
101
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
102
+ */
103
+ public function clearNationalNumber()
104
+ {
105
+ $this->nationalNumber = null;
106
+ return $this;
107
+ }
108
+
109
+ /**
110
+ * The extension.
111
+ *
112
+ * @var string|null
113
+ */
114
+ private $extension = null;
115
+
116
+ /**
117
+ * Returns whether this phone number has an extension set.
118
+ *
119
+ * @return bool True if an extension is set, false otherwise.
120
+ */
121
+ public function hasExtension()
122
+ {
123
+ return isset($this->extension);
124
+ }
125
+
126
+ /**
127
+ * Returns the extension of this phone number.
128
+ *
129
+ * @return string|null The extension, or null if not set.
130
+ */
131
+ public function getExtension()
132
+ {
133
+ return $this->extension;
134
+ }
135
+
136
+ /**
137
+ * Sets the extension of this phone number.
138
+ *
139
+ * @param string $value The extension.
140
+ *
141
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
142
+ */
143
+ public function setExtension($value)
144
+ {
145
+ $this->extension = (string) $value;
146
+ return $this;
147
+ }
148
+
149
+ /**
150
+ * Clears the extension of this phone number.
151
+ *
152
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
153
+ */
154
+ public function clearExtension()
155
+ {
156
+ $this->extension = null;
157
+ return $this;
158
+ }
159
+
160
+ /**
161
+ * Whether this phone number uses an italian leading zero.
162
+ *
163
+ * @var bool|null
164
+ */
165
+ private $italianLeadingZero = null;
166
+
167
+ /**
168
+ * Returns whether this phone number has the italian leading zero information set.
169
+ *
170
+ * @return bool
171
+ */
172
+ public function hasItalianLeadingZero()
173
+ {
174
+ return isset($this->italianLeadingZero);
175
+ }
176
+
177
+ /**
178
+ * Returns whether this phone number uses an italian leading zero.
179
+ *
180
+ * @return bool|null True if it uses an italian leading zero, false it it does not, null if not set.
181
+ */
182
+ public function isItalianLeadingZero()
183
+ {
184
+ return $this->italianLeadingZero;
185
+ }
186
+
187
+ /**
188
+ * Sets whether this phone number uses an italian leading zero.
189
+ *
190
+ * @param bool $value True to use italian leading zero, false otherwise.
191
+ *
192
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
193
+ */
194
+ public function setItalianLeadingZero($value)
195
+ {
196
+ $this->italianLeadingZero = (bool) $value;
197
+ return $this;
198
+ }
199
+
200
+ /**
201
+ * Clears the italian leading zero information of this phone number.
202
+ *
203
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
204
+ */
205
+ public function clearItalianLeadingZero()
206
+ {
207
+ $this->italianLeadingZero = null;
208
+ return $this;
209
+ }
210
+
211
+ /**
212
+ * The raw input.
213
+ *
214
+ * @var string|null
215
+ */
216
+ private $rawInput = null;
217
+
218
+ /**
219
+ * Returns whether this phone number has a raw input.
220
+ *
221
+ * @return bool True if a raw input is set, false otherwise.
222
+ */
223
+ public function hasRawInput()
224
+ {
225
+ return isset($this->rawInput);
226
+ }
227
+
228
+ /**
229
+ * Returns the raw input of this phone number.
230
+ *
231
+ * @return string|null The raw input, or null if not set.
232
+ */
233
+ public function getRawInput()
234
+ {
235
+ return $this->rawInput;
236
+ }
237
+
238
+ /**
239
+ * Sets the raw input of this phone number.
240
+ *
241
+ * @param string $value The raw input.
242
+ *
243
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
244
+ */
245
+ public function setRawInput($value)
246
+ {
247
+ $this->rawInput = (string) $value;
248
+ return $this;
249
+ }
250
+
251
+ /**
252
+ * Clears the raw input of this phone number.
253
+ *
254
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
255
+ */
256
+ public function clearRawInput()
257
+ {
258
+ $this->rawInput = null;
259
+ return $this;
260
+ }
261
+
262
+ /**
263
+ * The country code source.
264
+ *
265
+ * This must be one of the CountryCodeSource constants.
266
+ *
267
+ * @var int|null
268
+ */
269
+ private $countryCodeSource = null;
270
+
271
+ /**
272
+ * Returns whether this phone number has a country code source.
273
+ *
274
+ * @return bool True if a country code source is set, false otherwise.
275
+ */
276
+ public function hasCountryCodeSource()
277
+ {
278
+ return isset($this->countryCodeSource);
279
+ }
280
+
281
+ /**
282
+ * Returns the country code source of this phone number.
283
+ *
284
+ * @return int|null A CountryCodeSource constant, or null if not set.
285
+ */
286
+ public function getCountryCodeSource()
287
+ {
288
+ return $this->countryCodeSource;
289
+ }
290
+
291
+ /**
292
+ * Sets the country code source of this phone number.
293
+ *
294
+ * @param int $value A CountryCodeSource constant.
295
+ *
296
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
297
+ */
298
+ public function setCountryCodeSource($value)
299
+ {
300
+ $this->countryCodeSource = (int) $value;
301
+ return $this;
302
+ }
303
+
304
+ /**
305
+ * Clears the country code source of this phone number.
306
+ *
307
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
308
+ */
309
+ public function clearCountryCodeSource()
310
+ {
311
+ $this->countryCodeSource = null;
312
+ return $this;
313
+ }
314
+
315
+ /**
316
+ * The preferred domestic carrier code.
317
+ *
318
+ * @var string|null
319
+ */
320
+ private $preferredDomesticCarrierCode = null;
321
+
322
+ /**
323
+ * Returns whether this phone number has a preferred domestic carrier code.
324
+ *
325
+ * @return bool True if a preferred domestic carrier code is set, false otherwise.
326
+ */
327
+ public function hasPreferredDomesticCarrierCode()
328
+ {
329
+ return isset($this->preferredDomesticCarrierCode);
330
+ }
331
+
332
+ /**
333
+ * Returns the preferred domestic carrier code of this phone number.
334
+ *
335
+ * @return string|null The preferred domestic carrier code, or null if not set.
336
+ */
337
+ public function getPreferredDomesticCarrierCode()
338
+ {
339
+ return $this->preferredDomesticCarrierCode;
340
+ }
341
+
342
+ /**
343
+ * Sets the preferred domestic carrier code of this phone number.
344
+ *
345
+ * @param string $value The preferred domestic carrier code.
346
+ *
347
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
348
+ */
349
+ public function setPreferredDomesticCarrierCode($value)
350
+ {
351
+ $this->preferredDomesticCarrierCode = (string) $value;
352
+ return $this;
353
+ }
354
+
355
+ /**
356
+ * Clears the preferred domestic carrier code of this phone number.
357
+ *
358
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
359
+ */
360
+ public function clearPreferredDomesticCarrierCode()
361
+ {
362
+ $this->preferredDomesticCarrierCode = null;
363
+ return $this;
364
+ }
365
+
366
+ /**
367
+ * Whether this phone number has a number of leading zeros set.
368
+ *
369
+ * @var bool
370
+ */
371
+ private $hasNumberOfLeadingZeros = false;
372
+
373
+ /**
374
+ * The number of leading zeros of this phone number.
375
+ *
376
+ * @var int
377
+ */
378
+ private $numberOfLeadingZeros = 1;
379
+
380
+ /**
381
+ * Returns whether this phone number has a number of leading zeros set.
382
+ *
383
+ * @return bool True if a number of leading zeros is set, false otherwise.
384
+ */
385
+ public function hasNumberOfLeadingZeros()
386
+ {
387
+ return $this->hasNumberOfLeadingZeros;
388
+ }
389
+
390
+ /**
391
+ * Returns the number of leading zeros of this phone number.
392
+ *
393
+ * @return int The number of leading zeros.
394
+ */
395
+ public function getNumberOfLeadingZeros()
396
+ {
397
+ return $this->numberOfLeadingZeros;
398
+ }
399
+
400
+ /**
401
+ * Sets the number of leading zeros of this phone number.
402
+ *
403
+ * @param int $value The number of leading zeros.
404
+ *
405
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
406
+ */
407
+ public function setNumberOfLeadingZeros($value)
408
+ {
409
+ $this->hasNumberOfLeadingZeros = true;
410
+ $this->numberOfLeadingZeros = (int) $value;
411
+ return $this;
412
+ }
413
+
414
+ /**
415
+ * Clears the number of leading zeros of this phone number.
416
+ *
417
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
418
+ */
419
+ public function clearNumberOfLeadingZeros()
420
+ {
421
+ $this->hasNumberOfLeadingZeros = false;
422
+ $this->numberOfLeadingZeros = 1;
423
+ return $this;
424
+ }
425
+
426
+ /**
427
+ * Clears this phone number.
428
+ *
429
+ * This effectively resets this phone number to the state of a new instance.
430
+ *
431
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
432
+ */
433
+ public function clear()
434
+ {
435
+ $this->clearCountryCode();
436
+ $this->clearNationalNumber();
437
+ $this->clearExtension();
438
+ $this->clearItalianLeadingZero();
439
+ $this->clearNumberOfLeadingZeros();
440
+ $this->clearRawInput();
441
+ $this->clearCountryCodeSource();
442
+ $this->clearPreferredDomesticCarrierCode();
443
+ return $this;
444
+ }
445
+
446
+ /**
447
+ * Merges the information from another phone number into this phone number.
448
+ *
449
+ * @param PhoneNumber $other The phone number to copy.
450
+ *
451
+ * @return PhoneNumber This PhoneNumber instance, for chaining method calls.
452
+ */
453
+ public function mergeFrom(PhoneNumber $other)
454
+ {
455
+ if ($other->hasCountryCode()) {
456
+ $this->setCountryCode($other->getCountryCode());
457
+ }
458
+ if ($other->hasNationalNumber()) {
459
+ $this->setNationalNumber($other->getNationalNumber());
460
+ }
461
+ if ($other->hasExtension()) {
462
+ $this->setExtension($other->getExtension());
463
+ }
464
+ if ($other->hasItalianLeadingZero()) {
465
+ $this->setItalianLeadingZero($other->isItalianLeadingZero());
466
+ }
467
+ if ($other->hasNumberOfLeadingZeros()) {
468
+ $this->setNumberOfLeadingZeros($other->getNumberOfLeadingZeros());
469
+ }
470
+ if ($other->hasRawInput()) {
471
+ $this->setRawInput($other->getRawInput());
472
+ }
473
+ if ($other->hasCountryCodeSource()) {
474
+ $this->setCountryCodeSource($other->getCountryCodeSource());
475
+ }
476
+ if ($other->hasPreferredDomesticCarrierCode()) {
477
+ $this->setPreferredDomesticCarrierCode($other->getPreferredDomesticCarrierCode());
478
+ }
479
+ return $this;
480
+ }
481
+
482
+ /**
483
+ * Returns whether this phone number is equal to another.
484
+ *
485
+ * @param PhoneNumber $other The phone number to compare.
486
+ *
487
+ * @return bool True if the phone numbers are equal, false otherwise.
488
+ */
489
+ public function equals(PhoneNumber $other)
490
+ {
491
+ $sameType = get_class($other) == get_class($this);
492
+ $sameCountry = $this->hasCountryCode() == $other->hasCountryCode() &&
493
+ (!$this->hasCountryCode() || $this->getCountryCode() == $other->getCountryCode());
494
+ $sameNational = $this->hasNationalNumber() == $other->hasNationalNumber() &&
495
+ (!$this->hasNationalNumber() || $this->getNationalNumber() == $other->getNationalNumber());
496
+ $sameExt = $this->hasExtension() == $other->hasExtension() &&
497
+ (!$this->hasExtension() || $this->hasExtension() == $other->hasExtension());
498
+ $sameLead = $this->hasItalianLeadingZero() == $other->hasItalianLeadingZero() &&
499
+ (!$this->hasItalianLeadingZero() || $this->isItalianLeadingZero() == $other->isItalianLeadingZero());
500
+ $sameZeros = $this->getNumberOfLeadingZeros() == $other->getNumberOfLeadingZeros();
501
+ $sameRaw = $this->hasRawInput() == $other->hasRawInput() &&
502
+ (!$this->hasRawInput() || $this->getRawInput() == $other->getRawInput());
503
+ $sameCountrySource = $this->hasCountryCodeSource() == $other->hasCountryCodeSource() &&
504
+ (!$this->hasCountryCodeSource() || $this->getCountryCodeSource() == $other->getCountryCodeSource());
505
+ $samePrefCar = $this->hasPreferredDomesticCarrierCode() == $other->hasPreferredDomesticCarrierCode() &&
506
+ (!$this->hasPreferredDomesticCarrierCode() || $this->getPreferredDomesticCarrierCode(
507
+ ) == $other->getPreferredDomesticCarrierCode());
508
+ return $sameType && $sameCountry && $sameNational && $sameExt && $sameLead && $sameZeros && $sameRaw && $sameCountrySource && $samePrefCar;
509
+ }
510
+
511
+ /**
512
+ * Returns a string representation of this phone number.
513
+ * @return string
514
+ */
515
+ public function __toString()
516
+ {
517
+ $outputString = '';
518
+
519
+ $outputString .= 'Country Code: ' . $this->countryCode;
520
+ $outputString .= ' National Number: ' . $this->nationalNumber;
521
+ if ($this->hasItalianLeadingZero()) {
522
+ $outputString .= ' Leading Zero(s): true';
523
+ }
524
+ if ($this->hasNumberOfLeadingZeros()) {
525
+ $outputString .= ' Number of leading zeros: ' . $this->numberOfLeadingZeros;
526
+ }
527
+ if ($this->hasExtension()) {
528
+ $outputString .= ' Extension: ' . $this->extension;
529
+ }
530
+ if ($this->hasCountryCode()) {
531
+ $outputString .= ' Country Code Source: ' . $this->countryCodeSource;
532
+ }
533
+ if ($this->hasPreferredDomesticCarrierCode()) {
534
+ $outputString .= ' Preferred Domestic Carrier Code: ' . $this->preferredDomesticCarrierCode;
535
+ }
536
+ return $outputString;
537
+ }
538
+
539
+ /**
540
+ * @inheritDoc
541
+ */
542
+ public function serialize()
543
+ {
544
+ return serialize(
545
+ array(
546
+ $this->countryCode,
547
+ $this->nationalNumber,
548
+ $this->extension,
549
+ $this->italianLeadingZero,
550
+ $this->numberOfLeadingZeros,
551
+ $this->rawInput,
552
+ $this->countryCodeSource,
553
+ $this->preferredDomesticCarrierCode
554
+ )
555
+ );
556
+ }
557
+
558
+ /**
559
+ * @inheritDoc
560
+ */
561
+ public function unserialize($serialized)
562
+ {
563
+ $data = unserialize($serialized);
564
+
565
+ list (
566
+ $this->countryCode,
567
+ $this->nationalNumber,
568
+ $this->extension,
569
+ $this->italianLeadingZero,
570
+ $this->numberOfLeadingZeros,
571
+ $this->rawInput,
572
+ $this->countryCodeSource,
573
+ $this->preferredDomesticCarrierCode
574
+ ) = $data;
575
+
576
+ $this->hasNumberOfLeadingZeros = true;
577
+ }
578
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberDesc.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Phone Number Description
7
+ */
8
+ class PhoneNumberDesc
9
+ {
10
+ private $hasNationalNumberPattern = false;
11
+ private $nationalNumberPattern = "";
12
+ private $hasPossibleNumberPattern = false;
13
+ private $possibleNumberPattern = "";
14
+ private $hasExampleNumber = false;
15
+ private $exampleNumber = "";
16
+
17
+ /**
18
+ * @return boolean
19
+ */
20
+ public function hasNationalNumberPattern()
21
+ {
22
+ return $this->hasNationalNumberPattern;
23
+ }
24
+
25
+ /**
26
+ * @return string
27
+ */
28
+ public function getNationalNumberPattern()
29
+ {
30
+ return $this->nationalNumberPattern;
31
+ }
32
+
33
+ /**
34
+ * @param string $value
35
+ * @return PhoneNumberDesc
36
+ */
37
+ public function setNationalNumberPattern($value)
38
+ {
39
+ $this->hasNationalNumberPattern = true;
40
+ $this->nationalNumberPattern = $value;
41
+
42
+ return $this;
43
+ }
44
+
45
+ /**
46
+ * @return boolean
47
+ */
48
+ public function hasPossibleNumberPattern()
49
+ {
50
+ return $this->hasPossibleNumberPattern;
51
+ }
52
+
53
+ /**
54
+ * @return string
55
+ */
56
+ public function getPossibleNumberPattern()
57
+ {
58
+ return $this->possibleNumberPattern;
59
+ }
60
+
61
+ /**
62
+ * @param string $value
63
+ * @return PhoneNumberDesc
64
+ */
65
+ public function setPossibleNumberPattern($value)
66
+ {
67
+ $this->hasPossibleNumberPattern = true;
68
+ $this->possibleNumberPattern = $value;
69
+
70
+ return $this;
71
+ }
72
+
73
+ /**
74
+ * @return string
75
+ */
76
+ public function hasExampleNumber()
77
+ {
78
+ return $this->hasExampleNumber;
79
+ }
80
+
81
+ /**
82
+ * @return string
83
+ */
84
+ public function getExampleNumber()
85
+ {
86
+ return $this->exampleNumber;
87
+ }
88
+
89
+ /**
90
+ * @param string $value
91
+ * @return PhoneNumberDesc
92
+ */
93
+ public function setExampleNumber($value)
94
+ {
95
+ $this->hasExampleNumber = true;
96
+ $this->exampleNumber = $value;
97
+
98
+ return $this;
99
+ }
100
+
101
+ /**
102
+ * @param PhoneNumberDesc $other
103
+ * @return PhoneNumberDesc
104
+ */
105
+ public function mergeFrom(PhoneNumberDesc $other)
106
+ {
107
+ if ($other->hasNationalNumberPattern()) {
108
+ $this->setNationalNumberPattern($other->getNationalNumberPattern());
109
+ }
110
+ if ($other->hasPossibleNumberPattern()) {
111
+ $this->setPossibleNumberPattern($other->getPossibleNumberPattern());
112
+ }
113
+ if ($other->hasExampleNumber()) {
114
+ $this->setExampleNumber($other->getExampleNumber());
115
+ }
116
+
117
+ return $this;
118
+ }
119
+
120
+ /**
121
+ * @param PhoneNumberDesc $other
122
+ * @return boolean
123
+ */
124
+ public function exactlySameAs(PhoneNumberDesc $other)
125
+ {
126
+ return $this->nationalNumberPattern === $other->nationalNumberPattern &&
127
+ $this->possibleNumberPattern === $other->possibleNumberPattern &&
128
+ $this->exampleNumber === $other->exampleNumber;
129
+ }
130
+
131
+ /**
132
+ * @return array
133
+ */
134
+ public function toArray()
135
+ {
136
+ $data = array();
137
+ if ($this->hasNationalNumberPattern()) {
138
+ $data['NationalNumberPattern'] = $this->getNationalNumberPattern();
139
+ }
140
+ if ($this->hasPossibleNumberPattern()) {
141
+ $data['PossibleNumberPattern'] = $this->getPossibleNumberPattern();
142
+ }
143
+ if ($this->hasExampleNumber()) {
144
+ $data['ExampleNumber'] = $this->getExampleNumber();
145
+ }
146
+
147
+ return $data;
148
+ }
149
+
150
+ /**
151
+ * @param array $input
152
+ * @return PhoneNumberDesc
153
+ */
154
+ public function fromArray(array $input)
155
+ {
156
+ if (isset($input['NationalNumberPattern']) && $input['NationalNumberPattern'] != '') {
157
+ $this->setNationalNumberPattern($input['NationalNumberPattern']);
158
+ }
159
+ if (isset($input['PossibleNumberPattern']) && $input['NationalNumberPattern'] != '') {
160
+ $this->setPossibleNumberPattern($input['PossibleNumberPattern']);
161
+ }
162
+ if (isset($input['ExampleNumber']) && $input['NationalNumberPattern'] != '') {
163
+ $this->setExampleNumber($input['ExampleNumber']);
164
+ }
165
+
166
+ return $this;
167
+ }
168
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberFormat.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * INTERNATIONAL and NATIONAL formats are consistent with the definition in ITU-T Recommendation
7
+ * E123. For example, the number of the Google Switzerland office will be written as
8
+ * "+41 44 668 1800" in INTERNATIONAL format, and as "044 668 1800" in NATIONAL format.
9
+ * E164 format is as per INTERNATIONAL format but with no formatting applied, e.g.
10
+ * "+41446681800". RFC3966 is as per INTERNATIONAL format, but with all spaces and other
11
+ * separating symbols replaced with a hyphen, and with any phone number extension appended with
12
+ * ";ext=". It also will have a prefix of "tel:" added, e.g. "tel:+41-44-668-1800".
13
+ *
14
+ * Note: If you are considering storing the number in a neutral format, you are highly advised to
15
+ * use the PhoneNumber class.
16
+ */
17
+ class PhoneNumberFormat
18
+ {
19
+ const E164 = 0;
20
+ const INTERNATIONAL = 1;
21
+ const NATIONAL = 2;
22
+ const RFC3966 = 3;
23
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberToCarrierMapper.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ *
5
+ * @author giggsey
6
+ * @created: 02/10/13 16:52
7
+ * @project libphonenumber-for-php
8
+ */
9
+
10
+ namespace libphonenumber;
11
+
12
+
13
+ use libphonenumber\prefixmapper\PrefixFileReader;
14
+
15
+ class PhoneNumberToCarrierMapper
16
+ {
17
+ /**
18
+ * @var PhoneNumberToCarrierMapper[]
19
+ */
20
+ private static $instance = array();
21
+
22
+ const MAPPING_DATA_DIRECTORY = '/carrier/data/';
23
+
24
+ /**
25
+ * @var PhoneNumberUtil
26
+ */
27
+ private $phoneUtil;
28
+ /**
29
+ * @var PrefixFileReader
30
+ */
31
+ private $prefixFileReader;
32
+
33
+ private function __construct($phonePrefixDataDirectory)
34
+ {
35
+ if(!extension_loaded('intl')) {
36
+ throw new \RuntimeException('The intl extension must be installed');
37
+ }
38
+
39
+ $this->prefixFileReader = new PrefixFileReader(dirname(__FILE__) . $phonePrefixDataDirectory);
40
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
41
+ }
42
+
43
+ /**
44
+ * Gets a {@link PhoneNumberToCarrierMapper} instance to carry out international carrier lookup.
45
+ *
46
+ * <p> The {@link PhoneNumberToCarrierMapper} is implemented as a singleton. Therefore, calling
47
+ * this method multiple times will only result in one instance being created.
48
+ *
49
+ * @param string $mappingDir
50
+ * @return PhoneNumberToCarrierMapper
51
+ */
52
+ public static function getInstance($mappingDir = self::MAPPING_DATA_DIRECTORY)
53
+ {
54
+ if (!array_key_exists($mappingDir, self::$instance)) {
55
+ self::$instance[$mappingDir] = new self($mappingDir);
56
+ }
57
+
58
+ return self::$instance[$mappingDir];
59
+ }
60
+
61
+ /**
62
+ * Returns a carrier name for the given phone number, in the language provided. The carrier name
63
+ * is the one the number was originally allocated to, however if the country supports mobile
64
+ * number portability the number might not belong to the returned carrier anymore. If no mapping
65
+ * is found an empty string is returned.
66
+ *
67
+ * <p>This method assumes the validity of the number passed in has already been checked, and that
68
+ * the number is suitable for carrier lookup. We consider mobile and pager numbers possible
69
+ * candidates for carrier lookup.
70
+ *
71
+ * @param PhoneNumber $number a valid phone number for which we want to get a carrier name
72
+ * @param string $languageCode the language code in which the name should be written
73
+ * @return string a carrier name for the given phone number
74
+ */
75
+ public function getNameForValidNumber(PhoneNumber $number, $languageCode)
76
+ {
77
+ $languageStr = \Locale::getPrimaryLanguage($languageCode);
78
+ $scriptStr = "";
79
+ $regionStr = \Locale::getRegion($languageCode);
80
+
81
+ return $this->prefixFileReader->getDescriptionForNumber($number, $languageStr, $scriptStr, $regionStr);
82
+ }
83
+
84
+
85
+ /**
86
+ * Gets the name of the carrier for the given phone number, in the language provided. As per
87
+ * {@link #getNameForValidNumber(PhoneNumber, Locale)} but explicitly checks the validity of
88
+ * the number passed in.
89
+ *
90
+ * @param PhoneNumber $number The phone number for which we want to get a carrier name
91
+ * @param string $languageCode Language code for which the description should be written
92
+ * @return string a carrier name for the given phone number, or empty string if the number passed in is
93
+ * invalid
94
+ */
95
+ public function getNameForNumber(PhoneNumber $number, $languageCode)
96
+ {
97
+ $numberType = $this->phoneUtil->getNumberType($number);
98
+ if ($this->isMobile($numberType)) {
99
+ return $this->getNameForValidNumber($number, $languageCode);
100
+ }
101
+ return "";
102
+ }
103
+
104
+ /**
105
+ * Gets the name of the carrier for the given phone number only when it is 'safe' to display to
106
+ * users. A carrier name is considered safe if the number is valid and for a region that doesn't
107
+ * support
108
+ * {@linkplain http://en.wikipedia.org/wiki/Mobile_number_portability mobile number portability}.
109
+ *
110
+ * @param $number PhoneNumber the phone number for which we want to get a carrier name
111
+ * @param $languageCode String the language code in which the name should be written
112
+ * @return string a carrier name that is safe to display to users, or the empty string
113
+ */
114
+ public function getSafeDisplayName(PhoneNumber $number, $languageCode)
115
+ {
116
+ if ($this->phoneUtil->isMobileNumberPortableRegion($this->phoneUtil->getRegionCodeForNumber($number))) {
117
+ return "";
118
+ }
119
+
120
+ return $this->getNameForNumber($number, $languageCode);
121
+ }
122
+
123
+ /**
124
+ * Checks if the supplied number type supports carrier lookup.
125
+ * @param int $numberType A PhoneNumberType int
126
+ * @return bool
127
+ */
128
+ private function isMobile($numberType)
129
+ {
130
+ return ($numberType === PhoneNumberType::MOBILE ||
131
+ $numberType === PhoneNumberType::FIXED_LINE_OR_MOBILE ||
132
+ $numberType === PhoneNumberType::PAGER
133
+ );
134
+ }
135
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberToTimeZonesMapper.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: giggsey
5
+ * Date: 14/10/13
6
+ * Time: 16:00
7
+ */
8
+
9
+ namespace libphonenumber;
10
+
11
+ use libphonenumber\prefixmapper\PrefixTimeZonesMap;
12
+
13
+ class PhoneNumberToTimeZonesMapper
14
+ {
15
+ const UNKNOWN_TIMEZONE = 'Etc/Unknown';
16
+ const MAPPING_DATA_DIRECTORY = '/timezone/data/';
17
+ const MAPPING_DATA_FILE_NAME = "map_data.php";
18
+ /**
19
+ * @var PhoneNumberToTimeZonesMapper
20
+ */
21
+ private static $instance = null;
22
+ private $unknownTimeZoneList = array();
23
+ /**
24
+ * @var PhoneNumberUtil
25
+ */
26
+ private $phoneUtil;
27
+ private $prefixTimeZonesMap;
28
+
29
+ private function __construct($phonePrefixDataDirectory)
30
+ {
31
+ $this->prefixTimeZonesMap = self::loadPrefixTimeZonesMapFromFile(
32
+ dirname(__FILE__) . $phonePrefixDataDirectory . DIRECTORY_SEPARATOR . self::MAPPING_DATA_FILE_NAME
33
+ );
34
+ $this->phoneUtil = PhoneNumberUtil::getInstance();
35
+
36
+ $this->unknownTimeZoneList[] = self::UNKNOWN_TIMEZONE;
37
+ }
38
+
39
+ private static function loadPrefixTimeZonesMapFromFile($path)
40
+ {
41
+ if (!is_readable($path)) {
42
+ throw new \InvalidArgumentException("Mapping file can not be found");
43
+ }
44
+
45
+ $data = require $path;
46
+
47
+ $map = new PrefixTimeZonesMap($data);
48
+
49
+ return $map;
50
+ }
51
+
52
+ /**
53
+ * Gets a {@link PhoneNumberToTimeZonesMapper} instance.
54
+ *
55
+ * <p> The {@link PhoneNumberToTimeZonesMapper} is implemented as a singleton. Therefore, calling
56
+ * this method multiple times will only result in one instance being created.
57
+ *
58
+ * @param $mappingDir
59
+ * @return PhoneNumberToTimeZonesMapper instance
60
+ */
61
+ public static function getInstance($mappingDir = self::MAPPING_DATA_DIRECTORY)
62
+ {
63
+ if (self::$instance === null) {
64
+ self::$instance = new self($mappingDir);
65
+ }
66
+
67
+ return self::$instance;
68
+ }
69
+
70
+ /**
71
+ * Returns a String with the ICU unknown time zone.
72
+ * @return string
73
+ */
74
+ public static function getUnknownTimeZone()
75
+ {
76
+ return self::UNKNOWN_TIMEZONE;
77
+ }
78
+
79
+ /**
80
+ * As per {@link #getTimeZonesForGeographicalNumber(PhoneNumber)} but explicitly checks
81
+ * the validity of the number passed in.
82
+ *
83
+ * @param $number PhoneNumber the phone number for which we want to get the time zones to which it belongs
84
+ * @return array a list of the corresponding time zones or a single element list with the default
85
+ * unknown time zone if no other time zone was found or if the number was invalid
86
+ */
87
+ public function getTimeZonesForNumber(PhoneNumber $number)
88
+ {
89
+ $numberType = $this->phoneUtil->getNumberType($number);
90
+
91
+ if ($numberType === PhoneNumberType::UNKNOWN) {
92
+ return $this->unknownTimeZoneList;
93
+ } elseif (!$this->canBeGeocoded($numberType)) {
94
+ return $this->getCountryLevelTimeZonesforNumber($number);
95
+ }
96
+
97
+ return $this->getTimeZonesForGeographicalNumber($number);
98
+ }
99
+
100
+ /**
101
+ * A similar method is implemented as PhoneNumberUtil.isNumberGeographical, which performs a
102
+ * stricter check, as it determines if a number has a geographical association. Also, if new
103
+ * phone number types were added, we should check if this other method should be updated too.
104
+ * TODO: Remove duplication by completing the logic in the method in PhoneNumberUtil.
105
+ * For more information, see the comments in that method.
106
+ * @param $numberType
107
+ * @return bool
108
+ */
109
+ public function canBeGeocoded($numberType)
110
+ {
111
+ return ($numberType === PhoneNumberType::FIXED_LINE ||
112
+ $numberType === PhoneNumberType::MOBILE ||
113
+ $numberType === PhoneNumberType::FIXED_LINE_OR_MOBILE
114
+ );
115
+ }
116
+
117
+ /**
118
+ * Returns the list of time zones corresponding to the country calling code of {@code number}.
119
+ *
120
+ * @param $number PhoneNumber the phone number to look up
121
+ * @return array the list of corresponding time zones or a single element list with the default
122
+ * unknown time zone if no other time zone was found
123
+ */
124
+ private function getCountryLevelTimeZonesforNumber(PhoneNumber $number)
125
+ {
126
+ $timezones = $this->prefixTimeZonesMap->lookupCountryLevelTimeZonesForNumber($number);
127
+ return (count($timezones) == 0) ? $this->unknownTimeZoneList : $timezones;
128
+ }
129
+
130
+ /**
131
+ * Returns a list of time zones to which a phone number belongs.
132
+ *
133
+ * <p>This method assumes the validity of the number passed in has already been checked, and that
134
+ * the number is geo-localizable. We consider fixed-line and mobile numbers possible candidates
135
+ * for geo-localization.
136
+ *
137
+ * @param $number PhoneNumber a valid phone number for which we want to get the time zones to which it belongs
138
+ * @return array a list of the corresponding time zones or a single element list with the default
139
+ * unknown time zone if no other time zone was found or if the number was invalid
140
+ */
141
+ public function getTimeZonesForGeographicalNumber(PhoneNumber $number)
142
+ {
143
+ return $this->getTimeZonesForGeocodableNumber($number);
144
+ }
145
+
146
+ /**
147
+ * Returns a list of time zones to which a geocodable phone number belongs.
148
+ *
149
+ * @param PhoneNumber $number The phone number for which we want to get the time zones to which it belongs
150
+ * @return array the list of correspondiing time zones or a single element list with the default
151
+ * unknown timezone if no other time zone was found or if the number was invalid
152
+ */
153
+ private function getTimeZonesForGeocodableNumber(PhoneNumber $number)
154
+ {
155
+ $timezones = $this->prefixTimeZonesMap->lookupTimeZonesForNumber($number);
156
+ return (count($timezones) == 0) ? $this->unknownTimeZoneList : $timezones;
157
+ }
158
+
159
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberType.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Type of phone numbers.
7
+ */
8
+ class PhoneNumberType
9
+ {
10
+ const FIXED_LINE = 0;
11
+ const MOBILE = 1;
12
+ // In some regions (e.g. the USA), it is impossible to distinguish between fixed-line and
13
+ // mobile numbers by looking at the phone number itself.
14
+ const FIXED_LINE_OR_MOBILE = 2;
15
+ // Freephone lines
16
+ const TOLL_FREE = 3;
17
+ const PREMIUM_RATE = 4;
18
+ // The cost of this call is shared between the caller and the recipient, and is hence typically
19
+ // less than PREMIUM_RATE calls. See // http://en.wikipedia.org/wiki/Shared_Cost_Service for
20
+ // more information.
21
+ const SHARED_COST = 5;
22
+ // Voice over IP numbers. This includes TSoIP (Telephony Service over IP).
23
+ const VOIP = 6;
24
+ // A personal number is associated with a particular person, and may be routed to either a
25
+ // MOBILE or FIXED_LINE number. Some more information can be found here:
26
+ // http://en.wikipedia.org/wiki/Personal_Numbers
27
+ const PERSONAL_NUMBER = 7;
28
+ const PAGER = 8;
29
+ // Used for "Universal Access Numbers" or "Company Numbers". They may be further routed to
30
+ // specific offices, but allow one number to be used for a company.
31
+ const UAN = 9;
32
+ // A phone number is of type UNKNOWN when it does not fit any of the known patterns for a
33
+ // specific region.
34
+ const UNKNOWN = 10;
35
+
36
+ // Emergency
37
+ const EMERGENCY = 27;
38
+
39
+ // Voicemail
40
+ const VOICEMAIL = 28;
41
+
42
+ // Short Code
43
+ const SHORT_CODE = 29;
44
+
45
+ // Standard Rate
46
+ const STANDARD_RATE = 30;
47
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/PhoneNumberUtil.php ADDED
@@ -0,0 +1,3118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Utility for international phone numbers. Functionality includes formatting, parsing and
7
+ * validation.
8
+ *
9
+ * <p>If you use this library, and want to be notified about important changes, please sign up to
10
+ * our <a href="http://groups.google.com/group/libphonenumber-discuss/about">mailing list</a>.
11
+ *
12
+ * NOTE: A lot of methods in this class require Region Code strings. These must be provided using
13
+ * ISO 3166-1 two-letter country-code format. These should be in upper-case. The list of the codes
14
+ * can be found here:
15
+ * http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm
16
+ *
17
+ * @author Shaopeng Jia
18
+ * @author Lara Rennie
19
+ * @see https://code.google.com/p/libphonenumber/
20
+ */
21
+ class PhoneNumberUtil
22
+ {
23
+ /** Flags to use when compiling regular expressions for phone numbers */
24
+ const REGEX_FLAGS = 'ui'; //Unicode and case insensitive
25
+ // The minimum and maximum length of the national significant number.
26
+ const MIN_LENGTH_FOR_NSN = 2;
27
+ // The ITU says the maximum length should be 15, but we have found longer numbers in Germany.
28
+ const MAX_LENGTH_FOR_NSN = 17;
29
+
30
+ // We don't allow input strings for parsing to be longer than 250 chars. This prevents malicious
31
+ // input from overflowing the regular-expression engine.
32
+ const MAX_INPUT_STRING_LENGTH = 250;
33
+
34
+ // The maximum length of the country calling code.
35
+ const MAX_LENGTH_COUNTRY_CODE = 3;
36
+
37
+ const REGION_CODE_FOR_NON_GEO_ENTITY = "001";
38
+ const META_DATA_FILE_PREFIX = 'PhoneNumberMetadata';
39
+ const TEST_META_DATA_FILE_PREFIX = 'PhoneNumberMetadataForTesting';
40
+
41
+ // Region-code for the unknown region.
42
+ const UNKNOWN_REGION = "ZZ";
43
+
44
+ const NANPA_COUNTRY_CODE = 1;
45
+ /*
46
+ * The prefix that needs to be inserted in front of a Colombian landline number when dialed from
47
+ * a mobile number in Colombia.
48
+ */
49
+ const COLOMBIA_MOBILE_TO_FIXED_LINE_PREFIX = "3";
50
+ // The PLUS_SIGN signifies the international prefix.
51
+ const PLUS_SIGN = '+';
52
+ const PLUS_CHARS = '++';
53
+ const STAR_SIGN = '*';
54
+
55
+ const RFC3966_EXTN_PREFIX = ";ext=";
56
+ const RFC3966_PREFIX = "tel:";
57
+ const RFC3966_PHONE_CONTEXT = ";phone-context=";
58
+ const RFC3966_ISDN_SUBADDRESS = ";isub=";
59
+
60
+ // We use this pattern to check if the phone number has at least three letters in it - if so, then
61
+ // we treat it as a number where some phone-number digits are represented by letters.
62
+ const VALID_ALPHA_PHONE_PATTERN = "(?:.*?[A-Za-z]){3}.*";
63
+ // We accept alpha characters in phone numbers, ASCII only, upper and lower case.
64
+ const VALID_ALPHA = "A-Za-z";
65
+
66
+
67
+ // Default extension prefix to use when formatting. This will be put in front of any extension
68
+ // component of the number, after the main national number is formatted. For example, if you wish
69
+ // the default extension formatting to be " extn: 3456", then you should specify " extn: " here
70
+ // as the default extension prefix. This can be overridden by region-specific preferences.
71
+ const DEFAULT_EXTN_PREFIX = " ext. ";
72
+
73
+ // Regular expression of acceptable punctuation found in phone numbers. This excludes punctuation
74
+ // found as a leading character only.
75
+ // This consists of dash characters, white space characters, full stops, slashes,
76
+ // square brackets, parentheses and tildes. It also includes the letter 'x' as that is found as a
77
+ // placeholder for carrier information in some phone numbers. Full-width variants are also
78
+ // present.
79
+ const VALID_PUNCTUATION = "-x\xE2\x80\x90-\xE2\x80\x95\xE2\x88\x92\xE3\x83\xBC\xEF\xBC\x8D-\xEF\xBC\x8F \xC2\xA0\xC2\xAD\xE2\x80\x8B\xE2\x81\xA0\xE3\x80\x80()\xEF\xBC\x88\xEF\xBC\x89\xEF\xBC\xBB\xEF\xBC\xBD.\\[\\]/~\xE2\x81\x93\xE2\x88\xBC";
80
+ const DIGITS = "\\p{Nd}";
81
+
82
+ // Pattern that makes it easy to distinguish whether a region has a unique international dialing
83
+ // prefix or not. If a region has a unique international prefix (e.g. 011 in USA), it will be
84
+ // represented as a string that contains a sequence of ASCII digits. If there are multiple
85
+ // available international prefixes in a region, they will be represented as a regex string that
86
+ // always contains character(s) other than ASCII digits.
87
+ // Note this regex also includes tilde, which signals waiting for the tone.
88
+ const UNIQUE_INTERNATIONAL_PREFIX = "[\\d]+(?:[~\xE2\x81\x93\xE2\x88\xBC\xEF\xBD\x9E][\\d]+)?";
89
+ const NON_DIGITS_PATTERN = "(\\D+)";
90
+
91
+ // The FIRST_GROUP_PATTERN was originally set to $1 but there are some countries for which the
92
+ // first group is not used in the national pattern (e.g. Argentina) so the $1 group does not match
93
+ // correctly. Therefore, we use \d, so that the first group actually used in the pattern will be
94
+ // matched.
95
+ const FIRST_GROUP_PATTERN = "(\\$\\d)";
96
+ const NP_PATTERN = '\\$NP';
97
+ const FG_PATTERN = '\\$FG';
98
+ const CC_PATTERN = '\\$CC';
99
+
100
+ // A pattern that is used to determine if the national prefix formatting rule has the first group
101
+ // only, i.e., does not start with the national prefix. Note that the pattern explicitly allows
102
+ // for unbalanced parentheses.
103
+ const FIRST_GROUP_ONLY_PREFIX_PATTERN = '\\(?\\$1\\)?';
104
+ public static $PLUS_CHARS_PATTERN;
105
+ private static $SEPARATOR_PATTERN;
106
+ private static $CAPTURING_DIGIT_PATTERN;
107
+ private static $VALID_START_CHAR_PATTERN = null;
108
+ private static $SECOND_NUMBER_START_PATTERN = "[\\\\/] *x";
109
+ private static $UNWANTED_END_CHAR_PATTERN = "[[\\P{N}&&\\P{L}]&&[^#]]+$";
110
+ private static $DIALLABLE_CHAR_MAPPINGS = array();
111
+ private static $CAPTURING_EXTN_DIGITS;
112
+
113
+ /**
114
+ * @var PhoneNumberUtil
115
+ */
116
+ private static $instance = null;
117
+
118
+ /**
119
+ * Only upper-case variants of alpha characters are stored.
120
+ * @var array
121
+ */
122
+ private static $ALPHA_MAPPINGS = array(
123
+ 'A' => '2',
124
+ 'B' => '2',
125
+ 'C' => '2',
126
+ 'D' => '3',
127
+ 'E' => '3',
128
+ 'F' => '3',
129
+ 'G' => '4',
130
+ 'H' => '4',
131
+ 'I' => '4',
132
+ 'J' => '5',
133
+ 'K' => '5',
134
+ 'L' => '5',
135
+ 'M' => '6',
136
+ 'N' => '6',
137
+ 'O' => '6',
138
+ 'P' => '7',
139
+ 'Q' => '7',
140
+ 'R' => '7',
141
+ 'S' => '7',
142
+ 'T' => '8',
143
+ 'U' => '8',
144
+ 'V' => '8',
145
+ 'W' => '9',
146
+ 'X' => '9',
147
+ 'Y' => '9',
148
+ 'Z' => '9',
149
+ );
150
+
151
+ /**
152
+ * Map of country calling codes that use a mobile token before the area code. One example of when
153
+ * this is relevant is when determining the length of the national destination code, which should
154
+ * be the length of the area code plus the length of the mobile token.
155
+ * @var array
156
+ */
157
+ private static $MOBILE_TOKEN_MAPPINGS;
158
+
159
+ /**
160
+ * For performance reasons, amalgamate both into one map.
161
+ * @var array
162
+ */
163
+ private static $ALPHA_PHONE_MAPPINGS;
164
+
165
+ /**
166
+ * Separate map of all symbols that we wish to retain when formatting alpha numbers. This
167
+ * includes digits, ASCII letters and number grouping symbols such as "-" and " ".
168
+ * @var array
169
+ */
170
+ private static $ALL_PLUS_NUMBER_GROUPING_SYMBOLS;
171
+
172
+ /**
173
+ * Simple ASCII digits map used to populate ALPHA_PHONE_MAPPINGS and
174
+ * ALL_PLUS_NUMBER_GROUPING_SYMBOLS.
175
+ * @var array
176
+ */
177
+ private static $asciiDigitMappings = array(
178
+ '0' => '0',
179
+ '1' => '1',
180
+ '2' => '2',
181
+ '3' => '3',
182
+ '4' => '4',
183
+ '5' => '5',
184
+ '6' => '6',
185
+ '7' => '7',
186
+ '8' => '8',
187
+ '9' => '9',
188
+ );
189
+
190
+ /**
191
+ * Regexp of all possible ways to write extensions, for use when parsing. This will be run as a
192
+ * case-insensitive regexp match. Wide character versions are also provided after each ASCII
193
+ * version.
194
+ * @var String
195
+ */
196
+ private static $EXTN_PATTERNS_FOR_PARSING;
197
+ private static $EXTN_PATTERNS_FOR_MATCHING;
198
+ private static $EXTN_PATTERN = null;
199
+ private static $VALID_PHONE_NUMBER_PATTERN;
200
+ private static $MIN_LENGTH_PHONE_NUMBER_PATTERN;
201
+ /**
202
+ * Regular expression of viable phone numbers. This is location independent. Checks we have at
203
+ * least three leading digits, and only valid punctuation, alpha characters and
204
+ * digits in the phone number. Does not include extension data.
205
+ * The symbol 'x' is allowed here as valid punctuation since it is often used as a placeholder for
206
+ * carrier codes, for example in Brazilian phone numbers. We also allow multiple "+" characters at
207
+ * the start.
208
+ * Corresponds to the following:
209
+ * [digits]{minLengthNsn}|
210
+ * plus_sign*(([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*
211
+ *
212
+ * The first reg-ex is to allow short numbers (two digits long) to be parsed if they are entered
213
+ * as "15" etc, but only if there is no punctuation in them. The second expression restricts the
214
+ * number of digits to three or more, but then allows them to be in international form, and to
215
+ * have alpha-characters and punctuation.
216
+ *
217
+ * Note VALID_PUNCTUATION starts with a -, so must be the first in the range.
218
+ * @var string
219
+ */
220
+ private static $VALID_PHONE_NUMBER;
221
+ private static $numericCharacters = array(
222
+ "\xef\xbc\x90" => 0,
223
+ "\xef\xbc\x91" => 1,
224
+ "\xef\xbc\x92" => 2,
225
+ "\xef\xbc\x93" => 3,
226
+ "\xef\xbc\x94" => 4,
227
+ "\xef\xbc\x95" => 5,
228
+ "\xef\xbc\x96" => 6,
229
+ "\xef\xbc\x97" => 7,
230
+ "\xef\xbc\x98" => 8,
231
+ "\xef\xbc\x99" => 9,
232
+
233
+ "\xd9\xa0" => 0,
234
+ "\xd9\xa1" => 1,
235
+ "\xd9\xa2" => 2,
236
+ "\xd9\xa3" => 3,
237
+ "\xd9\xa4" => 4,
238
+ "\xd9\xa5" => 5,
239
+ "\xd9\xa6" => 6,
240
+ "\xd9\xa7" => 7,
241
+ "\xd9\xa8" => 8,
242
+ "\xd9\xa9" => 9,
243
+
244
+ "\xdb\xb0" => 0,
245
+ "\xdb\xb1" => 1,
246
+ "\xdb\xb2" => 2,
247
+ "\xdb\xb3" => 3,
248
+ "\xdb\xb4" => 4,
249
+ "\xdb\xb5" => 5,
250
+ "\xdb\xb6" => 6,
251
+ "\xdb\xb7" => 7,
252
+ "\xdb\xb8" => 8,
253
+ "\xdb\xb9" => 9,
254
+
255
+ "\xe1\xa0\x90" => 0,
256
+ "\xe1\xa0\x91" => 1,
257
+ "\xe1\xa0\x92" => 2,
258
+ "\xe1\xa0\x93" => 3,
259
+ "\xe1\xa0\x94" => 4,
260
+ "\xe1\xa0\x95" => 5,
261
+ "\xe1\xa0\x96" => 6,
262
+ "\xe1\xa0\x97" => 7,
263
+ "\xe1\xa0\x98" => 8,
264
+ "\xe1\xa0\x99" => 9,
265
+ );
266
+
267
+ /**
268
+ * The set of county calling codes that map to the non-geo entity region ("001").
269
+ * @var array
270
+ */
271
+ private $countryCodesForNonGeographicalRegion = array();
272
+ /**
273
+ * The set of regions the library supports.
274
+ * @var array
275
+ */
276
+ private $supportedRegions = array();
277
+
278
+ /**
279
+ * A mapping from a country calling code to the region codes which denote the region represented
280
+ * by that country calling code. In the case of multiple regions sharing a calling code, such as
281
+ * the NANPA regions, the one indicated with "isMainCountryForCode" in the metadata should be
282
+ * first.
283
+ * @var array
284
+ */
285
+ private $countryCallingCodeToRegionCodeMap = array();
286
+ /**
287
+ * The set of regions that share country calling code 1.
288
+ * @var array
289
+ */
290
+ private $nanpaRegions = array();
291
+
292
+ /**
293
+ * @var MetadataSourceInterface
294
+ */
295
+ private $metadataSource;
296
+
297
+ /**
298
+ * This class implements a singleton, so the only constructor is private.
299
+ * @param MetadataSourceInterface $metadataSource
300
+ * @param $countryCallingCodeToRegionCodeMap
301
+ */
302
+ private function __construct(MetadataSourceInterface $metadataSource, $countryCallingCodeToRegionCodeMap)
303
+ {
304
+ $this->metadataSource = $metadataSource;
305
+ $this->countryCallingCodeToRegionCodeMap = $countryCallingCodeToRegionCodeMap;
306
+ $this->init();
307
+ self::initCapturingExtnDigits();
308
+ self::initExtnPatterns();
309
+ self::initExtnPattern();
310
+ self::$PLUS_CHARS_PATTERN = "[" . self::PLUS_CHARS . "]+";
311
+ self::$SEPARATOR_PATTERN = "[" . self::VALID_PUNCTUATION . "]+";
312
+ self::$CAPTURING_DIGIT_PATTERN = "(" . self::DIGITS . ")";
313
+ self::$VALID_START_CHAR_PATTERN = "[" . self::PLUS_CHARS . self::DIGITS . "]";
314
+
315
+ self::$ALPHA_PHONE_MAPPINGS = self::$ALPHA_MAPPINGS + self::$asciiDigitMappings;
316
+
317
+ self::$DIALLABLE_CHAR_MAPPINGS = self::$asciiDigitMappings;
318
+ self::$DIALLABLE_CHAR_MAPPINGS[self::PLUS_SIGN] = self::PLUS_SIGN;
319
+ self::$DIALLABLE_CHAR_MAPPINGS['*'] = '*';
320
+
321
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS = array();
322
+ // Put (lower letter -> upper letter) and (upper letter -> upper letter) mappings.
323
+ foreach (self::$ALPHA_MAPPINGS as $c => $value) {
324
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS[strtolower($c)] = $c;
325
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS[$c] = $c;
326
+ }
327
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS += self::$asciiDigitMappings;
328
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["-"] = '-';
329
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xEF\xBC\x8D"] = '-';
330
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xE2\x80\x90"] = '-';
331
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xE2\x80\x91"] = '-';
332
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xE2\x80\x92"] = '-';
333
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xE2\x80\x93"] = '-';
334
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xE2\x80\x94"] = '-';
335
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xE2\x80\x95"] = '-';
336
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xE2\x88\x92"] = '-';
337
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["/"] = "/";
338
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xEF\xBC\x8F"] = "/";
339
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS[" "] = " ";
340
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xE3\x80\x80"] = " ";
341
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xE2\x81\xA0"] = " ";
342
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["."] = ".";
343
+ self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xEF\xBC\x8E"] = ".";
344
+
345
+
346
+ self::$MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" . self::DIGITS . "]{" . self::MIN_LENGTH_FOR_NSN . "}";
347
+ self::$VALID_PHONE_NUMBER = "[" . self::PLUS_CHARS . "]*(?:[" . self::VALID_PUNCTUATION . self::STAR_SIGN . "]*[" . self::DIGITS . "]){3,}[" . self::VALID_PUNCTUATION . self::STAR_SIGN . self::VALID_ALPHA . self::DIGITS . "]*";
348
+ self::$VALID_PHONE_NUMBER_PATTERN = "%^" . self::$MIN_LENGTH_PHONE_NUMBER_PATTERN . "$|^" . self::$VALID_PHONE_NUMBER . "(?:" . self::$EXTN_PATTERNS_FOR_PARSING . ")?$%" . self::REGEX_FLAGS;
349
+
350
+ self::$UNWANTED_END_CHAR_PATTERN = "[^" . self::DIGITS . self::VALID_ALPHA . "#]+$";
351
+
352
+ self::$MOBILE_TOKEN_MAPPINGS = array();
353
+ self::$MOBILE_TOKEN_MAPPINGS['52'] = "1";
354
+ self::$MOBILE_TOKEN_MAPPINGS['54'] = "9";
355
+ }
356
+
357
+ /**
358
+ * Gets a {@link PhoneNumberUtil} instance to carry out international phone number formatting,
359
+ * parsing, or validation. The instance is loaded with phone number metadata for a number of most
360
+ * commonly used regions.
361
+ *
362
+ * <p>The {@link PhoneNumberUtil} is implemented as a singleton. Therefore, calling getInstance
363
+ * multiple times will only result in one instance being created.
364
+ *
365
+ * @param string $baseFileLocation
366
+ * @param array|null $countryCallingCodeToRegionCodeMap
367
+ * @param MetadataLoaderInterface|null $metadataLoader
368
+ * @param MetadataSourceInterface|null $metadataSource
369
+ * @return PhoneNumberUtil instance
370
+ */
371
+ public static function getInstance($baseFileLocation = self::META_DATA_FILE_PREFIX, array $countryCallingCodeToRegionCodeMap = null, MetadataLoaderInterface $metadataLoader = null, MetadataSourceInterface $metadataSource = null)
372
+ {
373
+ if (self::$instance === null) {
374
+ if ($countryCallingCodeToRegionCodeMap === null) {
375
+ $countryCallingCodeToRegionCodeMap = CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap;
376
+ }
377
+
378
+ if ($metadataLoader === null) {
379
+ $metadataLoader = new DefaultMetadataLoader();
380
+ }
381
+
382
+ if ($metadataSource === null) {
383
+ $metadataSource = new MultiFileMetadataSourceImpl($metadataLoader, __DIR__ . '/data/' . $baseFileLocation);
384
+ }
385
+
386
+ self::$instance = new PhoneNumberUtil($metadataSource, $countryCallingCodeToRegionCodeMap);
387
+ }
388
+ return self::$instance;
389
+ }
390
+
391
+ private function init()
392
+ {
393
+ foreach ($this->countryCallingCodeToRegionCodeMap as $countryCode => $regionCodes) {
394
+ // We can assume that if the country calling code maps to the non-geo entity region code then
395
+ // that's the only region code it maps to.
396
+ if (count($regionCodes) == 1 && self::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCodes[0]) {
397
+ // This is the subset of all country codes that map to the non-geo entity region code.
398
+ $this->countryCodesForNonGeographicalRegion[] = $countryCode;
399
+ } else {
400
+ // The supported regions set does not include the "001" non-geo entity region code.
401
+ $this->supportedRegions = array_merge($this->supportedRegions, $regionCodes);
402
+ }
403
+ }
404
+ // If the non-geo entity still got added to the set of supported regions it must be because
405
+ // there are entries that list the non-geo entity alongside normal regions (which is wrong).
406
+ // If we discover this, remove the non-geo entity from the set of supported regions and log.
407
+ $idx_region_code_non_geo_entity = array_search(self::REGION_CODE_FOR_NON_GEO_ENTITY, $this->supportedRegions);
408
+ if ($idx_region_code_non_geo_entity !== false) {
409
+ unset($this->supportedRegions[$idx_region_code_non_geo_entity]);
410
+ }
411
+ $this->nanpaRegions = $this->countryCallingCodeToRegionCodeMap[self::NANPA_COUNTRY_CODE];
412
+ }
413
+
414
+ private static function initCapturingExtnDigits()
415
+ {
416
+ self::$CAPTURING_EXTN_DIGITS = "(" . self::DIGITS . "{1,7})";
417
+ }
418
+
419
+ private static function initExtnPatterns()
420
+ {
421
+ // One-character symbols that can be used to indicate an extension.
422
+ $singleExtnSymbolsForMatching = "x\xEF\xBD\x98#\xEF\xBC\x83~\xEF\xBD\x9E";
423
+ // For parsing, we are slightly more lenient in our interpretation than for matching. Here we
424
+ // allow a "comma" as a possible extension indicator. When matching, this is hardly ever used to
425
+ // indicate this.
426
+ $singleExtnSymbolsForParsing = "," . $singleExtnSymbolsForMatching;
427
+
428
+ self::$EXTN_PATTERNS_FOR_PARSING = self::createExtnPattern($singleExtnSymbolsForParsing);
429
+ self::$EXTN_PATTERNS_FOR_MATCHING = self::createExtnPattern($singleExtnSymbolsForMatching);
430
+ }
431
+
432
+ // The FIRST_GROUP_PATTERN was originally set to $1 but there are some countries for which the
433
+ // first group is not used in the national pattern (e.g. Argentina) so the $1 group does not match
434
+ // correctly. Therefore, we use \d, so that the first group actually used in the pattern will be
435
+ // matched.
436
+
437
+ /**
438
+ * Helper initialiser method to create the regular-expression pattern to match extensions,
439
+ * allowing the one-char extension symbols provided by {@code singleExtnSymbols}.
440
+ * @param string $singleExtnSymbols
441
+ * @return string
442
+ */
443
+ private static function createExtnPattern($singleExtnSymbols)
444
+ {
445
+ // There are three regular expressions here. The first covers RFC 3966 format, where the
446
+ // extension is added using ";ext=". The second more generic one starts with optional white
447
+ // space and ends with an optional full stop (.), followed by zero or more spaces/tabs and then
448
+ // the numbers themselves. The other one covers the special case of American numbers where the
449
+ // extension is written with a hash at the end, such as "- 503#".
450
+ // Note that the only capturing groups should be around the digits that you want to capture as
451
+ // part of the extension, or else parsing will fail!
452
+ // Canonical-equivalence doesn't seem to be an option with Android java, so we allow two options
453
+ // for representing the accented o - the character itself, and one in the unicode decomposed
454
+ // form with the combining acute accent.
455
+ return (self::RFC3966_EXTN_PREFIX . self::$CAPTURING_EXTN_DIGITS . "|" . "[ \xC2\xA0\\t,]*" .
456
+ "(?:e?xt(?:ensi(?:o\xCC\x81?|\xC3\xB3))?n?|(?:\xEF\xBD\x85)?\xEF\xBD\x98\xEF\xBD\x94(?:\xEF\xBD\x8E)?|" .
457
+ "[" . $singleExtnSymbols . "]|int|\xEF\xBD\x89\xEF\xBD\x8E\xEF\xBD\x94|anexo)" .
458
+ "[:\\.\xEF\xBC\x8E]?[ \xC2\xA0\\t,-]*" . self::$CAPTURING_EXTN_DIGITS . "#?|" .
459
+ "[- ]+(" . self::DIGITS . "{1,5})#");
460
+ }
461
+
462
+ private static function initExtnPattern()
463
+ {
464
+ self::$EXTN_PATTERN = "/(?:" . self::$EXTN_PATTERNS_FOR_PARSING . ")$/" . self::REGEX_FLAGS;
465
+ }
466
+
467
+ /**
468
+ * Used for testing purposes only to reset the PhoneNumberUtil singleton to null.
469
+ */
470
+ public static function resetInstance()
471
+ {
472
+ self::$instance = null;
473
+ }
474
+
475
+ /**
476
+ * Converts all alpha characters in a number to their respective digits on a keypad, but retains
477
+ * existing formatting.
478
+ * @param string $number
479
+ * @return string
480
+ */
481
+ public static function convertAlphaCharactersInNumber($number)
482
+ {
483
+ return self::normalizeHelper($number, self::$ALPHA_PHONE_MAPPINGS, false);
484
+ }
485
+
486
+ /**
487
+ * Normalizes a string of characters representing a phone number by replacing all characters found
488
+ * in the accompanying map with the values therein, and stripping all other characters if
489
+ * removeNonMatches is true.
490
+ *
491
+ * @param string $number a string of characters representing a phone number
492
+ * @param array $normalizationReplacements a mapping of characters to what they should be replaced by in
493
+ * the normalized version of the phone number
494
+ * @param bool $removeNonMatches indicates whether characters that are not able to be replaced
495
+ * should be stripped from the number. If this is false, they will be left unchanged in the number.
496
+ * @return string the normalized string version of the phone number
497
+ */
498
+ private static function normalizeHelper($number, array $normalizationReplacements, $removeNonMatches)
499
+ {
500
+ $normalizedNumber = "";
501
+ $strLength = mb_strlen($number, 'UTF-8');
502
+ for ($i = 0; $i < $strLength; $i++) {
503
+ $character = mb_substr($number, $i, 1, 'UTF-8');
504
+ if (isset($normalizationReplacements[mb_strtoupper($character, 'UTF-8')])) {
505
+ $normalizedNumber .= $normalizationReplacements[mb_strtoupper($character, 'UTF-8')];
506
+ } else {
507
+ if (!$removeNonMatches) {
508
+ $normalizedNumber .= $character;
509
+ }
510
+ }
511
+ // If neither of the above are true, we remove this character.
512
+ }
513
+ return $normalizedNumber;
514
+ }
515
+
516
+ /**
517
+ * Helper function to check if the national prefix formatting rule has the first group only, i.e.,
518
+ * does not start with the national prefix.
519
+ * @param string $nationalPrefixFormattingRule
520
+ * @return bool
521
+ */
522
+ public static function formattingRuleHasFirstGroupOnly($nationalPrefixFormattingRule)
523
+ {
524
+ $m = preg_match(self::FIRST_GROUP_ONLY_PREFIX_PATTERN, $nationalPrefixFormattingRule);
525
+ return $m > 0;
526
+ }
527
+
528
+ /**
529
+ * Convenience method to get a list of what regions the library has metadata for.
530
+ * @return array
531
+ */
532
+ public function getSupportedRegions()
533
+ {
534
+ return $this->supportedRegions;
535
+ }
536
+
537
+ /**
538
+ * Convenience method to get a list of what global network calling codes the library has metadata
539
+ * for.
540
+ * @return array
541
+ */
542
+ public function getSupportedGlobalNetworkCallingCodes()
543
+ {
544
+ return $this->countryCodesForNonGeographicalRegion;
545
+ }
546
+
547
+ /**
548
+ * Gets the length of the geographical area code from the {@code nationalNumber} field of the
549
+ * PhoneNumber object passed in, so that clients could use it to split a national significant
550
+ * number into geographical area code and subscriber number. It works in such a way that the
551
+ * resultant subscriber number should be diallable, at least on some devices. An example of how
552
+ * this could be used:
553
+ *
554
+ * <code>
555
+ * $phoneUtil = PhoneNumberUtil::getInstance();
556
+ * $number = $phoneUtil->parse("16502530000", "US");
557
+ * $nationalSignificantNumber = $phoneUtil->getNationalSignificantNumber($number);
558
+ *
559
+ * $areaCodeLength = $phoneUtil->getLengthOfGeographicalAreaCode($number);
560
+ * if ($areaCodeLength > 0)
561
+ * {
562
+ * $areaCode = substr($nationalSignificantNumber, 0,$areaCodeLength);
563
+ * $subscriberNumber = substr($nationalSignificantNumber, $areaCodeLength);
564
+ * } else {
565
+ * $areaCode = "";
566
+ * $subscriberNumber = $nationalSignificantNumber;
567
+ * }
568
+ * </code>
569
+ *
570
+ * N.B.: area code is a very ambiguous concept, so the I18N team generally recommends against
571
+ * using it for most purposes, but recommends using the more general {@code nationalNumber}
572
+ * instead. Read the following carefully before deciding to use this method:
573
+ * <ul>
574
+ * <li> geographical area codes change over time, and this method honors those changes;
575
+ * therefore, it doesn't guarantee the stability of the result it produces.
576
+ * <li> subscriber numbers may not be diallable from all devices (notably mobile devices, which
577
+ * typically requires the full national_number to be dialled in most regions).
578
+ * <li> most non-geographical numbers have no area codes, including numbers from non-geographical
579
+ * entities
580
+ * <li> some geographical numbers have no area codes.
581
+ * </ul>
582
+ * @param PhoneNumber $number PhoneNumber object for which clients want to know the length of the area code.
583
+ * @return int the length of area code of the PhoneNumber object passed in.
584
+ */
585
+ public function getLengthOfGeographicalAreaCode(PhoneNumber $number)
586
+ {
587
+ $metadata = $this->getMetadataForRegion($this->getRegionCodeForNumber($number));
588
+ if ($metadata === null) {
589
+ return 0;
590
+ }
591
+ // If a country doesn't use a national prefix, and this number doesn't have an Italian leading
592
+ // zero, we assume it is a closed dialling plan with no area codes.
593
+ if (!$metadata->hasNationalPrefix() && !$number->isItalianLeadingZero()) {
594
+ return 0;
595
+ }
596
+
597
+ if (!$this->isNumberGeographical($number)) {
598
+ return 0;
599
+ }
600
+
601
+ return $this->getLengthOfNationalDestinationCode($number);
602
+ }
603
+
604
+ /**
605
+ * Returns the metadata for the given region code or {@code null} if the region code is invalid
606
+ * or unknown.
607
+ * @param string $regionCode
608
+ * @return PhoneMetadata
609
+ */
610
+ public function getMetadataForRegion($regionCode)
611
+ {
612
+ if (!$this->isValidRegionCode($regionCode)) {
613
+ return null;
614
+ }
615
+
616
+ return $this->metadataSource->getMetadataForRegion($regionCode);
617
+ }
618
+
619
+ /**
620
+ * Helper function to check region code is not unknown or null.
621
+ * @param string $regionCode
622
+ * @return bool
623
+ */
624
+ private function isValidRegionCode($regionCode)
625
+ {
626
+ return $regionCode !== null && in_array($regionCode, $this->supportedRegions);
627
+ }
628
+
629
+ /**
630
+ * Returns the region where a phone number is from. This could be used for geocoding at the region
631
+ * level.
632
+ *
633
+ * @param PhoneNumber $number the phone number whose origin we want to know
634
+ * @return null|string the region where the phone number is from, or null if no region matches this calling
635
+ * code
636
+ */
637
+ public function getRegionCodeForNumber(PhoneNumber $number)
638
+ {
639
+ $countryCode = $number->getCountryCode();
640
+ if (!isset($this->countryCallingCodeToRegionCodeMap[$countryCode])) {
641
+ return null;
642
+ }
643
+ $regions = $this->countryCallingCodeToRegionCodeMap[$countryCode];
644
+ if (count($regions) == 1) {
645
+ return $regions[0];
646
+ } else {
647
+ return $this->getRegionCodeForNumberFromRegionList($number, $regions);
648
+ }
649
+ }
650
+
651
+ /**
652
+ * @param PhoneNumber $number
653
+ * @param array $regionCodes
654
+ * @return null|string
655
+ */
656
+ private function getRegionCodeForNumberFromRegionList(PhoneNumber $number, array $regionCodes)
657
+ {
658
+ $nationalNumber = $this->getNationalSignificantNumber($number);
659
+ foreach ($regionCodes as $regionCode) {
660
+ // If leadingDigits is present, use this. Otherwise, do full validation.
661
+ // Metadata cannot be null because the region codes come from the country calling code map.
662
+ $metadata = $this->getMetadataForRegion($regionCode);
663
+ if ($metadata->hasLeadingDigits()) {
664
+ $nbMatches = preg_match(
665
+ '/' . $metadata->getLeadingDigits() . '/',
666
+ $nationalNumber,
667
+ $matches,
668
+ PREG_OFFSET_CAPTURE
669
+ );
670
+ if ($nbMatches > 0 && $matches[0][1] === 0) {
671
+ return $regionCode;
672
+ }
673
+ } else if ($this->getNumberTypeHelper($nationalNumber, $metadata) != PhoneNumberType::UNKNOWN) {
674
+ return $regionCode;
675
+ }
676
+ }
677
+ return null;
678
+ }
679
+
680
+ /**
681
+ * Gets the national significant number of the a phone number. Note a national significant number
682
+ * doesn't contain a national prefix or any formatting.
683
+ *
684
+ * @param PhoneNumber $number the phone number for which the national significant number is needed
685
+ * @return string the national significant number of the PhoneNumber object passed in
686
+ */
687
+ public function getNationalSignificantNumber(PhoneNumber $number)
688
+ {
689
+ // If leading zero(s) have been set, we prefix this now. Note this is not a national prefix.
690
+ $nationalNumber = '';
691
+ if ($number->isItalianLeadingZero()) {
692
+ $zeros = str_repeat('0', $number->getNumberOfLeadingZeros());
693
+ $nationalNumber .= $zeros;
694
+ }
695
+ $nationalNumber .= $number->getNationalNumber();
696
+ return $nationalNumber;
697
+ }
698
+
699
+ /**
700
+ * @param string $nationalNumber
701
+ * @param PhoneMetadata $metadata
702
+ * @return int PhoneNumberType constant
703
+ */
704
+ private function getNumberTypeHelper($nationalNumber, PhoneMetadata $metadata)
705
+ {
706
+ if (!$this->isNumberMatchingDesc($nationalNumber, $metadata->getGeneralDesc())) {
707
+ return PhoneNumberType::UNKNOWN;
708
+ }
709
+ if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getPremiumRate())) {
710
+ return PhoneNumberType::PREMIUM_RATE;
711
+ }
712
+ if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getTollFree())) {
713
+ return PhoneNumberType::TOLL_FREE;
714
+ }
715
+
716
+
717
+ if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getSharedCost())) {
718
+ return PhoneNumberType::SHARED_COST;
719
+ }
720
+ if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getVoip())) {
721
+ return PhoneNumberType::VOIP;
722
+ }
723
+ if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getPersonalNumber())) {
724
+ return PhoneNumberType::PERSONAL_NUMBER;
725
+ }
726
+ if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getPager())) {
727
+ return PhoneNumberType::PAGER;
728
+ }
729
+ if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getUan())) {
730
+ return PhoneNumberType::UAN;
731
+ }
732
+ if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getVoicemail())) {
733
+ return PhoneNumberType::VOICEMAIL;
734
+ }
735
+ $isFixedLine = $this->isNumberMatchingDesc($nationalNumber, $metadata->getFixedLine());
736
+ if ($isFixedLine) {
737
+ if ($metadata->isSameMobileAndFixedLinePattern()) {
738
+ return PhoneNumberType::FIXED_LINE_OR_MOBILE;
739
+ } else if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getMobile())) {
740
+ return PhoneNumberType::FIXED_LINE_OR_MOBILE;
741
+ }
742
+ return PhoneNumberType::FIXED_LINE;
743
+ }
744
+ // Otherwise, test to see if the number is mobile. Only do this if certain that the patterns for
745
+ // mobile and fixed line aren't the same.
746
+ if (!$metadata->isSameMobileAndFixedLinePattern() &&
747
+ $this->isNumberMatchingDesc($nationalNumber, $metadata->getMobile())
748
+ ) {
749
+ return PhoneNumberType::MOBILE;
750
+ }
751
+ return PhoneNumberType::UNKNOWN;
752
+ }
753
+
754
+ /**
755
+ * @param string $nationalNumber
756
+ * @param PhoneNumberDesc $numberDesc
757
+ * @return bool
758
+ */
759
+ public function isNumberMatchingDesc($nationalNumber, PhoneNumberDesc $numberDesc)
760
+ {
761
+ $nationalNumberPatternMatcher = new Matcher($numberDesc->getNationalNumberPattern(), $nationalNumber);
762
+
763
+ return $this->isNumberPossibleForDesc($nationalNumber, $numberDesc) && $nationalNumberPatternMatcher->matches();
764
+ }
765
+
766
+ /**
767
+ *
768
+ * Helper method to check whether a number is too short to be a regular length phone number in a
769
+ * region.
770
+ *
771
+ * @param PhoneMetadata $regionMetadata
772
+ * @param string $number
773
+ * @return bool
774
+ */
775
+ private function isShorterThanPossibleNormalNumber(PhoneMetadata $regionMetadata, $number)
776
+ {
777
+ $possibleNumberPattern = $regionMetadata->getGeneralDesc()->getPossibleNumberPattern();
778
+ return ($this->testNumberLengthAgainstPattern($possibleNumberPattern, $number) === ValidationResult::TOO_SHORT);
779
+ }
780
+
781
+ /**
782
+ * @param string $nationalNumber
783
+ * @param PhoneNumberDesc $numberDesc
784
+ * @return bool
785
+ */
786
+ public function isNumberPossibleForDesc($nationalNumber, PhoneNumberDesc $numberDesc)
787
+ {
788
+ $possibleNumberPatternMatcher = new Matcher($numberDesc->getPossibleNumberPattern(), $nationalNumber);
789
+
790
+ return $possibleNumberPatternMatcher->matches();
791
+ }
792
+
793
+ /**
794
+ * Tests whether a phone number has a geographical association. It checks if the number is
795
+ * associated to a certain region in the country where it belongs to. Note that this doesn't
796
+ * verify if the number is actually in use.
797
+ * @param PhoneNumber $phoneNumber
798
+ * @return bool
799
+ */
800
+ public function isNumberGeographical(PhoneNumber $phoneNumber)
801
+ {
802
+ $numberType = $this->getNumberType($phoneNumber);
803
+ // TODO: Include mobile phone numbers from countries like Indonesia, which has some
804
+ // mobile numbers that are geographical.
805
+ return $numberType == PhoneNumberType::FIXED_LINE || $numberType == PhoneNumberType::FIXED_LINE_OR_MOBILE;
806
+ }
807
+
808
+ /**
809
+ * Gets the type of a phone number.
810
+ * @param PhoneNumber $number the number the phone number that we want to know the type
811
+ * @return int PhoneNumberType the type of the phone number
812
+ */
813
+ public function getNumberType(PhoneNumber $number)
814
+ {
815
+ $regionCode = $this->getRegionCodeForNumber($number);
816
+ $metadata = $this->getMetadataForRegionOrCallingCode($number->getCountryCode(), $regionCode);
817
+ if ($metadata === null) {
818
+ return PhoneNumberType::UNKNOWN;
819
+ }
820
+ $nationalSignificantNumber = $this->getNationalSignificantNumber($number);
821
+ return $this->getNumberTypeHelper($nationalSignificantNumber, $metadata);
822
+ }
823
+
824
+ /**
825
+ * @param int $countryCallingCode
826
+ * @param string $regionCode
827
+ * @return PhoneMetadata
828
+ */
829
+ private function getMetadataForRegionOrCallingCode($countryCallingCode, $regionCode)
830
+ {
831
+ return self::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCode ?
832
+ $this->getMetadataForNonGeographicalRegion($countryCallingCode) : $this->getMetadataForRegion($regionCode);
833
+ }
834
+
835
+ /**
836
+ * @param int $countryCallingCode
837
+ * @return PhoneMetadata
838
+ */
839
+ public function getMetadataForNonGeographicalRegion($countryCallingCode)
840
+ {
841
+ if (!isset($this->countryCallingCodeToRegionCodeMap[$countryCallingCode])) {
842
+ return null;
843
+ }
844
+ return $this->metadataSource->getMetadataForNonGeographicalRegion($countryCallingCode);
845
+ }
846
+
847
+ /**
848
+ * Gets the length of the national destination code (NDC) from the PhoneNumber object passed in,
849
+ * so that clients could use it to split a national significant number into NDC and subscriber
850
+ * number. The NDC of a phone number is normally the first group of digit(s) right after the
851
+ * country calling code when the number is formatted in the international format, if there is a
852
+ * subscriber number part that follows. An example of how this could be used:
853
+ *
854
+ * <code>
855
+ * $phoneUtil = PhoneNumberUtil::getInstance();
856
+ * $number = $phoneUtil->parse("18002530000", "US");
857
+ * $nationalSignificantNumber = $phoneUtil->getNationalSignificantNumber($number);
858
+ *
859
+ * $nationalDestinationCodeLength = $phoneUtil->getLengthOfNationalDestinationCode($number);
860
+ * if ($nationalDestinationCodeLength > 0) {
861
+ * $nationalDestinationCode = substr($nationalSignificantNumber, 0, $nationalDestinationCodeLength);
862
+ * $subscriberNumber = substr($nationalSignificantNumber, $nationalDestinationCodeLength);
863
+ * } else {
864
+ * $nationalDestinationCode = "";
865
+ * $subscriberNumber = $nationalSignificantNumber;
866
+ * }
867
+ * </code>
868
+ *
869
+ * Refer to the unit tests to see the difference between this function and
870
+ * {@link #getLengthOfGeographicalAreaCode}.
871
+ *
872
+ * @param PhoneNumber $number the PhoneNumber object for which clients want to know the length of the NDC.
873
+ * @return int the length of NDC of the PhoneNumber object passed in.
874
+ */
875
+ public function getLengthOfNationalDestinationCode(PhoneNumber $number)
876
+ {
877
+ if ($number->hasExtension()) {
878
+ // We don't want to alter the proto given to us, but we don't want to include the extension
879
+ // when we format it, so we copy it and clear the extension here.
880
+ $copiedProto = new PhoneNumber();
881
+ $copiedProto->mergeFrom($number);
882
+ $copiedProto->clearExtension();
883
+ } else {
884
+ $copiedProto = clone $number;
885
+ }
886
+
887
+ $nationalSignificantNumber = $this->format($copiedProto, PhoneNumberFormat::INTERNATIONAL);
888
+
889
+ $numberGroups = preg_split('/' . self::NON_DIGITS_PATTERN . '/', $nationalSignificantNumber);
890
+
891
+ // The pattern will start with "+COUNTRY_CODE " so the first group will always be the empty
892
+ // string (before the + symbol) and the second group will be the country calling code. The third
893
+ // group will be area code if it is not the last group.
894
+ if (count($numberGroups) <= 3) {
895
+ return 0;
896
+ }
897
+
898
+ if ($this->getNumberType($number) == PhoneNumberType::MOBILE) {
899
+ // For example Argentinian mobile numbers, when formatted in the international format, are in
900
+ // the form of +54 9 NDC XXXX.... As a result, we take the length of the third group (NDC) and
901
+ // add the length of the second group (which is the mobile token), which also forms part of
902
+ // the national significant number. This assumes that the mobile token is always formatted
903
+ // separately from the rest of the phone number.
904
+
905
+ $mobileToken = self::getCountryMobileToken($number->getCountryCode());
906
+ if ($mobileToken !== "") {
907
+ return mb_strlen($numberGroups[2]) + mb_strlen($numberGroups[3]);
908
+ }
909
+ }
910
+ return mb_strlen($numberGroups[2]);
911
+ }
912
+
913
+ /**
914
+ * Formats a phone number in the specified format using default rules. Note that this does not
915
+ * promise to produce a phone number that the user can dial from where they are - although we do
916
+ * format in either 'national' or 'international' format depending on what the client asks for, we
917
+ * do not currently support a more abbreviated format, such as for users in the same "area" who
918
+ * could potentially dial the number without area code. Note that if the phone number has a
919
+ * country calling code of 0 or an otherwise invalid country calling code, we cannot work out
920
+ * which formatting rules to apply so we return the national significant number with no formatting
921
+ * applied.
922
+ *
923
+ * @param PhoneNumber $number the phone number to be formatted
924
+ * @param int $numberFormat the PhoneNumberFormat the phone number should be formatted into
925
+ * @return string the formatted phone number
926
+ */
927
+ public function format(PhoneNumber $number, $numberFormat)
928
+ {
929
+ if ($number->getNationalNumber() == 0 && $number->hasRawInput()) {
930
+ // Unparseable numbers that kept their raw input just use that.
931
+ // This is the only case where a number can be formatted as E164 without a
932
+ // leading '+' symbol (but the original number wasn't parseable anyway).
933
+ // TODO: Consider removing the 'if' above so that unparseable
934
+ // strings without raw input format to the empty string instead of "+00"
935
+ $rawInput = $number->getRawInput();
936
+ if (mb_strlen($rawInput) > 0) {
937
+ return $rawInput;
938
+ }
939
+ }
940
+ $metadata = null;
941
+ $formattedNumber = "";
942
+ $countryCallingCode = $number->getCountryCode();
943
+ $nationalSignificantNumber = $this->getNationalSignificantNumber($number);
944
+ if ($numberFormat == PhoneNumberFormat::E164) {
945
+ // Early exit for E164 case (even if the country calling code is invalid) since no formatting
946
+ // of the national number needs to be applied. Extensions are not formatted.
947
+ $formattedNumber .= $nationalSignificantNumber;
948
+ $this->prefixNumberWithCountryCallingCode($countryCallingCode, PhoneNumberFormat::E164, $formattedNumber);
949
+ } elseif (!$this->hasValidCountryCallingCode($countryCallingCode)) {
950
+ $formattedNumber .= $nationalSignificantNumber;
951
+ } else {
952
+ // Note getRegionCodeForCountryCode() is used because formatting information for regions which
953
+ // share a country calling code is contained by only one region for performance reasons. For
954
+ // example, for NANPA regions it will be contained in the metadata for US.
955
+ $regionCode = $this->getRegionCodeForCountryCode($countryCallingCode);
956
+ // Metadata cannot be null because the country calling code is valid (which means that the
957
+ // region code cannot be ZZ and must be one of our supported region codes).
958
+ $metadata = $this->getMetadataForRegionOrCallingCode($countryCallingCode, $regionCode);
959
+ $formattedNumber .= $this->formatNsn($nationalSignificantNumber, $metadata, $numberFormat);
960
+ $this->prefixNumberWithCountryCallingCode($countryCallingCode, $numberFormat, $formattedNumber);
961
+ }
962
+ $this->maybeAppendFormattedExtension($number, $metadata, $numberFormat, $formattedNumber);
963
+ return $formattedNumber;
964
+ }
965
+
966
+ /**
967
+ * A helper function that is used by format and formatByPattern.
968
+ * @param int $countryCallingCode
969
+ * @param int $numberFormat PhoneNumberFormat
970
+ * @param string $formattedNumber
971
+ */
972
+ private function prefixNumberWithCountryCallingCode($countryCallingCode, $numberFormat, &$formattedNumber)
973
+ {
974
+ switch ($numberFormat) {
975
+ case PhoneNumberFormat::E164:
976
+ $formattedNumber = self::PLUS_SIGN . $countryCallingCode . $formattedNumber;
977
+ return;
978
+ case PhoneNumberFormat::INTERNATIONAL:
979
+ $formattedNumber = self::PLUS_SIGN . $countryCallingCode . " " . $formattedNumber;
980
+ return;
981
+ case PhoneNumberFormat::RFC3966:
982
+ $formattedNumber = self::RFC3966_PREFIX . self::PLUS_SIGN . $countryCallingCode . "-" . $formattedNumber;
983
+ return;
984
+ case PhoneNumberFormat::NATIONAL:
985
+ default:
986
+ return;
987
+ }
988
+ }
989
+
990
+ /**
991
+ * Helper function to check the country calling code is valid.
992
+ * @param int $countryCallingCode
993
+ * @return bool
994
+ */
995
+ private function hasValidCountryCallingCode($countryCallingCode)
996
+ {
997
+ return isset($this->countryCallingCodeToRegionCodeMap[$countryCallingCode]);
998
+ }
999
+
1000
+ /**
1001
+ * Returns the region code that matches the specific country calling code. In the case of no
1002
+ * region code being found, ZZ will be returned. In the case of multiple regions, the one
1003
+ * designated in the metadata as the "main" region for this calling code will be returned. If the
1004
+ * countryCallingCode entered is valid but doesn't match a specific region (such as in the case of
1005
+ * non-geographical calling codes like 800) the value "001" will be returned (corresponding to
1006
+ * the value for World in the UN M.49 schema).
1007
+ *
1008
+ * @param int $countryCallingCode
1009
+ * @return string
1010
+ */
1011
+ public function getRegionCodeForCountryCode($countryCallingCode)
1012
+ {
1013
+ $regionCodes = isset($this->countryCallingCodeToRegionCodeMap[$countryCallingCode]) ? $this->countryCallingCodeToRegionCodeMap[$countryCallingCode] : null;
1014
+ return $regionCodes === null ? self::UNKNOWN_REGION : $regionCodes[0];
1015
+ }
1016
+
1017
+ /**
1018
+ * Note in some regions, the national number can be written in two completely different ways
1019
+ * depending on whether it forms part of the NATIONAL format or INTERNATIONAL format. The
1020
+ * numberFormat parameter here is used to specify which format to use for those cases. If a
1021
+ * carrierCode is specified, this will be inserted into the formatted string to replace $CC.
1022
+ * @param string $number
1023
+ * @param PhoneMetadata $metadata
1024
+ * @param int $numberFormat PhoneNumberFormat
1025
+ * @param null|string $carrierCode
1026
+ * @return string
1027
+ */
1028
+ private function formatNsn($number, PhoneMetadata $metadata, $numberFormat, $carrierCode = null)
1029
+ {
1030
+ $intlNumberFormats = $metadata->intlNumberFormats();
1031
+ // When the intlNumberFormats exists, we use that to format national number for the
1032
+ // INTERNATIONAL format instead of using the numberDesc.numberFormats.
1033
+ $availableFormats = (count($intlNumberFormats) == 0 || $numberFormat == PhoneNumberFormat::NATIONAL)
1034
+ ? $metadata->numberFormats()
1035
+ : $metadata->intlNumberFormats();
1036
+ $formattingPattern = $this->chooseFormattingPatternForNumber($availableFormats, $number);
1037
+ return ($formattingPattern === null)
1038
+ ? $number
1039
+ : $this->formatNsnUsingPattern($number, $formattingPattern, $numberFormat, $carrierCode);
1040
+ }
1041
+
1042
+ /**
1043
+ * @param NumberFormat[] $availableFormats
1044
+ * @param string $nationalNumber
1045
+ * @return NumberFormat|null
1046
+ */
1047
+ public function chooseFormattingPatternForNumber(array $availableFormats, $nationalNumber)
1048
+ {
1049
+ foreach ($availableFormats as $numFormat) {
1050
+ $leadingDigitsPatternMatcher = null;
1051
+ $size = $numFormat->leadingDigitsPatternSize();
1052
+ // We always use the last leading_digits_pattern, as it is the most detailed.
1053
+ if ($size > 0) {
1054
+ $leadingDigitsPatternMatcher = new Matcher(
1055
+ $numFormat->getLeadingDigitsPattern($size - 1),
1056
+ $nationalNumber
1057
+ );
1058
+ }
1059
+ if ($size == 0 || $leadingDigitsPatternMatcher->lookingAt()) {
1060
+ $m = new Matcher($numFormat->getPattern(), $nationalNumber);
1061
+ if ($m->matches() > 0) {
1062
+ return $numFormat;
1063
+ }
1064
+ }
1065
+ }
1066
+ return null;
1067
+ }
1068
+
1069
+ /**
1070
+ * Note that carrierCode is optional - if null or an empty string, no carrier code replacement
1071
+ * will take place.
1072
+ * @param string $nationalNumber
1073
+ * @param NumberFormat $formattingPattern
1074
+ * @param int $numberFormat PhoneNumberFormat
1075
+ * @param null|string $carrierCode
1076
+ * @return string
1077
+ */
1078
+ private function formatNsnUsingPattern(
1079
+ $nationalNumber,
1080
+ NumberFormat $formattingPattern,
1081
+ $numberFormat,
1082
+ $carrierCode = null
1083
+ ) {
1084
+ $numberFormatRule = $formattingPattern->getFormat();
1085
+ $m = new Matcher($formattingPattern->getPattern(), $nationalNumber);
1086
+ if ($numberFormat === PhoneNumberFormat::NATIONAL &&
1087
+ $carrierCode !== null && mb_strlen($carrierCode) > 0 &&
1088
+ mb_strlen($formattingPattern->getDomesticCarrierCodeFormattingRule()) > 0
1089
+ ) {
1090
+ // Replace the $CC in the formatting rule with the desired carrier code.
1091
+ $carrierCodeFormattingRule = $formattingPattern->getDomesticCarrierCodeFormattingRule();
1092
+ $ccPatternMatcher = new Matcher(self::CC_PATTERN, $carrierCodeFormattingRule);
1093
+ $carrierCodeFormattingRule = $ccPatternMatcher->replaceFirst($carrierCode);
1094
+ // Now replace the $FG in the formatting rule with the first group and the carrier code
1095
+ // combined in the appropriate way.
1096
+ $firstGroupMatcher = new Matcher(self::FIRST_GROUP_PATTERN, $numberFormatRule);
1097
+ $numberFormatRule = $firstGroupMatcher->replaceFirst($carrierCodeFormattingRule);
1098
+ $formattedNationalNumber = $m->replaceAll($numberFormatRule);
1099
+ } else {
1100
+ // Use the national prefix formatting rule instead.
1101
+ $nationalPrefixFormattingRule = $formattingPattern->getNationalPrefixFormattingRule();
1102
+ if ($numberFormat == PhoneNumberFormat::NATIONAL &&
1103
+ $nationalPrefixFormattingRule !== null &&
1104
+ mb_strlen($nationalPrefixFormattingRule) > 0
1105
+ ) {
1106
+ $firstGroupMatcher = new Matcher(self::FIRST_GROUP_PATTERN, $numberFormatRule);
1107
+ $formattedNationalNumber = $m->replaceAll(
1108
+ $firstGroupMatcher->replaceFirst($nationalPrefixFormattingRule)
1109
+ );
1110
+ } else {
1111
+ $formattedNationalNumber = $m->replaceAll($numberFormatRule);
1112
+ }
1113
+
1114
+ }
1115
+ if ($numberFormat == PhoneNumberFormat::RFC3966) {
1116
+ // Strip any leading punctuation.
1117
+ $matcher = new Matcher(self::$SEPARATOR_PATTERN, $formattedNationalNumber);
1118
+ if ($matcher->lookingAt()) {
1119
+ $formattedNationalNumber = $matcher->replaceFirst("");
1120
+ }
1121
+ // Replace the rest with a dash between each number group.
1122
+ $formattedNationalNumber = $matcher->reset($formattedNationalNumber)->replaceAll("-");
1123
+ }
1124
+ return $formattedNationalNumber;
1125
+ }
1126
+
1127
+ /**
1128
+ * Appends the formatted extension of a phone number to formattedNumber, if the phone number had
1129
+ * an extension specified.
1130
+ *
1131
+ * @param PhoneNumber $number
1132
+ * @param PhoneMetadata|null $metadata
1133
+ * @param int $numberFormat PhoneNumberFormat
1134
+ * @param string $formattedNumber
1135
+ */
1136
+ private function maybeAppendFormattedExtension(PhoneNumber $number, $metadata, $numberFormat, &$formattedNumber)
1137
+ {
1138
+ if ($number->hasExtension() && mb_strlen($number->getExtension()) > 0) {
1139
+ if ($numberFormat === PhoneNumberFormat::RFC3966) {
1140
+ $formattedNumber .= self::RFC3966_EXTN_PREFIX . $number->getExtension();
1141
+ } else {
1142
+ if (!empty($metadata) && $metadata->hasPreferredExtnPrefix()) {
1143
+ $formattedNumber .= $metadata->getPreferredExtnPrefix() . $number->getExtension();
1144
+ } else {
1145
+ $formattedNumber .= self::DEFAULT_EXTN_PREFIX . $number->getExtension();
1146
+ }
1147
+ }
1148
+ }
1149
+ }
1150
+
1151
+ /**
1152
+ * Returns the mobile token for the provided country calling code if it has one, otherwise
1153
+ * returns an empty string. A mobile token is a number inserted before the area code when dialing
1154
+ * a mobile number from that country from abroad.
1155
+ *
1156
+ * @param int $countryCallingCode the country calling code for which we want the mobile token
1157
+ * @return string the mobile token, as a string, for the given country calling code
1158
+ */
1159
+ public static function getCountryMobileToken($countryCallingCode)
1160
+ {
1161
+ if (array_key_exists($countryCallingCode, self::$MOBILE_TOKEN_MAPPINGS)) {
1162
+ return self::$MOBILE_TOKEN_MAPPINGS[$countryCallingCode];
1163
+ }
1164
+ return "";
1165
+ }
1166
+
1167
+ /**
1168
+ * Checks if the number is a valid vanity (alpha) number such as 800 MICROSOFT. A valid vanity
1169
+ * number will start with at least 3 digits and will have three or more alpha characters. This
1170
+ * does not do region-specific checks - to work out if this number is actually valid for a region,
1171
+ * it should be parsed and methods such as {@link #isPossibleNumberWithReason} and
1172
+ * {@link #isValidNumber} should be used.
1173
+ *
1174
+ * @param string $number the number that needs to be checked
1175
+ * @return bool true if the number is a valid vanity number
1176
+ */
1177
+ public function isAlphaNumber($number)
1178
+ {
1179
+ if (!$this->isViablePhoneNumber($number)) {
1180
+ // Number is too short, or doesn't match the basic phone number pattern.
1181
+ return false;
1182
+ }
1183
+ $this->maybeStripExtension($number);
1184
+ return (bool)preg_match('/' . self::VALID_ALPHA_PHONE_PATTERN . '/' . self::REGEX_FLAGS, $number);
1185
+ }
1186
+
1187
+ /**
1188
+ * Checks to see if the string of characters could possibly be a phone number at all. At the
1189
+ * moment, checks to see that the string begins with at least 2 digits, ignoring any punctuation
1190
+ * commonly found in phone numbers.
1191
+ * This method does not require the number to be normalized in advance - but does assume that
1192
+ * leading non-number symbols have been removed, such as by the method extractPossibleNumber.
1193
+ *
1194
+ * @param string $number to be checked for viability as a phone number
1195
+ * @return boolean true if the number could be a phone number of some sort, otherwise false
1196
+ */
1197
+ public static function isViablePhoneNumber($number)
1198
+ {
1199
+ if (mb_strlen($number) < self::MIN_LENGTH_FOR_NSN) {
1200
+ return false;
1201
+ }
1202
+
1203
+ $validPhoneNumberPattern = self::getValidPhoneNumberPattern();
1204
+
1205
+ $m = preg_match($validPhoneNumberPattern, $number);
1206
+ return $m > 0;
1207
+ }
1208
+
1209
+ /**
1210
+ * We append optionally the extension pattern to the end here, as a valid phone number may
1211
+ * have an extension prefix appended, followed by 1 or more digits.
1212
+ * @return string
1213
+ */
1214
+ private static function getValidPhoneNumberPattern()
1215
+ {
1216
+ return self::$VALID_PHONE_NUMBER_PATTERN;
1217
+ }
1218
+
1219
+ /**
1220
+ * Strips any extension (as in, the part of the number dialled after the call is connected,
1221
+ * usually indicated with extn, ext, x or similar) from the end of the number, and returns it.
1222
+ *
1223
+ * @param string $number the non-normalized telephone number that we wish to strip the extension from
1224
+ * @return string the phone extension
1225
+ */
1226
+ private function maybeStripExtension(&$number)
1227
+ {
1228
+ $matches = array();
1229
+ $find = preg_match(self::$EXTN_PATTERN, $number, $matches, PREG_OFFSET_CAPTURE);
1230
+ // If we find a potential extension, and the number preceding this is a viable number, we assume
1231
+ // it is an extension.
1232
+ if ($find > 0 && $this->isViablePhoneNumber(substr($number, 0, $matches[0][1]))) {
1233
+ // The numbers are captured into groups in the regular expression.
1234
+
1235
+ for ($i = 1, $length = count($matches); $i <= $length; $i++) {
1236
+ if ($matches[$i][0] != "") {
1237
+ // We go through the capturing groups until we find one that captured some digits. If none
1238
+ // did, then we will return the empty string.
1239
+ $extension = $matches[$i][0];
1240
+ $number = substr($number, 0, $matches[0][1]);
1241
+ return $extension;
1242
+ }
1243
+ }
1244
+ }
1245
+ return "";
1246
+ }
1247
+
1248
+ /**
1249
+ * Parses a string and returns it in proto buffer format. This method differs from {@link #parse}
1250
+ * in that it always populates the raw_input field of the protocol buffer with numberToParse as
1251
+ * well as the country_code_source field.
1252
+ *
1253
+ * @param string $numberToParse number that we are attempting to parse. This can contain formatting
1254
+ * such as +, ( and -, as well as a phone number extension. It can also
1255
+ * be provided in RFC3966 format.
1256
+ * @param string $defaultRegion region that we are expecting the number to be from. This is only used
1257
+ * if the number being parsed is not written in international format.
1258
+ * The country calling code for the number in this case would be stored
1259
+ * as that of the default region supplied.
1260
+ * @param PhoneNumber $phoneNumber
1261
+ * @return PhoneNumber a phone number proto buffer filled with the parsed number
1262
+ */
1263
+ public function parseAndKeepRawInput($numberToParse, $defaultRegion, PhoneNumber $phoneNumber = null)
1264
+ {
1265
+ if ($phoneNumber === null) {
1266
+ $phoneNumber = new PhoneNumber();
1267
+ }
1268
+ $this->parseHelper($numberToParse, $defaultRegion, true, true, $phoneNumber);
1269
+ return $phoneNumber;
1270
+ }
1271
+
1272
+ /**
1273
+ * A helper function to set the values related to leading zeros in a PhoneNumber.
1274
+ * @param string $nationalNumber
1275
+ * @param PhoneNumber $phoneNumber
1276
+ */
1277
+ public static function setItalianLeadingZerosForPhoneNumber($nationalNumber, PhoneNumber $phoneNumber)
1278
+ {
1279
+ if (strlen($nationalNumber) > 1 && substr($nationalNumber, 0, 1) == '0') {
1280
+ $phoneNumber->setItalianLeadingZero(true);
1281
+ $numberOfLeadingZeros = 1;
1282
+ // Note that if the national number is all "0"s, the last "0" is not counted as a leading
1283
+ // zero.
1284
+ while ($numberOfLeadingZeros < (strlen($nationalNumber) - 1) &&
1285
+ substr($nationalNumber, $numberOfLeadingZeros, 1) == '0') {
1286
+ $numberOfLeadingZeros++;
1287
+ }
1288
+
1289
+ if ($numberOfLeadingZeros != 1) {
1290
+ $phoneNumber->setNumberOfLeadingZeros($numberOfLeadingZeros);
1291
+ }
1292
+ }
1293
+ }
1294
+
1295
+ /**
1296
+ * Parses a string and fills up the phoneNumber. This method is the same as the public
1297
+ * parse() method, with the exception that it allows the default region to be null, for use by
1298
+ * isNumberMatch(). checkRegion should be set to false if it is permitted for the default region
1299
+ * to be null or unknown ("ZZ").
1300
+ * @param string $numberToParse
1301
+ * @param string $defaultRegion
1302
+ * @param bool $keepRawInput
1303
+ * @param bool $checkRegion
1304
+ * @param PhoneNumber $phoneNumber
1305
+ * @throws NumberParseException
1306
+ */
1307
+ private function parseHelper($numberToParse, $defaultRegion, $keepRawInput, $checkRegion, PhoneNumber $phoneNumber)
1308
+ {
1309
+ if ($numberToParse === null) {
1310
+ throw new NumberParseException(NumberParseException::NOT_A_NUMBER, "The phone number supplied was null.");
1311
+ }
1312
+
1313
+ $numberToParse = trim($numberToParse);
1314
+
1315
+ if (mb_strlen($numberToParse) > self::MAX_INPUT_STRING_LENGTH) {
1316
+ throw new NumberParseException(
1317
+ NumberParseException::TOO_LONG,
1318
+ "The string supplied was too long to parse."
1319
+ );
1320
+ }
1321
+
1322
+ $nationalNumber = '';
1323
+ $this->buildNationalNumberForParsing($numberToParse, $nationalNumber);
1324
+
1325
+ if (!$this->isViablePhoneNumber($nationalNumber)) {
1326
+ throw new NumberParseException(
1327
+ NumberParseException::NOT_A_NUMBER,
1328
+ "The string supplied did not seem to be a phone number."
1329
+ );
1330
+ }
1331
+
1332
+ // Check the region supplied is valid, or that the extracted number starts with some sort of +
1333
+ // sign so the number's region can be determined.
1334
+ if ($checkRegion && !$this->checkRegionForParsing($nationalNumber, $defaultRegion)) {
1335
+ throw new NumberParseException(
1336
+ NumberParseException::INVALID_COUNTRY_CODE,
1337
+ "Missing or invalid default region."
1338
+ );
1339
+ }
1340
+
1341
+ if ($keepRawInput) {
1342
+ $phoneNumber->setRawInput($numberToParse);
1343
+ }
1344
+ // Attempt to parse extension first, since it doesn't require region-specific data and we want
1345
+ // to have the non-normalised number here.
1346
+ $extension = $this->maybeStripExtension($nationalNumber);
1347
+ if (mb_strlen($extension) > 0) {
1348
+ $phoneNumber->setExtension($extension);
1349
+ }
1350
+
1351
+ $regionMetadata = $this->getMetadataForRegion($defaultRegion);
1352
+ // Check to see if the number is given in international format so we know whether this number is
1353
+ // from the default region or not.
1354
+ $normalizedNationalNumber = "";
1355
+ try {
1356
+ // TODO: This method should really just take in the string buffer that has already
1357
+ // been created, and just remove the prefix, rather than taking in a string and then
1358
+ // outputting a string buffer.
1359
+ $countryCode = $this->maybeExtractCountryCode(
1360
+ $nationalNumber,
1361
+ $regionMetadata,
1362
+ $normalizedNationalNumber,
1363
+ $keepRawInput,
1364
+ $phoneNumber
1365
+ );
1366
+ } catch (NumberParseException $e) {
1367
+ $matcher = new Matcher(self::$PLUS_CHARS_PATTERN, $nationalNumber);
1368
+ if ($e->getErrorType() == NumberParseException::INVALID_COUNTRY_CODE && $matcher->lookingAt()) {
1369
+ // Strip the plus-char, and try again.
1370
+ $countryCode = $this->maybeExtractCountryCode(
1371
+ substr($nationalNumber, $matcher->end()),
1372
+ $regionMetadata,
1373
+ $normalizedNationalNumber,
1374
+ $keepRawInput,
1375
+ $phoneNumber
1376
+ );
1377
+ if ($countryCode == 0) {
1378
+ throw new NumberParseException(
1379
+ NumberParseException::INVALID_COUNTRY_CODE,
1380
+ "Could not interpret numbers after plus-sign."
1381
+ );
1382
+ }
1383
+ } else {
1384
+ throw new NumberParseException($e->getErrorType(), $e->getMessage(), $e);
1385
+ }
1386
+ }
1387
+ if ($countryCode !== 0) {
1388
+ $phoneNumberRegion = $this->getRegionCodeForCountryCode($countryCode);
1389
+ if ($phoneNumberRegion != $defaultRegion) {
1390
+ // Metadata cannot be null because the country calling code is valid.
1391
+ $regionMetadata = $this->getMetadataForRegionOrCallingCode($countryCode, $phoneNumberRegion);
1392
+ }
1393
+ } else {
1394
+ // If no extracted country calling code, use the region supplied instead. The national number
1395
+ // is just the normalized version of the number we were given to parse.
1396
+
1397
+ $normalizedNationalNumber .= $this->normalize($nationalNumber);
1398
+ if ($defaultRegion !== null) {
1399
+ $countryCode = $regionMetadata->getCountryCode();
1400
+ $phoneNumber->setCountryCode($countryCode);
1401
+ } else if ($keepRawInput) {
1402
+ $phoneNumber->clearCountryCodeSource();
1403
+ }
1404
+ }
1405
+ if (mb_strlen($normalizedNationalNumber) < self::MIN_LENGTH_FOR_NSN) {
1406
+ throw new NumberParseException(
1407
+ NumberParseException::TOO_SHORT_NSN,
1408
+ "The string supplied is too short to be a phone number."
1409
+ );
1410
+ }
1411
+ if ($regionMetadata !== null) {
1412
+ $carrierCode = "";
1413
+ $potentialNationalNumber = $normalizedNationalNumber;
1414
+ $this->maybeStripNationalPrefixAndCarrierCode($potentialNationalNumber, $regionMetadata, $carrierCode);
1415
+ // We require that the NSN remaining after stripping the national prefix and carrier code be
1416
+ // of a possible length for the region. Otherwise, we don't do the stripping, since the
1417
+ // original number could be a valid short number.
1418
+ if (!$this->isShorterThanPossibleNormalNumber($regionMetadata, $potentialNationalNumber)) {
1419
+ $normalizedNationalNumber = $potentialNationalNumber;
1420
+ if ($keepRawInput) {
1421
+ $phoneNumber->setPreferredDomesticCarrierCode($carrierCode);
1422
+ }
1423
+ }
1424
+ }
1425
+ $lengthOfNationalNumber = mb_strlen($normalizedNationalNumber);
1426
+ if ($lengthOfNationalNumber < self::MIN_LENGTH_FOR_NSN) {
1427
+ throw new NumberParseException(
1428
+ NumberParseException::TOO_SHORT_NSN,
1429
+ "The string supplied is too short to be a phone number."
1430
+ );
1431
+ }
1432
+ if ($lengthOfNationalNumber > self::MAX_LENGTH_FOR_NSN) {
1433
+ throw new NumberParseException(
1434
+ NumberParseException::TOO_LONG,
1435
+ "The string supplied is too long to be a phone number."
1436
+ );
1437
+ }
1438
+ $this->setItalianLeadingZerosForPhoneNumber($normalizedNationalNumber, $phoneNumber);
1439
+
1440
+
1441
+ /*
1442
+ * We have to store the National Number as a string instead of a "long" as Google do
1443
+ *
1444
+ * Since PHP doesn't always support 64 bit INTs, this was a float, but that had issues
1445
+ * with long numbers.
1446
+ *
1447
+ * We have to remove the leading zeroes ourself though
1448
+ */
1449
+ if ((int)$normalizedNationalNumber == 0) {
1450
+ $normalizedNationalNumber = "0";
1451
+ } else {
1452
+ $normalizedNationalNumber = ltrim($normalizedNationalNumber, '0');
1453
+ }
1454
+
1455
+ $phoneNumber->setNationalNumber($normalizedNationalNumber);
1456
+ }
1457
+
1458
+ /**
1459
+ * Converts numberToParse to a form that we can parse and write it to nationalNumber if it is
1460
+ * written in RFC3966; otherwise extract a possible number out of it and write to nationalNumber.
1461
+ * @param string $numberToParse
1462
+ * @param string $nationalNumber
1463
+ */
1464
+ private function buildNationalNumberForParsing($numberToParse, &$nationalNumber)
1465
+ {
1466
+ $indexOfPhoneContext = strpos($numberToParse, self::RFC3966_PHONE_CONTEXT);
1467
+ if ($indexOfPhoneContext > 0) {
1468
+ $phoneContextStart = $indexOfPhoneContext + mb_strlen(self::RFC3966_PHONE_CONTEXT);
1469
+ // If the phone context contains a phone number prefix, we need to capture it, whereas domains
1470
+ // will be ignored.
1471
+ if (substr($numberToParse, $phoneContextStart, 1) == self::PLUS_SIGN) {
1472
+ // Additional parameters might follow the phone context. If so, we will remove them here
1473
+ // because the parameters after phone context are not important for parsing the
1474
+ // phone number.
1475
+ $phoneContextEnd = strpos($numberToParse, ';', $phoneContextStart);
1476
+ if ($phoneContextEnd > 0) {
1477
+ $nationalNumber .= substr($numberToParse, $phoneContextStart, $phoneContextEnd - $phoneContextStart);
1478
+ } else {
1479
+ $nationalNumber .= substr($numberToParse, $phoneContextStart);
1480
+ }
1481
+ }
1482
+
1483
+ // Now append everything between the "tel:" prefix and the phone-context. This should include
1484
+ // the national number, an optional extension or isdn-subaddress component. Note we also
1485
+ // handle the case when "tel:" is missing, as we have seen in some of the phone number inputs.
1486
+ // In that case, we append everything from the beginning.
1487
+
1488
+ $indexOfRfc3966Prefix = strpos($numberToParse, self::RFC3966_PREFIX);
1489
+ $indexOfNationalNumber = ($indexOfRfc3966Prefix !== false) ? $indexOfRfc3966Prefix + strlen(self::RFC3966_PREFIX) : 0;
1490
+ $nationalNumber .= substr($numberToParse, $indexOfNationalNumber, ($indexOfPhoneContext - $indexOfNationalNumber));
1491
+ } else {
1492
+ // Extract a possible number from the string passed in (this strips leading characters that
1493
+ // could not be the start of a phone number.)
1494
+ $nationalNumber .= $this->extractPossibleNumber($numberToParse);
1495
+ }
1496
+
1497
+ // Delete the isdn-subaddress and everything after it if it is present. Note extension won't
1498
+ // appear at the same time with isdn-subaddress according to paragraph 5.3 of the RFC3966 spec,
1499
+ $indexOfIsdn = strpos($nationalNumber, self::RFC3966_ISDN_SUBADDRESS);
1500
+ if ($indexOfIsdn > 0) {
1501
+ $nationalNumber = substr($nationalNumber, 0, $indexOfIsdn);
1502
+ }
1503
+ // If both phone context and isdn-subaddress are absent but other parameters are present, the
1504
+ // parameters are left in nationalNumber. This is because we are concerned about deleting
1505
+ // content from a potential number string when there is no strong evidence that the number is
1506
+ // actually written in RFC3966.
1507
+ }
1508
+
1509
+ /**
1510
+ * Attempts to extract a possible number from the string passed in. This currently strips all
1511
+ * leading characters that cannot be used to start a phone number. Characters that can be used to
1512
+ * start a phone number are defined in the VALID_START_CHAR_PATTERN. If none of these characters
1513
+ * are found in the number passed in, an empty string is returned. This function also attempts to
1514
+ * strip off any alternative extensions or endings if two or more are present, such as in the case
1515
+ * of: (530) 583-6985 x302/x2303. The second extension here makes this actually two phone numbers,
1516
+ * (530) 583-6985 x302 and (530) 583-6985 x2303. We remove the second extension so that the first
1517
+ * number is parsed correctly.
1518
+ *
1519
+ * @param int $number the string that might contain a phone number
1520
+ * @return string the number, stripped of any non-phone-number prefix (such as "Tel:") or an empty
1521
+ * string if no character used to start phone numbers (such as + or any digit) is
1522
+ * found in the number
1523
+ */
1524
+ public static function extractPossibleNumber($number)
1525
+ {
1526
+ $matches = array();
1527
+ $match = preg_match('/' . self::$VALID_START_CHAR_PATTERN . '/ui', $number, $matches, PREG_OFFSET_CAPTURE);
1528
+ if ($match > 0) {
1529
+ $number = substr($number, $matches[0][1]);
1530
+ // Remove trailing non-alpha non-numerical characters.
1531
+ $trailingCharsMatcher = new Matcher(self::$UNWANTED_END_CHAR_PATTERN, $number);
1532
+ if ($trailingCharsMatcher->find() && $trailingCharsMatcher->start() > 0) {
1533
+ $number = substr($number, 0, $trailingCharsMatcher->start());
1534
+ }
1535
+
1536
+ // Check for extra numbers at the end.
1537
+ $match = preg_match('%' . self::$SECOND_NUMBER_START_PATTERN . '%', $number, $matches, PREG_OFFSET_CAPTURE);
1538
+ if ($match > 0) {
1539
+ $number = substr($number, 0, $matches[0][1]);
1540
+ }
1541
+
1542
+ return $number;
1543
+ } else {
1544
+ return "";
1545
+ }
1546
+ }
1547
+
1548
+ /**
1549
+ * Checks to see that the region code used is valid, or if it is not valid, that the number to
1550
+ * parse starts with a + symbol so that we can attempt to infer the region from the number.
1551
+ * Returns false if it cannot use the region provided and the region cannot be inferred.
1552
+ * @param string $numberToParse
1553
+ * @param string $defaultRegion
1554
+ * @return bool
1555
+ */
1556
+ private function checkRegionForParsing($numberToParse, $defaultRegion)
1557
+ {
1558
+ if (!$this->isValidRegionCode($defaultRegion)) {
1559
+ // If the number is null or empty, we can't infer the region.
1560
+ $plusCharsPatternMatcher = new Matcher(self::$PLUS_CHARS_PATTERN, $numberToParse);
1561
+ if ($numberToParse === null || mb_strlen($numberToParse) == 0 || !$plusCharsPatternMatcher->lookingAt()) {
1562
+ return false;
1563
+ }
1564
+ }
1565
+ return true;
1566
+ }
1567
+
1568
+ /**
1569
+ * Tries to extract a country calling code from a number. This method will return zero if no
1570
+ * country calling code is considered to be present. Country calling codes are extracted in the
1571
+ * following ways:
1572
+ * <ul>
1573
+ * <li> by stripping the international dialing prefix of the region the person is dialing from,
1574
+ * if this is present in the number, and looking at the next digits
1575
+ * <li> by stripping the '+' sign if present and then looking at the next digits
1576
+ * <li> by comparing the start of the number and the country calling code of the default region.
1577
+ * If the number is not considered possible for the numbering plan of the default region
1578
+ * initially, but starts with the country calling code of this region, validation will be
1579
+ * reattempted after stripping this country calling code. If this number is considered a
1580
+ * possible number, then the first digits will be considered the country calling code and
1581
+ * removed as such.
1582
+ * </ul>
1583
+ * It will throw a NumberParseException if the number starts with a '+' but the country calling
1584
+ * code supplied after this does not match that of any known region.
1585
+ *
1586
+ * @param string $number non-normalized telephone number that we wish to extract a country calling
1587
+ * code from - may begin with '+'
1588
+ * @param PhoneMetadata $defaultRegionMetadata metadata about the region this number may be from
1589
+ * @param string $nationalNumber a string buffer to store the national significant number in, in the case
1590
+ * that a country calling code was extracted. The number is appended to any existing contents.
1591
+ * If no country calling code was extracted, this will be left unchanged.
1592
+ * @param bool $keepRawInput true if the country_code_source and preferred_carrier_code fields of
1593
+ * phoneNumber should be populated.
1594
+ * @param PhoneNumber $phoneNumber the PhoneNumber object where the country_code and country_code_source need
1595
+ * to be populated. Note the country_code is always populated, whereas country_code_source is
1596
+ * only populated when keepCountryCodeSource is true.
1597
+ * @return int the country calling code extracted or 0 if none could be extracted
1598
+ * @throws NumberParseException
1599
+ */
1600
+ public function maybeExtractCountryCode(
1601
+ $number,
1602
+ PhoneMetadata $defaultRegionMetadata = null,
1603
+ &$nationalNumber,
1604
+ $keepRawInput,
1605
+ PhoneNumber $phoneNumber
1606
+ ) {
1607
+ if (mb_strlen($number) == 0) {
1608
+ return 0;
1609
+ }
1610
+ $fullNumber = $number;
1611
+ // Set the default prefix to be something that will never match.
1612
+ $possibleCountryIddPrefix = "NonMatch";
1613
+ if ($defaultRegionMetadata !== null) {
1614
+ $possibleCountryIddPrefix = $defaultRegionMetadata->getInternationalPrefix();
1615
+ }
1616
+ $countryCodeSource = $this->maybeStripInternationalPrefixAndNormalize($fullNumber, $possibleCountryIddPrefix);
1617
+
1618
+ if ($keepRawInput) {
1619
+ $phoneNumber->setCountryCodeSource($countryCodeSource);
1620
+ }
1621
+ if ($countryCodeSource != CountryCodeSource::FROM_DEFAULT_COUNTRY) {
1622
+ if (mb_strlen($fullNumber) <= self::MIN_LENGTH_FOR_NSN) {
1623
+ throw new NumberParseException(
1624
+ NumberParseException::TOO_SHORT_AFTER_IDD,
1625
+ "Phone number had an IDD, but after this was not long enough to be a viable phone number."
1626
+ );
1627
+ }
1628
+ $potentialCountryCode = $this->extractCountryCode($fullNumber, $nationalNumber);
1629
+
1630
+ if ($potentialCountryCode != 0) {
1631
+ $phoneNumber->setCountryCode($potentialCountryCode);
1632
+ return $potentialCountryCode;
1633
+ }
1634
+
1635
+ // If this fails, they must be using a strange country calling code that we don't recognize,
1636
+ // or that doesn't exist.
1637
+ throw new NumberParseException(
1638
+ NumberParseException::INVALID_COUNTRY_CODE,
1639
+ "Country calling code supplied was not recognised."
1640
+ );
1641
+ } else if ($defaultRegionMetadata !== null) {
1642
+ // Check to see if the number starts with the country calling code for the default region. If
1643
+ // so, we remove the country calling code, and do some checks on the validity of the number
1644
+ // before and after.
1645
+ $defaultCountryCode = $defaultRegionMetadata->getCountryCode();
1646
+ $defaultCountryCodeString = (string)$defaultCountryCode;
1647
+ $normalizedNumber = (string)$fullNumber;
1648
+ if (strpos($normalizedNumber, $defaultCountryCodeString) === 0) {
1649
+ $potentialNationalNumber = substr($normalizedNumber, mb_strlen($defaultCountryCodeString));
1650
+ $generalDesc = $defaultRegionMetadata->getGeneralDesc();
1651
+ $validNumberPattern = $generalDesc->getNationalNumberPattern();
1652
+ // Don't need the carrier code.
1653
+ $carriercode = null;
1654
+ $this->maybeStripNationalPrefixAndCarrierCode(
1655
+ $potentialNationalNumber,
1656
+ $defaultRegionMetadata,
1657
+ $carriercode
1658
+ );
1659
+ $possibleNumberPattern = $generalDesc->getPossibleNumberPattern();
1660
+ // If the number was not valid before but is valid now, or if it was too long before, we
1661
+ // consider the number with the country calling code stripped to be a better result and
1662
+ // keep that instead.
1663
+ if ((preg_match('/^(' . $validNumberPattern . ')$/x', $fullNumber) == 0 &&
1664
+ preg_match('/^(' . $validNumberPattern . ')$/x', $potentialNationalNumber) > 0) ||
1665
+ $this->testNumberLengthAgainstPattern($possibleNumberPattern, (string)$fullNumber)
1666
+ == ValidationResult::TOO_LONG
1667
+ ) {
1668
+ $nationalNumber .= $potentialNationalNumber;
1669
+ if ($keepRawInput) {
1670
+ $phoneNumber->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITHOUT_PLUS_SIGN);
1671
+ }
1672
+ $phoneNumber->setCountryCode($defaultCountryCode);
1673
+ return $defaultCountryCode;
1674
+ }
1675
+ }
1676
+ }
1677
+ // No country calling code present.
1678
+ $phoneNumber->setCountryCode(0);
1679
+ return 0;
1680
+ }
1681
+
1682
+ /**
1683
+ * Strips any international prefix (such as +, 00, 011) present in the number provided, normalizes
1684
+ * the resulting number, and indicates if an international prefix was present.
1685
+ *
1686
+ * @param string $number the non-normalized telephone number that we wish to strip any international
1687
+ * dialing prefix from.
1688
+ * @param string $possibleIddPrefix string the international direct dialing prefix from the region we
1689
+ * think this number may be dialed in
1690
+ * @return int the corresponding CountryCodeSource if an international dialing prefix could be
1691
+ * removed from the number, otherwise CountryCodeSource.FROM_DEFAULT_COUNTRY if the number did
1692
+ * not seem to be in international format.
1693
+ */
1694
+ public function maybeStripInternationalPrefixAndNormalize(&$number, $possibleIddPrefix)
1695
+ {
1696
+ if (mb_strlen($number) == 0) {
1697
+ return CountryCodeSource::FROM_DEFAULT_COUNTRY;
1698
+ }
1699
+ $matches = array();
1700
+ // Check to see if the number begins with one or more plus signs.
1701
+ $match = preg_match('/^' . self::$PLUS_CHARS_PATTERN . '/' . self::REGEX_FLAGS, $number, $matches, PREG_OFFSET_CAPTURE);
1702
+ if ($match > 0) {
1703
+ $number = mb_substr($number, $matches[0][1] + mb_strlen($matches[0][0]));
1704
+ // Can now normalize the rest of the number since we've consumed the "+" sign at the start.
1705
+ $number = $this->normalize($number);
1706
+ return CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN;
1707
+ }
1708
+ // Attempt to parse the first digits as an international prefix.
1709
+ $iddPattern = $possibleIddPrefix;
1710
+ $number = $this->normalize($number);
1711
+ return $this->parsePrefixAsIdd($iddPattern, $number)
1712
+ ? CountryCodeSource::FROM_NUMBER_WITH_IDD
1713
+ : CountryCodeSource::FROM_DEFAULT_COUNTRY;
1714
+ }
1715
+
1716
+ /**
1717
+ * Normalizes a string of characters representing a phone number. This performs
1718
+ * the following conversions:
1719
+ * Punctuation is stripped.
1720
+ * For ALPHA/VANITY numbers:
1721
+ * Letters are converted to their numeric representation on a telephone
1722
+ * keypad. The keypad used here is the one defined in ITU Recommendation
1723
+ * E.161. This is only done if there are 3 or more letters in the number,
1724
+ * to lessen the risk that such letters are typos.
1725
+ * For other numbers:
1726
+ * Wide-ascii digits are converted to normal ASCII (European) digits.
1727
+ * Arabic-Indic numerals are converted to European numerals.
1728
+ * Spurious alpha characters are stripped.
1729
+ *
1730
+ * @param string $number a string of characters representing a phone number.
1731
+ * @return string the normalized string version of the phone number.
1732
+ */
1733
+ public static function normalize(&$number)
1734
+ {
1735
+ $m = new Matcher(self::VALID_ALPHA_PHONE_PATTERN, $number);
1736
+ if ($m->matches()) {
1737
+ return self::normalizeHelper($number, self::$ALPHA_PHONE_MAPPINGS, true);
1738
+ } else {
1739
+ return self::normalizeDigitsOnly($number);
1740
+ }
1741
+ }
1742
+
1743
+ /**
1744
+ * Normalizes a string of characters representing a phone number. This converts wide-ascii and
1745
+ * arabic-indic numerals to European numerals, and strips punctuation and alpha characters.
1746
+ *
1747
+ * @param $number string a string of characters representing a phone number
1748
+ * @return string the normalized string version of the phone number
1749
+ */
1750
+ public static function normalizeDigitsOnly($number)
1751
+ {
1752
+ return self::normalizeDigits($number, false /* strip non-digits */);
1753
+ }
1754
+
1755
+ /**
1756
+ * @param string $number
1757
+ * @param bool $keepNonDigits
1758
+ * @return string
1759
+ */
1760
+ public static function normalizeDigits($number, $keepNonDigits)
1761
+ {
1762
+ $normalizedDigits = "";
1763
+ $numberAsArray = preg_split('/(?<!^)(?!$)/u', $number);
1764
+ foreach ($numberAsArray as $character) {
1765
+ if (is_numeric($character)) {
1766
+ $normalizedDigits .= $character;
1767
+ } elseif ($keepNonDigits) {
1768
+ $normalizedDigits .= $character;
1769
+ }
1770
+ // If neither of the above are true, we remove this character.
1771
+
1772
+ // Check if we are in the unicode number range
1773
+ if (array_key_exists($character, self::$numericCharacters)) {
1774
+ $normalizedDigits .= self::$numericCharacters[$character];
1775
+ }
1776
+ }
1777
+ return $normalizedDigits;
1778
+ }
1779
+
1780
+ /**
1781
+ * Strips the IDD from the start of the number if present. Helper function used by
1782
+ * maybeStripInternationalPrefixAndNormalize.
1783
+ * @param string $iddPattern
1784
+ * @param string $number
1785
+ * @return bool
1786
+ */
1787
+ private function parsePrefixAsIdd($iddPattern, &$number)
1788
+ {
1789
+ $m = new Matcher($iddPattern, $number);
1790
+ if ($m->lookingAt()) {
1791
+ $matchEnd = $m->end();
1792
+ // Only strip this if the first digit after the match is not a 0, since country calling codes
1793
+ // cannot begin with 0.
1794
+ $digitMatcher = new Matcher(self::$CAPTURING_DIGIT_PATTERN, substr($number, $matchEnd));
1795
+ if ($digitMatcher->find()) {
1796
+ $normalizedGroup = $this->normalizeDigitsOnly($digitMatcher->group(1));
1797
+ if ($normalizedGroup == "0") {
1798
+ return false;
1799
+ }
1800
+ }
1801
+ $number = substr($number, $matchEnd);
1802
+ return true;
1803
+ }
1804
+ return false;
1805
+ }
1806
+
1807
+ /**
1808
+ * Extracts country calling code from fullNumber, returns it and places the remaining number in nationalNumber.
1809
+ * It assumes that the leading plus sign or IDD has already been removed.
1810
+ * Returns 0 if fullNumber doesn't start with a valid country calling code, and leaves nationalNumber unmodified.
1811
+ * @param string $fullNumber
1812
+ * @param string $nationalNumber
1813
+ * @return int
1814
+ */
1815
+ private function extractCountryCode(&$fullNumber, &$nationalNumber)
1816
+ {
1817
+ if ((mb_strlen($fullNumber) == 0) || ($fullNumber[0] == '0')) {
1818
+ // Country codes do not begin with a '0'.
1819
+ return 0;
1820
+ }
1821
+ $numberLength = mb_strlen($fullNumber);
1822
+ for ($i = 1; $i <= self::MAX_LENGTH_COUNTRY_CODE && $i <= $numberLength; $i++) {
1823
+ $potentialCountryCode = (int)substr($fullNumber, 0, $i);
1824
+ if (isset($this->countryCallingCodeToRegionCodeMap[$potentialCountryCode])) {
1825
+ $nationalNumber .= substr($fullNumber, $i);
1826
+ return $potentialCountryCode;
1827
+ }
1828
+ }
1829
+ return 0;
1830
+ }
1831
+
1832
+ /**
1833
+ * Strips any national prefix (such as 0, 1) present in the number provided.
1834
+ *
1835
+ * @param string $number the normalized telephone number that we wish to strip any national
1836
+ * dialing prefix from
1837
+ * @param PhoneMetadata $metadata the metadata for the region that we think this number is from
1838
+ * @param string $carrierCode a place to insert the carrier code if one is extracted
1839
+ * @return bool true if a national prefix or carrier code (or both) could be extracted.
1840
+ */
1841
+ public function maybeStripNationalPrefixAndCarrierCode(&$number, PhoneMetadata $metadata, &$carrierCode)
1842
+ {
1843
+ $numberLength = mb_strlen($number);
1844
+ $possibleNationalPrefix = $metadata->getNationalPrefixForParsing();
1845
+ if ($numberLength == 0 || $possibleNationalPrefix === null || mb_strlen($possibleNationalPrefix) == 0) {
1846
+ // Early return for numbers of zero length.
1847
+ return false;
1848
+ }
1849
+
1850
+ // Attempt to parse the first digits as a national prefix.
1851
+ $prefixMatcher = new Matcher($possibleNationalPrefix, $number);
1852
+ if ($prefixMatcher->lookingAt()) {
1853
+ $nationalNumberRule = $metadata->getGeneralDesc()->getNationalNumberPattern();
1854
+ // Check if the original number is viable.
1855
+ $nationalNumberRuleMatcher = new Matcher($nationalNumberRule, $number);
1856
+ $isViableOriginalNumber = $nationalNumberRuleMatcher->matches();
1857
+ // $prefixMatcher->group($numOfGroups) === null implies nothing was captured by the capturing
1858
+ // groups in $possibleNationalPrefix; therefore, no transformation is necessary, and we just
1859
+ // remove the national prefix
1860
+ $numOfGroups = $prefixMatcher->groupCount();
1861
+ $transformRule = $metadata->getNationalPrefixTransformRule();
1862
+ if ($transformRule === null
1863
+ || mb_strlen($transformRule) == 0
1864
+ || $prefixMatcher->group($numOfGroups - 1) === null
1865
+ ) {
1866
+ // If the original number was viable, and the resultant number is not, we return.
1867
+ $matcher = new Matcher($nationalNumberRule, substr($number, $prefixMatcher->end()));
1868
+ if ($isViableOriginalNumber && !$matcher->matches()) {
1869
+ return false;
1870
+ }
1871
+ if ($carrierCode !== null && $numOfGroups > 0 && $prefixMatcher->group($numOfGroups) !== null) {
1872
+ $carrierCode .= $prefixMatcher->group(1);
1873
+ }
1874
+
1875
+ $number = substr($number, $prefixMatcher->end());
1876
+ return true;
1877
+ } else {
1878
+ // Check that the resultant number is still viable. If not, return. Check this by copying
1879
+ // the string and making the transformation on the copy first.
1880
+ $transformedNumber = $number;
1881
+ $transformedNumber = substr_replace(
1882
+ $transformedNumber,
1883
+ $prefixMatcher->replaceFirst($transformRule),
1884
+ 0,
1885
+ $numberLength
1886
+ );
1887
+ $matcher = new Matcher($nationalNumberRule, $transformedNumber);
1888
+ if ($isViableOriginalNumber && !$matcher->matches()) {
1889
+ return false;
1890
+ }
1891
+ if ($carrierCode !== null && $numOfGroups > 1) {
1892
+ $carrierCode .= $prefixMatcher->group(1);
1893
+ }
1894
+ $number = substr_replace($number, $transformedNumber, 0, mb_strlen($number));
1895
+ return true;
1896
+ }
1897
+ }
1898
+ return false;
1899
+ }
1900
+
1901
+ /**
1902
+ * Helper method to check a number against a particular pattern and determine whether it matches,
1903
+ * or is too short or too long. Currently, if a number pattern suggests that numbers of length 7
1904
+ * and 10 are possible, and a number in between these possible lengths is entered, such as of
1905
+ * length 8, this will return TOO_LONG.
1906
+ * @param string $numberPattern
1907
+ * @param string $number
1908
+ * @return int ValidationResult
1909
+ */
1910
+ private function testNumberLengthAgainstPattern($numberPattern, $number)
1911
+ {
1912
+ $numberMatcher = new Matcher($numberPattern, $number);
1913
+ if ($numberMatcher->matches()) {
1914
+ return ValidationResult::IS_POSSIBLE;
1915
+ }
1916
+ if ($numberMatcher->lookingAt()) {
1917
+ return ValidationResult::TOO_LONG;
1918
+ } else {
1919
+ return ValidationResult::TOO_SHORT;
1920
+ }
1921
+ }
1922
+
1923
+ /**
1924
+ * Returns a list with the region codes that match the specific country calling code. For
1925
+ * non-geographical country calling codes, the region code 001 is returned. Also, in the case
1926
+ * of no region code being found, an empty list is returned.
1927
+ * @param int $countryCallingCode
1928
+ * @return array|null
1929
+ */
1930
+ public function getRegionCodesForCountryCode($countryCallingCode)
1931
+ {
1932
+ $regionCodes = isset($this->countryCallingCodeToRegionCodeMap[$countryCallingCode]) ? $this->countryCallingCodeToRegionCodeMap[$countryCallingCode] : null;
1933
+ return $regionCodes === null ? array() : $regionCodes;
1934
+ }
1935
+
1936
+ /**
1937
+ * Returns the country calling code for a specific region. For example, this would be 1 for the
1938
+ * United States, and 64 for New Zealand. Assumes the region is already valid.
1939
+ *
1940
+ * @param string $regionCode the region that we want to get the country calling code for
1941
+ * @return int the country calling code for the region denoted by regionCode
1942
+ */
1943
+ public function getCountryCodeForRegion($regionCode)
1944
+ {
1945
+ if (!$this->isValidRegionCode($regionCode)) {
1946
+ return 0;
1947
+ }
1948
+ return $this->getCountryCodeForValidRegion($regionCode);
1949
+ }
1950
+
1951
+ /**
1952
+ * Returns the country calling code for a specific region. For example, this would be 1 for the
1953
+ * United States, and 64 for New Zealand. Assumes the region is already valid.
1954
+ *
1955
+ * @param string $regionCode the region that we want to get the country calling code for
1956
+ * @return int the country calling code for the region denoted by regionCode
1957
+ * @throws \InvalidArgumentException if the region is invalid
1958
+ */
1959
+ private function getCountryCodeForValidRegion($regionCode)
1960
+ {
1961
+ $metadata = $this->getMetadataForRegion($regionCode);
1962
+ if ($metadata === null) {
1963
+ throw new \InvalidArgumentException("Invalid region code: " . $regionCode);
1964
+ }
1965
+ return $metadata->getCountryCode();
1966
+ }
1967
+
1968
+ /**
1969
+ * Returns a number formatted in such a way that it can be dialed from a mobile phone in a
1970
+ * specific region. If the number cannot be reached from the region (e.g. some countries block
1971
+ * toll-free numbers from being called outside of the country), the method returns an empty
1972
+ * string.
1973
+ *
1974
+ * @param PhoneNumber $number the phone number to be formatted
1975
+ * @param string $regionCallingFrom the region where the call is being placed
1976
+ * @param boolean $withFormatting whether the number should be returned with formatting symbols, such as
1977
+ * spaces and dashes.
1978
+ * @return string the formatted phone number
1979
+ */
1980
+ public function formatNumberForMobileDialing(PhoneNumber $number, $regionCallingFrom, $withFormatting)
1981
+ {
1982
+ $countryCallingCode = $number->getCountryCode();
1983
+ if (!$this->hasValidCountryCallingCode($countryCallingCode)) {
1984
+ return $number->hasRawInput() ? $number->getRawInput() : "";
1985
+ }
1986
+
1987
+ $formattedNumber = "";
1988
+ // Clear the extension, as that part cannot normally be dialed together with the main number.
1989
+ $numberNoExt = new PhoneNumber();
1990
+ $numberNoExt->mergeFrom($number)->clearExtension();
1991
+ $regionCode = $this->getRegionCodeForCountryCode($countryCallingCode);
1992
+ $numberType = $this->getNumberType($numberNoExt);
1993
+ $isValidNumber = ($numberType !== PhoneNumberType::UNKNOWN);
1994
+ if ($regionCallingFrom == $regionCode) {
1995
+ $isFixedLineOrMobile = ($numberType == PhoneNumberType::FIXED_LINE) || ($numberType == PhoneNumberType::MOBILE) || ($numberType == PhoneNumberType::FIXED_LINE_OR_MOBILE);
1996
+ // Carrier codes may be needed in some countries. We handle this here.
1997
+ if ($regionCode == "CO" && $numberType == PhoneNumberType::FIXED_LINE) {
1998
+ $formattedNumber = $this->formatNationalNumberWithCarrierCode(
1999
+ $numberNoExt,
2000
+ self::COLOMBIA_MOBILE_TO_FIXED_LINE_PREFIX
2001
+ );
2002
+ } elseif ($regionCode == "BR" && $isFixedLineOrMobile) {
2003
+ // Brazilian fixed line and mobile numbers need to be dialed with a carrier code when
2004
+ // called within Brazil. Without that, most of the carriers won't connect the call.
2005
+ // Because of that, we return an empty string here.
2006
+ $formattedNumber = $numberNoExt->hasPreferredDomesticCarrierCode(
2007
+ ) ? $this->formatNationalNumberWithCarrierCode($numberNoExt, "") : "";
2008
+ } elseif ($isValidNumber && $regionCode == "HU") {
2009
+ // The national format for HU numbers doesn't contain the national prefix, because that is
2010
+ // how numbers are normally written down. However, the national prefix is obligatory when
2011
+ // dialing from a mobile phone, except for short numbers. As a result, we add it back here
2012
+ // if it is a valid regular length phone number.
2013
+ $formattedNumber = $this->getNddPrefixForRegion(
2014
+ $regionCode,
2015
+ true /* strip non-digits */
2016
+ ) . " " . $this->format($numberNoExt, PhoneNumberFormat::NATIONAL);
2017
+ } elseif ($countryCallingCode === self::NANPA_COUNTRY_CODE) {
2018
+ // For NANPA countries, we output international format for numbers that can be dialed
2019
+ // internationally, since that always works, except for numbers which might potentially be
2020
+ // short numbers, which are always dialled in national format.
2021
+ $regionMetadata = $this->getMetadataForRegion($regionCallingFrom);
2022
+ if ($this->canBeInternationallyDialled($numberNoExt) &&
2023
+ !$this->isShorterThanPossibleNormalNumber(
2024
+ $regionMetadata,
2025
+ $this->getNationalSignificantNumber($numberNoExt)
2026
+ )
2027
+ ) {
2028
+ $formattedNumber = $this->format($numberNoExt, PhoneNumberFormat::INTERNATIONAL);
2029
+ } else {
2030
+ $formattedNumber = $this->format($numberNoExt, PhoneNumberFormat::NATIONAL);
2031
+ }
2032
+ } else {
2033
+ // For non-geographical countries, Mexican and Chilean fixed line and mobile numbers, we
2034
+ // output international format for numbers that can be dialed internationally as that always
2035
+ // works.
2036
+ if (($regionCode == self::REGION_CODE_FOR_NON_GEO_ENTITY ||
2037
+ // MX fixed line and mobile numbers should always be formatted in international format,
2038
+ // even when dialed within MX. For national format to work, a carrier code needs to be
2039
+ // used, and the correct carrier code depends on if the caller and callee are from the
2040
+ // same local area. It is trickier to get that to work correctly than using
2041
+ // international format, which is tested to work fine on all carriers.
2042
+ // CL fixed line numbers need the national prefix when dialing in the national format,
2043
+ // but don't have it when used for display. The reverse is true for mobile numbers.
2044
+ // As a result, we output them in the international format to make it work.
2045
+ (($regionCode == "MX" || $regionCode == "CL") && $isFixedLineOrMobile)) && $this->canBeInternationallyDialled(
2046
+ $numberNoExt
2047
+ )
2048
+ ) {
2049
+ $formattedNumber = $this->format($numberNoExt, PhoneNumberFormat::INTERNATIONAL);
2050
+ } else {
2051
+ $formattedNumber = $this->format($numberNoExt, PhoneNumberFormat::NATIONAL);
2052
+ }
2053
+ }
2054
+ } elseif ($isValidNumber && $this->canBeInternationallyDialled($numberNoExt)) {
2055
+ // We assume that short numbers are not diallable from outside their region, so if a number
2056
+ // is not a valid regular length phone number, we treat it as if it cannot be internationally
2057
+ // dialled.
2058
+ return $withFormatting ?
2059
+ $this->format($numberNoExt, PhoneNumberFormat::INTERNATIONAL) :
2060
+ $this->format($numberNoExt, PhoneNumberFormat::E164);
2061
+ }
2062
+ return $withFormatting ? $formattedNumber : $this->normalizeDiallableCharsOnly($formattedNumber);
2063
+ }
2064
+
2065
+ /**
2066
+ * Formats a phone number in national format for dialing using the carrier as specified in the
2067
+ * {@code carrierCode}. The {@code carrierCode} will always be used regardless of whether the
2068
+ * phone number already has a preferred domestic carrier code stored. If {@code carrierCode}
2069
+ * contains an empty string, returns the number in national format without any carrier code.
2070
+ *
2071
+ * @param PhoneNumber $number the phone number to be formatted
2072
+ * @param string $carrierCode the carrier selection code to be used
2073
+ * @return string the formatted phone number in national format for dialing using the carrier as
2074
+ * specified in the {@code carrierCode}
2075
+ */
2076
+ public function formatNationalNumberWithCarrierCode(PhoneNumber $number, $carrierCode)
2077
+ {
2078
+ $countryCallingCode = $number->getCountryCode();
2079
+ $nationalSignificantNumber = $this->getNationalSignificantNumber($number);
2080
+ if (!$this->hasValidCountryCallingCode($countryCallingCode)) {
2081
+ return $nationalSignificantNumber;
2082
+ }
2083
+
2084
+ // Note getRegionCodeForCountryCode() is used because formatting information for regions which
2085
+ // share a country calling code is contained by only one region for performance reasons. For
2086
+ // example, for NANPA regions it will be contained in the metadata for US.
2087
+ $regionCode = $this->getRegionCodeForCountryCode($countryCallingCode);
2088
+ // Metadata cannot be null because the country calling code is valid.
2089
+ $metadata = $this->getMetadataForRegionOrCallingCode($countryCallingCode, $regionCode);
2090
+
2091
+ $formattedNumber = $this->formatNsn(
2092
+ $nationalSignificantNumber,
2093
+ $metadata,
2094
+ PhoneNumberFormat::NATIONAL,
2095
+ $carrierCode
2096
+ );
2097
+ $this->maybeAppendFormattedExtension($number, $metadata, PhoneNumberFormat::NATIONAL, $formattedNumber);
2098
+ $this->prefixNumberWithCountryCallingCode(
2099
+ $countryCallingCode,
2100
+ PhoneNumberFormat::NATIONAL,
2101
+ $formattedNumber
2102
+ );
2103
+ return $formattedNumber;
2104
+ }
2105
+
2106
+ /**
2107
+ * Formats a phone number in national format for dialing using the carrier as specified in the
2108
+ * preferredDomesticCarrierCode field of the PhoneNumber object passed in. If that is missing,
2109
+ * use the {@code fallbackCarrierCode} passed in instead. If there is no
2110
+ * {@code preferredDomesticCarrierCode}, and the {@code fallbackCarrierCode} contains an empty
2111
+ * string, return the number in national format without any carrier code.
2112
+ *
2113
+ * <p>Use {@link #formatNationalNumberWithCarrierCode} instead if the carrier code passed in
2114
+ * should take precedence over the number's {@code preferredDomesticCarrierCode} when formatting.
2115
+ *
2116
+ * @param PhoneNumber $number the phone number to be formatted
2117
+ * @param string $fallbackCarrierCode the carrier selection code to be used, if none is found in the
2118
+ * phone number itself
2119
+ * @return string the formatted phone number in national format for dialing using the number's
2120
+ * {@code preferredDomesticCarrierCode}, or the {@code fallbackCarrierCode} passed in if
2121
+ * none is found
2122
+ */
2123
+ public function formatNationalNumberWithPreferredCarrierCode(PhoneNumber $number, $fallbackCarrierCode)
2124
+ {
2125
+ return $this->formatNationalNumberWithCarrierCode(
2126
+ $number,
2127
+ $number->hasPreferredDomesticCarrierCode()
2128
+ ? $number->getPreferredDomesticCarrierCode()
2129
+ : $fallbackCarrierCode
2130
+ );
2131
+ }
2132
+
2133
+ /**
2134
+ * Returns true if the number can be dialled from outside the region, or unknown. If the number
2135
+ * can only be dialled from within the region, returns false. Does not check the number is a valid
2136
+ * number.
2137
+ * TODO: Make this method public when we have enough metadata to make it worthwhile.
2138
+ *
2139
+ * @param PhoneNumber $number the phone-number for which we want to know whether it is diallable from outside the region
2140
+ * @return bool
2141
+ */
2142
+ public function canBeInternationallyDialled(PhoneNumber $number)
2143
+ {
2144
+ $metadata = $this->getMetadataForRegion($this->getRegionCodeForNumber($number));
2145
+ if ($metadata === null) {
2146
+ // Note numbers belonging to non-geographical entities (e.g. +800 numbers) are always
2147
+ // internationally diallable, and will be caught here.
2148
+ return true;
2149
+ }
2150
+ $nationalSignificantNumber = $this->getNationalSignificantNumber($number);
2151
+ return !$this->isNumberMatchingDesc($nationalSignificantNumber, $metadata->getNoInternationalDialling());
2152
+ }
2153
+
2154
+ /**
2155
+ * Normalizes a string of characters representing a phone number. This strips all characters which
2156
+ * are not diallable on a mobile phone keypad (including all non-ASCII digits).
2157
+ *
2158
+ * @param string $number a string of characters representing a phone number
2159
+ * @return string the normalized string version of the phone number
2160
+ */
2161
+ public static function normalizeDiallableCharsOnly($number)
2162
+ {
2163
+ return self::normalizeHelper($number, self::$DIALLABLE_CHAR_MAPPINGS, true /* remove non matches */);
2164
+ }
2165
+
2166
+ /**
2167
+ * Formats a phone number for out-of-country dialing purposes.
2168
+ *
2169
+ * Note that in this version, if the number was entered originally using alpha characters and
2170
+ * this version of the number is stored in raw_input, this representation of the number will be
2171
+ * used rather than the digit representation. Grouping information, as specified by characters
2172
+ * such as "-" and " ", will be retained.
2173
+ *
2174
+ * <p><b>Caveats:</b></p>
2175
+ * <ul>
2176
+ * <li> This will not produce good results if the country calling code is both present in the raw
2177
+ * input _and_ is the start of the national number. This is not a problem in the regions
2178
+ * which typically use alpha numbers.
2179
+ * <li> This will also not produce good results if the raw input has any grouping information
2180
+ * within the first three digits of the national number, and if the function needs to strip
2181
+ * preceding digits/words in the raw input before these digits. Normally people group the
2182
+ * first three digits together so this is not a huge problem - and will be fixed if it
2183
+ * proves to be so.
2184
+ * </ul>
2185
+ *
2186
+ * @param PhoneNumber $number the phone number that needs to be formatted
2187
+ * @param String $regionCallingFrom the region where the call is being placed
2188
+ * @return String the formatted phone number
2189
+ */
2190
+ public function formatOutOfCountryKeepingAlphaChars(PhoneNumber $number, $regionCallingFrom)
2191
+ {
2192
+ $rawInput = $number->getRawInput();
2193
+ // If there is no raw input, then we can't keep alpha characters because there aren't any.
2194
+ // In this case, we return formatOutOfCountryCallingNumber.
2195
+ if (mb_strlen($rawInput) == 0) {
2196
+ return $this->formatOutOfCountryCallingNumber($number, $regionCallingFrom);
2197
+ }
2198
+ $countryCode = $number->getCountryCode();
2199
+ if (!$this->hasValidCountryCallingCode($countryCode)) {
2200
+ return $rawInput;
2201
+ }
2202
+ // Strip any prefix such as country calling code, IDD, that was present. We do this by comparing
2203
+ // the number in raw_input with the parsed number.
2204
+ // To do this, first we normalize punctuation. We retain number grouping symbols such as " "
2205
+ // only.
2206
+ $rawInput = $this->normalizeHelper($rawInput, self::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS, true);
2207
+ // Now we trim everything before the first three digits in the parsed number. We choose three
2208
+ // because all valid alpha numbers have 3 digits at the start - if it does not, then we don't
2209
+ // trim anything at all. Similarly, if the national number was less than three digits, we don't
2210
+ // trim anything at all.
2211
+ $nationalNumber = $this->getNationalSignificantNumber($number);
2212
+ if (mb_strlen($nationalNumber) > 3) {
2213
+ $firstNationalNumberDigit = strpos($rawInput, substr($nationalNumber, 0, 3));
2214
+ if ($firstNationalNumberDigit !== false) {
2215
+ $rawInput = substr($rawInput, $firstNationalNumberDigit);
2216
+ }
2217
+ }
2218
+ $metadataForRegionCallingFrom = $this->getMetadataForRegion($regionCallingFrom);
2219
+ if ($countryCode == self::NANPA_COUNTRY_CODE) {
2220
+ if ($this->isNANPACountry($regionCallingFrom)) {
2221
+ return $countryCode . " " . $rawInput;
2222
+ }
2223
+ } else if ($metadataForRegionCallingFrom !== null &&
2224
+ $countryCode == $this->getCountryCodeForValidRegion($regionCallingFrom)
2225
+ ) {
2226
+ $formattingPattern =
2227
+ $this->chooseFormattingPatternForNumber(
2228
+ $metadataForRegionCallingFrom->numberFormats(),
2229
+ $nationalNumber
2230
+ );
2231
+ if ($formattingPattern === null) {
2232
+ // If no pattern above is matched, we format the original input.
2233
+ return $rawInput;
2234
+ }
2235
+ $newFormat = new NumberFormat();
2236
+ $newFormat->mergeFrom($formattingPattern);
2237
+ // The first group is the first group of digits that the user wrote together.
2238
+ $newFormat->setPattern("(\\d+)(.*)");
2239
+ // Here we just concatenate them back together after the national prefix has been fixed.
2240
+ $newFormat->setFormat("$1$2");
2241
+ // Now we format using this pattern instead of the default pattern, but with the national
2242
+ // prefix prefixed if necessary.
2243
+ // This will not work in the cases where the pattern (and not the leading digits) decide
2244
+ // whether a national prefix needs to be used, since we have overridden the pattern to match
2245
+ // anything, but that is not the case in the metadata to date.
2246
+ return $this->formatNsnUsingPattern($rawInput, $newFormat, PhoneNumberFormat::NATIONAL);
2247
+ }
2248
+ $internationalPrefixForFormatting = "";
2249
+ // If an unsupported region-calling-from is entered, or a country with multiple international
2250
+ // prefixes, the international format of the number is returned, unless there is a preferred
2251
+ // international prefix.
2252
+ if ($metadataForRegionCallingFrom !== null) {
2253
+ $internationalPrefix = $metadataForRegionCallingFrom->getInternationalPrefix();
2254
+ $uniqueInternationalPrefixMatcher = new Matcher(self::UNIQUE_INTERNATIONAL_PREFIX, $internationalPrefix);
2255
+ $internationalPrefixForFormatting =
2256
+ $uniqueInternationalPrefixMatcher->matches()
2257
+ ? $internationalPrefix
2258
+ : $metadataForRegionCallingFrom->getPreferredInternationalPrefix();
2259
+ }
2260
+ $formattedNumber = $rawInput;
2261
+ $regionCode = $this->getRegionCodeForCountryCode($countryCode);
2262
+ // Metadata cannot be null because the country calling code is valid.
2263
+ $metadataForRegion = $this->getMetadataForRegionOrCallingCode($countryCode, $regionCode);
2264
+ $this->maybeAppendFormattedExtension(
2265
+ $number,
2266
+ $metadataForRegion,
2267
+ PhoneNumberFormat::INTERNATIONAL,
2268
+ $formattedNumber
2269
+ );
2270
+ if (mb_strlen($internationalPrefixForFormatting) > 0) {
2271
+ $formattedNumber = $internationalPrefixForFormatting . " " . $countryCode . " " . $formattedNumber;
2272
+ } else {
2273
+ // Invalid region entered as country-calling-from (so no metadata was found for it) or the
2274
+ // region chosen has multiple international dialling prefixes.
2275
+ $this->prefixNumberWithCountryCallingCode(
2276
+ $countryCode,
2277
+ PhoneNumberFormat::INTERNATIONAL,
2278
+ $formattedNumber
2279
+ );
2280
+ }
2281
+ return $formattedNumber;
2282
+ }
2283
+
2284
+ /**
2285
+ * Formats a phone number for out-of-country dialing purposes. If no regionCallingFrom is
2286
+ * supplied, we format the number in its INTERNATIONAL format. If the country calling code is the
2287
+ * same as that of the region where the number is from, then NATIONAL formatting will be applied.
2288
+ *
2289
+ * <p>If the number itself has a country calling code of zero or an otherwise invalid country
2290
+ * calling code, then we return the number with no formatting applied.
2291
+ *
2292
+ * <p>Note this function takes care of the case for calling inside of NANPA and between Russia and
2293
+ * Kazakhstan (who share the same country calling code). In those cases, no international prefix
2294
+ * is used. For regions which have multiple international prefixes, the number in its
2295
+ * INTERNATIONAL format will be returned instead.
2296
+ *
2297
+ * @param PhoneNumber $number the phone number to be formatted
2298
+ * @param string $regionCallingFrom the region where the call is being placed
2299
+ * @return string the formatted phone number
2300
+ */
2301
+ public function formatOutOfCountryCallingNumber(PhoneNumber $number, $regionCallingFrom)
2302
+ {
2303
+ if (!$this->isValidRegionCode($regionCallingFrom)) {
2304
+ return $this->format($number, PhoneNumberFormat::INTERNATIONAL);
2305
+ }
2306
+ $countryCallingCode = $number->getCountryCode();
2307
+ $nationalSignificantNumber = $this->getNationalSignificantNumber($number);
2308
+ if (!$this->hasValidCountryCallingCode($countryCallingCode)) {
2309
+ return $nationalSignificantNumber;
2310
+ }
2311
+ if ($countryCallingCode == self::NANPA_COUNTRY_CODE) {
2312
+ if ($this->isNANPACountry($regionCallingFrom)) {
2313
+ // For NANPA regions, return the national format for these regions but prefix it with the
2314
+ // country calling code.
2315
+ return $countryCallingCode . " " . $this->format($number, PhoneNumberFormat::NATIONAL);
2316
+ }
2317
+ } else if ($countryCallingCode == $this->getCountryCodeForValidRegion($regionCallingFrom)) {
2318
+ // If regions share a country calling code, the country calling code need not be dialled.
2319
+ // This also applies when dialling within a region, so this if clause covers both these cases.
2320
+ // Technically this is the case for dialling from La Reunion to other overseas departments of
2321
+ // France (French Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover this
2322
+ // edge case for now and for those cases return the version including country calling code.
2323
+ // Details here: http://www.petitfute.com/voyage/225-info-pratiques-reunion
2324
+ return $this->format($number, PhoneNumberFormat::NATIONAL);
2325
+ }
2326
+ // Metadata cannot be null because we checked 'isValidRegionCode()' above.
2327
+ $metadataForRegionCallingFrom = $this->getMetadataForRegion($regionCallingFrom);
2328
+
2329
+ $internationalPrefix = $metadataForRegionCallingFrom->getInternationalPrefix();
2330
+
2331
+ // For regions that have multiple international prefixes, the international format of the
2332
+ // number is returned, unless there is a preferred international prefix.
2333
+ $internationalPrefixForFormatting = "";
2334
+ $uniqueInternationalPrefixMatcher = new Matcher(self::UNIQUE_INTERNATIONAL_PREFIX, $internationalPrefix);
2335
+
2336
+ if ($uniqueInternationalPrefixMatcher->matches()) {
2337
+ $internationalPrefixForFormatting = $internationalPrefix;
2338
+ } else if ($metadataForRegionCallingFrom->hasPreferredInternationalPrefix()) {
2339
+ $internationalPrefixForFormatting = $metadataForRegionCallingFrom->getPreferredInternationalPrefix();
2340
+ }
2341
+
2342
+ $regionCode = $this->getRegionCodeForCountryCode($countryCallingCode);
2343
+ // Metadata cannot be null because the country calling code is valid.
2344
+ $metadataForRegion = $this->getMetadataForRegionOrCallingCode($countryCallingCode, $regionCode);
2345
+ $formattedNationalNumber = $this->formatNsn(
2346
+ $nationalSignificantNumber,
2347
+ $metadataForRegion,
2348
+ PhoneNumberFormat::INTERNATIONAL
2349
+ );
2350
+ $formattedNumber = $formattedNationalNumber;
2351
+ $this->maybeAppendFormattedExtension(
2352
+ $number,
2353
+ $metadataForRegion,
2354
+ PhoneNumberFormat::INTERNATIONAL,
2355
+ $formattedNumber
2356
+ );
2357
+ if (mb_strlen($internationalPrefixForFormatting) > 0) {
2358
+ $formattedNumber = $internationalPrefixForFormatting . " " . $countryCallingCode . " " . $formattedNumber;
2359
+ } else {
2360
+ $this->prefixNumberWithCountryCallingCode(
2361
+ $countryCallingCode,
2362
+ PhoneNumberFormat::INTERNATIONAL,
2363
+ $formattedNumber
2364
+ );
2365
+ }
2366
+ return $formattedNumber;
2367
+ }
2368
+
2369
+ /**
2370
+ * Checks if this is a region under the North American Numbering Plan Administration (NANPA).
2371
+ * @param string $regionCode
2372
+ * @return boolean true if regionCode is one of the regions under NANPA
2373
+ */
2374
+ public function isNANPACountry($regionCode)
2375
+ {
2376
+ return in_array($regionCode, $this->nanpaRegions);
2377
+ }
2378
+
2379
+ /**
2380
+ * Formats a phone number using the original phone number format that the number is parsed from.
2381
+ * The original format is embedded in the country_code_source field of the PhoneNumber object
2382
+ * passed in. If such information is missing, the number will be formatted into the NATIONAL
2383
+ * format by default. When the number contains a leading zero and this is unexpected for this
2384
+ * country, or we don't have a formatting pattern for the number, the method returns the raw input
2385
+ * when it is available.
2386
+ *
2387
+ * Note this method guarantees no digit will be inserted, removed or modified as a result of
2388
+ * formatting.
2389
+ *
2390
+ * @param PhoneNumber $number the phone number that needs to be formatted in its original number format
2391
+ * @param string $regionCallingFrom the region whose IDD needs to be prefixed if the original number
2392
+ * has one
2393
+ * @return string the formatted phone number in its original number format
2394
+ */
2395
+ public function formatInOriginalFormat(PhoneNumber $number, $regionCallingFrom)
2396
+ {
2397
+ if ($number->hasRawInput() &&
2398
+ ($this->hasUnexpectedItalianLeadingZero($number) || !$this->hasFormattingPatternForNumber($number))
2399
+ ) {
2400
+ // We check if we have the formatting pattern because without that, we might format the number
2401
+ // as a group without national prefix.
2402
+ return $number->getRawInput();
2403
+ }
2404
+ if (!$number->hasCountryCodeSource()) {
2405
+ return $this->format($number, PhoneNumberFormat::NATIONAL);
2406
+ }
2407
+ switch ($number->getCountryCodeSource()) {
2408
+ case CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN:
2409
+ $formattedNumber = $this->format($number, PhoneNumberFormat::INTERNATIONAL);
2410
+ break;
2411
+ case CountryCodeSource::FROM_NUMBER_WITH_IDD:
2412
+ $formattedNumber = $this->formatOutOfCountryCallingNumber($number, $regionCallingFrom);
2413
+ break;
2414
+ case CountryCodeSource::FROM_NUMBER_WITHOUT_PLUS_SIGN:
2415
+ $formattedNumber = substr($this->format($number, PhoneNumberFormat::INTERNATIONAL), 1);
2416
+ break;
2417
+ case CountryCodeSource::FROM_DEFAULT_COUNTRY:
2418
+ // Fall-through to default case.
2419
+ default:
2420
+
2421
+ $regionCode = $this->getRegionCodeForCountryCode($number->getCountryCode());
2422
+ // We strip non-digits from the NDD here, and from the raw input later, so that we can
2423
+ // compare them easily.
2424
+ $nationalPrefix = $this->getNddPrefixForRegion($regionCode, true /* strip non-digits */);
2425
+ $nationalFormat = $this->format($number, PhoneNumberFormat::NATIONAL);
2426
+ if ($nationalPrefix === null || mb_strlen($nationalPrefix) == 0) {
2427
+ // If the region doesn't have a national prefix at all, we can safely return the national
2428
+ // format without worrying about a national prefix being added.
2429
+ $formattedNumber = $nationalFormat;
2430
+ break;
2431
+ }
2432
+ // Otherwise, we check if the original number was entered with a national prefix.
2433
+ if ($this->rawInputContainsNationalPrefix(
2434
+ $number->getRawInput(),
2435
+ $nationalPrefix,
2436
+ $regionCode
2437
+ )
2438
+ ) {
2439
+ // If so, we can safely return the national format.
2440
+ $formattedNumber = $nationalFormat;
2441
+ break;
2442
+ }
2443
+ // Metadata cannot be null here because getNddPrefixForRegion() (above) returns null if
2444
+ // there is no metadata for the region.
2445
+ $metadata = $this->getMetadataForRegion($regionCode);
2446
+ $nationalNumber = $this->getNationalSignificantNumber($number);
2447
+ $formatRule = $this->chooseFormattingPatternForNumber($metadata->numberFormats(), $nationalNumber);
2448
+ // The format rule could still be null here if the national number was 0 and there was no
2449
+ // raw input (this should not be possible for numbers generated by the phonenumber library
2450
+ // as they would also not have a country calling code and we would have exited earlier).
2451
+ if ($formatRule === null) {
2452
+ $formattedNumber = $nationalFormat;
2453
+ break;
2454
+ }
2455
+ // When the format we apply to this number doesn't contain national prefix, we can just
2456
+ // return the national format.
2457
+ // TODO: Refactor the code below with the code in isNationalPrefixPresentIfRequired.
2458
+ $candidateNationalPrefixRule = $formatRule->getNationalPrefixFormattingRule();
2459
+ // We assume that the first-group symbol will never be _before_ the national prefix.
2460
+ $indexOfFirstGroup = strpos($candidateNationalPrefixRule, '$1');
2461
+ if ($indexOfFirstGroup <= 0) {
2462
+ $formattedNumber = $nationalFormat;
2463
+ break;
2464
+ }
2465
+ $candidateNationalPrefixRule = substr($candidateNationalPrefixRule, 0, $indexOfFirstGroup);
2466
+ $candidateNationalPrefixRule = $this->normalizeDigitsOnly($candidateNationalPrefixRule);
2467
+ if (mb_strlen($candidateNationalPrefixRule) == 0) {
2468
+ // National prefix not used when formatting this number.
2469
+ $formattedNumber = $nationalFormat;
2470
+ break;
2471
+ }
2472
+ // Otherwise, we need to remove the national prefix from our output.
2473
+ $numFormatCopy = new NumberFormat();
2474
+ $numFormatCopy->mergeFrom($formatRule);
2475
+ $numFormatCopy->clearNationalPrefixFormattingRule();
2476
+ $numberFormats = array();
2477
+ $numberFormats[] = $numFormatCopy;
2478
+ $formattedNumber = $this->formatByPattern($number, PhoneNumberFormat::NATIONAL, $numberFormats);
2479
+ break;
2480
+ }
2481
+ $rawInput = $number->getRawInput();
2482
+ // If no digit is inserted/removed/modified as a result of our formatting, we return the
2483
+ // formatted phone number; otherwise we return the raw input the user entered.
2484
+ if ($formattedNumber !== null && mb_strlen($rawInput) > 0) {
2485
+ $normalizedFormattedNumber = $this->normalizeDiallableCharsOnly($formattedNumber);
2486
+ $normalizedRawInput = $this->normalizeDiallableCharsOnly($rawInput);
2487
+ if ($normalizedFormattedNumber != $normalizedRawInput) {
2488
+ $formattedNumber = $rawInput;
2489
+ }
2490
+ }
2491
+ return $formattedNumber;
2492
+ }
2493
+
2494
+ /**
2495
+ * Returns true if a number is from a region whose national significant number couldn't contain a
2496
+ * leading zero, but has the italian_leading_zero field set to true.
2497
+ * @param PhoneNumber $number
2498
+ * @return bool
2499
+ */
2500
+ private function hasUnexpectedItalianLeadingZero(PhoneNumber $number)
2501
+ {
2502
+ return $number->isItalianLeadingZero() && !$this->isLeadingZeroPossible($number->getCountryCode());
2503
+ }
2504
+
2505
+ /**
2506
+ * Checks whether the country calling code is from a region whose national significant number
2507
+ * could contain a leading zero. An example of such a region is Italy. Returns false if no
2508
+ * metadata for the country is found.
2509
+ * @param int $countryCallingCode
2510
+ * @return bool
2511
+ */
2512
+ public function isLeadingZeroPossible($countryCallingCode)
2513
+ {
2514
+ $mainMetadataForCallingCode = $this->getMetadataForRegionOrCallingCode(
2515
+ $countryCallingCode,
2516
+ $this->getRegionCodeForCountryCode($countryCallingCode)
2517
+ );
2518
+ if ($mainMetadataForCallingCode === null) {
2519
+ return false;
2520
+ }
2521
+ return (bool)$mainMetadataForCallingCode->isLeadingZeroPossible();
2522
+ }
2523
+
2524
+ /**
2525
+ * @param PhoneNumber $number
2526
+ * @return bool
2527
+ */
2528
+ private function hasFormattingPatternForNumber(PhoneNumber $number)
2529
+ {
2530
+ $countryCallingCode = $number->getCountryCode();
2531
+ $phoneNumberRegion = $this->getRegionCodeForCountryCode($countryCallingCode);
2532
+ $metadata = $this->getMetadataForRegionOrCallingCode($countryCallingCode, $phoneNumberRegion);
2533
+ if ($metadata === null) {
2534
+ return false;
2535
+ }
2536
+ $nationalNumber = $this->getNationalSignificantNumber($number);
2537
+ $formatRule = $this->chooseFormattingPatternForNumber($metadata->numberFormats(), $nationalNumber);
2538
+ return $formatRule !== null;
2539
+ }
2540
+
2541
+ /**
2542
+ * Returns the national dialling prefix for a specific region. For example, this would be 1 for
2543
+ * the United States, and 0 for New Zealand. Set stripNonDigits to true to strip symbols like "~"
2544
+ * (which indicates a wait for a dialling tone) from the prefix returned. If no national prefix is
2545
+ * present, we return null.
2546
+ *
2547
+ * <p>Warning: Do not use this method for do-your-own formatting - for some regions, the
2548
+ * national dialling prefix is used only for certain types of numbers. Use the library's
2549
+ * formatting functions to prefix the national prefix when required.
2550
+ *
2551
+ * @param string $regionCode the region that we want to get the dialling prefix for
2552
+ * @param boolean $stripNonDigits true to strip non-digits from the national dialling prefix
2553
+ * @return string the dialling prefix for the region denoted by regionCode
2554
+ */
2555
+ public function getNddPrefixForRegion($regionCode, $stripNonDigits)
2556
+ {
2557
+ $metadata = $this->getMetadataForRegion($regionCode);
2558
+ if ($metadata === null) {
2559
+ return null;
2560
+ }
2561
+ $nationalPrefix = $metadata->getNationalPrefix();
2562
+ // If no national prefix was found, we return null.
2563
+ if (mb_strlen($nationalPrefix) == 0) {
2564
+ return null;
2565
+ }
2566
+ if ($stripNonDigits) {
2567
+ // Note: if any other non-numeric symbols are ever used in national prefixes, these would have
2568
+ // to be removed here as well.
2569
+ $nationalPrefix = str_replace("~", "", $nationalPrefix);
2570
+ }
2571
+ return $nationalPrefix;
2572
+ }
2573
+
2574
+ /**
2575
+ * Check if rawInput, which is assumed to be in the national format, has a national prefix. The
2576
+ * national prefix is assumed to be in digits-only form.
2577
+ * @param string $rawInput
2578
+ * @param string $nationalPrefix
2579
+ * @param string $regionCode
2580
+ * @return bool
2581
+ */
2582
+ private function rawInputContainsNationalPrefix($rawInput, $nationalPrefix, $regionCode)
2583
+ {
2584
+ $normalizedNationalNumber = $this->normalizeDigitsOnly($rawInput);
2585
+ if (strpos($normalizedNationalNumber, $nationalPrefix) === 0) {
2586
+ try {
2587
+ // Some Japanese numbers (e.g. 00777123) might be mistaken to contain the national prefix
2588
+ // when written without it (e.g. 0777123) if we just do prefix matching. To tackle that, we
2589
+ // check the validity of the number if the assumed national prefix is removed (777123 won't
2590
+ // be valid in Japan).
2591
+ return $this->isValidNumber(
2592
+ $this->parse(substr($normalizedNationalNumber, mb_strlen($nationalPrefix)), $regionCode)
2593
+ );
2594
+ } catch (NumberParseException $e) {
2595
+ return false;
2596
+ }
2597
+ }
2598
+ return false;
2599
+ }
2600
+
2601
+ /**
2602
+ * Tests whether a phone number matches a valid pattern. Note this doesn't verify the number
2603
+ * is actually in use, which is impossible to tell by just looking at a number itself.
2604
+ *
2605
+ * @param PhoneNumber $number the phone number that we want to validate
2606
+ * @return boolean that indicates whether the number is of a valid pattern
2607
+ */
2608
+ public function isValidNumber(PhoneNumber $number)
2609
+ {
2610
+ $regionCode = $this->getRegionCodeForNumber($number);
2611
+ return $this->isValidNumberForRegion($number, $regionCode);
2612
+ }
2613
+
2614
+ /**
2615
+ * Tests whether a phone number is valid for a certain region. Note this doesn't verify the number
2616
+ * is actually in use, which is impossible to tell by just looking at a number itself. If the
2617
+ * country calling code is not the same as the country calling code for the region, this
2618
+ * immediately exits with false. After this, the specific number pattern rules for the region are
2619
+ * examined. This is useful for determining for example whether a particular number is valid for
2620
+ * Canada, rather than just a valid NANPA number.
2621
+ * Warning: In most cases, you want to use {@link #isValidNumber} instead. For example, this
2622
+ * method will mark numbers from British Crown dependencies such as the Isle of Man as invalid for
2623
+ * the region "GB" (United Kingdom), since it has its own region code, "IM", which may be
2624
+ * undesirable.
2625
+ *
2626
+ * @param PhoneNumber $number the phone number that we want to validate
2627
+ * @param string $regionCode the region that we want to validate the phone number for
2628
+ * @return boolean that indicates whether the number is of a valid pattern
2629
+ */
2630
+ public function isValidNumberForRegion(PhoneNumber $number, $regionCode)
2631
+ {
2632
+ $countryCode = $number->getCountryCode();
2633
+ $metadata = $this->getMetadataForRegionOrCallingCode($countryCode, $regionCode);
2634
+ if (($metadata === null) ||
2635
+ (self::REGION_CODE_FOR_NON_GEO_ENTITY !== $regionCode &&
2636
+ $countryCode !== $this->getCountryCodeForValidRegion($regionCode))
2637
+ ) {
2638
+ // Either the region code was invalid, or the country calling code for this number does not
2639
+ // match that of the region code.
2640
+ return false;
2641
+ }
2642
+ $nationalSignificantNumber = $this->getNationalSignificantNumber($number);
2643
+
2644
+ return $this->getNumberTypeHelper($nationalSignificantNumber, $metadata) != PhoneNumberType::UNKNOWN;
2645
+ }
2646
+
2647
+ /**
2648
+ * Parses a string and returns it in proto buffer format. This method will throw a
2649
+ * {@link NumberParseException} if the number is not considered to be
2650
+ * a possible number. Note that validation of whether the number is actually a valid number for a
2651
+ * particular region is not performed. This can be done separately with {@link #isValidNumber}.
2652
+ *
2653
+ * @param string $numberToParse number that we are attempting to parse. This can contain formatting
2654
+ * such as +, ( and -, as well as a phone number extension.
2655
+ * @param string $defaultRegion region that we are expecting the number to be from. This is only used
2656
+ * if the number being parsed is not written in international format.
2657
+ * The country_code for the number in this case would be stored as that
2658
+ * of the default region supplied. If the number is guaranteed to
2659
+ * start with a '+' followed by the country calling code, then
2660
+ * "ZZ" or null can be supplied.
2661
+ * @param PhoneNumber|null $phoneNumber
2662
+ * @param bool $keepRawInput
2663
+ * @return PhoneNumber a phone number proto buffer filled with the parsed number
2664
+ * @throws NumberParseException if the string is not considered to be a viable phone number or if
2665
+ * no default region was supplied and the number is not in
2666
+ * international format (does not start with +)
2667
+ */
2668
+ public function parse($numberToParse, $defaultRegion, PhoneNumber $phoneNumber = null, $keepRawInput = false)
2669
+ {
2670
+ if ($phoneNumber === null) {
2671
+ $phoneNumber = new PhoneNumber();
2672
+ }
2673
+ $this->parseHelper($numberToParse, $defaultRegion, $keepRawInput, true, $phoneNumber);
2674
+ return $phoneNumber;
2675
+ }
2676
+
2677
+ /**
2678
+ * Formats a phone number in the specified format using client-defined formatting rules. Note that
2679
+ * if the phone number has a country calling code of zero or an otherwise invalid country calling
2680
+ * code, we cannot work out things like whether there should be a national prefix applied, or how
2681
+ * to format extensions, so we return the national significant number with no formatting applied.
2682
+ *
2683
+ * @param PhoneNumber $number the phone number to be formatted
2684
+ * @param int $numberFormat the format the phone number should be formatted into
2685
+ * @param array $userDefinedFormats formatting rules specified by clients
2686
+ * @return String the formatted phone number
2687
+ */
2688
+ public function formatByPattern(PhoneNumber $number, $numberFormat, array $userDefinedFormats)
2689
+ {
2690
+ $countryCallingCode = $number->getCountryCode();
2691
+ $nationalSignificantNumber = $this->getNationalSignificantNumber($number);
2692
+ if (!$this->hasValidCountryCallingCode($countryCallingCode)) {
2693
+ return $nationalSignificantNumber;
2694
+ }
2695
+ // Note getRegionCodeForCountryCode() is used because formatting information for regions which
2696
+ // share a country calling code is contained by only one region for performance reasons. For
2697
+ // example, for NANPA regions it will be contained in the metadata for US.
2698
+ $regionCode = $this->getRegionCodeForCountryCode($countryCallingCode);
2699
+ // Metadata cannot be null because the country calling code is valid
2700
+ $metadata = $this->getMetadataForRegionOrCallingCode($countryCallingCode, $regionCode);
2701
+
2702
+ $formattedNumber = "";
2703
+
2704
+ $formattingPattern = $this->chooseFormattingPatternForNumber($userDefinedFormats, $nationalSignificantNumber);
2705
+ if ($formattingPattern === null) {
2706
+ // If no pattern above is matched, we format the number as a whole.
2707
+ $formattedNumber .= $nationalSignificantNumber;
2708
+ } else {
2709
+ $numFormatCopy = new NumberFormat();
2710
+ // Before we do a replacement of the national prefix pattern $NP with the national prefix, we
2711
+ // need to copy the rule so that subsequent replacements for different numbers have the
2712
+ // appropriate national prefix.
2713
+ $numFormatCopy->mergeFrom($formattingPattern);
2714
+ $nationalPrefixFormattingRule = $formattingPattern->getNationalPrefixFormattingRule();
2715
+ if (mb_strlen($nationalPrefixFormattingRule) > 0) {
2716
+ $nationalPrefix = $metadata->getNationalPrefix();
2717
+ if (mb_strlen($nationalPrefix) > 0) {
2718
+ // Replace $NP with national prefix and $FG with the first group ($1).
2719
+ $npPatternMatcher = new Matcher(self::NP_PATTERN, $nationalPrefixFormattingRule);
2720
+ $nationalPrefixFormattingRule = $npPatternMatcher->replaceFirst($nationalPrefix);
2721
+ $fgPatternMatcher = new Matcher(self::FG_PATTERN, $nationalPrefixFormattingRule);
2722
+ $nationalPrefixFormattingRule = $fgPatternMatcher->replaceFirst("\\$1");
2723
+ $numFormatCopy->setNationalPrefixFormattingRule($nationalPrefixFormattingRule);
2724
+ } else {
2725
+ // We don't want to have a rule for how to format the national prefix if there isn't one.
2726
+ $numFormatCopy->clearNationalPrefixFormattingRule();
2727
+ }
2728
+ }
2729
+ $formattedNumber .= $this->formatNsnUsingPattern($nationalSignificantNumber, $numFormatCopy, $numberFormat);
2730
+ }
2731
+ $this->maybeAppendFormattedExtension($number, $metadata, $numberFormat, $formattedNumber);
2732
+ $this->prefixNumberWithCountryCallingCode($countryCallingCode, $numberFormat, $formattedNumber);
2733
+ return $formattedNumber;
2734
+ }
2735
+
2736
+ /**
2737
+ * Gets a valid number for the specified region.
2738
+ *
2739
+ * @param string regionCode the region for which an example number is needed
2740
+ * @return PhoneNumber a valid fixed-line number for the specified region. Returns null when the metadata
2741
+ * does not contain such information, or the region 001 is passed in. For 001 (representing
2742
+ * non-geographical numbers), call {@link #getExampleNumberForNonGeoEntity} instead.
2743
+ */
2744
+ public function getExampleNumber($regionCode)
2745
+ {
2746
+ return $this->getExampleNumberForType($regionCode, PhoneNumberType::FIXED_LINE);
2747
+ }
2748
+
2749
+ /**
2750
+ * Gets a valid number for the specified region and number type.
2751
+ *
2752
+ * @param string $regionCode the region for which an example number is needed
2753
+ * @param int $type the PhoneNumberType of number that is needed
2754
+ * @return PhoneNumber a valid number for the specified region and type. Returns null when the metadata
2755
+ * does not contain such information or if an invalid region or region 001 was entered.
2756
+ * For 001 (representing non-geographical numbers), call
2757
+ * {@link #getExampleNumberForNonGeoEntity} instead.
2758
+ */
2759
+ public function getExampleNumberForType($regionCode, $type)
2760
+ {
2761
+ // Check the region code is valid.
2762
+ if (!$this->isValidRegionCode($regionCode)) {
2763
+ return null;
2764
+ }
2765
+ $desc = $this->getNumberDescByType($this->getMetadataForRegion($regionCode), $type);
2766
+ try {
2767
+ if ($desc->hasExampleNumber()) {
2768
+ return $this->parse($desc->getExampleNumber(), $regionCode);
2769
+ }
2770
+ } catch (NumberParseException $e) {
2771
+ }
2772
+ return null;
2773
+ }
2774
+
2775
+ /**
2776
+ * @param PhoneMetadata $metadata
2777
+ * @param int $type PhoneNumberType
2778
+ * @return PhoneNumberDesc
2779
+ */
2780
+ private function getNumberDescByType(PhoneMetadata $metadata, $type)
2781
+ {
2782
+ switch ($type) {
2783
+ case PhoneNumberType::PREMIUM_RATE:
2784
+ return $metadata->getPremiumRate();
2785
+ case PhoneNumberType::TOLL_FREE:
2786
+ return $metadata->getTollFree();
2787
+ case PhoneNumberType::MOBILE:
2788
+ return $metadata->getMobile();
2789
+ case PhoneNumberType::FIXED_LINE:
2790
+ case PhoneNumberType::FIXED_LINE_OR_MOBILE:
2791
+ return $metadata->getFixedLine();
2792
+ case PhoneNumberType::SHARED_COST:
2793
+ return $metadata->getSharedCost();
2794
+ case PhoneNumberType::VOIP:
2795
+ return $metadata->getVoip();
2796
+ case PhoneNumberType::PERSONAL_NUMBER:
2797
+ return $metadata->getPersonalNumber();
2798
+ case PhoneNumberType::PAGER:
2799
+ return $metadata->getPager();
2800
+ case PhoneNumberType::UAN:
2801
+ return $metadata->getUan();
2802
+ case PhoneNumberType::VOICEMAIL:
2803
+ return $metadata->getVoicemail();
2804
+ default:
2805
+ return $metadata->getGeneralDesc();
2806
+ }
2807
+ }
2808
+
2809
+ /**
2810
+ * Gets a valid number for the specified country calling code for a non-geographical entity.
2811
+ *
2812
+ * @param int $countryCallingCode the country calling code for a non-geographical entity
2813
+ * @return PhoneNumber a valid number for the non-geographical entity. Returns null when the metadata
2814
+ * does not contain such information, or the country calling code passed in does not belong
2815
+ * to a non-geographical entity.
2816
+ */
2817
+ public function getExampleNumberForNonGeoEntity($countryCallingCode)
2818
+ {
2819
+ $metadata = $this->getMetadataForNonGeographicalRegion($countryCallingCode);
2820
+ if ($metadata !== null) {
2821
+ $desc = $metadata->getGeneralDesc();
2822
+ try {
2823
+ if ($desc->hasExampleNumber()) {
2824
+ return $this->parse("+" . $countryCallingCode . $desc->getExampleNumber(), "ZZ");
2825
+ }
2826
+ } catch (NumberParseException $e) {
2827
+ }
2828
+ }
2829
+ return null;
2830
+ }
2831
+
2832
+
2833
+ /**
2834
+ * Takes two phone numbers and compares them for equality.
2835
+ *
2836
+ * <p>Returns EXACT_MATCH if the country_code, NSN, presence of a leading zero
2837
+ * for Italian numbers and any extension present are the same. Returns NSN_MATCH
2838
+ * if either or both has no region specified, and the NSNs and extensions are
2839
+ * the same. Returns SHORT_NSN_MATCH if either or both has no region specified,
2840
+ * or the region specified is the same, and one NSN could be a shorter version
2841
+ * of the other number. This includes the case where one has an extension
2842
+ * specified, and the other does not. Returns NO_MATCH otherwise. For example,
2843
+ * the numbers +1 345 657 1234 and 657 1234 are a SHORT_NSN_MATCH. The numbers
2844
+ * +1 345 657 1234 and 345 657 are a NO_MATCH.
2845
+ *
2846
+ * @param $firstNumberIn PhoneNumber|string First number to compare. If it is a
2847
+ * string it can contain formatting, and can have country calling code specified
2848
+ * with + at the start.
2849
+ * @param $secondNumberIn PhoneNumber|string Second number to compare. If it is a
2850
+ * string it can contain formatting, and can have country calling code specified
2851
+ * with + at the start.
2852
+ * @throws \InvalidArgumentException
2853
+ * @return int {MatchType} NOT_A_NUMBER, NO_MATCH,
2854
+ */
2855
+ public function isNumberMatch($firstNumberIn, $secondNumberIn)
2856
+ {
2857
+ if (is_string($firstNumberIn) && is_string($secondNumberIn)) {
2858
+ try {
2859
+ $firstNumberAsProto = $this->parse($firstNumberIn, self::UNKNOWN_REGION);
2860
+ return $this->isNumberMatch($firstNumberAsProto, $secondNumberIn);
2861
+ } catch (NumberParseException $e) {
2862
+ if ($e->getErrorType() === NumberParseException::INVALID_COUNTRY_CODE) {
2863
+ try {
2864
+ $secondNumberAsProto = $this->parse($secondNumberIn, self::UNKNOWN_REGION);
2865
+ return $this->isNumberMatch($secondNumberAsProto, $firstNumberIn);
2866
+ } catch (NumberParseException $e2) {
2867
+ if ($e2->getErrorType() === NumberParseException::INVALID_COUNTRY_CODE) {
2868
+ try {
2869
+ $firstNumberProto = new PhoneNumber();
2870
+ $secondNumberProto = new PhoneNumber();
2871
+ $this->parseHelper($firstNumberIn, null, false, false, $firstNumberProto);
2872
+ $this->parseHelper($secondNumberIn, null, false, false, $secondNumberProto);
2873
+ return $this->isNumberMatch($firstNumberProto, $secondNumberProto);
2874
+ } catch (NumberParseException $e3) {
2875
+ // Fall through and return MatchType::NOT_A_NUMBER
2876
+ }
2877
+ }
2878
+ }
2879
+ }
2880
+ }
2881
+ return MatchType::NOT_A_NUMBER;
2882
+ }
2883
+ if ($firstNumberIn instanceof PhoneNumber && is_string($secondNumberIn)) {
2884
+ // First see if the second number has an implicit country calling code, by attempting to parse
2885
+ // it.
2886
+ try {
2887
+ $secondNumberAsProto = $this->parse($secondNumberIn, self::UNKNOWN_REGION);
2888
+ return $this->isNumberMatch($firstNumberIn, $secondNumberAsProto);
2889
+ } catch (NumberParseException $e) {
2890
+ if ($e->getErrorType() === NumberParseException::INVALID_COUNTRY_CODE) {
2891
+ // The second number has no country calling code. EXACT_MATCH is no longer possible.
2892
+ // We parse it as if the region was the same as that for the first number, and if
2893
+ // EXACT_MATCH is returned, we replace this with NSN_MATCH.
2894
+ $firstNumberRegion = $this->getRegionCodeForCountryCode($firstNumberIn->getCountryCode());
2895
+ try {
2896
+ if ($firstNumberRegion != self::UNKNOWN_REGION) {
2897
+ $secondNumberWithFirstNumberRegion = $this->parse($secondNumberIn, $firstNumberRegion);
2898
+ $match = $this->isNumberMatch($firstNumberIn, $secondNumberWithFirstNumberRegion);
2899
+ if ($match === MatchType::EXACT_MATCH) {
2900
+ return MatchType::NSN_MATCH;
2901
+ }
2902
+ return $match;
2903
+ } else {
2904
+ // If the first number didn't have a valid country calling code, then we parse the
2905
+ // second number without one as well.
2906
+ $secondNumberProto = new PhoneNumber();
2907
+ $this->parseHelper($secondNumberIn, null, false, false, $secondNumberProto);
2908
+ return $this->isNumberMatch($firstNumberIn, $secondNumberProto);
2909
+ }
2910
+ } catch (NumberParseException $e2) {
2911
+ // Fall-through to return NOT_A_NUMBER.
2912
+ }
2913
+ }
2914
+ }
2915
+ }
2916
+ if ($firstNumberIn instanceof PhoneNumber && $secondNumberIn instanceof PhoneNumber) {
2917
+ // Make copies of the phone number so that the numbers passed in are not edited.
2918
+ $firstNumber = new PhoneNumber();
2919
+ $firstNumber->mergeFrom($firstNumberIn);
2920
+ $secondNumber = new PhoneNumber();
2921
+ $secondNumber->mergeFrom($secondNumberIn);
2922
+
2923
+ // First clear raw_input, country_code_source and preferred_domestic_carrier_code fields and any
2924
+ // empty-string extensions so that we can use the proto-buffer equality method.
2925
+ $firstNumber->clearRawInput();
2926
+ $firstNumber->clearCountryCodeSource();
2927
+ $firstNumber->clearPreferredDomesticCarrierCode();
2928
+ $secondNumber->clearRawInput();
2929
+ $secondNumber->clearCountryCodeSource();
2930
+ $secondNumber->clearPreferredDomesticCarrierCode();
2931
+ if ($firstNumber->hasExtension() && mb_strlen($firstNumber->getExtension()) === 0) {
2932
+ $firstNumber->clearExtension();
2933
+ }
2934
+
2935
+ if ($secondNumber->hasExtension() && mb_strlen($secondNumber->getExtension()) === 0) {
2936
+ $secondNumber->clearExtension();
2937
+ }
2938
+
2939
+ // Early exit if both had extensions and these are different.
2940
+ if ($firstNumber->hasExtension() && $secondNumber->hasExtension() &&
2941
+ $firstNumber->getExtension() != $secondNumber->getExtension()
2942
+ ) {
2943
+ return MatchType::NO_MATCH;
2944
+ }
2945
+
2946
+ $firstNumberCountryCode = $firstNumber->getCountryCode();
2947
+ $secondNumberCountryCode = $secondNumber->getCountryCode();
2948
+ // Both had country_code specified.
2949
+ if ($firstNumberCountryCode != 0 && $secondNumberCountryCode != 0) {
2950
+ if ($firstNumber->equals($secondNumber)) {
2951
+ return MatchType::EXACT_MATCH;
2952
+ } elseif ($firstNumberCountryCode == $secondNumberCountryCode &&
2953
+ $this->isNationalNumberSuffixOfTheOther($firstNumber, $secondNumber)
2954
+ ) {
2955
+ // A SHORT_NSN_MATCH occurs if there is a difference because of the presence or absence of
2956
+ // an 'Italian leading zero', the presence or absence of an extension, or one NSN being a
2957
+ // shorter variant of the other.
2958
+ return MatchType::SHORT_NSN_MATCH;
2959
+ }
2960
+ // This is not a match.
2961
+ return MatchType::NO_MATCH;
2962
+ }
2963
+ // Checks cases where one or both country_code fields were not specified. To make equality
2964
+ // checks easier, we first set the country_code fields to be equal.
2965
+ $firstNumber->setCountryCode($secondNumberCountryCode);
2966
+ // If all else was the same, then this is an NSN_MATCH.
2967
+ if ($firstNumber->equals($secondNumber)) {
2968
+ return MatchType::NSN_MATCH;
2969
+ }
2970
+ if ($this->isNationalNumberSuffixOfTheOther($firstNumber, $secondNumber)) {
2971
+ return MatchType::SHORT_NSN_MATCH;
2972
+ }
2973
+ return MatchType::NO_MATCH;
2974
+ }
2975
+ return MatchType::NOT_A_NUMBER;
2976
+ }
2977
+
2978
+ /**
2979
+ * Returns true when one national number is the suffix of the other or both are the same.
2980
+ * @param PhoneNumber $firstNumber
2981
+ * @param PhoneNumber $secondNumber
2982
+ * @return bool
2983
+ */
2984
+ private function isNationalNumberSuffixOfTheOther(PhoneNumber $firstNumber, PhoneNumber $secondNumber)
2985
+ {
2986
+ $firstNumberNationalNumber = trim((string)$firstNumber->getNationalNumber());
2987
+ $secondNumberNationalNumber = trim((string)$secondNumber->getNationalNumber());
2988
+ return $this->stringEndsWithString($firstNumberNationalNumber, $secondNumberNationalNumber) ||
2989
+ $this->stringEndsWithString($secondNumberNationalNumber, $firstNumberNationalNumber);
2990
+ }
2991
+
2992
+ private function stringEndsWithString($hayStack, $needle)
2993
+ {
2994
+ $revNeedle = strrev($needle);
2995
+ $revHayStack = strrev($hayStack);
2996
+ return strpos($revHayStack, $revNeedle) === 0;
2997
+ }
2998
+
2999
+ /**
3000
+ * Returns true if the supplied region supports mobile number portability. Returns false for
3001
+ * invalid, unknown or regions that don't support mobile number portability.
3002
+ *
3003
+ * @param string $regionCode the region for which we want to know whether it supports mobile number
3004
+ * portability or not.
3005
+ * @return bool
3006
+ */
3007
+ public function isMobileNumberPortableRegion($regionCode)
3008
+ {
3009
+ $metadata = $this->getMetadataForRegion($regionCode);
3010
+ if ($metadata === null) {
3011
+ return false;
3012
+ }
3013
+
3014
+ return $metadata->isMobileNumberPortableRegion();
3015
+ }
3016
+
3017
+ /**
3018
+ * Check whether a phone number is a possible number given a number in the form of a string, and
3019
+ * the region where the number could be dialed from. It provides a more lenient check than
3020
+ * {@link #isValidNumber}. See {@link #isPossibleNumber(PhoneNumber)} for details.
3021
+ *
3022
+ * <p>This method first parses the number, then invokes {@link #isPossibleNumber(PhoneNumber)}
3023
+ * with the resultant PhoneNumber object.
3024
+ *
3025
+ * @param PhoneNumber|string $number the number that needs to be checked, in the form of a string
3026
+ * @param string $regionDialingFrom the region that we are expecting the number to be dialed from.
3027
+ * Note this is different from the region where the number belongs. For example, the number
3028
+ * +1 650 253 0000 is a number that belongs to US. When written in this form, it can be
3029
+ * dialed from any region. When it is written as 00 1 650 253 0000, it can be dialed from any
3030
+ * region which uses an international dialling prefix of 00. When it is written as
3031
+ * 650 253 0000, it can only be dialed from within the US, and when written as 253 0000, it
3032
+ * can only be dialed from within a smaller area in the US (Mountain View, CA, to be more
3033
+ * specific).
3034
+ * @return boolean true if the number is possible
3035
+ */
3036
+ public function isPossibleNumber($number, $regionDialingFrom = null)
3037
+ {
3038
+ if ($regionDialingFrom !== null && is_string($number)) {
3039
+ try {
3040
+ return $this->isPossibleNumberWithReason(
3041
+ $this->parse($number, $regionDialingFrom)
3042
+ ) === ValidationResult::IS_POSSIBLE;
3043
+ } catch (NumberParseException $e) {
3044
+ return false;
3045
+ }
3046
+ } else {
3047
+ return $this->isPossibleNumberWithReason($number) === ValidationResult::IS_POSSIBLE;
3048
+ }
3049
+ }
3050
+
3051
+
3052
+ /**
3053
+ * Check whether a phone number is a possible number. It provides a more lenient check than
3054
+ * {@link #isValidNumber} in the following sense:
3055
+ * <ol>
3056
+ * <li> It only checks the length of phone numbers. In particular, it doesn't check starting
3057
+ * digits of the number.
3058
+ * <li> It doesn't attempt to figure out the type of the number, but uses general rules which
3059
+ * applies to all types of phone numbers in a region. Therefore, it is much faster than
3060
+ * isValidNumber.
3061
+ * <li> For fixed line numbers, many regions have the concept of area code, which together with
3062
+ * subscriber number constitute the national significant number. It is sometimes okay to dial
3063
+ * the subscriber number only when dialing in the same area. This function will return
3064
+ * true if the subscriber-number-only version is passed in. On the other hand, because
3065
+ * isValidNumber validates using information on both starting digits (for fixed line
3066
+ * numbers, that would most likely be area codes) and length (obviously includes the
3067
+ * length of area codes for fixed line numbers), it will return false for the
3068
+ * subscriber-number-only version.
3069
+ * </ol>
3070
+ * @param PhoneNumber $number the number that needs to be checked
3071
+ * @return int a ValidationResult object which indicates whether the number is possible
3072
+ */
3073
+ public function isPossibleNumberWithReason(PhoneNumber $number)
3074
+ {
3075
+ $nationalNumber = $this->getNationalSignificantNumber($number);
3076
+ $countryCode = $number->getCountryCode();
3077
+ // Note: For Russian Fed and NANPA numbers, we just use the rules from the default region (US or
3078
+ // Russia) since the getRegionCodeForNumber will not work if the number is possible but not
3079
+ // valid. This would need to be revisited if the possible number pattern ever differed between
3080
+ // various regions within those plans.
3081
+ if (!$this->hasValidCountryCallingCode($countryCode)) {
3082
+ return ValidationResult::INVALID_COUNTRY_CODE;
3083
+ }
3084
+
3085
+ $regionCode = $this->getRegionCodeForCountryCode($countryCode);
3086
+ // Metadata cannot be null because the country calling code is valid.
3087
+ $metadata = $this->getMetadataForRegionOrCallingCode($countryCode, $regionCode);
3088
+
3089
+ $possibleNumberPattern = $metadata->getGeneralDesc()->getPossibleNumberPattern();
3090
+ return $this->testNumberLengthAgainstPattern($possibleNumberPattern, $nationalNumber);
3091
+ }
3092
+
3093
+ /**
3094
+ * Attempts to extract a valid number from a phone number that is too long to be valid, and resets
3095
+ * the PhoneNumber object passed in to that valid version. If no valid number could be extracted,
3096
+ * the PhoneNumber object passed in will not be modified.
3097
+ * @param PhoneNumber $number a PhoneNumber object which contains a number that is too long to be valid.
3098
+ * @return boolean true if a valid phone number can be successfully extracted.
3099
+ */
3100
+ public function truncateTooLongNumber(PhoneNumber $number)
3101
+ {
3102
+ if ($this->isValidNumber($number)) {
3103
+ return true;
3104
+ }
3105
+ $numberCopy = new PhoneNumber();
3106
+ $numberCopy->mergeFrom($number);
3107
+ $nationalNumber = $number->getNationalNumber();
3108
+ do {
3109
+ $nationalNumber = floor($nationalNumber / 10);
3110
+ $numberCopy->setNationalNumber($nationalNumber);
3111
+ if ($this->isPossibleNumberWithReason($numberCopy) == ValidationResult::TOO_SHORT || $nationalNumber == 0) {
3112
+ return false;
3113
+ }
3114
+ } while (!$this->isValidNumber($numberCopy));
3115
+ $number->setNationalNumber($nationalNumber);
3116
+ return true;
3117
+ }
3118
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/RegexBasedMatcher.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ class RegexBasedMatcher implements MatcherAPIInterface
6
+ {
7
+ public static function create()
8
+ {
9
+ return new static();
10
+ }
11
+
12
+ /**
13
+ * Returns whether the given national number (a string containing only decimal digits) matches
14
+ * the national number pattern defined in the given {@code PhoneNumberDesc} message.
15
+ *
16
+ * @param string $nationalNumber
17
+ * @param PhoneNumberDesc $numberDesc
18
+ * @param boolean $allowPrefixMatch
19
+ * @return boolean
20
+ */
21
+ public function matchesNationalNumber($nationalNumber, PhoneNumberDesc $numberDesc, $allowPrefixMatch)
22
+ {
23
+ $nationalNumberPatternMatcher = new Matcher($numberDesc->getNationalNumberPattern(), $nationalNumber);
24
+
25
+ return ($nationalNumberPatternMatcher->matches()
26
+ || ($allowPrefixMatch && $nationalNumberPatternMatcher->lookingAt()));
27
+ }
28
+
29
+ /**
30
+ * Returns whether the given national number (a string containing only decimal digits) matches
31
+ * the possible number pattern defined in the given {@code PhoneNumberDesc} message.
32
+ *
33
+ * @param string $nationalNumber
34
+ * @param PhoneNumberDesc $numberDesc
35
+ * @return boolean
36
+ */
37
+ public function matchesPossibleNumber($nationalNumber, PhoneNumberDesc $numberDesc)
38
+ {
39
+ $possibleNumberPatternMatcher = new Matcher($numberDesc->getPossibleNumberPattern(), $nationalNumber);
40
+
41
+ return $possibleNumberPatternMatcher->matches();
42
+ }
43
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/RegionCode.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ namespace libphonenumber;
19
+
20
+ /**
21
+ * Class containing string constants of region codes for easier testing.
22
+ */
23
+ class RegionCode
24
+ {
25
+ // Region code for global networks (e.g. +800 numbers).
26
+ const UN001 = "001";
27
+ const AD = "AD";
28
+ const AE = "AE";
29
+ const AM = "AM";
30
+ const AO = "AO";
31
+ const AQ = "AQ";
32
+ const AR = "AR";
33
+ const AU = "AU";
34
+ const BB = "BB";
35
+ const BR = "BR";
36
+ const BS = "BS";
37
+ const BY = "BY";
38
+ const CA = "CA";
39
+ const CH = "CH";
40
+ const CL = "CL";
41
+ const CN = "CN";
42
+ const CS = "CS";
43
+ const CX = "CX";
44
+ const DE = "DE";
45
+ const FR = "FR";
46
+ const GB = "GB";
47
+ const HU = "HU";
48
+ const IT = "IT";
49
+ const JP = "JP";
50
+ const KR = "KR";
51
+ const MX = "MX";
52
+ const NZ = "NZ";
53
+ const PG = "PG";
54
+ const PL = "PL";
55
+ const RE = "RE";
56
+ const SE = "SE";
57
+ const SG = "SG";
58
+ const US = "US";
59
+ const YT = "YT";
60
+ const ZW = "ZW";
61
+ // Official code for the unknown region.
62
+ const ZZ = "ZZ";
63
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ShortNumberCost.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Cost categories of short numbers
7
+ * @package libphonenumber
8
+ */
9
+ class ShortNumberCost
10
+ {
11
+ const TOLL_FREE = 3;
12
+ const PREMIUM_RATE = 4;
13
+ const STANDARD_RATE = 30;
14
+ const UNKNOWN_COST = 10;
15
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ShortNumberInfo.php ADDED
@@ -0,0 +1,626 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Methods for getting information about short phone numbers, such as short codes and emergency
4
+ * numbers. Note that most commercial short numbers are not handled here, but by the
5
+ * {@link PhoneNumberUtil}.
6
+ *
7
+ * @author Shaopeng Jia
8
+ * @author David Yonge-Mallo
9
+ * @since 5.8
10
+ */
11
+
12
+ namespace libphonenumber;
13
+
14
+
15
+ class ShortNumberInfo
16
+ {
17
+ const META_DATA_FILE_PREFIX = 'ShortNumberMetadata';
18
+ /**
19
+ * @var ShortNumberInfo
20
+ */
21
+ private static $instance = null;
22
+ /**
23
+ * @var MatcherAPIInterface
24
+ */
25
+ private $matcherAPI;
26
+ private $currentFilePrefix;
27
+ private $regionToMetadataMap = array();
28
+ private $countryCallingCodeToRegionCodeMap = array();
29
+ private $countryCodeToNonGeographicalMetadataMap = array();
30
+ private static $regionsWhereEmergencyNumbersMustBeExact = array(
31
+ 'BR',
32
+ 'CL',
33
+ 'NI',
34
+ );
35
+
36
+ private function __construct(MatcherAPIInterface $matcherAPI)
37
+ {
38
+ $this->matcherAPI = $matcherAPI;
39
+
40
+ // TODO: Create ShortNumberInfo for a given map
41
+ $this->countryCallingCodeToRegionCodeMap = CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap;
42
+
43
+ $this->currentFilePrefix = dirname(__FILE__) . '/data/' . self::META_DATA_FILE_PREFIX;
44
+
45
+ // Initialise PhoneNumberUtil to make sure regex's are setup correctly
46
+ PhoneNumberUtil::getInstance();
47
+ }
48
+
49
+ /**
50
+ * Returns the singleton instance of ShortNumberInfo
51
+ *
52
+ * @return \libphonenumber\ShortNumberInfo
53
+ */
54
+ public static function getInstance()
55
+ {
56
+ if (null === self::$instance) {
57
+ self::$instance = new self(RegexBasedMatcher::create());
58
+ }
59
+
60
+ return self::$instance;
61
+ }
62
+
63
+ public static function resetInstance()
64
+ {
65
+ self::$instance = null;
66
+ }
67
+
68
+ /**
69
+ * Returns a list with teh region codes that match the specific country calling code. For
70
+ * non-geographical country calling codes, the region code 001 is returned. Also, in the case
71
+ * of no region code being found, an empty list is returned.
72
+ *
73
+ * @param int $countryCallingCode
74
+ * @return array
75
+ */
76
+ private function getRegionCodesForCountryCode($countryCallingCode)
77
+ {
78
+ if (!array_key_exists($countryCallingCode, $this->countryCallingCodeToRegionCodeMap)) {
79
+ $regionCodes = null;
80
+ } else {
81
+ $regionCodes = $this->countryCallingCodeToRegionCodeMap[$countryCallingCode];
82
+ }
83
+
84
+ return ($regionCodes === null) ? array() : $regionCodes;
85
+ }
86
+
87
+ /**
88
+ * Helper method to check that the country calling code of the number matches the region it's
89
+ * being dialed from.
90
+ * @param PhoneNumber $number
91
+ * @param string $regionDialingFrom
92
+ * @return bool
93
+ */
94
+ private function regionDialingFromMatchesNumber(PhoneNumber $number, $regionDialingFrom)
95
+ {
96
+ $regionCodes = $this->getRegionCodesForCountryCode($number->getCountryCode());
97
+
98
+ return in_array($regionDialingFrom, $regionCodes);
99
+ }
100
+
101
+ public function getSupportedRegions()
102
+ {
103
+ return ShortNumbersRegionCodeSet::$shortNumbersRegionCodeSet;
104
+ }
105
+
106
+ /**
107
+ * Gets a valid short number for the specified region.
108
+ *
109
+ * @param $regionCode String the region for which an example short number is needed
110
+ * @return string a valid short number for the specified region. Returns an empty string when the
111
+ * metadata does not contain such information.
112
+ */
113
+ public function getExampleShortNumber($regionCode)
114
+ {
115
+ $phoneMetadata = $this->getMetadataForRegion($regionCode);
116
+ if ($phoneMetadata === null) {
117
+ return "";
118
+ }
119
+
120
+ /** @var PhoneNumberDesc $desc */
121
+ $desc = $phoneMetadata->getShortCode();
122
+ if ($desc !== null && $desc->hasExampleNumber()) {
123
+ return $desc->getExampleNumber();
124
+ }
125
+ return "";
126
+ }
127
+
128
+ /**
129
+ * @param $regionCode
130
+ * @return PhoneMetadata|null
131
+ */
132
+ public function getMetadataForRegion($regionCode)
133
+ {
134
+ if (!in_array($regionCode, ShortNumbersRegionCodeSet::$shortNumbersRegionCodeSet)) {
135
+ return null;
136
+ }
137
+
138
+ if (!isset($this->regionToMetadataMap[$regionCode])) {
139
+ // The regionCode here will be valid and won't be '001', so we don't need to worry about
140
+ // what to pass in for the country calling code.
141
+ $this->loadMetadataFromFile($this->currentFilePrefix, $regionCode, 0);
142
+ }
143
+
144
+ return isset($this->regionToMetadataMap[$regionCode]) ? $this->regionToMetadataMap[$regionCode] : null;
145
+ }
146
+
147
+ private function loadMetadataFromFile($filePrefix, $regionCode, $countryCallingCode)
148
+ {
149
+ $isNonGeoRegion = PhoneNumberUtil::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCode;
150
+ $fileName = $filePrefix . '_' . ($isNonGeoRegion ? $countryCallingCode : $regionCode) . '.php';
151
+ if (!is_readable($fileName)) {
152
+ throw new \Exception('missing metadata: ' . $fileName);
153
+ } else {
154
+ $data = include $fileName;
155
+ $metadata = new PhoneMetadata();
156
+ $metadata->fromArray($data);
157
+ if ($isNonGeoRegion) {
158
+ $this->countryCodeToNonGeographicalMetadataMap[$countryCallingCode] = $metadata;
159
+ } else {
160
+ $this->regionToMetadataMap[$regionCode] = $metadata;
161
+ }
162
+ }
163
+ }
164
+
165
+ /**
166
+ * Gets a valid short number for the specified cost category.
167
+ *
168
+ * @param string $regionCode the region for which an example short number is needed
169
+ * @param int $cost the cost category of number that is needed
170
+ * @return string a valid short number for the specified region and cost category. Returns an empty string
171
+ * when the metadata does not contain such information, or the cost is UNKNOWN_COST.
172
+ */
173
+ public function getExampleShortNumberForCost($regionCode, $cost)
174
+ {
175
+ $phoneMetadata = $this->getMetadataForRegion($regionCode);
176
+ if ($phoneMetadata === null) {
177
+ return "";
178
+ }
179
+
180
+ /** @var PhoneNumberDesc $desc */
181
+ $desc = null;
182
+ switch ($cost) {
183
+ case ShortNumberCost::TOLL_FREE:
184
+ $desc = $phoneMetadata->getTollFree();
185
+ break;
186
+ case ShortNumberCost::STANDARD_RATE:
187
+ $desc = $phoneMetadata->getStandardRate();
188
+ break;
189
+ case ShortNumberCost::PREMIUM_RATE:
190
+ $desc = $phoneMetadata->getPremiumRate();
191
+ break;
192
+ default:
193
+ // UNKNOWN_COST numbers are computed by the process of elimination from the other cost categories
194
+ break;
195
+ }
196
+
197
+ if ($desc !== null && $desc->hasExampleNumber()) {
198
+ return $desc->getExampleNumber();
199
+ }
200
+
201
+ return "";
202
+ }
203
+
204
+ /**
205
+ * Returns true if the given number, exactly as dialed, might be used to connect to an emergency
206
+ * service in the given region.
207
+ * <p>
208
+ * This method accepts a string, rather than a PhoneNumber, because it needs to distinguish
209
+ * cases such as "+1 911" and "911", where the former may not connect to an emergency service in
210
+ * all cases but the latter would. This method takes into account cases where the number might
211
+ * contain formatting, or might have additional digits appended (when it is okay to do that in
212
+ * the specified region).
213
+ *
214
+ * @param string $number the phone number to test
215
+ * @param string $regionCode the region where the phone number if being dialled
216
+ * @return boolean whether the number might be used to connect to an emergency service in the given region
217
+ */
218
+ public function connectsToEmergencyNumber($number, $regionCode)
219
+ {
220
+ return $this->matchesEmergencyNumberHelper($number, $regionCode, true /* allows prefix match */);
221
+ }
222
+
223
+ /**
224
+ * @param string $number
225
+ * @param string $regionCode
226
+ * @param bool $allowPrefixMatch
227
+ * @return bool
228
+ */
229
+ private function matchesEmergencyNumberHelper($number, $regionCode, $allowPrefixMatch)
230
+ {
231
+ $number = PhoneNumberUtil::extractPossibleNumber($number);
232
+ $matcher = new Matcher(PhoneNumberUtil::$PLUS_CHARS_PATTERN, $number);
233
+ if ($matcher->lookingAt()) {
234
+ // Returns false if the number starts with a plus sign. We don't believe dialing the country
235
+ // code before emergency numbers (e.g. +1911) works, but later, if that proves to work, we can
236
+ // add additional logic here to handle it.
237
+ return false;
238
+ }
239
+
240
+ $metadata = $this->getMetadataForRegion($regionCode);
241
+ if ($metadata === null || !$metadata->hasEmergency()) {
242
+ return false;
243
+ }
244
+
245
+ $normalizedNumber = PhoneNumberUtil::normalizeDigitsOnly($number);
246
+ $emergencyDesc = $metadata->getEmergency();
247
+
248
+ $allowPrefixMatchForRegion = ($allowPrefixMatch
249
+ && !in_array($regionCode, self::$regionsWhereEmergencyNumbersMustBeExact)
250
+ );
251
+
252
+ return $this->matcherAPI->matchesNationalNumber($normalizedNumber, $emergencyDesc, $allowPrefixMatchForRegion);
253
+ }
254
+
255
+ /**
256
+ * Given a valid short number, determines whether it is carrier-specific (however, nothing is
257
+ * implied about its validity). If it is important that the number is valid, then its validity
258
+ * must first be checked using {@link isValidShortNumber} or
259
+ * {@link #isValidShortNumberForRegion}.
260
+ *
261
+ * @param PhoneNumber $number the valid short number to check
262
+ * @return boolean whether the short number is carrier-specific (assuming the input was a valid short
263
+ * number).
264
+ */
265
+ public function isCarrierSpecific(PhoneNumber $number)
266
+ {
267
+ $regionCodes = $this->getRegionCodesForCountryCode($number->getCountryCode());
268
+ $regionCode = $this->getRegionCodeForShortNumberFromRegionList($number, $regionCodes);
269
+ $nationalNumber = $this->getNationalSignificantNumber($number);
270
+ $phoneMetadata = $this->getMetadataForRegion($regionCode);
271
+
272
+ return ($phoneMetadata !== null) && ($this->matchesPossibleNumberAndNationalNumber(
273
+ $nationalNumber,
274
+ $phoneMetadata->getCarrierSpecific()
275
+ ));
276
+ }
277
+
278
+ /**
279
+ * Helper method to get the region code for a given phone number, from a list of possible region
280
+ * codes. If the list contains more than one region, the first region for which the number is
281
+ * valid is returned.
282
+ *
283
+ * @param PhoneNumber $number
284
+ * @param $regionCodes
285
+ * @return String|null Region Code (or null if none are found)
286
+ */
287
+ private function getRegionCodeForShortNumberFromRegionList(PhoneNumber $number, $regionCodes)
288
+ {
289
+ if (count($regionCodes) == 0) {
290
+ return null;
291
+ } elseif (count($regionCodes) == 1) {
292
+ return $regionCodes[0];
293
+ }
294
+
295
+ $nationalNumber = $this->getNationalSignificantNumber($number);
296
+
297
+ foreach ($regionCodes as $regionCode) {
298
+ $phoneMetadata = $this->getMetadataForRegion($regionCode);
299
+ if ($phoneMetadata !== null
300
+ && $this->matchesPossibleNumberAndNationalNumber($nationalNumber, $phoneMetadata->getShortCode())
301
+ ) {
302
+ // The number is valid for this region.
303
+ return $regionCode;
304
+ }
305
+ }
306
+ return null;
307
+ }
308
+
309
+ /**
310
+ * Check whether a short number is a possible number. If a country calling code is shared by
311
+ * multiple regions, this returns true if it's possible in any of them. This provides a more
312
+ * lenient check than {@link #isValidShortNumber}. See {@link
313
+ * #IsPossibleShortNumberForRegion(PhoneNumber, String)} for details.
314
+ *
315
+ * @param $number PhoneNumber the short number to check
316
+ * @return boolean whether the number is a possible short number
317
+ */
318
+ public function isPossibleShortNumber(PhoneNumber $number)
319
+ {
320
+ $regionCodes = $this->getRegionCodesForCountryCode($number->getCountryCode());
321
+ $shortNumber = $this->getNationalSignificantNumber($number);
322
+
323
+ foreach ($regionCodes as $region) {
324
+ $phoneMetadata = $this->getMetadataForRegion($region);
325
+
326
+ if ($phoneMetadata === null) {
327
+ continue;
328
+ }
329
+
330
+ if ($this->matcherAPI->matchesPossibleNumber($shortNumber, $phoneMetadata->getGeneralDesc())) {
331
+ return true;
332
+ }
333
+ }
334
+
335
+ return false;
336
+ }
337
+
338
+ /**
339
+ * Check whether a short number is a possible number when dialled from a region, given the number
340
+ * in the form of a string, and the region where the number is dialled from. This provides a more
341
+ * lenient check than {@link #isValidShortNumber}.
342
+ *
343
+ * @param PhoneNumber|string $shortNumber The short number to check
344
+ * @param string $regionDialingFrom Region dialing From
345
+ * @return boolean whether the number is a possible short number
346
+ */
347
+ public function isPossibleShortNumberForRegion($shortNumber, $regionDialingFrom)
348
+ {
349
+ if ($shortNumber instanceof PhoneNumber) {
350
+ if (!$this->regionDialingFromMatchesNumber($shortNumber, $regionDialingFrom)) {
351
+ return false;
352
+ }
353
+ }
354
+ $phoneMetadata = $this->getMetadataForRegion($regionDialingFrom);
355
+
356
+ if ($phoneMetadata === null) {
357
+ return false;
358
+ }
359
+
360
+ if ($shortNumber instanceof PhoneNumber) {
361
+ return $this->matcherAPI->matchesPossibleNumber(
362
+ $this->getNationalSignificantNumber($shortNumber),
363
+ $phoneMetadata->getGeneralDesc()
364
+ );
365
+ } else {
366
+ /**
367
+ * @deprecated Anyone who was using it and passing in a string with whitespace (or other
368
+ * formatting characters) would have been getting the wrong result. You should parse
369
+ * the string to PhoneNumber and use the method
370
+ * {@code #isPossibleShortNumberForRegion(PhoneNumber, String)}. This method will be
371
+ * removed in the next release.
372
+ */
373
+
374
+ return $this->matcherAPI->matchesPossibleNumber($shortNumber, $phoneMetadata->getGeneralDesc());
375
+ }
376
+ }
377
+
378
+ /**
379
+ * Tests whether a short number matches a valid pattern. If a country calling code is shared by
380
+ * multiple regions, this returns true if it's valid in any of them. Note that this doesn't verify
381
+ * the number is actually in use, which is impossible to tell by just looking at the number
382
+ * itself. See {@link #isValidShortNumberForRegion(PhoneNumber, String)} for details.
383
+ *
384
+ * @param $number PhoneNumber the short number for which we want to test the validity
385
+ * @return boolean whether the short number matches a valid pattern
386
+ */
387
+ public function isValidShortNumber(PhoneNumber $number)
388
+ {
389
+ $regionCodes = $this->getRegionCodesForCountryCode($number->getCountryCode());
390
+ $regionCode = $this->getRegionCodeForShortNumberFromRegionList($number, $regionCodes);
391
+ if (count($regionCodes) > 1 && $regionCode !== null) {
392
+ // If a matching region had been found for the phone number from among two or more regions,
393
+ // then we have already implicitly verified its validity for that region.
394
+ return true;
395
+ }
396
+
397
+ return $this->isValidShortNumberForRegion($number, $regionCode);
398
+ }
399
+
400
+ /**
401
+ * Tests whether a short number matches a valid pattern in a region. Note that this doesn't verify
402
+ * the number is actually in use, which is impossible to tell by just looking at the number
403
+ * itself.
404
+ *
405
+ * @param PhoneNumber|string $number The Short number for which we want to test the validity
406
+ * @param string $regionDialingFrom the region from which the number is dialed
407
+ * @return boolean whether the short number matches a valid pattern
408
+ */
409
+ public function isValidShortNumberForRegion($number, $regionDialingFrom)
410
+ {
411
+ if ($number instanceof PhoneNumber) {
412
+ if (!$this->regionDialingFromMatchesNumber($number, $regionDialingFrom)) {
413
+ return false;
414
+ }
415
+ }
416
+ $phoneMetadata = $this->getMetadataForRegion($regionDialingFrom);
417
+
418
+ if ($phoneMetadata === null) {
419
+ return false;
420
+ }
421
+
422
+ if ($number instanceof PhoneNumber) {
423
+ $shortNumber = $this->getNationalSignificantNumber($number);
424
+ } else {
425
+ /**
426
+ * @deprecated Anyone who was using it and passing in a string with whitespace (or other
427
+ * formatting characters) would have been getting the wrong result. You should parse
428
+ * the string to PhoneNumber and use the method
429
+ * {@code #isValidShortNumberForRegion(PhoneNumber, String)}. This method will be
430
+ * removed in the next release.
431
+ */
432
+ $shortNumber = $number;
433
+ }
434
+
435
+ $generalDesc = $phoneMetadata->getGeneralDesc();
436
+
437
+ if (!$this->matchesPossibleNumberAndNationalNumber($shortNumber, $generalDesc)) {
438
+ return false;
439
+ }
440
+
441
+ $shortNumberDesc = $phoneMetadata->getShortCode();
442
+
443
+ return $this->matchesPossibleNumberAndNationalNumber($shortNumber, $shortNumberDesc);
444
+ }
445
+
446
+ /**
447
+ * Gets the expected cost category of a short number when dialled from a region (however, nothing is
448
+ * implied about its validity). If it is important that the number is valid, then its validity
449
+ * must first be checked using {@link isValidShortNumberForRegion}. Note that emergency numbers
450
+ * are always considered toll-free.
451
+ * Example usage:
452
+ * <pre>{@code
453
+ * $shortInfo = ShortNumberInfo::getInstance();
454
+ * $shortNumber = "110";
455
+ * $regionCode = "FR";
456
+ * if ($shortInfo->isValidShortNumberForRegion($shortNumber, $regionCode)) {
457
+ * $cost = $shortInfo->getExpectedCostForRegion($shortNumber, $regionCode);
458
+ * // Do something with the cost information here.
459
+ * }}</pre>
460
+ *
461
+ * @param PhoneNumber|string $number the short number for which we want to know the expected cost category,
462
+ * as a string
463
+ * @param string $regionDialingFrom the region from which the number is dialed
464
+ * @return int the expected cost category for that region of the short number. Returns UNKNOWN_COST if
465
+ * the number does not match a cost category. Note that an invalid number may match any cost
466
+ * category.
467
+ */
468
+ public function getExpectedCostForRegion($number, $regionDialingFrom)
469
+ {
470
+ if ($number instanceof PhoneNumber) {
471
+ if (!$this->regionDialingFromMatchesNumber($number, $regionDialingFrom)) {
472
+ return ShortNumberCost::UNKNOWN_COST;
473
+ }
474
+ }
475
+ // Note that regionDialingFrom may be null, in which case phoneMetadata will also be null.
476
+ $phoneMetadata = $this->getMetadataForRegion($regionDialingFrom);
477
+ if ($phoneMetadata === null) {
478
+ return ShortNumberCost::UNKNOWN_COST;
479
+ }
480
+
481
+ if ($number instanceof PhoneNumber) {
482
+ $shortNumber = $this->getNationalSignificantNumber($number);
483
+ } else {
484
+ /**
485
+ * @deprecated Anyone who was using it and passing in a string with whitespace (or other
486
+ * formatting characters) would have been getting the wrong result. You should parse
487
+ * the string to PhoneNumber and use the method
488
+ * {@code #getExpectedCostForRegion(PhoneNumber, String)}. This method will be
489
+ * removed in the next release.
490
+ */
491
+ $shortNumber = $number;
492
+ }
493
+
494
+ // The cost categories are tested in order of decreasing expense, since if for some reason the
495
+ // patterns overlap the most expensive matching cost category should be returned.
496
+ if ($this->matchesPossibleNumberAndNationalNumber($shortNumber, $phoneMetadata->getPremiumRate())) {
497
+ return ShortNumberCost::PREMIUM_RATE;
498
+ }
499
+
500
+ if ($this->matchesPossibleNumberAndNationalNumber($shortNumber, $phoneMetadata->getStandardRate())) {
501
+ return ShortNumberCost::STANDARD_RATE;
502
+ }
503
+
504
+ if ($this->matchesPossibleNumberAndNationalNumber($shortNumber, $phoneMetadata->getTollFree())) {
505
+ return ShortNumberCost::TOLL_FREE;
506
+ }
507
+
508
+ if ($this->isEmergencyNumber($shortNumber, $regionDialingFrom)) {
509
+ // Emergency numbers are implicitly toll-free.
510
+ return ShortNumberCost::TOLL_FREE;
511
+ }
512
+
513
+ return ShortNumberCost::UNKNOWN_COST;
514
+ }
515
+
516
+ /**
517
+ * Gets the expected cost category of a short number (however, nothing is implied about its
518
+ * validity). If the country calling code is unique to a region, this method behaves exactly the
519
+ * same as {@link #getExpectedCostForRegion(PhoneNumber, String)}. However, if the country calling
520
+ * code is shared by multiple regions, then it returns the highest cost in the sequence
521
+ * PREMIUM_RATE, UNKNOWN_COST, STANDARD_RATE, TOLL_FREE. The reason for the position of
522
+ * UNKNOWN_COST in this order is that if a number is UNKNOWN_COST in one region but STANDARD_RATE
523
+ * or TOLL_FREE in another, its expected cost cannot be estimated as one of the latter since it
524
+ * might be a PREMIUM_RATE number.
525
+ *
526
+ * <p>
527
+ * For example, if a number is STANDARD_RATE in the US, but TOLL_FREE in Canada, the expected
528
+ * cost returned by this method will be STANDARD_RATE, since the NANPA countries share the same
529
+ * country calling code.
530
+ * </p>
531
+ *
532
+ * Note: If the region from which the number is dialed is known, it is highly preferable to call
533
+ * {@link #getExpectedCostForRegion(PhoneNumber, String)} instead.
534
+ *
535
+ * @param PhoneNumber $number the short number for which we want to know the expected cost category
536
+ * @return int the highest expected cost category of the short number in the region(s) with the given
537
+ * country calling code
538
+ */
539
+ public function getExpectedCost(PhoneNumber $number)
540
+ {
541
+ $regionCodes = $this->getRegionCodesForCountryCode($number->getCountryCode());
542
+ if (count($regionCodes) == 0) {
543
+ return ShortNumberCost::UNKNOWN_COST;
544
+ }
545
+ if (count($regionCodes) == 1) {
546
+ return $this->getExpectedCostForRegion($number, $regionCodes[0]);
547
+ }
548
+ $cost = ShortNumberCost::TOLL_FREE;
549
+ foreach ($regionCodes as $regionCode) {
550
+ $costForRegion = $this->getExpectedCostForRegion($number, $regionCode);
551
+ switch ($costForRegion) {
552
+ case ShortNumberCost::PREMIUM_RATE:
553
+ return ShortNumberCost::PREMIUM_RATE;
554
+
555
+ case ShortNumberCost::UNKNOWN_COST:
556
+ $cost = ShortNumberCost::UNKNOWN_COST;
557
+ break;
558
+
559
+ case ShortNumberCost::STANDARD_RATE:
560
+ if ($cost != ShortNumberCost::UNKNOWN_COST) {
561
+ $cost = ShortNumberCost::STANDARD_RATE;
562
+ }
563
+ break;
564
+ case ShortNumberCost::TOLL_FREE:
565
+ // Do nothing
566
+ break;
567
+ }
568
+ }
569
+ return $cost;
570
+ }
571
+
572
+ /**
573
+ * Returns true if the given number exactly matches an emergency service number in the given
574
+ * region.
575
+ * <p>
576
+ * This method takes into account cases where the number might contain formatting, but doesn't
577
+ * allow additional digits to be appended. Note that {@code isEmergencyNumber(number, region)}
578
+ * implies {@code connectsToEmergencyNumber(number, region)}.
579
+ *
580
+ * @param string $number the phone number to test
581
+ * @param string $regionCode the region where the phone number is being dialled
582
+ * @return boolean whether the number exactly matches an emergency services number in the given region
583
+ */
584
+ public function isEmergencyNumber($number, $regionCode)
585
+ {
586
+ return $this->matchesEmergencyNumberHelper($number, $regionCode, false /* doesn't allow prefix match */);
587
+ }
588
+
589
+ /**
590
+ * Gets the national significant number of the a phone number. Note a national significant number
591
+ * doesn't contain a national prefix or any formatting.
592
+ * <p>
593
+ * This is a temporary duplicate of the {@code getNationalSignificantNumber} method from
594
+ * {@code PhoneNumberUtil}. Ultimately a canonical static version should exist in a separate
595
+ * utility class (to prevent {@code ShortNumberInfo} needing to depend on PhoneNumberUtil).
596
+ *
597
+ * @param PhoneNumber $number the phone number for which the national significant number is needed
598
+ * @return string the national significant number of the PhoneNumber object passed in
599
+ */
600
+ private function getNationalSignificantNumber(PhoneNumber $number)
601
+ {
602
+ // If leading zero(s) have been set, we prefix this now. Note this is not a national prefix.
603
+ $nationalNumber = '';
604
+ if ($number->isItalianLeadingZero()) {
605
+ $zeros = str_repeat('0', $number->getNumberOfLeadingZeros());
606
+ $nationalNumber .= $zeros;
607
+ }
608
+
609
+ $nationalNumber .= $number->getNationalNumber();
610
+
611
+ return $nationalNumber;
612
+ }
613
+
614
+ /**
615
+ * // TODO: Once we have benchmarked ShortnumberInfo, consider if it is worth keeping
616
+ * this performance optimization, and if so move this into the matcher implementation
617
+ * @param string $number
618
+ * @param PhoneNumberDesc $numberDesc
619
+ * @return bool
620
+ */
621
+ private function matchesPossibleNumberAndNationalNumber($number, PhoneNumberDesc $numberDesc)
622
+ {
623
+ return ($this->matcherAPI->matchesPossibleNumber($number, $numberDesc)
624
+ && $this->matcherAPI->matchesNationalNumber($number, $numberDesc, false));
625
+ }
626
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ShortNumberUtil.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Utility for international short phone numbers, such as short codes and emergency numbers.
4
+ * Note most commercial short numbers are not handled here, but by the PhoneNumberUtil
5
+ *
6
+ * @author Shaopeng Jia
7
+ * @author David Yonge-Mallo
8
+ * @deprecated As of release 5.8, replaced by ShortNumberInfo.
9
+ */
10
+
11
+ namespace libphonenumber;
12
+
13
+ /**
14
+ * Class ShortNumberUtil
15
+ * @package libphonenumber
16
+ * @deprecated As of release 5.8, replaced by ShortNumberInfo.
17
+ */
18
+ class ShortNumberUtil
19
+ {
20
+ /**
21
+ * @var PhoneNumberUtil
22
+ */
23
+ private $phoneUtil;
24
+
25
+ public function __construct(PhoneNumberUtil $phoneNumberUtil = null)
26
+ {
27
+ $this->phoneUtil = $phoneNumberUtil;
28
+ }
29
+
30
+ public function getSupportedRegions()
31
+ {
32
+ return ShortNumberInfo::getInstance($this->phoneUtil)->getSupportedRegions();
33
+ }
34
+
35
+ /**
36
+ * Returns true if the number might be used to connect to an emergency service in the given
37
+ * region.
38
+ *
39
+ * This method takes into account cases where the number might contain formatting, or might have
40
+ * additional digits appended (when it is okay to do that in the region specified).
41
+ *
42
+ * @param $number String the phone number to test
43
+ * @param $regionCode String the region where the phone number is being dialed
44
+ * @return boolean if the number might be used to connect to an emergency service in the given region.
45
+ */
46
+ public function connectsToEmergencyNumber($number, $regionCode)
47
+ {
48
+ return ShortNumberInfo::getInstance($this->phoneUtil)->connectsToEmergencyNumber($number, $regionCode);
49
+ }
50
+
51
+ /**
52
+ * Returns true if the number exactly matches an emergency service number in the given region.
53
+ *
54
+ * This method takes into account cases where the number might contain formatting, but doesn't
55
+ * allow additional digits to be appended.
56
+ *
57
+ * @param $number String The phone number to test
58
+ * @param $regionCode String The region where the phone number is being dialed
59
+ * @return boolean if the number exactly matches an emergency services number in the given region.
60
+ */
61
+ public function isEmergencyNumber($number, $regionCode)
62
+ {
63
+ return ShortNumberInfo::getInstance($this->phoneUtil)->isEmergencyNumber($number, $regionCode);
64
+ }
65
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ShortNumbersRegionCodeSet.php ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link BuildMetadataPHPFromXml}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+
8
+ namespace libphonenumber;
9
+ class ShortNumbersRegionCodeSet {
10
+
11
+ // A set of all region codes for which data is available.
12
+
13
+ public static $shortNumbersRegionCodeSet = array (
14
+ 0 => 'AC',
15
+ 1 => 'AD',
16
+ 2 => 'AE',
17
+ 3 => 'AF',
18
+ 4 => 'AG',
19
+ 5 => 'AI',
20
+ 6 => 'AL',
21
+ 7 => 'AM',
22
+ 8 => 'AO',
23
+ 9 => 'AR',
24
+ 10 => 'AS',
25
+ 11 => 'AT',
26
+ 12 => 'AU',
27
+ 13 => 'AW',
28
+ 14 => 'AX',
29
+ 15 => 'AZ',
30
+ 16 => 'BA',
31
+ 17 => 'BB',
32
+ 18 => 'BD',
33
+ 19 => 'BE',
34
+ 20 => 'BF',
35
+ 21 => 'BG',
36
+ 22 => 'BH',
37
+ 23 => 'BI',
38
+ 24 => 'BJ',
39
+ 25 => 'BL',
40
+ 26 => 'BM',
41
+ 27 => 'BN',
42
+ 28 => 'BO',
43
+ 29 => 'BQ',
44
+ 30 => 'BR',
45
+ 31 => 'BS',
46
+ 32 => 'BT',
47
+ 33 => 'BW',
48
+ 34 => 'BY',
49
+ 35 => 'BZ',
50
+ 36 => 'CA',
51
+ 37 => 'CC',
52
+ 38 => 'CD',
53
+ 39 => 'CF',
54
+ 40 => 'CG',
55
+ 41 => 'CH',
56
+ 42 => 'CI',
57
+ 43 => 'CK',
58
+ 44 => 'CL',
59
+ 45 => 'CM',
60
+ 46 => 'CN',
61
+ 47 => 'CO',
62
+ 48 => 'CR',
63
+ 49 => 'CU',
64
+ 50 => 'CV',
65
+ 51 => 'CW',
66
+ 52 => 'CX',
67
+ 53 => 'CY',
68
+ 54 => 'CZ',
69
+ 55 => 'DE',
70
+ 56 => 'DJ',
71
+ 57 => 'DK',
72
+ 58 => 'DM',
73
+ 59 => 'DO',
74
+ 60 => 'DZ',
75
+ 61 => 'EC',
76
+ 62 => 'EE',
77
+ 63 => 'EG',
78
+ 64 => 'EH',
79
+ 65 => 'ER',
80
+ 66 => 'ES',
81
+ 67 => 'ET',
82
+ 68 => 'FI',
83
+ 69 => 'FJ',
84
+ 70 => 'FK',
85
+ 71 => 'FM',
86
+ 72 => 'FO',
87
+ 73 => 'FR',
88
+ 74 => 'GA',
89
+ 75 => 'GB',
90
+ 76 => 'GD',
91
+ 77 => 'GE',
92
+ 78 => 'GF',
93
+ 79 => 'GG',
94
+ 80 => 'GH',
95
+ 81 => 'GI',
96
+ 82 => 'GL',
97
+ 83 => 'GM',
98
+ 84 => 'GN',
99
+ 85 => 'GP',
100
+ 86 => 'GR',
101
+ 87 => 'GT',
102
+ 88 => 'GU',
103
+ 89 => 'GW',
104
+ 90 => 'GY',
105
+ 91 => 'HK',
106
+ 92 => 'HN',
107
+ 93 => 'HR',
108
+ 94 => 'HT',
109
+ 95 => 'HU',
110
+ 96 => 'ID',
111
+ 97 => 'IE',
112
+ 98 => 'IL',
113
+ 99 => 'IM',
114
+ 100 => 'IN',
115
+ 101 => 'IQ',
116
+ 102 => 'IR',
117
+ 103 => 'IS',
118
+ 104 => 'IT',
119
+ 105 => 'JE',
120
+ 106 => 'JM',
121
+ 107 => 'JO',
122
+ 108 => 'JP',
123
+ 109 => 'KE',
124
+ 110 => 'KG',
125
+ 111 => 'KH',
126
+ 112 => 'KI',
127
+ 113 => 'KM',
128
+ 114 => 'KN',
129
+ 115 => 'KP',
130
+ 116 => 'KR',
131
+ 117 => 'KW',
132
+ 118 => 'KY',
133
+ 119 => 'KZ',
134
+ 120 => 'LA',
135
+ 121 => 'LB',
136
+ 122 => 'LC',
137
+ 123 => 'LI',
138
+ 124 => 'LK',
139
+ 125 => 'LR',
140
+ 126 => 'LS',
141
+ 127 => 'LT',
142
+ 128 => 'LU',
143
+ 129 => 'LV',
144
+ 130 => 'LY',
145
+ 131 => 'MA',
146
+ 132 => 'MC',
147
+ 133 => 'MD',
148
+ 134 => 'ME',
149
+ 135 => 'MF',
150
+ 136 => 'MG',
151
+ 137 => 'MH',
152
+ 138 => 'MK',
153
+ 139 => 'ML',
154
+ 140 => 'MM',
155
+ 141 => 'MN',
156
+ 142 => 'MO',
157
+ 143 => 'MP',
158
+ 144 => 'MQ',
159
+ 145 => 'MR',
160
+ 146 => 'MS',
161
+ 147 => 'MT',
162
+ 148 => 'MU',
163
+ 149 => 'MV',
164
+ 150 => 'MW',
165
+ 151 => 'MX',
166
+ 152 => 'MY',
167
+ 153 => 'MZ',
168
+ 154 => 'NA',
169
+ 155 => 'NC',
170
+ 156 => 'NE',
171
+ 157 => 'NF',
172
+ 158 => 'NG',
173
+ 159 => 'NI',
174
+ 160 => 'NL',
175
+ 161 => 'NO',
176
+ 162 => 'NP',
177
+ 163 => 'NR',
178
+ 164 => 'NU',
179
+ 165 => 'NZ',
180
+ 166 => 'OM',
181
+ 167 => 'PA',
182
+ 168 => 'PE',
183
+ 169 => 'PF',
184
+ 170 => 'PG',
185
+ 171 => 'PH',
186
+ 172 => 'PK',
187
+ 173 => 'PL',
188
+ 174 => 'PM',
189
+ 175 => 'PR',
190
+ 176 => 'PT',
191
+ 177 => 'PW',
192
+ 178 => 'PY',
193
+ 179 => 'QA',
194
+ 180 => 'RE',
195
+ 181 => 'RO',
196
+ 182 => 'RS',
197
+ 183 => 'RU',
198
+ 184 => 'RW',
199
+ 185 => 'SA',
200
+ 186 => 'SB',
201
+ 187 => 'SC',
202
+ 188 => 'SD',
203
+ 189 => 'SE',
204
+ 190 => 'SG',
205
+ 191 => 'SH',
206
+ 192 => 'SI',
207
+ 193 => 'SJ',
208
+ 194 => 'SK',
209
+ 195 => 'SL',
210
+ 196 => 'SM',
211
+ 197 => 'SN',
212
+ 198 => 'SO',
213
+ 199 => 'SR',
214
+ 200 => 'ST',
215
+ 201 => 'SV',
216
+ 202 => 'SX',
217
+ 203 => 'SY',
218
+ 204 => 'SZ',
219
+ 205 => 'TC',
220
+ 206 => 'TD',
221
+ 207 => 'TG',
222
+ 208 => 'TH',
223
+ 209 => 'TJ',
224
+ 210 => 'TL',
225
+ 211 => 'TM',
226
+ 212 => 'TN',
227
+ 213 => 'TO',
228
+ 214 => 'TR',
229
+ 215 => 'TT',
230
+ 216 => 'TV',
231
+ 217 => 'TW',
232
+ 218 => 'TZ',
233
+ 219 => 'UA',
234
+ 220 => 'UG',
235
+ 221 => 'US',
236
+ 222 => 'UY',
237
+ 223 => 'UZ',
238
+ 224 => 'VA',
239
+ 225 => 'VC',
240
+ 226 => 'VE',
241
+ 227 => 'VG',
242
+ 228 => 'VI',
243
+ 229 => 'VN',
244
+ 230 => 'VU',
245
+ 231 => 'WF',
246
+ 232 => 'WS',
247
+ 233 => 'YE',
248
+ 234 => 'YT',
249
+ 235 => 'ZA',
250
+ 236 => 'ZM',
251
+ 237 => 'ZW',
252
+ );
253
+
254
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/ValidationResult.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace libphonenumber;
4
+
5
+ /**
6
+ * Possible outcomes when testing if a PhoneNumber is possible.
7
+ */
8
+ class ValidationResult
9
+ {
10
+ const IS_POSSIBLE = 0;
11
+ const INVALID_COUNTRY_CODE = 1;
12
+ const TOO_SHORT = 2;
13
+ const TOO_LONG = 3;
14
+ }
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/Map.php ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 'ar' =>
9
+ array (
10
+ 0 => 965,
11
+ ),
12
+ 'be' =>
13
+ array (
14
+ 0 => 375,
15
+ ),
16
+ 'en' =>
17
+ array (
18
+ 0 => 1242,
19
+ 1 => 1246,
20
+ 2 => 1264,
21
+ 3 => 1441,
22
+ 4 => 1473,
23
+ 5 => 1649,
24
+ 6 => 1671,
25
+ 7 => 1684,
26
+ 8 => 1758,
27
+ 9 => 1767,
28
+ 10 => 1784,
29
+ 11 => 1787,
30
+ 12 => 1809,
31
+ 13 => 1868,
32
+ 14 => 1869,
33
+ 15 => 1876,
34
+ 16 => 1939,
35
+ 17 => 20,
36
+ 18 => 211,
37
+ 19 => 212,
38
+ 20 => 213,
39
+ 21 => 216,
40
+ 22 => 220,
41
+ 23 => 221,
42
+ 24 => 222,
43
+ 25 => 223,
44
+ 26 => 224,
45
+ 27 => 225,
46
+ 28 => 226,
47
+ 29 => 227,
48
+ 30 => 228,
49
+ 31 => 229,
50
+ 32 => 230,
51
+ 33 => 231,
52
+ 34 => 232,
53
+ 35 => 233,
54
+ 36 => 234,
55
+ 37 => 235,
56
+ 38 => 236,
57
+ 39 => 237,
58
+ 40 => 238,
59
+ 41 => 239,
60
+ 42 => 240,
61
+ 43 => 241,
62
+ 44 => 242,
63
+ 45 => 243,
64
+ 46 => 244,
65
+ 47 => 245,
66
+ 48 => 248,
67
+ 49 => 249,
68
+ 50 => 250,
69
+ 51 => 251,
70
+ 52 => 252,
71
+ 53 => 253,
72
+ 54 => 254,
73
+ 55 => 255,
74
+ 56 => 256,
75
+ 57 => 257,
76
+ 58 => 258,
77
+ 59 => 260,
78
+ 60 => 261,
79
+ 61 => 263,
80
+ 62 => 265,
81
+ 63 => 267,
82
+ 64 => 268,
83
+ 65 => 27,
84
+ 66 => 297,
85
+ 67 => 298,
86
+ 68 => 299,
87
+ 69 => 30,
88
+ 70 => 31,
89
+ 71 => 32,
90
+ 72 => 33,
91
+ 73 => 350,
92
+ 74 => 351,
93
+ 75 => 352,
94
+ 76 => 353,
95
+ 77 => 354,
96
+ 78 => 355,
97
+ 79 => 356,
98
+ 80 => 357,
99
+ 81 => 358,
100
+ 82 => 359,
101
+ 83 => 36,
102
+ 84 => 370,
103
+ 85 => 372,
104
+ 86 => 373,
105
+ 87 => 374,
106
+ 88 => 375,
107
+ 89 => 376,
108
+ 90 => 380,
109
+ 91 => 381,
110
+ 92 => 385,
111
+ 93 => 386,
112
+ 94 => 387,
113
+ 95 => 389,
114
+ 96 => 39,
115
+ 97 => 40,
116
+ 98 => 41,
117
+ 99 => 420,
118
+ 100 => 421,
119
+ 101 => 43,
120
+ 102 => 45,
121
+ 103 => 47,
122
+ 104 => 48,
123
+ 105 => 49,
124
+ 106 => 501,
125
+ 107 => 505,
126
+ 108 => 506,
127
+ 109 => 507,
128
+ 110 => 509,
129
+ 111 => 51,
130
+ 112 => 53,
131
+ 113 => 54,
132
+ 114 => 55,
133
+ 115 => 56,
134
+ 116 => 57,
135
+ 117 => 58,
136
+ 118 => 591,
137
+ 119 => 592,
138
+ 120 => 595,
139
+ 121 => 597,
140
+ 122 => 598,
141
+ 123 => 599,
142
+ 124 => 60,
143
+ 125 => 61,
144
+ 126 => 62,
145
+ 127 => 63,
146
+ 128 => 64,
147
+ 129 => 65,
148
+ 130 => 66,
149
+ 131 => 670,
150
+ 132 => 673,
151
+ 133 => 675,
152
+ 134 => 676,
153
+ 135 => 677,
154
+ 136 => 678,
155
+ 137 => 679,
156
+ 138 => 685,
157
+ 139 => 686,
158
+ 140 => 689,
159
+ 141 => 7,
160
+ 142 => 84,
161
+ 143 => 852,
162
+ 144 => 853,
163
+ 145 => 855,
164
+ 146 => 856,
165
+ 147 => 86130,
166
+ 148 => 86131,
167
+ 149 => 86132,
168
+ 150 => 86133,
169
+ 151 => 86134,
170
+ 152 => 86135,
171
+ 153 => 86136,
172
+ 154 => 86137,
173
+ 155 => 86138,
174
+ 156 => 86139,
175
+ 157 => 86150,
176
+ 158 => 86151,
177
+ 159 => 86153,
178
+ 160 => 86156,
179
+ 161 => 86157,
180
+ 162 => 86158,
181
+ 163 => 86159,
182
+ 164 => 86176,
183
+ 165 => 86177,
184
+ 166 => 86178,
185
+ 167 => 86180,
186
+ 168 => 86185,
187
+ 169 => 86186,
188
+ 170 => 86187,
189
+ 171 => 86188,
190
+ 172 => 86189,
191
+ 173 => 880,
192
+ 174 => 90,
193
+ 175 => 91,
194
+ 176 => 92,
195
+ 177 => 93,
196
+ 178 => 94,
197
+ 179 => 95,
198
+ 180 => 960,
199
+ 181 => 961,
200
+ 182 => 962,
201
+ 183 => 964,
202
+ 184 => 965,
203
+ 185 => 966,
204
+ 186 => 967,
205
+ 187 => 968,
206
+ 188 => 970,
207
+ 189 => 971,
208
+ 190 => 972,
209
+ 191 => 973,
210
+ 192 => 974,
211
+ 193 => 975,
212
+ 194 => 976,
213
+ 195 => 977,
214
+ 196 => 98,
215
+ 197 => 992,
216
+ 198 => 993,
217
+ 199 => 994,
218
+ 200 => 995,
219
+ 201 => 996,
220
+ 202 => 998,
221
+ ),
222
+ 'ru' =>
223
+ array (
224
+ 0 => 375,
225
+ ),
226
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/ar/965.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 9655 => 'فيفا',
9
+ 9656 => 'الوطنية',
10
+ 9659 => 'زين',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/be/375.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 37525 => 'БеСТ',
9
+ 375291 => 'Velcom',
10
+ 375292 => 'МТС',
11
+ 375293 => 'Velcom',
12
+ 375294 => 'БелСел',
13
+ 375295 => 'МТС',
14
+ 375296 => 'Velcom',
15
+ 375297 => 'МТС',
16
+ 375298 => 'МТС',
17
+ 375299 => 'Velcom',
18
+ 37533 => 'МТС',
19
+ 37544 => 'Velcom',
20
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1242.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 124235 => 'BaTelCo',
9
+ 124245 => 'BaTelCo',
10
+ 124255 => 'BaTelCo',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1246.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 124623 => 'LIME',
9
+ 124624 => 'LIME',
10
+ 1246250 => 'LIME',
11
+ 1246251 => 'LIME',
12
+ 1246252 => 'LIME',
13
+ 1246253 => 'LIME',
14
+ 1246254 => 'LIME',
15
+ 1246255 => 'LIME',
16
+ 1246256 => 'Digicel',
17
+ 1246257 => 'Digicel',
18
+ 1246258 => 'Digicel',
19
+ 1246259 => 'Digicel',
20
+ 124626 => 'Digicel',
21
+ 124628 => 'LIME',
22
+ 124645 => 'Sunbeach Communications',
23
+ 124682 => 'Digicel',
24
+ 124683 => 'Digicel',
25
+ 124684 => 'Digicel',
26
+ 124685 => 'Digicel',
27
+ 1246883 => 'Digicel',
28
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1264.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1264536 => 'Weblinks Limited',
9
+ 1264537 => 'Weblinks Limited',
10
+ 1264538 => 'Weblinks Limited',
11
+ 1264539 => 'Weblinks Limited',
12
+ 1264581 => 'Digicel',
13
+ 1264582 => 'Digicel',
14
+ 1264583 => 'Digicel',
15
+ 1264584 => 'Digicel',
16
+ 1264729 => 'Cable & Wireless',
17
+ 1264772 => 'Cable & Wireless',
18
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1441.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 14413 => 'Mobility',
9
+ 1441500 => 'Digicel Bermuda',
10
+ 1441539 => 'Digicel Bermuda',
11
+ 1441590 => 'Digicel Bermuda',
12
+ 1441599 => 'Digicel Bermuda',
13
+ 14417 => 'Cellular One',
14
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1473.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1473402 => 'Affordable Island Communications',
9
+ 147341 => 'Digicel Grenada',
10
+ 1473420 => 'Digicel Grenada',
11
+ 1473520 => 'Affordable Island Communications',
12
+ 1473521 => 'Affordable Island Communications',
13
+ 147353 => 'AWS Grenada',
14
+ 1473901 => 'Affordable Island Communications',
15
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1649.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 164923 => 'C&W',
9
+ 164924 => 'C&W',
10
+ 164933 => 'DIGICEL',
11
+ 164934 => 'DIGICEL',
12
+ 164943 => 'Islandcom',
13
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1671.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1671838 => 'i CAN_GSM',
9
+ 1671848 => 'i CAN_GSM',
10
+ 1671858 => 'i CAN_GSM',
11
+ 1671868 => 'Choice Phone',
12
+ 1671878 => 'Choice Phone',
13
+ 1671888 => 'Choice Phone',
14
+ 1671898 => 'Choice Phone',
15
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1684.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1684252 => 'Blue Sky',
9
+ 1684254 => 'Blue Sky',
10
+ 1684256 => 'Blue Sky',
11
+ 1684258 => 'Blue Sky',
12
+ 1684272 => 'Blue Sky',
13
+ 1684731 => 'ASTCA',
14
+ 1684733 => 'ASTCA',
15
+ 1684770 => 'ASTCA',
16
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1758.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 175828 => 'Cable & Wireless',
9
+ 1758384 => 'Cable & Wireless',
10
+ 1758460 => 'Cable & Wireless',
11
+ 1758461 => 'Cable & Wireless',
12
+ 1758484 => 'Cable & Wireless',
13
+ 1758485 => 'Cable & Wireless',
14
+ 1758486 => 'Cable & Wireless',
15
+ 1758487 => 'Cable & Wireless',
16
+ 1758488 => 'Cable & Wireless',
17
+ 1758489 => 'Cable & Wireless',
18
+ 175851 => 'AT&T',
19
+ 175852 => 'AT&T',
20
+ 1758584 => 'Cable & Wireless',
21
+ 17587 => 'Digicel',
22
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1767.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1767315 => 'Digicel',
9
+ 1767316 => 'Digicel',
10
+ 1767317 => 'Digicel',
11
+ 1767225 => 'Cable & Wireless',
12
+ 1767235 => 'Cable & Wireless',
13
+ 1767245 => 'Cable & Wireless',
14
+ 1767265 => 'Cable & Wireless',
15
+ 1767275 => 'Cable & Wireless',
16
+ 1767276 => 'Cable & Wireless',
17
+ 1767277 => 'Cable & Wireless',
18
+ 1767285 => 'Cable & Wireless',
19
+ 1767295 => 'Cable & Wireless',
20
+ 1767612 => 'Digicel',
21
+ 1767613 => 'Digicel',
22
+ 1767614 => 'Digicel',
23
+ 1767615 => 'Digicel',
24
+ 1767616 => 'Digicel',
25
+ 1767617 => 'Digicel',
26
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1784.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1784430 => 'AT&T',
9
+ 1784431 => 'AT&T',
10
+ 1784432 => 'AT&T',
11
+ 1784433 => 'Digicel',
12
+ 1784434 => 'Digicel',
13
+ 1784454 => 'Cable & Wireless',
14
+ 1784455 => 'Cable & Wireless',
15
+ 1784489 => 'Cable & Wireless',
16
+ 1784490 => 'Cable & Wireless',
17
+ 1784491 => 'Cable & Wireless',
18
+ 1784492 => 'Cable & Wireless',
19
+ 1784493 => 'Cable & Wireless',
20
+ 1784494 => 'Cable & Wireless',
21
+ 1784495 => 'Cable & Wireless',
22
+ 1784526 => 'Digicel',
23
+ 1784527 => 'Digicel',
24
+ 1784528 => 'Digicel',
25
+ 1784529 => 'Digicel',
26
+ 1784530 => 'Digicel',
27
+ 1784531 => 'Digicel',
28
+ 1784532 => 'Digicel',
29
+ 1784533 => 'Digicel',
30
+ 1784534 => 'Digicel',
31
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1787.php ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1787203 => 'Claro',
9
+ 1787210 => 'SunCom Wireless Puerto Rico',
10
+ 1787212 => 'Claro',
11
+ 1787213 => 'Claro',
12
+ 1787214 => 'Claro',
13
+ 1787215 => 'Claro',
14
+ 1787216 => 'Claro',
15
+ 1787217 => 'Claro',
16
+ 1787218 => 'Claro',
17
+ 1787219 => 'Claro',
18
+ 1787220 => 'CENTENNIAL',
19
+ 1787221 => 'CENTENNIAL',
20
+ 1787222 => 'CENTENNIAL',
21
+ 1787223 => 'CENTENNIAL',
22
+ 1787224 => 'CENTENNIAL',
23
+ 1787225 => 'SunCom Wireless Puerto Rico',
24
+ 1787226 => 'SunCom Wireless Puerto Rico',
25
+ 1787227 => 'CENTENNIAL',
26
+ 1787229 => 'CENTENNIAL',
27
+ 1787253 => 'Claro',
28
+ 1787254 => 'Claro',
29
+ 1787255 => 'Claro',
30
+ 1787256 => 'Claro',
31
+ 1787257 => 'Claro',
32
+ 1787258 => 'Claro',
33
+ 1787259 => 'Claro',
34
+ 1787260 => 'Claro',
35
+ 1787291 => 'CENTENNIAL',
36
+ 1787299 => 'SunCom Wireless Puerto Rico',
37
+ 1787300 => 'CENTENNIAL',
38
+ 1787310 => 'SunCom Wireless Puerto Rico',
39
+ 1787312 => 'Claro',
40
+ 1787313 => 'Claro',
41
+ 1787314 => 'Claro',
42
+ 1787315 => 'Claro',
43
+ 1787316 => 'Claro',
44
+ 1787317 => 'Claro',
45
+ 1787318 => 'Claro',
46
+ 17873191 => 'Claro',
47
+ 17873192 => 'Claro',
48
+ 17873193 => 'Claro',
49
+ 17873194 => 'Claro',
50
+ 17873195 => 'Claro',
51
+ 17873196 => 'Claro',
52
+ 17873197 => 'Claro',
53
+ 17873198 => 'Claro',
54
+ 17873199 => 'Claro',
55
+ 1787341 => 'SunCom Wireless Puerto Rico',
56
+ 1787344 => 'SunCom Wireless Puerto Rico',
57
+ 1787346 => 'SunCom Wireless Puerto Rico',
58
+ 1787355 => 'CENTENNIAL',
59
+ 1787357 => 'CENTENNIAL',
60
+ 1787359 => 'SunCom Wireless Puerto Rico',
61
+ 1787367 => 'SunCom Wireless Puerto Rico',
62
+ 1787368 => 'SunCom Wireless Puerto Rico',
63
+ 1787369 => 'CENTENNIAL',
64
+ 1787371 => 'Claro',
65
+ 1787372 => 'Claro',
66
+ 1787374 => 'Claro',
67
+ 1787375 => 'Claro',
68
+ 1787376 => 'Claro',
69
+ 1787380 => 'Claro',
70
+ 1787381 => 'Claro',
71
+ 1787382 => 'Claro',
72
+ 1787383 => 'Claro',
73
+ 1787384 => 'Claro',
74
+ 1787385 => 'Claro',
75
+ 1787389 => 'Claro',
76
+ 1787390 => 'Claro',
77
+ 1787391 => 'Claro',
78
+ 1787392 => 'Claro',
79
+ 1787400 => 'CENTENNIAL',
80
+ 1787410 => 'SunCom Wireless Puerto Rico',
81
+ 1787434 => 'CENTENNIAL',
82
+ 1787447 => 'CENTENNIAL',
83
+ 1787448 => 'CENTENNIAL',
84
+ 1787449 => 'CENTENNIAL',
85
+ 1787450 => 'Claro',
86
+ 1787453 => 'Claro',
87
+ 1787454 => 'SunCom Wireless Puerto Rico',
88
+ 1787458 => 'SunCom Wireless Puerto Rico',
89
+ 1787459 => 'SunCom Wireless Puerto Rico',
90
+ 1787460 => 'SunCom Wireless Puerto Rico',
91
+ 1787462 => 'SunCom Wireless Puerto Rico',
92
+ 1787463 => 'SunCom Wireless Puerto Rico',
93
+ 1787465 => 'CENTENNIAL',
94
+ 1787466 => 'SunCom Wireless Puerto Rico',
95
+ 1787471 => 'CENTENNIAL',
96
+ 1787473 => 'CENTENNIAL',
97
+ 1787474 => 'CENTENNIAL',
98
+ 1787478 => 'SunCom Wireless Puerto Rico',
99
+ 1787479 => 'CENTENNIAL',
100
+ 1787481 => 'Claro',
101
+ 1787484 => 'Claro',
102
+ 1787485 => 'Claro',
103
+ 1787486 => 'Claro',
104
+ 1787487 => 'Claro',
105
+ 1787513 => 'SunCom Wireless Puerto Rico',
106
+ 1787514 => 'Claro',
107
+ 1787515 => 'Claro',
108
+ 1787516 => 'Claro',
109
+ 1787517 => 'Claro',
110
+ 1787518 => 'Claro',
111
+ 1787519 => 'Claro',
112
+ 1787520 => 'CENTENNIAL',
113
+ 1787521 => 'CENTENNIAL',
114
+ 1787522 => 'CENTENNIAL',
115
+ 1787523 => 'CENTENNIAL',
116
+ 1787528 => 'SunCom Wireless Puerto Rico',
117
+ 1787534 => 'CENTENNIAL',
118
+ 1787535 => 'CENTENNIAL',
119
+ 1787537 => 'CENTENNIAL',
120
+ 1787544 => 'CENTENNIAL',
121
+ 1787545 => 'CENTENNIAL',
122
+ 1787546 => 'SunCom Wireless Puerto Rico',
123
+ 1787551 => 'CENTENNIAL',
124
+ 1787553 => 'Claro',
125
+ 1787561 => 'CENTENNIAL',
126
+ 1787563 => 'CENTENNIAL',
127
+ 1787568 => 'SunCom Wireless Puerto Rico',
128
+ 1787569 => 'CENTENNIAL',
129
+ 1787579 => 'Claro',
130
+ 1787580 => 'CENTENNIAL',
131
+ 1787585 => 'CENTENNIAL',
132
+ 1787588 => 'CENTENNIAL',
133
+ 1787589 => 'CENTENNIAL',
134
+ 1787595 => 'SunCom Wireless Puerto Rico',
135
+ 1787597 => 'SunCom Wireless Puerto Rico',
136
+ 1787598 => 'SunCom Wireless Puerto Rico',
137
+ 1787601 => 'SunCom Wireless Puerto Rico',
138
+ 1787602 => 'CENTENNIAL',
139
+ 1787604 => 'SunCom Wireless Puerto Rico',
140
+ 1787605 => 'SunCom Wireless Puerto Rico',
141
+ 1787607 => 'CENTENNIAL',
142
+ 1787608 => 'CENTENNIAL',
143
+ 1787609 => 'CENTENNIAL',
144
+ 1787612 => 'Claro',
145
+ 1787613 => 'Claro',
146
+ 1787614 => 'Claro',
147
+ 1787615 => 'Claro',
148
+ 1787616 => 'Claro',
149
+ 1787617 => 'Claro',
150
+ 1787619 => 'SunCom Wireless Puerto Rico',
151
+ 1787620 => 'CENTENNIAL',
152
+ 1787621 => 'CENTENNIAL',
153
+ 1787622 => 'CENTENNIAL',
154
+ 1787623 => 'CENTENNIAL',
155
+ 1787624 => 'CENTENNIAL',
156
+ 1787625 => 'CENTENNIAL',
157
+ 1787626 => 'CENTENNIAL',
158
+ 1787628 => 'CENTENNIAL',
159
+ 1787629 => 'SunCom Wireless Puerto Rico',
160
+ 178764 => 'CENTENNIAL',
161
+ 178765 => 'CENTENNIAL',
162
+ 1787662 => 'SunCom Wireless Puerto Rico',
163
+ 1787666 => 'SunCom Wireless Puerto Rico',
164
+ 1787673 => 'SunCom Wireless Puerto Rico',
165
+ 1787675 => 'CENTENNIAL',
166
+ 1787678 => 'SunCom Wireless Puerto Rico',
167
+ 1787686 => 'CENTENNIAL',
168
+ 1787687 => 'CENTENNIAL',
169
+ 1787689 => 'CENTENNIAL',
170
+ 1787690 => 'CENTENNIAL',
171
+ 1787692 => 'CENTENNIAL',
172
+ 1787693 => 'CENTENNIAL',
173
+ 1787695 => 'CENTENNIAL',
174
+ 1787717 => 'CENTENNIAL',
175
+ 1787719 => 'CENTENNIAL',
176
+ 1787901 => 'SunCom Wireless Puerto Rico',
177
+ 1787903 => 'CENTENNIAL',
178
+ 1787904 => 'SunCom Wireless Puerto Rico',
179
+ 1787908 => 'CENTENNIAL',
180
+ 1787912 => 'CENTENNIAL',
181
+ 1787915 => 'CENTENNIAL',
182
+ 1787916 => 'CENTENNIAL',
183
+ 1787917 => 'CENTENNIAL',
184
+ 1787922 => 'SunCom Wireless Puerto Rico',
185
+ 1787923 => 'SunCom Wireless Puerto Rico',
186
+ 1787924 => 'CENTENNIAL',
187
+ 1787926 => 'CENTENNIAL',
188
+ 1787927 => 'CENTENNIAL',
189
+ 1787928 => 'CENTENNIAL',
190
+ 1787933 => 'CENTENNIAL',
191
+ 1787935 => 'CENTENNIAL',
192
+ 1787937 => 'CENTENNIAL',
193
+ 1787940 => 'CENTENNIAL',
194
+ 1787947 => 'CENTENNIAL',
195
+ 1787949 => 'SunCom Wireless Puerto Rico',
196
+ 1787952 => 'CENTENNIAL',
197
+ 1787953 => 'CENTENNIAL',
198
+ 1787954 => 'CENTENNIAL',
199
+ 1787957 => 'CENTENNIAL',
200
+ 1787961 => 'CENTENNIAL',
201
+ 1787968 => 'CENTENNIAL',
202
+ 1787969 => 'CENTENNIAL',
203
+ 1787971 => 'CENTENNIAL',
204
+ 1787975 => 'CENTENNIAL',
205
+ 1787978 => 'CENTENNIAL',
206
+ 1787992 => 'CENTENNIAL',
207
+ 1787993 => 'CENTENNIAL',
208
+ 1787998 => 'CENTENNIAL',
209
+ 1787999 => 'CENTENNIAL',
210
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1809.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 180920 => 'Tricom',
9
+ 180922 => 'Claro',
10
+ 180923 => 'Claro',
11
+ 180924 => 'Claro',
12
+ 180925 => 'Claro',
13
+ 180926 => 'Claro',
14
+ 180927 => 'Claro',
15
+ 180928 => 'Claro',
16
+ 180929 => 'Tricom',
17
+ 180930 => 'Viva',
18
+ 180931 => 'Tricom',
19
+ 180932 => 'Tricom',
20
+ 180933 => 'Claro',
21
+ 180934 => 'Tricom',
22
+ 180935 => 'Claro',
23
+ 180936 => 'Claro',
24
+ 180937 => 'Claro',
25
+ 180938 => 'Claro',
26
+ 180939 => 'Claro',
27
+ 180941 => 'Viva',
28
+ 180942 => 'Claro',
29
+ 180943 => 'Viva',
30
+ 180944 => 'Viva',
31
+ 180945 => 'Claro',
32
+ 180947 => 'Tricom',
33
+ 180948 => 'Claro',
34
+ 180949 => 'Claro',
35
+ 180951 => 'Claro',
36
+ 180954 => 'Claro',
37
+ 180960 => 'Claro',
38
+ 180962 => 'Tricom',
39
+ 180963 => 'Tricom',
40
+ 180964 => 'Tricom',
41
+ 180965 => 'Tricom',
42
+ 180967 => 'Claro',
43
+ 180969 => 'Claro',
44
+ 180970 => 'Claro',
45
+ 180971 => 'Claro',
46
+ 180972 => 'Claro',
47
+ 180974 => 'Claro',
48
+ 180975 => 'Claro',
49
+ 180976 => 'Claro',
50
+ 180977 => 'Viva',
51
+ 180978 => 'Claro',
52
+ 180979 => 'Claro',
53
+ 180980 => 'Orange',
54
+ 180981 => 'Viva',
55
+ 180982 => 'Claro',
56
+ 180983 => 'Claro',
57
+ 180984 => 'Orange',
58
+ 180985 => 'Orange',
59
+ 180986 => 'Orange',
60
+ 180987 => 'Tricom',
61
+ 180988 => 'Orange',
62
+ 180989 => 'Orange',
63
+ 180991 => 'Orange',
64
+ 180992 => 'Tricom',
65
+ 180993 => 'Tricom',
66
+ 180994 => 'Tricom',
67
+ 180995 => 'Claro',
68
+ 180997 => 'Orange',
69
+ 180998 => 'Orange',
70
+ 180999 => 'Tricom',
71
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1868.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 186827 => 'Digicel',
9
+ 186828 => 'Digicel',
10
+ 186829 => 'Digicel',
11
+ 18683 => 'Digicel',
12
+ 18684 => 'bmobile',
13
+ 18686 => 'bmobile',
14
+ 18687 => 'bmobile',
15
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1869.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 186955 => 'CariGlobe St. Kitts',
9
+ 186956 => 'The Cable St. Kitts',
10
+ 186966 => 'Cable & Wireless',
11
+ 186976 => 'Digicel',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1876.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 187626 => 'Digicel',
9
+ 1876503 => 'Digicel',
10
+ 1876504 => 'Digicel',
11
+ 1876505 => 'Digicel',
12
+ 1876506 => 'Digicel',
13
+ 1876507 => 'Digicel',
14
+ 1876508 => 'Digicel',
15
+ 1876509 => 'Digicel',
16
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/1939.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 1939201 => 'CENTENNIAL',
9
+ 1939212 => 'CENTENNIAL',
10
+ 1939214 => 'CENTENNIAL',
11
+ 1939240 => 'SunCom Wireless Puerto Rico',
12
+ 19392410 => 'Claro',
13
+ 19392411 => 'Claro',
14
+ 19392412 => 'Claro',
15
+ 19392413 => 'Claro',
16
+ 19392414 => 'Claro',
17
+ 19392415 => 'Claro',
18
+ 19392416 => 'Claro',
19
+ 193924199 => 'Claro',
20
+ 1939242 => 'Claro',
21
+ 19392433 => 'Claro',
22
+ 19392434 => 'Claro',
23
+ 19392435 => 'Claro',
24
+ 19392436 => 'Claro',
25
+ 19392437 => 'Claro',
26
+ 19392438 => 'Claro',
27
+ 19392439 => 'Claro',
28
+ 1939244 => 'Claro',
29
+ 1939245 => 'Claro',
30
+ 1939246 => 'Claro',
31
+ 1939247 => 'Claro',
32
+ 1939248 => 'Claro',
33
+ 1939249 => 'Claro',
34
+ 1939250 => 'Claro',
35
+ 1939251 => 'Claro',
36
+ 1939252 => 'CENTENNIAL',
37
+ 1939253 => 'Claro',
38
+ 1939254 => 'Claro',
39
+ 1939255 => 'Claro',
40
+ 1939256 => 'Claro',
41
+ 1939257 => 'Claro',
42
+ 1939258 => 'Claro',
43
+ 1939259 => 'Claro',
44
+ 1939307 => 'CENTENNIAL',
45
+ 1939325 => 'SunCom Wireless Puerto Rico',
46
+ 1939329 => 'CENTENNIAL',
47
+ 1939334 => 'Claro',
48
+ 1939339 => 'SunCom Wireless Puerto Rico',
49
+ 1939394 => 'CENTENNIAL',
50
+ 1939440 => 'CENTENNIAL',
51
+ 1939628 => 'CENTENNIAL',
52
+ 1939630 => 'CENTENNIAL',
53
+ 1939639 => 'CENTENNIAL',
54
+ 1939640 => 'CENTENNIAL',
55
+ 1939642 => 'CENTENNIAL',
56
+ 1939644 => 'CENTENNIAL',
57
+ 1939645 => 'CENTENNIAL',
58
+ 1939697 => 'CENTENNIAL',
59
+ 1939717 => 'CENTENNIAL',
60
+ 1939731 => 'CENTENNIAL',
61
+ 1939777 => 'Claro',
62
+ 1939865 => 'SunCom Wireless Puerto Rico',
63
+ 1939891 => 'SunCom Wireless Puerto Rico',
64
+ 1939910 => 'CENTENNIAL',
65
+ 1939940 => 'CENTENNIAL',
66
+ 1939969 => 'CENTENNIAL',
67
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/20.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2010 => 'Vodafone',
9
+ 2011 => 'Etisalat',
10
+ 2012 => 'Mobinil',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/211.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 21191 => 'Zain',
9
+ 21192 => 'MTN',
10
+ 21195 => 'Vivacell',
11
+ 21197 => 'Gemtel',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/212.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 212600 => 'Inwi',
9
+ 212601 => 'Inwi',
10
+ 212602 => 'Inwi',
11
+ 212603 => 'Inwi',
12
+ 212604 => 'Inwi',
13
+ 212605 => 'Inwi',
14
+ 212606 => 'Inwi',
15
+ 212607 => 'Inwi',
16
+ 212608 => 'Inwi',
17
+ 212610 => 'Maroc Telecom',
18
+ 212611 => 'Maroc Telecom',
19
+ 212612 => 'Méditel',
20
+ 212613 => 'Maroc Telecom',
21
+ 212614 => 'Méditel',
22
+ 212615 => 'Maroc Telecom',
23
+ 212616 => 'Maroc Telecom',
24
+ 212617 => 'Méditel',
25
+ 212618 => 'Maroc Telecom',
26
+ 212619 => 'Méditel',
27
+ 212620 => 'Méditel',
28
+ 212621 => 'Méditel',
29
+ 212622 => 'Maroc Telecom',
30
+ 212623 => 'Maroc Telecom',
31
+ 212624 => 'Maroc Telecom',
32
+ 212625 => 'Méditel',
33
+ 212626 => 'Inwi',
34
+ 212627 => 'Inwi',
35
+ 212628 => 'Maroc Telecom',
36
+ 212629 => 'Inwi',
37
+ 212630 => 'Inwi',
38
+ 212631 => 'Méditel',
39
+ 212632 => 'Méditel',
40
+ 212633 => 'Inwi',
41
+ 212634 => 'Inwi',
42
+ 212635 => 'Inwi',
43
+ 212636 => 'Maroc Telecom',
44
+ 212637 => 'Maroc Telecom',
45
+ 212638 => 'Inwi',
46
+ 212639 => 'Maroc Telecom',
47
+ 212640 => 'Inwi',
48
+ 212641 => 'Maroc Telecom',
49
+ 212642 => 'Maroc Telecom',
50
+ 212643 => 'Maroc Telecom',
51
+ 212644 => 'Méditel',
52
+ 212645 => 'Méditel',
53
+ 212646 => 'Inwi',
54
+ 212647 => 'Inwi',
55
+ 212648 => 'Maroc Telecom',
56
+ 212649 => 'Méditel',
57
+ 212650 => 'Maroc Telecom',
58
+ 212651 => 'Maroc Telecom',
59
+ 212652 => 'Maroc Telecom',
60
+ 212653 => 'Maroc Telecom',
61
+ 212654 => 'Maroc Telecom',
62
+ 212655 => 'Maroc Telecom',
63
+ 212656 => 'Méditel',
64
+ 212657 => 'Méditel',
65
+ 212658 => 'Maroc Telecom',
66
+ 212659 => 'Maroc Telecom',
67
+ 212660 => 'Méditel',
68
+ 212661 => 'Maroc Telecom',
69
+ 212662 => 'Maroc Telecom',
70
+ 212663 => 'Méditel',
71
+ 212664 => 'Méditel',
72
+ 212665 => 'Méditel',
73
+ 212666 => 'Maroc Telecom',
74
+ 212667 => 'Maroc Telecom',
75
+ 212668 => 'Maroc Telecom',
76
+ 212669 => 'Méditel',
77
+ 212670 => 'Maroc Telecom',
78
+ 212671 => 'Maroc Telecom',
79
+ 212672 => 'Maroc Telecom',
80
+ 212673 => 'Maroc Telecom',
81
+ 212674 => 'Méditel',
82
+ 212675 => 'Méditel',
83
+ 212676 => 'Maroc Telecom',
84
+ 212677 => 'Maroc Telecom',
85
+ 212678 => 'Maroc Telecom',
86
+ 212679 => 'Méditel',
87
+ 212680 => 'Inwi',
88
+ 212681 => 'Inwi',
89
+ 212687 => 'Inwi',
90
+ 212690 => 'Inwi',
91
+ 212691 => 'Inwi',
92
+ 212692 => 'GlobalStar',
93
+ 212694 => 'Méditel',
94
+ 212695 => 'Inwi',
95
+ 212696 => 'Inwi',
96
+ 212697 => 'Maroc Telecom',
97
+ 212698 => 'Inwi',
98
+ 212699 => 'Inwi',
99
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/213.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 21354 => 'Nedjma',
9
+ 21355 => 'Nedjma',
10
+ 21356 => 'Nedjma',
11
+ 2136 => 'Mobilis',
12
+ 21377 => 'Djezzy',
13
+ 21379 => 'Djezzy',
14
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/216.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2162 => 'Ooredoo',
9
+ 21640 => 'Tunisie Telecom',
10
+ 21641 => 'Tunisie Telecom',
11
+ 21642 => 'Tunisie Telecom',
12
+ 21643 => 'Lyca Mobile',
13
+ 21644 => 'Tunisie Telecom',
14
+ 21645 => 'Watany Ettisalat',
15
+ 21646 => 'Ooredoo',
16
+ 2165 => 'Orange',
17
+ 2169 => 'Tunisie Telecom',
18
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/220.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2202 => 'Africell',
9
+ 2203 => 'QCell',
10
+ 2206 => 'Comium',
11
+ 2207 => 'Africell',
12
+ 2209 => 'Gamcel',
13
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/221.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 22170 => 'Expresso',
9
+ 22172 => 'HAYO',
10
+ 22176 => 'Tigo',
11
+ 22177 => 'Orange',
12
+ 22178 => 'Orange',
13
+ 22179 => 'ADIE',
14
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/222.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2222 => 'Chinguitel',
9
+ 2223 => 'Mattel',
10
+ 2224 => 'Mauritel',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/223.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2237 => 'Orange',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/224.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 22460 => 'Sotelgui',
9
+ 22462 => 'Orange',
10
+ 22463 => 'Intercel',
11
+ 22465 => 'Cellcom',
12
+ 22466 => 'Areeba',
13
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/225.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 22501 => 'Moov',
9
+ 22502 => 'Moov',
10
+ 22503 => 'Moov',
11
+ 22504 => 'MTN',
12
+ 22505 => 'MTN',
13
+ 22506 => 'MTN',
14
+ 22507 => 'Orange',
15
+ 22508 => 'Orange',
16
+ 22509 => 'Orange',
17
+ 22540 => 'Moov',
18
+ 22541 => 'Moov',
19
+ 22542 => 'Moov',
20
+ 22543 => 'Moov',
21
+ 22544 => 'MTN',
22
+ 22545 => 'MTN',
23
+ 22546 => 'MTN',
24
+ 22547 => 'Orange',
25
+ 22548 => 'Orange',
26
+ 22549 => 'Orange',
27
+ 22554 => 'MTN',
28
+ 22555 => 'MTN',
29
+ 22556 => 'MTN',
30
+ 22557 => 'Orange',
31
+ 22558 => 'Orange',
32
+ 22559 => 'Orange',
33
+ 22560 => 'GreenN',
34
+ 22561 => 'GreenN',
35
+ 22565 => 'KoZ',
36
+ 22566 => 'KoZ',
37
+ 22567 => 'KoZ',
38
+ 22569 => 'Aircom',
39
+ 22575 => 'MTN',
40
+ 22577 => 'Orange',
41
+ 22578 => 'Orange',
42
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/226.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 22660 => 'Telmob',
9
+ 22661 => 'Telmob',
10
+ 22662 => 'Telmob',
11
+ 22663 => 'Telmob',
12
+ 22664 => 'Airtel',
13
+ 22665 => 'Airtel',
14
+ 22666 => 'Airtel',
15
+ 22667 => 'Airtel',
16
+ 22668 => 'Telecel Faso',
17
+ 22669 => 'Telecel Faso',
18
+ 22670 => 'Telmob',
19
+ 22671 => 'Telmob',
20
+ 22672 => 'Telmob',
21
+ 22673 => 'Telmob',
22
+ 22674 => 'Airtel',
23
+ 22675 => 'Airtel',
24
+ 22676 => 'Airtel',
25
+ 22677 => 'Airtel',
26
+ 22678 => 'Telecel Faso',
27
+ 22679 => 'Telecel Faso',
28
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/227.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 22780 => 'Orange',
9
+ 22788 => 'Airtel',
10
+ 22789 => 'Airtel',
11
+ 22790 => 'Orange',
12
+ 22791 => 'Orange',
13
+ 22792 => 'Orange',
14
+ 22794 => 'Moov',
15
+ 22795 => 'Moov',
16
+ 22796 => 'Airtel',
17
+ 22797 => 'Airtel',
18
+ 22798 => 'Airtel',
19
+ 22799 => 'Airtel',
20
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/228.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 22898 => 'Moov',
9
+ 22899 => 'Moov',
10
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/229.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 22961 => 'MTN',
9
+ 22964 => 'Moov',
10
+ 22966 => 'MTN',
11
+ 22967 => 'MTN',
12
+ 22968 => 'Glo',
13
+ 22990 => 'Libercom',
14
+ 22993 => 'BLK',
15
+ 22994 => 'Moov',
16
+ 22995 => 'Moov',
17
+ 22997 => 'MTN',
18
+ 22998 => 'Glo',
19
+ 22999 => 'Glo',
20
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/230.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 230525 => 'Cellplus',
9
+ 230529 => 'MTML',
10
+ 2305421 => 'Emtel',
11
+ 2305422 => 'Emtel',
12
+ 2305423 => 'Emtel',
13
+ 2305428 => 'Emtel',
14
+ 2305429 => 'Emtel',
15
+ 230544 => 'Emtel',
16
+ 2305471 => 'Mauritius Telecom',
17
+ 2305472 => 'Emtel',
18
+ 2305473 => 'Emtel',
19
+ 2305474 => 'Emtel',
20
+ 2305475 => 'Emtel',
21
+ 2305476 => 'Emtel',
22
+ 2305477 => 'Emtel',
23
+ 2305478 => 'Emtel',
24
+ 2305479 => 'Emtel',
25
+ 230549 => 'Emtel',
26
+ 230570 => 'Cellplus',
27
+ 230571 => 'Emtel',
28
+ 230572 => 'Emtel',
29
+ 230573 => 'Emtel',
30
+ 230574 => 'Emtel',
31
+ 230575 => 'Cellplus',
32
+ 230576 => 'Cellplus',
33
+ 230577 => 'Cellplus',
34
+ 230578 => 'Cellplus',
35
+ 230579 => 'Cellplus',
36
+ 230580 => 'Cellplus',
37
+ 230581 => 'Cellplus',
38
+ 230582 => 'Cellplus',
39
+ 230585 => 'Emtel',
40
+ 230586 => 'MTML',
41
+ 2305871 => 'MTML',
42
+ 2305875 => 'Cellplus',
43
+ 2305876 => 'Cellplus',
44
+ 2305877 => 'Cellplus',
45
+ 2305878 => 'Cellplus',
46
+ 230590 => 'Cellplus',
47
+ 230591 => 'Cellplus',
48
+ 230592 => 'Cellplus',
49
+ 230593 => 'Emtel',
50
+ 230594 => 'Cellplus',
51
+ 230595 => 'MTML',
52
+ 230596 => 'MTML',
53
+ 230597 => 'Emtel',
54
+ 230598 => 'Emtel',
55
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/231.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 23120 => 'LIBTELCO',
9
+ 231330 => 'West Africa Telecom',
10
+ 23133202 => 'Atlantic Reality',
11
+ 2313325 => 'WASSCOM',
12
+ 231555 => 'Novafone',
13
+ 23177 => 'Cellcom',
14
+ 23188 => 'Lonestar Cell',
15
+ 231994 => 'Atlantic Wireless',
16
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/232.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 23221 => 'Sierratel',
9
+ 23225 => 'Sierratel',
10
+ 23230 => 'Africell',
11
+ 23233 => 'Comium',
12
+ 23234 => 'Comium',
13
+ 23235 => 'IPTEL',
14
+ 23240 => 'Datatel/Cellcom',
15
+ 23244 => 'Intergroup',
16
+ 23250 => 'Datatel/Cellcom',
17
+ 23255 => 'AFCOM',
18
+ 23266 => 'Onlime',
19
+ 23276 => 'Airtel',
20
+ 23277 => 'Africell',
21
+ 23278 => 'Airtel',
22
+ 23279 => 'Airtel',
23
+ 23288 => 'Africell',
24
+ 23299 => 'Africell',
25
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/233.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 23320 => 'Vodafone',
9
+ 23323 => 'Globacom (Zain)',
10
+ 23324 => 'MTN',
11
+ 23326 => 'Airtel',
12
+ 23327 => 'tiGO',
13
+ 23328 => 'Expresso',
14
+ 23350 => 'Vodafone',
15
+ 233553 => 'MTN',
16
+ 233554 => 'MTN',
17
+ 233555 => 'MTN',
18
+ 233556 => 'MTN',
19
+ 233560 => 'Airtel',
20
+ 233561 => 'Airtel',
21
+ 23357 => 'tiGO',
22
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/234.php ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 234173 => 'Starcomms',
9
+ 234174 => 'Starcomms',
10
+ 2341804 => 'Starcomms',
11
+ 234181 => 'Starcomms',
12
+ 234182 => 'Starcomms',
13
+ 234184 => 'Starcomms',
14
+ 234185 => 'Starcomms',
15
+ 234187 => 'Starcomms',
16
+ 2341880 => 'Starcomms',
17
+ 2341881 => 'Starcomms',
18
+ 2341882 => 'Starcomms',
19
+ 2341883 => 'Starcomms',
20
+ 234189 => 'Starcomms',
21
+ 234195 => 'Starcomms',
22
+ 2342870 => 'Starcomms',
23
+ 2342871 => 'Starcomms',
24
+ 2342872 => 'Starcomms',
25
+ 2342873 => 'Starcomms',
26
+ 2342874 => 'Starcomms',
27
+ 2342875 => 'Starcomms',
28
+ 2342876 => 'Starcomms',
29
+ 2342877 => 'Starcomms',
30
+ 2343181 => 'Starcomms',
31
+ 2343182 => 'Starcomms',
32
+ 2343183 => 'Starcomms',
33
+ 2343184 => 'Starcomms',
34
+ 2343185 => 'Starcomms',
35
+ 2343186 => 'Starcomms',
36
+ 2343187 => 'Starcomms',
37
+ 2343188 => 'Starcomms',
38
+ 2343880 => 'Starcomms',
39
+ 2343881 => 'Starcomms',
40
+ 2343882 => 'Starcomms',
41
+ 2343883 => 'Starcomms',
42
+ 2343884 => 'Starcomms',
43
+ 2343885 => 'Starcomms',
44
+ 2343886 => 'Starcomms',
45
+ 2343887 => 'Starcomms',
46
+ 2343961 => 'Starcomms',
47
+ 2343962 => 'Starcomms',
48
+ 2343963 => 'Starcomms',
49
+ 2343964 => 'Starcomms',
50
+ 2343965 => 'Starcomms',
51
+ 2343985 => 'Starcomms',
52
+ 2343986 => 'Starcomms',
53
+ 2343987 => 'Starcomms',
54
+ 2343988 => 'Starcomms',
55
+ 2343989 => 'Starcomms',
56
+ 2344280 => 'Starcomms',
57
+ 2344281 => 'Starcomms',
58
+ 2344282 => 'Starcomms',
59
+ 2344671 => 'Starcomms',
60
+ 2344672 => 'Starcomms',
61
+ 2344673 => 'Starcomms',
62
+ 2344674 => 'Starcomms',
63
+ 2344675 => 'Starcomms',
64
+ 2344676 => 'Starcomms',
65
+ 2344677 => 'Starcomms',
66
+ 2344678 => 'Starcomms',
67
+ 2344679 => 'Starcomms',
68
+ 2344680 => 'Starcomms',
69
+ 2344682 => 'Starcomms',
70
+ 2344683 => 'Starcomms',
71
+ 2344684 => 'Starcomms',
72
+ 2344687 => 'Starcomms',
73
+ 2344880 => 'Starcomms',
74
+ 2344881 => 'Starcomms',
75
+ 2344882 => 'Starcomms',
76
+ 2345277 => 'Starcomms',
77
+ 2345278 => 'Starcomms',
78
+ 2345279 => 'Starcomms',
79
+ 234528 => 'Starcomms',
80
+ 2345381 => 'Starcomms',
81
+ 2345382 => 'Starcomms',
82
+ 2345383 => 'Starcomms',
83
+ 2345384 => 'Starcomms',
84
+ 2345385 => 'Starcomms',
85
+ 2345386 => 'Starcomms',
86
+ 2345387 => 'Starcomms',
87
+ 2345389 => 'Starcomms',
88
+ 2345480 => 'Starcomms',
89
+ 2345481 => 'Starcomms',
90
+ 2345482 => 'Starcomms',
91
+ 2345483 => 'Starcomms',
92
+ 2345484 => 'Starcomms',
93
+ 2345485 => 'Starcomms',
94
+ 2345486 => 'Starcomms',
95
+ 2345487 => 'Starcomms',
96
+ 2345684 => 'Starcomms',
97
+ 2345685 => 'Starcomms',
98
+ 2345686 => 'Starcomms',
99
+ 2345687 => 'Starcomms',
100
+ 2346277 => 'Starcomms',
101
+ 2346278 => 'Starcomms',
102
+ 2346279 => 'Starcomms',
103
+ 234628 => 'Starcomms',
104
+ 2346437 => 'Starcomms',
105
+ 2346438 => 'Starcomms',
106
+ 2346439 => 'Starcomms',
107
+ 2346461 => 'Starcomms',
108
+ 2346462 => 'Starcomms',
109
+ 2346469 => 'Starcomms',
110
+ 2346470 => 'Starcomms',
111
+ 2346474 => 'Starcomms',
112
+ 2346475 => 'Starcomms',
113
+ 2346476 => 'Starcomms',
114
+ 2346479 => 'Starcomms',
115
+ 2346481 => 'Starcomms',
116
+ 2346482 => 'Starcomms',
117
+ 2346489 => 'Starcomms',
118
+ 2346491 => 'Starcomms',
119
+ 2346492 => 'Starcomms',
120
+ 2346493 => 'Starcomms',
121
+ 2346494 => 'Starcomms',
122
+ 2346495 => 'Starcomms',
123
+ 2346496 => 'Starcomms',
124
+ 2346497 => 'Starcomms',
125
+ 2346498 => 'Starcomms',
126
+ 2346580 => 'Starcomms',
127
+ 2346581 => 'Starcomms',
128
+ 2346582 => 'Starcomms',
129
+ 2346987 => 'Starcomms',
130
+ 2346988 => 'Starcomms',
131
+ 2346989 => 'Starcomms',
132
+ 2347021 => 'M-Tel',
133
+ 2347022 => 'M-Tel',
134
+ 2347025 => 'Visafone',
135
+ 2347026 => 'Visafone',
136
+ 2347028 => 'Starcomms',
137
+ 2347029 => 'Starcomms',
138
+ 234703 => 'MTN',
139
+ 234704 => 'Visafone',
140
+ 234705 => 'Glo',
141
+ 234706 => 'MTN',
142
+ 234707 => 'Glo',
143
+ 234708 => 'Airtel',
144
+ 2347380 => 'Starcomms',
145
+ 2347381 => 'Starcomms',
146
+ 2347382 => 'Starcomms',
147
+ 2347383 => 'Starcomms',
148
+ 2347384 => 'Starcomms',
149
+ 2347385 => 'Starcomms',
150
+ 2347386 => 'Starcomms',
151
+ 2347387 => 'Starcomms',
152
+ 2347691 => 'Starcomms',
153
+ 2347692 => 'Starcomms',
154
+ 2347693 => 'Starcomms',
155
+ 2347694 => 'Starcomms',
156
+ 2347695 => 'Starcomms',
157
+ 2347696 => 'Starcomms',
158
+ 2347697 => 'Starcomms',
159
+ 2347698 => 'Starcomms',
160
+ 2347782 => 'Starcomms',
161
+ 2347783 => 'Starcomms',
162
+ 2347784 => 'Starcomms',
163
+ 234802 => 'Airtel',
164
+ 234803 => 'MTN',
165
+ 234804 => 'M-Tel',
166
+ 234805 => 'Glo',
167
+ 234806 => 'MTN',
168
+ 234807 => 'Glo',
169
+ 234808 => 'Airtel',
170
+ 234809 => 'Etisalat',
171
+ 234810 => 'MTN',
172
+ 234811 => 'Glo',
173
+ 234812 => 'Airtel',
174
+ 234813 => 'MTN',
175
+ 234814 => 'MTN',
176
+ 234815 => 'Glo',
177
+ 234816 => 'MTN',
178
+ 234817 => 'Etisalat',
179
+ 234818 => 'Etisalat',
180
+ 2348190 => 'Starcomms',
181
+ 2348191 => 'Starcomms',
182
+ 2348283 => 'Starcomms',
183
+ 2348284 => 'Starcomms',
184
+ 2348285 => 'Starcomms',
185
+ 2348286 => 'Starcomms',
186
+ 2348287 => 'Starcomms',
187
+ 2348288 => 'Starcomms',
188
+ 2348380 => 'Starcomms',
189
+ 2348381 => 'Starcomms',
190
+ 2348382 => 'Starcomms',
191
+ 2348421 => 'Starcomms',
192
+ 2348422 => 'Starcomms',
193
+ 2348431 => 'Starcomms',
194
+ 2348434 => 'Starcomms',
195
+ 2348437 => 'Starcomms',
196
+ 2348438 => 'Starcomms',
197
+ 2348439 => 'Starcomms',
198
+ 2348453 => 'Starcomms',
199
+ 2348454 => 'Starcomms',
200
+ 2348456 => 'Starcomms',
201
+ 2348474 => 'Starcomms',
202
+ 2348475 => 'Starcomms',
203
+ 2348476 => 'Starcomms',
204
+ 2348477 => 'Starcomms',
205
+ 2348478 => 'Starcomms',
206
+ 2348479 => 'Starcomms',
207
+ 2348480 => 'Starcomms',
208
+ 2348481 => 'Starcomms',
209
+ 2348484 => 'Starcomms',
210
+ 2348485 => 'Starcomms',
211
+ 2348486 => 'Starcomms',
212
+ 2348488 => 'Starcomms',
213
+ 2348489 => 'Starcomms',
214
+ 2348490 => 'Starcomms',
215
+ 2348581 => 'Starcomms',
216
+ 2348582 => 'Starcomms',
217
+ 2348583 => 'Starcomms',
218
+ 2348584 => 'Starcomms',
219
+ 2348585 => 'Starcomms',
220
+ 2348586 => 'Starcomms',
221
+ 2348587 => 'Starcomms',
222
+ 2348588 => 'Starcomms',
223
+ 2348782 => 'Starcomms',
224
+ 2348783 => 'Starcomms',
225
+ 2348784 => 'Starcomms',
226
+ 2348785 => 'Starcomms',
227
+ 2348786 => 'Starcomms',
228
+ 2348787 => 'Starcomms',
229
+ 2348788 => 'Starcomms',
230
+ 2348789 => 'Starcomms',
231
+ 2348885 => 'Starcomms',
232
+ 2348886 => 'Starcomms',
233
+ 2348887 => 'Starcomms',
234
+ 234902 => 'Airtel',
235
+ 234903 => 'MTN',
236
+ 234905 => 'Glo',
237
+ 234909 => 'Etisalat',
238
+ 234980 => 'Starcomms',
239
+ 234987 => 'Starcomms',
240
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/235.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2356 => 'Airtel',
9
+ 2359 => 'Millicom',
10
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/236.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 23670 => 'TC',
9
+ 23672 => 'Orange',
10
+ 23675 => 'CTP',
11
+ 23677 => 'Nationlink',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/237.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 237650 => 'MTN Cameroon',
9
+ 237651 => 'MTN Cameroon',
10
+ 237652 => 'MTN Cameroon',
11
+ 237653 => 'MTN Cameroon',
12
+ 237654 => 'MTN Cameroon',
13
+ 237655 => 'Orange',
14
+ 237656 => 'Orange',
15
+ 237657 => 'Orange',
16
+ 237658 => 'Orange',
17
+ 237659 => 'Orange',
18
+ 23766 => 'NEXTTEL',
19
+ 23767 => 'MTN Cameroon',
20
+ 23768 => 'MTN Cameroon',
21
+ 23769 => 'Orange',
22
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/238.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 23891 => 'T+',
9
+ 23892 => 'T+',
10
+ 23895 => 'CVMOVEL',
11
+ 23897 => 'CVMOVEL',
12
+ 23898 => 'CVMOVEL',
13
+ 23899 => 'CVMOVEL',
14
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/239.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 23990 => 'Unitel',
9
+ 23998 => 'CSTmovel',
10
+ 23999 => 'CSTmovel',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/240.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2405 => 'Orange GQ',
9
+ 2406 => 'Orange GQ',
10
+ 2407 => 'Orange GQ',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/241.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 24104 => 'Airtel',
9
+ 24105 => 'Moov',
10
+ 24106 => 'Libertis',
11
+ 24107 => 'Airtel',
12
+ 24110 => 'Libertis',
13
+ 24111 => 'Libertis',
14
+ 24120 => 'Libertis',
15
+ 24121 => 'Libertis',
16
+ 24122 => 'Libertis',
17
+ 24123 => 'Libertis',
18
+ 24124 => 'Libertis',
19
+ 24125 => 'Libertis',
20
+ 24126 => 'Libertis',
21
+ 24127 => 'Libertis',
22
+ 2413 => 'Libertis',
23
+ 2414 => 'Airtel',
24
+ 2415 => 'Moov',
25
+ 2416 => 'Libertis',
26
+ 2417 => 'Airtel',
27
+ 24195 => 'Libertis',
28
+ 24197 => 'Libertis',
29
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/242.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 24201 => 'Equateur Telecom',
9
+ 24204 => 'Warid',
10
+ 24205 => 'Celtel',
11
+ 24206 => 'MTN',
12
+ 2428001 => 'Hightech Pro',
13
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/243.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 24380 => 'Supercell',
9
+ 24381 => 'Vodacom',
10
+ 24382 => 'Vodacom',
11
+ 24384 => 'CCT',
12
+ 24388 => 'Yozma Timeturns sprl -YTT',
13
+ 24389 => 'Tigo',
14
+ 24397 => 'Zain',
15
+ 24398 => 'Zain',
16
+ 24399 => 'Zain',
17
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/244.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 24491 => 'Movicel',
9
+ 24492 => 'UNITEL',
10
+ 24493 => 'UNITEL',
11
+ 24494 => 'UNITEL',
12
+ 24499 => 'Movicel',
13
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/245.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 245955 => 'Orange',
9
+ 245966 => 'Spacetel',
10
+ 245969 => 'Spacetel',
11
+ 245977 => 'Guinetel',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/248.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 24825 => 'CWS',
9
+ 24826 => 'CWS',
10
+ 24827 => 'Airtel',
11
+ 24828 => 'Airtel',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/249.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 24991 => 'Zain',
9
+ 24992 => 'MTN',
10
+ 24993 => 'MTN',
11
+ 24995 => 'Network of The World Ltd',
12
+ 24996 => 'Zain',
13
+ 24999 => 'MTN',
14
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/250.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 25073 => 'Airtel',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/251.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 25191 => 'ETH-MTN',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/252.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 25224 => 'Telesom',
9
+ 25228 => 'Nationlink',
10
+ 25262 => 'Somtel',
11
+ 25263 => 'Telesom',
12
+ 25265 => 'Somtel',
13
+ 25266 => 'Somtel',
14
+ 25267 => 'Nationlink',
15
+ 25268 => 'Nationlink',
16
+ 25269 => 'Nationlink',
17
+ 25279 => 'Somtel',
18
+ 252907 => 'Golis Telecom',
19
+ 25292 => 'STG',
20
+ 25293 => 'STG',
21
+ 25294 => 'STG',
22
+ 25295 => 'STG',
23
+ 25296 => 'STG',
24
+ 25297 => 'STG',
25
+ 25298 => 'STG',
26
+ 25299 => 'STG',
27
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/253.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 253776 => 'Evatis',
9
+ 253777 => 'Evatis',
10
+ 253778 => 'Evatis',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/254.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 25470 => 'Safaricom',
9
+ 25471 => 'Safaricom',
10
+ 25472 => 'Safaricom',
11
+ 25473 => 'Airtel',
12
+ 25476 => 'Airtel',
13
+ 254750 => 'Essar',
14
+ 254751 => 'Essar',
15
+ 254752 => 'Essar',
16
+ 254753 => 'Essar',
17
+ 254754 => 'Essar',
18
+ 254755 => 'Essar',
19
+ 254756 => 'Essar',
20
+ 254770 => 'Telkom',
21
+ 254771 => 'Telkom',
22
+ 254772 => 'Telkom',
23
+ 254773 => 'Telkom',
24
+ 254774 => 'Telkom',
25
+ 254775 => 'Telkom',
26
+ 254780 => 'Airtel',
27
+ 254781 => 'Airtel',
28
+ 254782 => 'Airtel',
29
+ 254785 => 'Airtel',
30
+ 254786 => 'Airtel',
31
+ 254787 => 'Airtel',
32
+ 254788 => 'Airtel',
33
+ 254789 => 'Airtel',
34
+ 254790 => 'Safaricom',
35
+ 254791 => 'Safaricom',
36
+ 254792 => 'Safaricom',
37
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/255.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 25562 => 'Viettel',
9
+ 25565 => 'tiGO',
10
+ 25566 => 'SMILE',
11
+ 25567 => 'tiGO',
12
+ 25568 => 'Airtel',
13
+ 25571 => 'tiGO',
14
+ 25573 => 'Tanzania Telecom',
15
+ 25574 => 'Vodacom',
16
+ 25575 => 'Vodacom',
17
+ 25576 => 'Vodacom',
18
+ 25577 => 'Zantel',
19
+ 25578 => 'Airtel',
20
+ 25579 => 'Benson Informatics',
21
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/256.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2562030 => 'Afrimax',
9
+ 25670 => 'Warid',
10
+ 25671 => 'UTL',
11
+ 256720 => 'Smile',
12
+ 256723 => 'Afrimax',
13
+ 256730 => 'K2',
14
+ 25674 => 'Sure Telecom',
15
+ 25675 => 'Airtel',
16
+ 25676 => 'i-Tel',
17
+ 25677 => 'MTN',
18
+ 25678 => 'MTN',
19
+ 25679 => 'Orange',
20
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/257.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 25729 => 'Leo',
9
+ 25761 => 'Viettel',
10
+ 25768 => 'Viettel',
11
+ 25769 => 'Viettel',
12
+ 25771 => 'Leo',
13
+ 25772 => 'Leo',
14
+ 25775 => 'Smart Mobile',
15
+ 25776 => 'Leo',
16
+ 25777 => 'Onatel',
17
+ 25778 => 'Tempo',
18
+ 25779 => 'Leo',
19
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/258.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 25882 => 'mcel',
9
+ 25883 => 'mcel',
10
+ 25884 => 'Vodacom',
11
+ 25887 => 'Movitel',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/260.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 26095 => 'ZAMTEL',
9
+ 26096 => 'MTN',
10
+ 26097 => 'Airtel',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/261.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 26132 => 'Orange',
9
+ 26133 => 'Airtel',
10
+ 26134 => 'Telma',
11
+ 26139 => 'Blueline',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/263.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 26371 => 'Net*One',
9
+ 26373 => 'Telecel',
10
+ 26377 => 'Econet',
11
+ 26378 => 'Econet',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/265.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 26588 => 'TNM',
9
+ 26599 => 'Airtel',
10
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/267.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 26771 => 'Mascom',
9
+ 26772 => 'Orange',
10
+ 26773 => 'BTC Mobile',
11
+ 267740 => 'Mascom',
12
+ 267741 => 'Mascom',
13
+ 267742 => 'Mascom',
14
+ 267743 => 'Orange',
15
+ 267744 => 'Orange',
16
+ 267745 => 'Mascom',
17
+ 267746 => 'Mascom',
18
+ 267747 => 'Mascom',
19
+ 267748 => 'Orange',
20
+ 267749 => 'BTC Mobile',
21
+ 267750 => 'Orange',
22
+ 267751 => 'Orange',
23
+ 267752 => 'Orange',
24
+ 267753 => 'Orange',
25
+ 267754 => 'Mascom',
26
+ 267755 => 'Mascom',
27
+ 267756 => 'Mascom',
28
+ 267757 => 'Orange',
29
+ 267758 => 'BTC Mobile',
30
+ 267759 => 'Mascom',
31
+ 267760 => 'Mascom',
32
+ 267761 => 'Mascom',
33
+ 267762 => 'Mascom',
34
+ 267763 => 'Orange',
35
+ 267764 => 'Orange',
36
+ 267765 => 'Orange',
37
+ 267766 => 'Mascom',
38
+ 267767 => 'Mascom',
39
+ 267768 => 'BTC Mobile',
40
+ 267769 => 'BTC Mobile/Orange',
41
+ 267770 => 'Mascom',
42
+ 267771 => 'Mascom',
43
+ 267774 => 'Orange',
44
+ 267775 => 'Orange',
45
+ 267776 => 'Mascom',
46
+ 267777 => 'Mascom',
47
+ 267778 => 'Mascom',
48
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/268.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2686 => 'Swazi MTN',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/27.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 27603 => 'MTN',
9
+ 27604 => 'MTN',
10
+ 27605 => 'MTN',
11
+ 27606 => 'Vodacom',
12
+ 27607 => 'Vodacom',
13
+ 27608 => 'Vodacom',
14
+ 27609 => 'Vodacom',
15
+ 27610 => 'Cell C',
16
+ 27611 => 'Cell C',
17
+ 27612 => 'Cell C',
18
+ 27613 => 'Cell C',
19
+ 27614 => 'Telkom Mobile',
20
+ 27615 => 'Cell C',
21
+ 27616 => 'Cell C',
22
+ 27617 => 'Cell C',
23
+ 27618 => 'Cell C',
24
+ 27619 => 'Cell C',
25
+ 27620 => 'Cell C',
26
+ 27621 => 'Cell C',
27
+ 27622 => 'Cell C',
28
+ 27623 => 'Cell C',
29
+ 27624 => 'Cell C',
30
+ 27710 => 'MTN',
31
+ 27711 => 'Vodacom',
32
+ 27712 => 'Vodacom',
33
+ 27713 => 'Vodacom',
34
+ 27714 => 'Vodacom',
35
+ 27715 => 'Vodacom',
36
+ 27716 => 'Vodacom',
37
+ 27717 => 'MTN',
38
+ 27718 => 'MTN',
39
+ 27719 => 'MTN',
40
+ 2772 => 'Vodacom',
41
+ 2773 => 'MTN',
42
+ 2774 => 'Cell C',
43
+ 27741 => 'Virgin Mobile',
44
+ 2776 => 'Vodacom',
45
+ 2778 => 'MTN',
46
+ 2779 => 'Vodacom',
47
+ 27810 => 'MTN',
48
+ 27811 => 'Telkom Mobile',
49
+ 27812 => 'Telkom Mobile',
50
+ 27813 => 'Telkom Mobile',
51
+ 27814 => 'Telkom Mobile',
52
+ 27815 => 'Telkom Mobile',
53
+ 27816 => 'WBS Mobile',
54
+ 27817 => 'Telkom Mobile',
55
+ 27818 => 'Vodacom',
56
+ 2782 => 'Vodacom',
57
+ 2783 => 'MTN',
58
+ 2784 => 'Cell C',
59
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/297.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 29756 => 'SETAR',
9
+ 297592 => 'SETAR',
10
+ 297593 => 'SETAR',
11
+ 297594 => 'SETAR',
12
+ 297597 => 'SETAR',
13
+ 297598 => 'SETAR',
14
+ 297660 => 'SETAR',
15
+ 297661 => 'SETAR',
16
+ 297690 => 'SETAR',
17
+ 29773 => 'Digicel',
18
+ 29774 => 'Digicel',
19
+ 297995 => 'SETAR',
20
+ 297996 => 'SETAR',
21
+ 297997 => 'SETAR',
22
+ 297998 => 'SETAR',
23
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/298.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2982 => 'Faroese Telecom',
9
+ 2985 => 'Vodafone',
10
+ 2986 => 'Vodafone',
11
+ 2987 => 'Vodafone',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/299.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 2992 => 'TELE Greenland A/S',
9
+ 2994 => 'TELE Greenland A/S',
10
+ 2995 => 'TELE Greenland A/S',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/30.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 30690 => 'Wind',
9
+ 30693 => 'Wind',
10
+ 30694 => 'Vodafone',
11
+ 30695 => 'Vodafone',
12
+ 30697 => 'Cosmote',
13
+ 30698 => 'Cosmote',
14
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/31.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 31610 => 'KPN',
9
+ 31611 => 'Vodafone Libertel B.V.',
10
+ 31612 => 'KPN',
11
+ 31613 => 'KPN',
12
+ 31614 => 'T-Mobile',
13
+ 31615 => 'Vodafone Libertel B.V.',
14
+ 31616 => 'Telfort',
15
+ 31617 => 'Telfort',
16
+ 31620 => 'KPN',
17
+ 31621 => 'Vodafone Libertel B.V.',
18
+ 31622 => 'KPN',
19
+ 31623 => 'KPN',
20
+ 31624 => 'T-Mobile',
21
+ 31625 => 'Vodafone Libertel B.V.',
22
+ 31626 => 'Telfort',
23
+ 31627 => 'Vodafone Libertel B.V.',
24
+ 31629 => 'Vodafone Libertel B.V.',
25
+ 31630 => 'KPN',
26
+ 31631 => 'Vodafone Libertel B.V.',
27
+ 31633 => 'Telfort',
28
+ 31634 => 'T-Mobile',
29
+ 316351 => 'Intercity Zakelijk',
30
+ 316359 => 'ASPIDER Solutions Nederland B.V.',
31
+ 31636 => 'Tele2',
32
+ 31637 => 'Teleena (MVNE)',
33
+ 31640 => 'Tele2',
34
+ 31641 => 'T-Mobile',
35
+ 31642 => 'T-Mobile',
36
+ 31643 => 'T-Mobile',
37
+ 31644 => 'Telfort',
38
+ 31645 => 'Telfort',
39
+ 31646 => 'Vodafone Libertel B.V.',
40
+ 31647 => 'Telfort',
41
+ 31649 => 'Telfort',
42
+ 31650 => 'Vodafone Libertel B.V.',
43
+ 31651 => 'KPN',
44
+ 31652 => 'Vodafone Libertel B.V.',
45
+ 31653 => 'KPN',
46
+ 31654 => 'Vodafone Libertel B.V.',
47
+ 31655 => 'Vodafone Libertel B.V.',
48
+ 31656 => 'T-Mobile',
49
+ 31657 => 'KPN',
50
+ 31658 => 'Telfort',
51
+ 31659 => 'Vectone Mobile/Delight Mobile',
52
+ 31680 => 'Vodafone Libertel B.V.',
53
+ 31681 => 'T-Mobile',
54
+ 31683 => 'KPN',
55
+ 31684 => 'Lycamobile',
56
+ 31685 => 'Lycamobile',
57
+ 31686 => 'Lycamobile',
58
+ 31687 => 'Lycamobile',
59
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/32.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 32460 => 'Proximus',
9
+ 324618 => 'N.M.B.S.',
10
+ 324630 => 'TISMI BV',
11
+ 324654 => 'Lycamobile',
12
+ 324655 => 'Lycamobile',
13
+ 324656 => 'Lycamobile',
14
+ 324657 => 'Lycamobile',
15
+ 324659 => 'Lycamobile',
16
+ 324660 => 'Lycamobile',
17
+ 324661 => 'Lycamobile',
18
+ 324662 => 'Lycamobile',
19
+ 324663 => 'Lycamobile',
20
+ 324664 => 'Lycamobile',
21
+ 324669 => 'Voxbone SA',
22
+ 324671 => 'Join Experience Belgium',
23
+ 324681 => 'Telenet',
24
+ 324682 => 'Telenet',
25
+ 324683 => 'Telenet',
26
+ 3247 => 'Proximus',
27
+ 3248 => 'BASE',
28
+ 3249 => 'Mobistar',
29
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/33.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 336001 => 'Orange France',
9
+ 336002 => 'SFR',
10
+ 336003 => 'Bouygues',
11
+ 336007 => 'SFR',
12
+ 336008 => 'Orange France',
13
+ 336009 => 'Bouygues',
14
+ 33601 => 'SFR',
15
+ 33603 => 'SFR',
16
+ 336040 => 'SFR',
17
+ 336041 => 'SFR',
18
+ 336044 => 'SFR',
19
+ 336045 => 'SFR',
20
+ 336046 => 'SFR',
21
+ 336047 => 'SFR',
22
+ 336048 => 'SFR',
23
+ 336049 => 'SFR',
24
+ 336050 => 'SFR',
25
+ 336051 => 'SFR',
26
+ 336052 => 'SFR',
27
+ 336053 => 'SFR',
28
+ 336054 => 'SFR',
29
+ 336069 => 'SFR',
30
+ 33607 => 'Orange France',
31
+ 33608 => 'Orange France',
32
+ 33609 => 'SFR',
33
+ 3361 => 'SFR',
34
+ 3362 => 'SFR',
35
+ 33634 => 'SFR',
36
+ 33635 => 'SFR',
37
+ 336360 => 'SFR',
38
+ 336361 => 'SFR',
39
+ 336362 => 'SFR',
40
+ 336363 => 'SFR',
41
+ 336364 => 'SFR',
42
+ 3364166 => 'SFR',
43
+ 3364167 => 'SFR',
44
+ 3364168 => 'SFR',
45
+ 3364169 => 'SFR',
46
+ 33642 => 'Orange France',
47
+ 33643 => 'Orange France',
48
+ 33645 => 'Orange France',
49
+ 33646 => 'SFR',
50
+ 33647 => 'Orange France',
51
+ 33648 => 'Orange France',
52
+ 33650 => 'Bouygues',
53
+ 33653 => 'Bouygues',
54
+ 33654 => 'Orange France',
55
+ 33655 => 'SFR',
56
+ 33658 => 'Bouygues',
57
+ 33659 => 'Bouygues',
58
+ 3366 => 'Bouygues',
59
+ 3367 => 'Orange France',
60
+ 3368 => 'Orange France',
61
+ 33692 => 'Bouygues',
62
+ 33693 => 'Bouygues',
63
+ 33696 => 'Bouygues',
64
+ 33698 => 'Bouygues',
65
+ 33699 => 'Bouygues',
66
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/350.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 35054 => 'GibTel',
9
+ 35056 => 'GibTel',
10
+ 35057 => 'GibTel',
11
+ 35058 => 'GibTel',
12
+ 35062 => 'Shine',
13
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/351.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 35191 => 'Vodafone',
9
+ 351922 => 'TMN',
10
+ 3519240 => 'TMN',
11
+ 3519241 => 'TMN',
12
+ 3519242 => 'TMN',
13
+ 3519243 => 'TMN',
14
+ 3519244 => 'TMN',
15
+ 351925 => 'TMN',
16
+ 351926 => 'TMN',
17
+ 351927 => 'TMN',
18
+ 35193 => 'Optimus',
19
+ 35196 => 'TMN',
20
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/352.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 352621 => 'POST',
9
+ 352628 => 'POST',
10
+ 352661 => 'Orange',
11
+ 352668 => 'Orange',
12
+ 352671 => 'JOIN',
13
+ 352678 => 'JOIN',
14
+ 352691 => 'Tango',
15
+ 352698 => 'Tango',
16
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/353.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 35383 => '3',
9
+ 35385 => 'Meteor',
10
+ 35386 => 'O2',
11
+ 35387 => 'Vodafone',
12
+ 35388 => 'eMobile',
13
+ 35389 => 'Tesco Mobile',
14
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/354.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 354385 => 'Síminn',
9
+ 354388 => 'IMC',
10
+ 354389 => 'IMC',
11
+ 354611 => 'Tal',
12
+ 354612 => 'Tal',
13
+ 354613 => 'Tal',
14
+ 354614 => 'Tal',
15
+ 354615 => 'Vodafone',
16
+ 354616 => 'Vodafone',
17
+ 354617 => 'Vodafone',
18
+ 354618 => 'Vodafone',
19
+ 35462 => 'Vodafone',
20
+ 354630 => 'IMC',
21
+ 354638 => 'Öryggisfjarskipti',
22
+ 354639 => 'Öryggisfjarskipti',
23
+ 354640 => 'Öryggisfjarskipti',
24
+ 354641 => 'Öryggisfjarskipti',
25
+ 354646 => 'IMC',
26
+ 354647 => 'IMC',
27
+ 354649 => 'Vodafone',
28
+ 354650 => 'IMC',
29
+ 354651 => 'IMC',
30
+ 354655 => 'Vodafone',
31
+ 354659 => 'Vodafone',
32
+ 35466 => 'Vodafone',
33
+ 35467 => 'Vodafone',
34
+ 35469 => 'Vodafone',
35
+ 354750 => 'Síminn',
36
+ 354755 => 'Síminn',
37
+ 354757 => 'Vodafone',
38
+ 35476 => 'Nova',
39
+ 35477 => 'Nova',
40
+ 35478 => 'Nova',
41
+ 35482 => 'Vodafone',
42
+ 35483 => 'Síminn',
43
+ 35484 => 'Síminn',
44
+ 35485 => 'Síminn',
45
+ 35486 => 'Síminn',
46
+ 35489 => 'Síminn',
47
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/355.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 35566 => 'Plus Communication',
9
+ 35567 => 'Eagle Mobile',
10
+ 35568 => 'AMC',
11
+ 35569 => 'Vodafone',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/356.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 3567210 => 'GO Mobile',
9
+ 35677 => 'Melita Mobile',
10
+ 35679 => 'GO Mobile',
11
+ 3569210 => 'Vodafone',
12
+ 3569211 => 'Vodafone',
13
+ 3569231 => 'Vodafone',
14
+ 3569696 => 'YOM',
15
+ 3569811 => 'Redtouch Fone',
16
+ 3569812 => 'Redtouch Fone',
17
+ 3569813 => 'Redtouch Fone',
18
+ 3569889 => 'GO Mobile',
19
+ 3569897 => 'Vodafone',
20
+ 35699 => 'Vodafone',
21
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/357.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 357123 => 'Cytamobile-Vodafone',
9
+ 35794 => 'Lemontel',
10
+ 35795 => 'PrimeTel',
11
+ 35796 => 'MTN',
12
+ 35797 => 'Cytamobile-Vodafone',
13
+ 35799 => 'Cytamobile-Vodafone',
14
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/358.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 35841 => 'DNA',
9
+ 35842 => 'Sonera',
10
+ 3584320 => 'DNA',
11
+ 3584321 => 'DNA',
12
+ 358436 => 'TDC',
13
+ 358438 => 'TDC',
14
+ 35844 => 'DNA',
15
+ 358450 => 'Sonera',
16
+ 358451 => 'Elisa',
17
+ 358452 => 'Elisa',
18
+ 358453 => 'Elisa',
19
+ 3584541 => 'Sonera',
20
+ 3584542 => 'Finnet Group / NOKIA OYJ',
21
+ 3584543 => 'Finnet Group / NOKIA OYJ',
22
+ 3584544 => 'Finnet Group / NOKIA OYJ',
23
+ 3584545 => 'Finnet Group / NOKIA OYJ',
24
+ 3584559 => 'Sonera',
25
+ 358456 => 'Elisa',
26
+ 3584570 => 'AMT',
27
+ 3584573 => 'AMT',
28
+ 3584574 => 'DNA',
29
+ 3584575 => 'AMT',
30
+ 3584576 => 'DNA',
31
+ 3584577 => 'DNA',
32
+ 3584578 => 'DNA',
33
+ 3584579 => 'DNA',
34
+ 358458 => 'Elisa',
35
+ 35846 => 'Elisa',
36
+ 3584944 => 'DNA',
37
+ 35850 => 'Elisa',
38
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/359.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 35987 => 'Vivacom',
9
+ 35988 => 'M-Tel',
10
+ 35989 => 'GLOBUL',
11
+ 35998 => 'GLOBUL',
12
+ 359999 => 'MAX',
13
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/36.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 3620 => 'Telenor',
9
+ 3630 => 'T-Mobile',
10
+ 3670 => 'Vodafone',
11
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/370.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 37060 => 'Tele 2',
9
+ 37061 => 'Omnitel',
10
+ 37062 => 'Omnitel',
11
+ 370640 => 'BITĖ',
12
+ 370641 => 'BITĖ',
13
+ 370642 => 'BITĖ',
14
+ 370643 => 'BITĖ',
15
+ 370644 => 'BITĖ',
16
+ 370645 => 'Tele 2',
17
+ 370646 => 'Tele 2',
18
+ 370647 => 'Tele 2',
19
+ 370648 => 'Tele 2',
20
+ 370649 => 'BITĖ',
21
+ 37065 => 'BITĖ',
22
+ 370660 => 'BITĖ',
23
+ 370662 => 'Omnitel',
24
+ 37067 => 'Tele 2',
25
+ 370680 => 'Omnitel',
26
+ 370681 => 'BITĖ',
27
+ 370682 => 'Omnitel',
28
+ 370683 => 'Tele 2',
29
+ 370684 => 'Tele 2',
30
+ 370685 => 'BITĖ',
31
+ 370686 => 'Omnitel',
32
+ 370687 => 'Omnitel',
33
+ 370688 => 'Omnitel',
34
+ 370689 => 'BITĖ',
35
+ 370690 => 'BITĖ',
36
+ 370692 => 'Omnitel',
37
+ 370693 => 'Omnitel',
38
+ 370694 => 'Omnitel',
39
+ 370695 => 'Omnitel',
40
+ 370696 => 'Omnitel',
41
+ 370697 => 'Omnitel',
42
+ 370698 => 'Omnitel',
43
+ 370699 => 'BITĖ',
44
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/372.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 37250 => 'EMT',
9
+ 372519 => 'EMT',
10
+ 37252 => 'EMT',
11
+ 372530 => 'EMT',
12
+ 372533 => 'EMT',
13
+ 372534 => 'EMT',
14
+ 372536 => 'EMT',
15
+ 372537 => 'EMT',
16
+ 372538 => 'EMT',
17
+ 372539 => 'EMT',
18
+ 372545 => 'Elisa',
19
+ 37255 => 'Tele 2',
20
+ 37256 => 'Elisa',
21
+ 372577 => 'Elisa',
22
+ 37258 => 'Tele 2',
23
+ 372590 => 'EMT',
24
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/373.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 373562 => 'IDC',
9
+ 37360 => 'Orange',
10
+ 373610 => 'Orange',
11
+ 373611 => 'Orange',
12
+ 373620 => 'Orange',
13
+ 373621 => 'Orange',
14
+ 373671 => 'Moldtelecom',
15
+ 373672 => 'Moldtelecom',
16
+ 373673 => 'Moldtelecom',
17
+ 373674 => 'Moldtelecom',
18
+ 373675 => 'Moldtelecom',
19
+ 373676 => 'Moldtelecom',
20
+ 3736770 => 'Moldtelecom',
21
+ 3736771 => 'Moldtelecom',
22
+ 3736772 => 'Moldtelecom',
23
+ 3736773 => 'Moldtelecom',
24
+ 3736774 => 'Moldtelecom',
25
+ 37368 => 'Orange',
26
+ 37369 => 'Orange',
27
+ 373760 => 'Moldcell',
28
+ 373774 => 'IDC',
29
+ 373775 => 'IDC',
30
+ 373777 => 'IDC',
31
+ 373778 => 'IDC',
32
+ 373779 => 'IDC',
33
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/374.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 37441 => 'Orange',
9
+ 37443 => 'Beeline',
10
+ 37449 => 'VivaCell-MTS',
11
+ 37455 => 'Orange',
12
+ 37477 => 'VivaCell-MTS',
13
+ 37491 => 'Beeline',
14
+ 37493 => 'VivaCell-MTS',
15
+ 37494 => 'VivaCell-MTS',
16
+ 37495 => 'Orange',
17
+ 37496 => 'Beeline',
18
+ 37498 => 'VivaCell-MTS',
19
+ 37499 => 'Beeline',
20
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/375.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 37525 => 'life:)',
9
+ 375291 => 'Velcom',
10
+ 375292 => 'MTS',
11
+ 375293 => 'Velcom',
12
+ 375294 => 'Belcel',
13
+ 375295 => 'MTS',
14
+ 375296 => 'Velcom',
15
+ 375297 => 'MTS',
16
+ 375298 => 'MTS',
17
+ 375299 => 'Velcom',
18
+ 37533 => 'MTS',
19
+ 37544 => 'Velcom',
20
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/376.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 3763 => 'Mobiland',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/380.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 38050 => 'MTS',
9
+ 38063 => 'Life',
10
+ 38066 => 'MTS',
11
+ 38067 => 'Kyivstar',
12
+ 38068 => 'Kyivstar',
13
+ 38073 => 'Life',
14
+ 38092 => 'PEOPLEnet',
15
+ 38093 => 'Life',
16
+ 38096 => 'Kyivstar',
17
+ 38097 => 'Kyivstar',
18
+ 38098 => 'Kyivstar',
19
+ 38099 => 'MTS',
20
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/381.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 38160 => 'VIP',
9
+ 38161 => 'VIP',
10
+ 38162 => 'Telenor',
11
+ 38163 => 'Telenor',
12
+ 38164 => 'mt:s',
13
+ 38165 => 'mt:s',
14
+ 38166 => 'mt:s',
15
+ 38168 => 'VIP',
16
+ 38169 => 'Telenor',
17
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/385.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 38591 => 'Vip',
9
+ 38592 => 'Vip',
10
+ 38595 => 'Tele2',
11
+ 385976 => 'Bonbon',
12
+ 385977 => 'Bonbon',
13
+ 385979 => 'MultiPlus',
14
+ 38598 => 'T-Mobile',
15
+ 38599 => 'T-Mobile',
16
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/386.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 38630 => 'Si.mobil',
9
+ 38631 => 'Mobitel',
10
+ 38640 => 'Si.mobil',
11
+ 38641 => 'Mobitel',
12
+ 38649 => 'Mobitel',
13
+ 38651 => 'Mobitel',
14
+ 38664 => 'T-2',
15
+ 38670 => 'Tušmobil',
16
+ 38671 => 'Mobitel',
17
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/387.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 38760 => 'BH Mobile',
9
+ 38761 => 'BH Mobile',
10
+ 38762 => 'BH Mobile',
11
+ 38763 => 'HT-ERONET',
12
+ 38765 => 'm:tel',
13
+ 38766 => 'm:tel',
14
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/389.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 38970 => 'T-Mobile',
9
+ 38971 => 'T-Mobile',
10
+ 38972 => 'T-Mobile',
11
+ 389732 => 'Albafone',
12
+ 3897421 => 'Mobik Telekomunikacii',
13
+ 38975 => 'One',
14
+ 38976 => 'One',
15
+ 38977 => 'vip',
16
+ 38978 => 'vip',
17
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/39.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 3932 => 'Wind',
9
+ 3933 => 'TIM',
10
+ 3934 => 'Vodafone',
11
+ 3936 => 'TIM',
12
+ 39370 => 'TIM',
13
+ 39373 => '3 Italia',
14
+ 39377 => 'Vodafone',
15
+ 3938 => 'Wind',
16
+ 3939 => '3 Italia',
17
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/40.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 40701 => 'Lycamobile',
9
+ 4072 => 'Vodafone',
10
+ 4073 => 'Vodafone',
11
+ 4074 => 'Orange',
12
+ 4075 => 'Orange',
13
+ 4076 => 'Cosmote',
14
+ 4077 => 'Digi.Mobil',
15
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/41.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 4176 => 'Sunrise',
9
+ 4177 => 'Tele4u',
10
+ 4178 => 'Salt',
11
+ 4179 => 'Swisscom',
12
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/420.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 420601 => 'O2',
9
+ 420602 => 'O2',
10
+ 420603 => 'T-Mobile',
11
+ 420604 => 'T-Mobile',
12
+ 420605 => 'T-Mobile',
13
+ 420606 => 'O2',
14
+ 420607 => 'O2',
15
+ 420608 => 'Vodafone',
16
+ 42072 => 'O2',
17
+ 42073 => 'T-Mobile',
18
+ 42077 => 'Vodafone',
19
+ 42093 => 'T-Mobile',
20
+ 420962 => 'O2',
21
+ 420963 => 'T-Mobile',
22
+ 420964 => 'T-Mobile',
23
+ 420965 => 'T-Mobile',
24
+ 420966 => 'O2',
25
+ 420967 => 'Vodafone',
26
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/421.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 421901 => 'Telekom',
9
+ 421902 => 'Telekom',
10
+ 421903 => 'Telekom',
11
+ 421904 => 'Telekom',
12
+ 421905 => 'Orange',
13
+ 421906 => 'Orange',
14
+ 421907 => 'Orange',
15
+ 421908 => 'Orange',
16
+ 421910 => 'Telekom',
17
+ 421911 => 'Telekom',
18
+ 421912 => 'Telekom',
19
+ 421914 => 'Telekom',
20
+ 421915 => 'Orange',
21
+ 421916 => 'Orange',
22
+ 421917 => 'Orange',
23
+ 421918 => 'Orange',
24
+ 421919 => 'Orange',
25
+ 421940 => 'O2',
26
+ 421944 => 'O2',
27
+ 421948 => 'O2',
28
+ 421949 => 'O2',
29
+ 421950 => '4ka of SWAN',
30
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/43.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 43650 => 'tele.ring',
9
+ 43660 => 'Hutchison Drei Austria',
10
+ 43664 => 'A1 TA',
11
+ 43676 => 'T-Mobile AT',
12
+ 436770 => 'T-Mobile AT',
13
+ 436771 => 'T-Mobile AT',
14
+ 436772 => 'T-Mobile AT',
15
+ 436778 => 'T-Mobile AT',
16
+ 436779 => 'T-Mobile AT',
17
+ 4368183 => 'Orange AT',
18
+ 43688 => 'Orange AT',
19
+ 43699 => 'Orange AT',
20
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/45.php ADDED
@@ -0,0 +1,593 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 45201 => 'TDC',
9
+ 45202 => 'TDC',
10
+ 45203 => 'TDC',
11
+ 45204 => 'TDC',
12
+ 45205 => 'TDC',
13
+ 45206 => 'Telenor',
14
+ 45207 => 'Telenor',
15
+ 45208 => 'Telenor',
16
+ 45209 => 'Telenor',
17
+ 4521 => 'TDC',
18
+ 4522 => 'Telenor',
19
+ 45231 => 'TDC',
20
+ 45232 => 'TDC',
21
+ 45233 => 'TDC',
22
+ 45234 => 'TDC',
23
+ 45235 => 'TDC',
24
+ 45236 => 'TDC',
25
+ 45237 => 'TDC',
26
+ 45238 => 'TDC',
27
+ 452390 => 'TDC',
28
+ 452391 => 'TDC',
29
+ 452392 => 'TDC',
30
+ 452393 => 'TDC',
31
+ 452394 => 'TDC',
32
+ 452395 => 'Telia',
33
+ 452396 => 'TDC',
34
+ 452397 => 'TDC',
35
+ 452398 => 'TDC',
36
+ 452399 => 'TDC',
37
+ 4524 => 'TDC',
38
+ 45251 => 'Telenor',
39
+ 45252 => 'Telenor',
40
+ 45253 => 'Telenor',
41
+ 45254 => 'Telenor',
42
+ 45255 => 'Telenor',
43
+ 45256 => 'Telenor',
44
+ 45257 => 'Telenor',
45
+ 45258 => 'Telenor',
46
+ 452590 => 'MI Carrier Services',
47
+ 452591 => 'CoolTEL',
48
+ 452592 => 'CoolTEL',
49
+ 452593 => 'Compatel Limited',
50
+ 452594 => 'Firmafon',
51
+ 452595 => 'CoolTEL',
52
+ 452596 => 'Viptel',
53
+ 452597 => '3',
54
+ 4525980 => 'Uni-tel',
55
+ 4525981 => 'MobiWeb Limited',
56
+ 4525982 => 'Jay.net',
57
+ 4525983 => '42 Telecom AB',
58
+ 4525984 => 'CoolTEL',
59
+ 4525985 => '42 Telecom AB',
60
+ 4525986 => '42 Telecom AB',
61
+ 4525987 => 'Netfors Unified Messaging',
62
+ 4525988 => 'CoolTEL',
63
+ 4525989 => 'Ipnordic',
64
+ 452599 => 'Danovation',
65
+ 4526 => 'Telia',
66
+ 4527 => 'Telia',
67
+ 4528 => 'Telia',
68
+ 4529 => 'TDC',
69
+ 4530 => 'TDC',
70
+ 45311 => '3',
71
+ 45312 => '3',
72
+ 453130 => '3',
73
+ 4531310 => '3',
74
+ 4531311 => '3',
75
+ 4531312 => 'MI Carrier Services',
76
+ 4531313 => '3',
77
+ 4531314 => '3',
78
+ 4531315 => '3',
79
+ 4531316 => '3',
80
+ 4531317 => '3',
81
+ 4531318 => '3',
82
+ 4531319 => '3',
83
+ 453132 => '3',
84
+ 453133 => '3',
85
+ 453134 => '3',
86
+ 453135 => '3',
87
+ 453136 => '3',
88
+ 453137 => '3',
89
+ 453138 => '3',
90
+ 453139 => '3',
91
+ 45314 => '3',
92
+ 45315 => '3',
93
+ 45316 => '3',
94
+ 45317 => '3',
95
+ 45318 => 'Lycamobile Denmark Ltd',
96
+ 45319 => 'Telenor',
97
+ 45401 => 'TDC',
98
+ 45402 => 'TDC',
99
+ 45403 => 'TDC',
100
+ 45404 => 'TDC',
101
+ 45405 => 'Telenor',
102
+ 45406 => 'Telenor',
103
+ 45407 => 'Telenor',
104
+ 45408 => 'Telenor',
105
+ 45409 => 'Telenor',
106
+ 45411 => 'Telenor',
107
+ 45412 => 'Telenor',
108
+ 45413 => 'Telenor',
109
+ 45414 => 'Telenor',
110
+ 45415 => 'Telenor',
111
+ 45416 => 'Telenor',
112
+ 45417 => 'Telenor',
113
+ 45418 => 'Telenor',
114
+ 45419 => 'Telenor',
115
+ 45421 => 'Telia',
116
+ 45422 => 'Telia',
117
+ 45423 => 'Telia',
118
+ 45424 => 'BiBoB',
119
+ 45425 => 'BiBoB',
120
+ 454260 => 'BiBoB',
121
+ 454261 => '3',
122
+ 454262 => '3',
123
+ 454263 => '3',
124
+ 454264 => '3',
125
+ 454265 => '3',
126
+ 454266 => '3',
127
+ 454267 => '3',
128
+ 454268 => '3',
129
+ 454269 => '3',
130
+ 454270 => 'BiBoB',
131
+ 454271 => '3',
132
+ 454272 => '3',
133
+ 454273 => '3',
134
+ 454274 => '3',
135
+ 454275 => 'YouSee',
136
+ 454276 => 'Telia',
137
+ 454277 => 'Telia',
138
+ 454278 => 'Telia',
139
+ 454279 => 'Telia',
140
+ 454280 => 'BiBoB',
141
+ 454281 => 'CBB Mobil',
142
+ 454282 => 'Telia',
143
+ 454283 => '3',
144
+ 454284 => 'CBB Mobil',
145
+ 454285 => 'CBB Mobil',
146
+ 454286 => 'Telia',
147
+ 454287 => 'CBB Mobil',
148
+ 454288 => 'CBB Mobil',
149
+ 454289 => 'CBB Mobil',
150
+ 454290 => 'Mundio Mobile',
151
+ 454291 => '3',
152
+ 454292 => '3',
153
+ 454293 => 'CBB Mobil',
154
+ 454294 => '3',
155
+ 454295 => '3',
156
+ 454296 => 'Telia',
157
+ 454297 => 'Telia',
158
+ 454298 => 'Telia',
159
+ 454299 => 'Telia',
160
+ 455015 => 'Lebara Limited',
161
+ 455016 => 'Lebara Limited',
162
+ 455017 => 'Lebara Limited',
163
+ 455018 => 'Lebara Limited',
164
+ 455019 => 'Lebara Limited',
165
+ 45502 => 'Lebara Limited',
166
+ 45503 => 'Lebara Limited',
167
+ 45504 => 'CBB Mobil',
168
+ 45505 => 'CBB Mobil',
169
+ 455060 => 'ipvision',
170
+ 455061 => 'Mach Connectivity',
171
+ 455062 => 'CBB Mobil',
172
+ 455063 => 'Mundio Mobile',
173
+ 455064 => 'Lycamobile Denmark Ltd',
174
+ 455065 => 'Lebara Limited',
175
+ 455066 => 'CBB Mobil',
176
+ 455067 => 'CBB Mobil',
177
+ 455068 => 'CBB Mobil',
178
+ 45507 => 'Telenor',
179
+ 45508 => 'Telenor',
180
+ 45509 => 'Telenor',
181
+ 45511 => 'TDC',
182
+ 45512 => 'TDC',
183
+ 45513 => 'TDC',
184
+ 45514 => 'TDC',
185
+ 45515 => 'TDC',
186
+ 45516 => 'TDC',
187
+ 45517 => 'TDC',
188
+ 455180 => 'TDC',
189
+ 455181 => 'TDC',
190
+ 455182 => 'TDC',
191
+ 455183 => 'TDC',
192
+ 455184 => 'TDC',
193
+ 455185 => 'TDC',
194
+ 455186 => 'TDC',
195
+ 455187 => 'TDC',
196
+ 455188 => 'Telia',
197
+ 455189 => 'Telia',
198
+ 45519 => 'TDC',
199
+ 455210 => 'Firstcom',
200
+ 455211 => '3',
201
+ 455212 => '3',
202
+ 455213 => 'Telia',
203
+ 455214 => 'Telia',
204
+ 455215 => 'Telia',
205
+ 455216 => 'Telia',
206
+ 455217 => 'Telia',
207
+ 455218 => 'Telia',
208
+ 455219 => 'Telia',
209
+ 455220 => 'CoolTEL',
210
+ 455221 => 'Telia',
211
+ 455222 => 'Lebara Limited',
212
+ 455223 => 'Telia',
213
+ 455224 => 'Telia',
214
+ 455225 => 'CBB Mobil',
215
+ 455226 => 'Telia',
216
+ 455227 => 'Telia',
217
+ 455228 => 'Telia',
218
+ 455229 => 'Telia',
219
+ 455230 => 'YouSee',
220
+ 455231 => 'Telia',
221
+ 455232 => 'Telia',
222
+ 455233 => 'CBB Mobil',
223
+ 455234 => 'Telia',
224
+ 455235 => 'Telia',
225
+ 455236 => 'Telia',
226
+ 455237 => 'Telia',
227
+ 455238 => 'Telia',
228
+ 455239 => 'Telia',
229
+ 455240 => 'YouSee',
230
+ 455241 => 'Telia',
231
+ 455242 => 'CBB Mobil',
232
+ 455243 => 'Telia',
233
+ 455244 => 'CBB Mobil',
234
+ 455245 => 'Telia',
235
+ 455246 => 'Telia',
236
+ 455247 => 'Telia',
237
+ 455248 => 'Telia',
238
+ 455249 => 'Telia',
239
+ 455250 => 'YouSee',
240
+ 455251 => 'Jay.net',
241
+ 455252 => 'Lebara Limited',
242
+ 455253 => 'CBB Mobil',
243
+ 455254 => 'SimService',
244
+ 455255 => 'CBB Mobil',
245
+ 455256 => 'SimService',
246
+ 455257 => 'SimService',
247
+ 455258 => 'YouSee',
248
+ 455259 => '42 Telecom AB',
249
+ 455260 => 'Lebara Limited',
250
+ 455261 => 'Lebara Limited',
251
+ 455262 => 'CBB Mobil',
252
+ 455263 => 'Lebara Limited',
253
+ 455264 => 'Lebara Limited',
254
+ 455265 => 'Lebara Limited',
255
+ 455266 => 'CBB Mobil',
256
+ 455267 => 'Lebara Limited',
257
+ 455268 => 'Lebara Limited',
258
+ 455269 => 'Lebara Limited',
259
+ 455270 => 'Lebara Limited',
260
+ 455271 => 'Lebara Limited',
261
+ 455272 => 'Lebara Limited',
262
+ 455273 => 'Lebara Limited',
263
+ 455274 => 'Lebara Limited',
264
+ 455275 => 'Lebara Limited',
265
+ 455276 => 'Lebara Limited',
266
+ 455277 => 'CBB Mobil',
267
+ 455278 => 'Lebara Limited',
268
+ 455279 => 'Lebara Limited',
269
+ 455280 => 'Lebara Limited',
270
+ 455281 => 'Lebara Limited',
271
+ 455282 => 'Lebara Limited',
272
+ 455283 => 'CBB Mobil',
273
+ 455284 => 'CBB Mobil',
274
+ 455285 => 'CBB Mobil',
275
+ 455286 => 'CBB Mobil',
276
+ 455287 => 'CBB Mobil',
277
+ 455288 => 'CBB Mobil',
278
+ 455289 => 'CBB Mobil',
279
+ 455290 => 'Lebara Limited',
280
+ 455291 => 'CBB Mobil',
281
+ 455292 => 'CBB Mobil',
282
+ 455293 => 'CBB Mobil',
283
+ 455294 => 'CBB Mobil',
284
+ 455295 => 'CBB Mobil',
285
+ 455296 => 'CBB Mobil',
286
+ 455297 => 'CBB Mobil',
287
+ 455298 => 'CBB Mobil',
288
+ 455299 => 'CBB Mobil',
289
+ 455310 => 'CBB Mobil',
290
+ 455311 => 'CBB Mobil',
291
+ 455312 => 'CBB Mobil',
292
+ 455313 => 'CBB Mobil',
293
+ 455314 => 'CBB Mobil',
294
+ 455315 => 'CBB Mobil',
295
+ 455316 => 'CBB Mobil',
296
+ 455317 => 'CBB Mobil',
297
+ 455318 => 'CBB Mobil',
298
+ 455319 => 'Telia',
299
+ 45532 => 'Telia',
300
+ 455330 => 'Telia',
301
+ 455331 => 'Telia',
302
+ 455332 => 'Telia',
303
+ 455333 => 'Lebara Limited',
304
+ 455334 => 'Telia',
305
+ 455335 => 'Telia',
306
+ 455336 => 'Telia',
307
+ 455337 => 'Telia',
308
+ 455338 => 'Telia',
309
+ 455339 => 'Telia',
310
+ 45534 => 'Telia',
311
+ 45535 => '3',
312
+ 45536 => '3',
313
+ 45537 => '3',
314
+ 45538 => '3',
315
+ 455390 => 'CBB Mobil',
316
+ 455391 => 'CBB Mobil',
317
+ 455392 => 'CBB Mobil',
318
+ 455393 => 'CBB Mobil',
319
+ 455394 => 'CBB Mobil',
320
+ 455395 => 'CBB Mobil',
321
+ 455396 => 'CBB Mobil',
322
+ 455397 => 'CBB Mobil',
323
+ 455398 => 'NextGen Mobile Ldt T/A CardBoardFish',
324
+ 455399 => 'CBB Mobil',
325
+ 45601 => 'Telia',
326
+ 45602 => 'Telia',
327
+ 45603 => 'Telia',
328
+ 45604 => 'Telia',
329
+ 456050 => 'Telenor',
330
+ 456051 => '3',
331
+ 456052 => '3',
332
+ 456053 => '3',
333
+ 456054 => '3',
334
+ 456055 => '3',
335
+ 456056 => '3',
336
+ 456057 => '3',
337
+ 456058 => '3',
338
+ 456059 => '3',
339
+ 45606 => 'CBB Mobil',
340
+ 45607 => 'CBB Mobil',
341
+ 45608 => 'CBB Mobil',
342
+ 456090 => 'Lebara Limited',
343
+ 456091 => 'Telenor',
344
+ 456092 => 'Telenor',
345
+ 456093 => 'Telenor',
346
+ 456094 => 'Telenor',
347
+ 456095 => 'Telenor',
348
+ 456096 => 'Tripple Track Europe',
349
+ 456097 => 'Tripple Track Europe',
350
+ 456098 => 'Telavox',
351
+ 456099 => 'Mach Connectivity',
352
+ 45611 => 'TDC',
353
+ 45612 => 'TDC',
354
+ 45613 => 'TDC',
355
+ 456140 => 'TDC',
356
+ 456141 => 'TDC',
357
+ 456142 => 'TDC',
358
+ 456143 => 'TDC',
359
+ 456144 => 'TDC',
360
+ 456145 => 'TDC',
361
+ 456146 => 'Telia',
362
+ 456147 => 'TDC',
363
+ 456148 => 'TDC',
364
+ 456149 => 'TDC',
365
+ 45615 => 'TDC',
366
+ 45616 => 'TDC',
367
+ 45617 => 'TDC',
368
+ 45618 => 'Telenor',
369
+ 45619 => 'Telenor',
370
+ 45711 => 'CBB Mobil',
371
+ 45712 => 'CBB Mobil',
372
+ 45713 => 'Lycamobile Denmark Ltd',
373
+ 45714 => 'Lycamobile Denmark Ltd',
374
+ 45715 => 'Lycamobile Denmark Ltd',
375
+ 45716 => 'Lycamobile Denmark Ltd',
376
+ 457170 => 'YouSee',
377
+ 457171 => 'Maxtel.dk',
378
+ 457172 => 'YouSee',
379
+ 457173 => 'CBB Mobil',
380
+ 457175 => 'Telenor',
381
+ 457176 => 'Telenor',
382
+ 457177 => 'TDC',
383
+ 457178 => 'Telenor',
384
+ 457179 => 'Telenor',
385
+ 45718 => 'Lycamobile Denmark Ltd',
386
+ 457190 => 'Phone-IT',
387
+ 457191 => 'Telecom X',
388
+ 457192 => 'Justfone',
389
+ 457193 => 'CBB Mobil',
390
+ 457194 => 'Telenor',
391
+ 457195 => 'Telenor',
392
+ 457196 => 'Mundio Mobile',
393
+ 457197 => 'Mundio Mobile',
394
+ 457198 => 'Mundio Mobile',
395
+ 457199 => 'Firmafon',
396
+ 458110 => 'ipvision',
397
+ 458111 => 'Evercall',
398
+ 458112 => 'CBB Mobil',
399
+ 458113 => 'CBB Mobil',
400
+ 458114 => 'CBB Mobil',
401
+ 458115 => 'CBB Mobil',
402
+ 458116 => 'CBB Mobil',
403
+ 458117 => 'CBB Mobil',
404
+ 458118 => 'CBB Mobil',
405
+ 458119 => 'CBB Mobil',
406
+ 45812 => 'CBB Mobil',
407
+ 458130 => 'CBB Mobil',
408
+ 458131 => 'CBB Mobil',
409
+ 458132 => 'CBB Mobil',
410
+ 458133 => 'CBB Mobil',
411
+ 458134 => 'CBB Mobil',
412
+ 458135 => 'CBB Mobil',
413
+ 458136 => 'CBB Mobil',
414
+ 4581370 => 'Flexonet',
415
+ 4581371 => 'CLX Networks AB',
416
+ 4581372 => 'Interfone International',
417
+ 4581373 => 'M Mobility',
418
+ 458138 => 'Mundio Mobile',
419
+ 458139 => 'Mundio Mobile',
420
+ 458141 => 'Simpl Telecom',
421
+ 458145 => 'Telavox',
422
+ 458146 => 'Mundio Mobile',
423
+ 458147 => 'Mundio Mobile',
424
+ 458148 => 'Mundio Mobile',
425
+ 458149 => 'Mundio Mobile',
426
+ 45815 => 'CBB Mobil',
427
+ 458160 => 'CBB Mobil',
428
+ 458161 => 'YouSee',
429
+ 458162 => 'CBB Mobil',
430
+ 458163 => 'CBB Mobil',
431
+ 458164 => 'CBB Mobil',
432
+ 458165 => 'CBB Mobil',
433
+ 458166 => 'CBB Mobil',
434
+ 458167 => 'CBB Mobil',
435
+ 458168 => 'CBB Mobil',
436
+ 458169 => 'CBB Mobil',
437
+ 458170 => 'CBB Mobil',
438
+ 458171 => 'YouSee',
439
+ 458172 => 'Fullrate',
440
+ 458173 => 'YouSee',
441
+ 458174 => 'YouSee',
442
+ 458175 => 'YouSee',
443
+ 458176 => 'CBB Mobil',
444
+ 458177 => 'ipvision',
445
+ 458178 => 'CBB Mobil',
446
+ 458179 => 'CBB Mobil',
447
+ 458180 => 'ipvision',
448
+ 458181 => 'Maxtel.dk',
449
+ 458182 => 'Polperro',
450
+ 458183 => 'CBB Mobil',
451
+ 458184 => 'CBB Mobil',
452
+ 458185 => 'CBB Mobil',
453
+ 458186 => 'CBB Mobil',
454
+ 458187 => 'CBB Mobil',
455
+ 458188 => 'ipvision',
456
+ 458189 => 'CBB Mobil',
457
+ 458190 => 'Lebara Limited',
458
+ 458191 => 'Lebara Limited',
459
+ 458192 => 'Lebara Limited',
460
+ 458193 => 'Lebara Limited',
461
+ 458194 => 'Lebara Limited',
462
+ 458195 => 'CBB Mobil',
463
+ 458196 => 'CBB Mobil',
464
+ 458197 => 'CBB Mobil',
465
+ 458198 => 'CBB Mobil',
466
+ 458199 => 'Banedanmark',
467
+ 459110 => 'Lebara Limited',
468
+ 459111 => 'Lebara Limited',
469
+ 459112 => 'SimService',
470
+ 459113 => 'SimService',
471
+ 459114 => 'SimService',
472
+ 459115 => 'Companymobile',
473
+ 459116 => 'Companymobile',
474
+ 459117 => 'Companymobile',
475
+ 459118 => 'Companymobile',
476
+ 459119 => 'Lebara Limited',
477
+ 459120 => 'Tismi BV',
478
+ 459121 => 'SimService',
479
+ 459122 => 'Companymobile',
480
+ 459123 => 'Companymobile',
481
+ 459124 => 'Companymobile',
482
+ 459125 => 'Companymobile',
483
+ 459126 => 'Mundio Mobile',
484
+ 459127 => 'Mundio Mobile',
485
+ 459128 => 'Mundio Mobile',
486
+ 459129 => 'Mundio Mobile',
487
+ 459130 => 'MobiWeb Limited',
488
+ 459131 => 'Telenor',
489
+ 459132 => 'Telenor',
490
+ 459133 => 'Telenor',
491
+ 459134 => 'Telenor',
492
+ 459135 => 'Telenor',
493
+ 459136 => 'Telenor',
494
+ 459137 => 'Telenor',
495
+ 459138 => 'Telenor',
496
+ 459139 => 'Telenor',
497
+ 45914 => 'Lycamobile Denmark Ltd',
498
+ 459150 => 'Telenor Connexion AB',
499
+ 459151 => 'Telenor Connexion AB',
500
+ 459152 => 'TDC',
501
+ 459153 => 'TDC',
502
+ 459154 => 'TDC',
503
+ 459155 => 'TDC',
504
+ 459156 => 'TDC',
505
+ 459157 => 'Mundio Mobile',
506
+ 459158 => 'NextGen Mobile Ldt T/A CardBoardFish',
507
+ 459159 => 'SimService',
508
+ 45916 => 'Lycamobile Denmark Ltd',
509
+ 45917 => 'Lycamobile Denmark Ltd',
510
+ 459180 => 'Lebara Limited',
511
+ 459181 => 'Lebara Limited',
512
+ 459182 => 'Lebara Limited',
513
+ 459183 => 'Lebara Limited',
514
+ 459184 => 'Lebara Limited',
515
+ 459185 => 'Lebara Limited',
516
+ 459186 => 'Lebara Limited',
517
+ 459187 => 'Lebara Limited',
518
+ 459188 => 'Lebara Limited',
519
+ 459189 => 'Uni-tel',
520
+ 459190 => 'Interactive digital media GmbH',
521
+ 459191 => 'Maxtel.dk',
522
+ 459192 => 'Lebara Limited',
523
+ 459193 => 'Lebara Limited',
524
+ 459194 => 'Lebara Limited',
525
+ 459195 => 'Lebara Limited',
526
+ 459196 => 'Lebara Limited',
527
+ 459197 => 'Lebara Limited',
528
+ 459198 => 'Lebara Limited',
529
+ 459199 => 'Lebara Limited',
530
+ 459210 => 'Companymobile',
531
+ 459211 => 'Companymobile',
532
+ 459212 => 'Companymobile',
533
+ 459213 => 'Companymobile',
534
+ 459214 => 'Companymobile',
535
+ 459215 => 'Companymobile',
536
+ 459216 => 'Companymobile',
537
+ 459217 => 'Interactive digital media GmbH',
538
+ 459218 => 'Telenor Connexion AB',
539
+ 459219 => 'Telenor Connexion AB',
540
+ 459220 => 'Telenor Connexion AB',
541
+ 459221 => 'SimService',
542
+ 459222 => 'Bolignet-Aarhus F.M.B.A.',
543
+ 459223 => '42 Telecom AB',
544
+ 459224 => 'SimService',
545
+ 459225 => 'Mundio Mobile',
546
+ 459226 => 'Mundio Mobile',
547
+ 459227 => 'Mundio Mobile',
548
+ 459228 => 'Mundio Mobile',
549
+ 459229 => 'Beepsend AB',
550
+ 459243 => 'Companymobile',
551
+ 459244 => 'Ipnordic',
552
+ 459245 => 'Compatel Limited',
553
+ 459246 => 'Telenor Connexion AB',
554
+ 459247 => 'Telenor Connexion AB',
555
+ 459248 => 'Telenor Connexion AB',
556
+ 459249 => 'Telenor Connexion AB',
557
+ 45925 => 'Telenor Connexion AB',
558
+ 45926 => 'Telenor Connexion AB',
559
+ 459270 => 'Ice Danmark',
560
+ 459271 => 'Naka AG',
561
+ 459272 => 'Thyfon',
562
+ 459273 => 'Telenor Connexion AB',
563
+ 459274 => 'Telenor Connexion AB',
564
+ 459275 => 'Telenor Connexion AB',
565
+ 459276 => 'Telenor Connexion AB',
566
+ 459277 => 'Telenor Connexion AB',
567
+ 459278 => 'Telenor Connexion AB',
568
+ 459279 => 'Telenor Connexion AB',
569
+ 459280 => 'Voxbone',
570
+ 459282 => 'Flexfone',
571
+ 459290 => 'Justfone',
572
+ 459292 => 'Mobil Data',
573
+ 459293 => 'SimService',
574
+ 459294 => 'SimService',
575
+ 459295 => 'SimService',
576
+ 459296 => 'SimService',
577
+ 459297 => 'SimService',
578
+ 459298 => 'SimService',
579
+ 459299 => 'ipvision',
580
+ 459310 => 'Justfone',
581
+ 459311 => 'MobiWeb Limited',
582
+ 459312 => 'SimService',
583
+ 459313 => 'SimService',
584
+ 459314 => 'SimService',
585
+ 459315 => 'SimService',
586
+ 459320 => 'Justfone',
587
+ 459330 => 'Justfone',
588
+ 459333 => 'Onoffapp',
589
+ 459339 => 'Uni-tel',
590
+ 459340 => 'Justfone',
591
+ 45935 => 'Telenor',
592
+ 45939 => '3',
593
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/47.php ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 474000 => 'NetCom',
9
+ 474001 => 'NetCom',
10
+ 474010 => 'NetCom',
11
+ 474011 => 'NetCom',
12
+ 474022 => 'Telenor',
13
+ 474028 => 'Telenor',
14
+ 474029 => 'NetCom',
15
+ 474031 => 'NetCom',
16
+ 474032 => 'NetCom',
17
+ 474045 => 'NetCom',
18
+ 474046 => 'NetCom',
19
+ 474047 => 'NetCom',
20
+ 474048 => 'NetCom',
21
+ 474049 => 'NetCom',
22
+ 474055 => 'NetCom',
23
+ 474060 => 'NetCom',
24
+ 474061 => 'NetCom',
25
+ 474062 => 'NetCom',
26
+ 474063 => 'NetCom',
27
+ 474064 => 'NetCom',
28
+ 474077 => 'NetCom',
29
+ 474087 => 'Telenor',
30
+ 474104 => 'NetCom',
31
+ 474106 => 'NetCom',
32
+ 474110 => 'NetCom',
33
+ 474114 => 'NetCom',
34
+ 47412 => 'Tele2',
35
+ 47413 => 'Tele2',
36
+ 47414 => 'Telenor',
37
+ 47415 => 'Telenor',
38
+ 47416 => 'Telenor',
39
+ 47417 => 'Telenor',
40
+ 474184 => 'Telenor',
41
+ 474185 => 'Telenor',
42
+ 474190 => 'NetCom',
43
+ 47452 => 'NetCom',
44
+ 474539 => 'NetCom',
45
+ 47454 => 'NetCom',
46
+ 474550 => 'NetCom',
47
+ 474551 => 'NetCom',
48
+ 474559 => 'NetCom',
49
+ 474560 => 'Telenor',
50
+ 474561 => 'Telenor',
51
+ 474563 => 'NetCom',
52
+ 474566 => 'Telenor',
53
+ 474580 => 'Telenor',
54
+ 474586 => 'NetCom',
55
+ 474621 => 'Telenor',
56
+ 474623 => 'NetCom',
57
+ 474624 => 'Telenor',
58
+ 474625 => 'Telenor',
59
+ 474626 => 'Telenor',
60
+ 474627 => 'Telenor',
61
+ 474634 => 'Telenor',
62
+ 474635 => 'Telenor',
63
+ 474636 => 'Telenor',
64
+ 474637 => 'Telenor',
65
+ 474638 => 'Telenor',
66
+ 474639 => 'Telenor',
67
+ 47464 => 'NetCom',
68
+ 474650 => 'NetCom',
69
+ 474654 => 'NetCom',
70
+ 474660 => 'NetCom',
71
+ 474661 => 'NetCom',
72
+ 474662 => 'NetCom',
73
+ 474663 => 'NetCom',
74
+ 474666 => 'Telenor',
75
+ 474670 => 'NetCom',
76
+ 474673 => 'NetCom',
77
+ 474674 => 'NetCom',
78
+ 474675 => 'NetCom',
79
+ 47468 => 'Telenor',
80
+ 474690 => 'Telenor',
81
+ 474691 => 'Telenor',
82
+ 474692 => 'Telenor',
83
+ 474693 => 'Telenor',
84
+ 474694 => 'Telenor',
85
+ 474695 => 'Telenor',
86
+ 474696 => 'Telenor',
87
+ 474705 => 'NetCom',
88
+ 474723 => 'Tele2',
89
+ 474724 => 'Tele2',
90
+ 474725 => 'Tele2',
91
+ 474726 => 'Tele2',
92
+ 474727 => 'Tele2',
93
+ 474728 => 'Tele2',
94
+ 474729 => 'Tele2',
95
+ 47473 => 'Tele2',
96
+ 474740 => 'Telenor',
97
+ 474744 => 'NetCom',
98
+ 474746 => 'Telenor',
99
+ 474760 => 'Telenor',
100
+ 474761 => 'Telenor',
101
+ 474762 => 'Telenor',
102
+ 474763 => 'Telenor',
103
+ 474764 => 'Telenor',
104
+ 474765 => 'Telenor',
105
+ 474766 => 'Telenor',
106
+ 474767 => 'Telenor',
107
+ 474768 => 'Telenor',
108
+ 474770 => 'Telenor',
109
+ 474771 => 'Telenor',
110
+ 474772 => 'Telenor',
111
+ 474773 => 'Telenor',
112
+ 474774 => 'Telenor',
113
+ 474775 => 'Telenor',
114
+ 474776 => 'Telenor',
115
+ 47478 => 'Telenor',
116
+ 474790 => 'Telenor',
117
+ 474791 => 'Network Norway',
118
+ 474792 => 'Network Norway',
119
+ 474793 => 'Network Norway',
120
+ 47480 => 'Telenor',
121
+ 47481 => 'Telenor',
122
+ 47482 => 'Telenor',
123
+ 474830 => 'Telenor',
124
+ 474831 => 'Telenor',
125
+ 474832 => 'Telenor',
126
+ 47591 => 'Telenor',
127
+ 4790 => 'Telenor',
128
+ 479124 => 'Telenor',
129
+ 47913 => 'Telenor',
130
+ 47915 => 'Telenor',
131
+ 47916 => 'Telenor',
132
+ 47917 => 'Telenor',
133
+ 47918 => 'Telenor',
134
+ 479191 => 'Telenor',
135
+ 479199 => 'Telenor',
136
+ 47920 => 'NetCom',
137
+ 479210 => 'NetCom',
138
+ 479217 => 'NetCom',
139
+ 47922 => 'NetCom',
140
+ 479237 => 'NetCom',
141
+ 47924 => 'NetCom',
142
+ 479257 => 'NetCom',
143
+ 47926 => 'NetCom',
144
+ 479277 => 'NetCom',
145
+ 47928 => 'NetCom',
146
+ 479297 => 'NetCom',
147
+ 47930 => 'NetCom',
148
+ 479317 => 'NetCom',
149
+ 47932 => 'NetCom',
150
+ 479337 => 'NetCom',
151
+ 47934 => 'NetCom',
152
+ 479357 => 'NetCom',
153
+ 47936 => 'NetCom',
154
+ 479377 => 'NetCom',
155
+ 47938 => 'NetCom',
156
+ 479391 => 'NetCom',
157
+ 479403 => 'Telenor',
158
+ 479405 => 'Telenor',
159
+ 479413 => 'Telenor',
160
+ 479414 => 'Telenor',
161
+ 479415 => 'Telenor',
162
+ 479416 => 'Telenor',
163
+ 479417 => 'Telenor',
164
+ 479418 => 'Telenor',
165
+ 479419 => 'Telenor',
166
+ 479423 => 'NetCom',
167
+ 479425 => 'Telenor',
168
+ 479474 => 'Telenor',
169
+ 479475 => 'Telenor',
170
+ 479476 => 'Telenor',
171
+ 479477 => 'Telenor',
172
+ 479478 => 'Telenor',
173
+ 479479 => 'Telenor',
174
+ 47948 => 'Telenor',
175
+ 479497 => 'Telenor',
176
+ 479498 => 'Telenor',
177
+ 47950 => 'Telenor',
178
+ 47951 => 'Telenor',
179
+ 47952 => 'Telenor',
180
+ 479536 => 'Telenor',
181
+ 47954 => 'Telenor',
182
+ 479552 => 'Telenor',
183
+ 479555 => 'Telenor',
184
+ 47957 => 'Telenor',
185
+ 47958 => 'Telenor',
186
+ 47959 => 'Telenor',
187
+ 479601 => 'Telenor',
188
+ 479604 => 'Telenor',
189
+ 479609 => 'Telenor',
190
+ 479620 => 'Telenor',
191
+ 479622 => 'Telenor',
192
+ 479623 => 'Telenor',
193
+ 479650 => 'Telenor',
194
+ 479651 => 'Telenor',
195
+ 479683 => 'NetCom',
196
+ 47970 => 'Telenor',
197
+ 47971 => 'Telenor',
198
+ 479740 => 'Telenor',
199
+ 479741 => 'Telenor',
200
+ 479742 => 'Telenor',
201
+ 479743 => 'Telenor',
202
+ 479746 => 'Telenor',
203
+ 479747 => 'Telenor',
204
+ 479748 => 'Telenor',
205
+ 479749 => 'Telenor',
206
+ 47975 => 'Telenor',
207
+ 47976 => 'Telenor',
208
+ 47977 => 'Telenor',
209
+ 479795 => 'Telenor',
210
+ 479796 => 'Telenor',
211
+ 479797 => 'Telenor',
212
+ 479798 => 'Telenor',
213
+ 479799 => 'Telenor',
214
+ 47980 => 'NetCom',
215
+ 479815 => 'NetCom',
216
+ 47982 => 'NetCom',
217
+ 479837 => 'NetCom',
218
+ 47984 => 'NetCom',
219
+ 479854 => 'NetCom',
220
+ 47986 => 'NetCom',
221
+ 479876 => 'NetCom',
222
+ 47988 => 'NetCom',
223
+ 479899 => 'NetCom',
224
+ 47990 => 'Telenor',
225
+ 479915 => 'Telenor',
226
+ 479916 => 'Telenor',
227
+ 47992 => 'Telenor',
228
+ 47993 => 'Telenor',
229
+ 47994 => 'Telenor',
230
+ 47995 => 'Telenor',
231
+ 47996 => 'Telenor',
232
+ 47997 => 'Telenor',
233
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/48.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 4850 => 'Orange',
9
+ 4851 => 'Orange',
10
+ 48530 => 'Play',
11
+ 48531 => 'Play',
12
+ 48532 => 'T-Mobile',
13
+ 48533 => 'Play',
14
+ 48535 => 'Play',
15
+ 4857 => 'Play',
16
+ 48600 => 'T-Mobile',
17
+ 48601 => 'Plus',
18
+ 48602 => 'T-Mobile',
19
+ 48603 => 'Plus',
20
+ 48604 => 'T-Mobile',
21
+ 48605 => 'Plus',
22
+ 48606 => 'T-Mobile',
23
+ 48607 => 'Plus',
24
+ 48608 => 'T-Mobile',
25
+ 48609 => 'Plus',
26
+ 48660 => 'T-Mobile',
27
+ 48661 => 'Plus',
28
+ 48662 => 'T-Mobile',
29
+ 48663 => 'Plus',
30
+ 48664 => 'T-Mobile',
31
+ 48665 => 'Plus',
32
+ 486666 => 'Play',
33
+ 48667 => 'Plus',
34
+ 48668 => 'T-Mobile',
35
+ 48669 => 'Plus',
36
+ 486901 => 'Orange',
37
+ 486902 => 'Orange',
38
+ 486903 => 'Orange',
39
+ 486904 => 'Orange',
40
+ 486905 => 'Orange',
41
+ 486906 => 'Orange',
42
+ 486907 => 'CenterNet',
43
+ 48691 => 'Plus',
44
+ 48692 => 'T-Mobile',
45
+ 48693 => 'Plus',
46
+ 48694 => 'T-Mobile',
47
+ 48695 => 'Plus',
48
+ 48696 => 'T-Mobile',
49
+ 48697 => 'Plus',
50
+ 48698 => 'T-Mobile',
51
+ 4869902 => 'Cyfrowy Polsat',
52
+ 4869903 => 'Cyfrowy Polsat',
53
+ 4869904 => 'Cyfrowy Polsat',
54
+ 4869905 => 'Cyfrowy Polsat',
55
+ 4869906 => 'Cyfrowy Polsat',
56
+ 4869907 => 'Cyfrowy Polsat',
57
+ 4869908 => 'Cyfrowy Polsat',
58
+ 4869909 => 'Cyfrowy Polsat',
59
+ 4869920 => 'Cyfrowy Polsat',
60
+ 4869921 => 'Cyfrowy Polsat',
61
+ 4869923 => 'Cyfrowy Polsat',
62
+ 4869924 => 'Cyfrowy Polsat',
63
+ 4869925 => 'Cyfrowy Polsat',
64
+ 4869926 => 'Cyfrowy Polsat',
65
+ 4869927 => 'Cyfrowy Polsat',
66
+ 4869928 => 'Cyfrowy Polsat',
67
+ 4869929 => 'Cyfrowy Polsat',
68
+ 4869961 => 'Cyfrowy Polsat',
69
+ 4869962 => 'Cyfrowy Polsat',
70
+ 4869963 => 'Cyfrowy Polsat',
71
+ 4869964 => 'Cyfrowy Polsat',
72
+ 4869965 => 'Cyfrowy Polsat',
73
+ 4869966 => 'Cyfrowy Polsat',
74
+ 4869967 => 'Plus',
75
+ 4869968 => 'Cyfrowy Polsat',
76
+ 4869969 => 'Plus',
77
+ 486998 => 'Plus',
78
+ 486999 => 'Plus',
79
+ 487200 => 'CenterNet',
80
+ 487201 => 'CenterNet',
81
+ 487202 => 'CenterNet',
82
+ 487203 => 'CenterNet',
83
+ 487204 => 'CenterNet',
84
+ 487205 => 'CenterNet',
85
+ 487206 => 'CenterNet',
86
+ 487207 => 'CenterNet',
87
+ 487209 => 'CenterNet',
88
+ 48721 => 'Plus',
89
+ 48722 => 'Plus',
90
+ 48723 => 'Plus',
91
+ 48724 => 'Plus',
92
+ 48725 => 'Plus',
93
+ 48726 => 'Plus',
94
+ 487270 => 'Plus',
95
+ 487272 => 'T-Mobile',
96
+ 487273 => 'T-Mobile',
97
+ 487274 => 'Plus',
98
+ 487275 => 'Plus',
99
+ 487276 => 'Plus',
100
+ 487277 => 'Plus',
101
+ 487278 => 'Plus',
102
+ 487279 => 'Plus',
103
+ 487280 => 'Mobyland',
104
+ 487281 => 'T-Mobile',
105
+ 487282 => 'T-Mobile',
106
+ 487283 => 'T-Mobile',
107
+ 487284 => 'T-Mobile',
108
+ 487285 => 'T-Mobile',
109
+ 487286 => 'T-Mobile',
110
+ 487287 => 'T-Mobile',
111
+ 487288 => 'T-Mobile',
112
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/49.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 491502 => 'Interactive digital media',
9
+ 491505 => 'NAKA AG',
10
+ 491508 => 'Easy World',
11
+ 49151 => 'T-Mobile',
12
+ 491520 => 'Vodafone',
13
+ 491521 => 'Vodafone/Lycamobile',
14
+ 491522 => 'Vodafone',
15
+ 491523 => 'Vodafone',
16
+ 491525 => 'Vodafone',
17
+ 491529 => 'Vodafone/Truphone',
18
+ 491555 => 'Tismi BV',
19
+ 491567 => 'Argon Networks',
20
+ 491570 => 'Eplus/Telogic',
21
+ 491573 => 'Eplus',
22
+ 491575 => 'Eplus',
23
+ 491577 => 'Eplus',
24
+ 491578 => 'Eplus',
25
+ 491579 => 'Eplus/Sipgate',
26
+ 491588 => 'TelcoVillage',
27
+ 491590 => 'O2',
28
+ 49160 => 'T-Mobile',
29
+ 49162 => 'Vodafone',
30
+ 49163 => 'Eplus',
31
+ 49170 => 'T-Mobile',
32
+ 49171 => 'T-Mobile',
33
+ 49172 => 'Vodafone',
34
+ 49173 => 'Vodafone',
35
+ 49174 => 'Vodafone',
36
+ 49175 => 'T-Mobile',
37
+ 49176 => 'O2',
38
+ 49177 => 'Eplus',
39
+ 49178 => 'Eplus',
40
+ 49179 => 'O2',
41
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/501.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 50120 => 'DigiCell',
9
+ 50121 => 'DigiCell',
10
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/505.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 50555 => 'Claro',
9
+ 50557 => 'Claro',
10
+ 50558 => 'Claro',
11
+ 50575 => 'Movistar',
12
+ 50576 => 'Movistar',
13
+ 50577 => 'Movistar',
14
+ 50578 => 'Movistar',
15
+ 50581 => 'Movistar',
16
+ 505820 => 'Claro',
17
+ 505821 => 'Claro',
18
+ 505822 => 'Claro',
19
+ 505823 => 'Claro',
20
+ 505824 => 'Movistar',
21
+ 505825 => 'Movistar',
22
+ 505826 => 'Movistar',
23
+ 505827 => 'Movistar',
24
+ 505828 => 'Movistar',
25
+ 505829 => 'Movistar',
26
+ 505832 => 'Movistar',
27
+ 505833 => 'Claro',
28
+ 505835 => 'Claro',
29
+ 505836 => 'Claro',
30
+ 505837 => 'Movistar',
31
+ 505838 => 'Movistar',
32
+ 505839 => 'Movistar',
33
+ 505840 => 'Claro',
34
+ 505841 => 'Claro',
35
+ 505842 => 'Claro',
36
+ 505843 => 'Claro',
37
+ 505844 => 'Claro',
38
+ 505845 => 'Movistar',
39
+ 505846 => 'Movistar',
40
+ 505847 => 'Movistar',
41
+ 505848 => 'Movistar',
42
+ 505849 => 'Claro',
43
+ 505850 => 'Claro',
44
+ 505851 => 'Claro',
45
+ 505852 => 'Claro',
46
+ 505853 => 'Claro',
47
+ 505854 => 'Claro',
48
+ 505855 => 'Movistar',
49
+ 505856 => 'Movistar',
50
+ 505857 => 'Movistar',
51
+ 505858 => 'Movistar',
52
+ 505859 => 'Movistar',
53
+ 505860 => 'Claro',
54
+ 505861 => 'Claro',
55
+ 505862 => 'Claro',
56
+ 505863 => 'Claro',
57
+ 505864 => 'Claro',
58
+ 505865 => 'Claro',
59
+ 505866 => 'Claro',
60
+ 505867 => 'Movistar',
61
+ 505868 => 'Movistar',
62
+ 505869 => 'Claro',
63
+ 505870 => 'Claro',
64
+ 505871 => 'Claro',
65
+ 505872 => 'Claro',
66
+ 505873 => 'Claro',
67
+ 505874 => 'Claro',
68
+ 505875 => 'Movistar',
69
+ 505876 => 'Movistar',
70
+ 505877 => 'Movistar',
71
+ 505878 => 'Movistar',
72
+ 505879 => 'Movistar',
73
+ 505880 => 'Movistar',
74
+ 505881 => 'Movistar',
75
+ 505882 => 'Claro',
76
+ 505883 => 'Claro',
77
+ 505884 => 'Claro',
78
+ 505885 => 'Claro',
79
+ 505886 => 'Movistar',
80
+ 505887 => 'Movistar',
81
+ 505888 => 'Movistar',
82
+ 505889 => 'Movistar',
83
+ 505890 => 'Claro',
84
+ 505891 => 'Claro',
85
+ 505892 => 'Claro',
86
+ 505893 => 'Claro',
87
+ 505894 => 'Claro',
88
+ 505895 => 'Movistar',
89
+ 505896 => 'Movistar',
90
+ 505897 => 'Movistar',
91
+ 505898 => 'Movistar',
92
+ 505899 => 'Movistar',
93
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/506.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 506500 => 'OMV',
9
+ 506501 => 'OMV',
10
+ 506570 => 'OMV',
11
+ 506571 => 'OMV',
12
+ 506572 => 'OMV',
13
+ 506573 => 'OMV',
14
+ 50670010 => 'Claro',
15
+ 50670011 => 'Claro',
16
+ 50670012 => 'Claro',
17
+ 50670013 => 'Claro',
18
+ 50670014 => 'Claro',
19
+ 5067002 => 'Claro',
20
+ 5067003 => 'Claro',
21
+ 5067004 => 'Claro',
22
+ 5067005 => 'Claro',
23
+ 5067006 => 'Claro',
24
+ 5067007 => 'Claro',
25
+ 5067008 => 'Claro',
26
+ 5067009 => 'Claro',
27
+ 506701 => 'Claro',
28
+ 506702 => 'Claro',
29
+ 506703 => 'Claro',
30
+ 506704 => 'Claro',
31
+ 506705 => 'Claro',
32
+ 506706 => 'Claro',
33
+ 506707 => 'Claro',
34
+ 506708 => 'Claro',
35
+ 506709 => 'Claro',
36
+ 50671 => 'Claro',
37
+ 50672 => 'Claro',
38
+ 5067300 => 'Claro',
39
+ 5067301 => 'Claro',
40
+ 50683 => 'Kolbi ICE',
41
+ 50688 => 'Kolbi ICE',
42
+ 50689 => 'Kolbi ICE',
43
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/507.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 507111 => 'Digicel',
9
+ 507161 => 'Cable & Wireless',
10
+ 507218 => 'Telefónica Móviles',
11
+ 507219 => 'Telefónica Móviles',
12
+ 50760 => 'Digicel',
13
+ 507610 => 'Digicel',
14
+ 507611 => 'Digicel',
15
+ 507612 => 'Digicel',
16
+ 507613 => 'Digicel',
17
+ 507614 => 'Digicel',
18
+ 507615 => 'Digicel',
19
+ 50762 => 'Claro',
20
+ 507630 => 'Claro',
21
+ 507631 => 'Claro',
22
+ 507632 => 'Claro',
23
+ 507634 => 'Cable & Wireless',
24
+ 507635 => 'Telefónica Móviles',
25
+ 507636 => 'Telefónica Móviles',
26
+ 507637 => 'Cable & Wireless',
27
+ 507638 => 'Telefónica Móviles',
28
+ 507639 => 'Telefónica Móviles',
29
+ 50764 => 'Telefónica Móviles',
30
+ 507650 => 'Cable & Wireless',
31
+ 507651 => 'Cable & Wireless',
32
+ 507652 => 'Cable & Wireless',
33
+ 507653 => 'Cable & Wireless',
34
+ 507654 => 'Cable & Wireless',
35
+ 507655 => 'Cable & Wireless',
36
+ 507656 => 'Telefónica Móviles',
37
+ 507657 => 'Telefónica Móviles',
38
+ 507658 => 'Telefónica Móviles',
39
+ 507659 => 'Telefónica Móviles',
40
+ 507660 => 'Telefónica Móviles',
41
+ 507661 => 'Telefónica Móviles',
42
+ 507662 => 'Telefónica Móviles',
43
+ 507663 => 'Telefónica Móviles',
44
+ 507664 => 'Telefónica Móviles',
45
+ 507665 => 'Cable & Wireless',
46
+ 507666 => 'Cable & Wireless',
47
+ 507667 => 'Cable & Wireless',
48
+ 507668 => 'Cable & Wireless',
49
+ 507669 => 'Cable & Wireless',
50
+ 50767 => 'Cable & Wireless',
51
+ 507680 => 'Cable & Wireless',
52
+ 507681 => 'Telefónica Móviles',
53
+ 507682 => 'Telefónica Móviles',
54
+ 507683 => 'Telefónica Móviles',
55
+ 507684 => 'Cable & Wireless',
56
+ 507685 => 'Telefónica Móviles',
57
+ 507686 => 'Telefónica Móviles',
58
+ 507687 => 'Cable & Wireless',
59
+ 507688 => 'Cable & Wireless',
60
+ 507689 => 'Telefónica Móviles',
61
+ 507690 => 'Cable & Wireless',
62
+ 507691 => 'Cable & Wireless',
63
+ 507692 => 'Telefónica Móviles',
64
+ 507693 => 'Telefónica Móviles',
65
+ 507694 => 'Cable & Wireless',
66
+ 507695 => 'Cable & Wireless',
67
+ 507696 => 'Cable & Wireless',
68
+ 507697 => 'Telefónica Móviles',
69
+ 507698 => 'Cable & Wireless',
70
+ 507699 => 'Cable & Wireless',
71
+ 507810 => 'Mobilphone',
72
+ 507811 => 'Mobilphone',
73
+ 507872 => 'Cable & Wireless',
74
+ 507873 => 'Cable & Wireless',
75
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/509.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 509980 => 'Hainet',
9
+ 509981 => 'Hainet',
10
+ 509982 => 'Hainet',
11
+ 509983 => 'Hainet',
12
+ 509985 => 'Hainet',
13
+ 509995 => 'Access Haiti',
14
+ 509996 => 'Access Haiti',
15
+ 509997 => 'Access Haiti',
16
+ 509998 => 'Access Haiti',
17
+ 509999 => 'Access Haiti',
18
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/51.php ADDED
@@ -0,0 +1,578 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 511973 => 'Claro',
9
+ 5119750 => 'Movistar',
10
+ 5119751 => 'Movistar',
11
+ 51197520 => 'Movistar',
12
+ 51198003 => 'Movistar',
13
+ 51198004 => 'Movistar',
14
+ 51198005 => 'Movistar',
15
+ 51198006 => 'Movistar',
16
+ 51198007 => 'Movistar',
17
+ 51198008 => 'Movistar',
18
+ 51198009 => 'Movistar',
19
+ 5119801 => 'Movistar',
20
+ 5119802 => 'Movistar',
21
+ 5119803 => 'Movistar',
22
+ 51198040 => 'Claro',
23
+ 5119805 => 'Claro',
24
+ 5119806 => 'Claro',
25
+ 5119807 => 'Claro',
26
+ 5119808 => 'Claro',
27
+ 5119809 => 'Claro',
28
+ 511985 => 'Movistar',
29
+ 511986 => 'Claro',
30
+ 511987 => 'Claro',
31
+ 511988 => 'Movistar',
32
+ 511989 => 'Claro',
33
+ 511990 => 'Movistar',
34
+ 511991 => 'Claro',
35
+ 511992 => 'Claro',
36
+ 511993 => 'Claro',
37
+ 5119943 => 'Claro',
38
+ 5119944 => 'Movistar',
39
+ 5119945 => 'Movistar',
40
+ 5119946 => 'Claro',
41
+ 5119947 => 'Claro',
42
+ 5119948 => 'Claro',
43
+ 5119949 => 'Claro',
44
+ 5119953 => 'Movistar',
45
+ 5119954 => 'Movistar',
46
+ 5119955 => 'Movistar',
47
+ 5119956 => 'Movistar',
48
+ 5119957 => 'Movistar',
49
+ 5119958 => 'Movistar',
50
+ 5119959 => 'Movistar',
51
+ 511996 => 'Movistar',
52
+ 511997 => 'Claro',
53
+ 5119980 => 'Movistar',
54
+ 5119984 => 'Movistar',
55
+ 5119986 => 'Movistar',
56
+ 5119987 => 'Movistar',
57
+ 5119988 => 'Movistar',
58
+ 5119989 => 'Movistar',
59
+ 514194170 => 'Claro',
60
+ 514194171 => 'Claro',
61
+ 514194172 => 'Claro',
62
+ 514194173 => 'Claro',
63
+ 514194188 => 'Movistar',
64
+ 514194189 => 'Movistar',
65
+ 51419419 => 'Movistar',
66
+ 514294200 => 'Movistar',
67
+ 514294201 => 'Movistar',
68
+ 514294202 => 'Movistar',
69
+ 51429424 => 'Movistar',
70
+ 51429426 => 'Movistar',
71
+ 51429427 => 'Claro',
72
+ 51429429 => 'Movistar',
73
+ 51439430 => 'Movistar',
74
+ 51439431 => 'Movistar',
75
+ 514394320 => 'Movistar',
76
+ 514394321 => 'Movistar',
77
+ 514394322 => 'Movistar',
78
+ 514394323 => 'Movistar',
79
+ 514394324 => 'Movistar',
80
+ 514394330 => 'Claro',
81
+ 514394331 => 'Claro',
82
+ 514394332 => 'Claro',
83
+ 514394333 => 'Claro',
84
+ 514394334 => 'Claro',
85
+ 514394335 => 'Claro',
86
+ 51439434 => 'Movistar',
87
+ 51439435 => 'Claro',
88
+ 51439436 => 'Movistar',
89
+ 514394370 => 'Claro',
90
+ 514394371 => 'Claro',
91
+ 514394372 => 'Claro',
92
+ 514394373 => 'Claro',
93
+ 514394374 => 'Claro',
94
+ 514394375 => 'Claro',
95
+ 514394376 => 'Claro',
96
+ 514394377 => 'Claro',
97
+ 514394378 => 'Movistar',
98
+ 514394379 => 'Movistar',
99
+ 51439438 => 'Movistar',
100
+ 514494801 => 'Movistar',
101
+ 514494802 => 'Movistar',
102
+ 514494803 => 'Movistar',
103
+ 514494804 => 'Movistar',
104
+ 514494805 => 'Claro',
105
+ 514494806 => 'Claro',
106
+ 514494807 => 'Claro',
107
+ 514494808 => 'Claro',
108
+ 514494809 => 'Claro',
109
+ 514494810 => 'Movistar',
110
+ 514494811 => 'Movistar',
111
+ 514494812 => 'Movistar',
112
+ 514494813 => 'Movistar',
113
+ 514494814 => 'Movistar',
114
+ 514494815 => 'Movistar',
115
+ 514494816 => 'Movistar',
116
+ 51449482 => 'Claro',
117
+ 51449483 => 'Claro',
118
+ 51449484 => 'Movistar',
119
+ 51449485 => 'Movistar',
120
+ 51449486 => 'Movistar',
121
+ 51449488 => 'Movistar',
122
+ 51449489 => 'Movistar',
123
+ 514494900 => 'Movistar',
124
+ 514494901 => 'Movistar',
125
+ 514494902 => 'Movistar',
126
+ 514494903 => 'Movistar',
127
+ 514494904 => 'Movistar',
128
+ 514494905 => 'Movistar',
129
+ 514494906 => 'Movistar',
130
+ 514494907 => 'Claro',
131
+ 514494908 => 'Claro',
132
+ 514494909 => 'Claro',
133
+ 51449491 => 'Claro',
134
+ 51449492 => 'Claro',
135
+ 51449493 => 'Claro',
136
+ 51449494 => 'Movistar',
137
+ 514494950 => 'Movistar',
138
+ 514494951 => 'Movistar',
139
+ 514494952 => 'Movistar',
140
+ 514494953 => 'Movistar',
141
+ 514494954 => 'Movistar',
142
+ 514494955 => 'Movistar',
143
+ 51449496 => 'Movistar',
144
+ 514494970 => 'Claro',
145
+ 514494971 => 'Claro',
146
+ 514494972 => 'Claro',
147
+ 514494973 => 'Claro',
148
+ 514494974 => 'Claro',
149
+ 514494975 => 'Claro',
150
+ 514494976 => 'Claro',
151
+ 514494977 => 'Claro',
152
+ 514494978 => 'Movistar',
153
+ 514494979 => 'Movistar',
154
+ 51449498 => 'Movistar',
155
+ 514494991 => 'Movistar',
156
+ 514494995 => 'Movistar',
157
+ 514494996 => 'Movistar',
158
+ 514494997 => 'Movistar',
159
+ 514494998 => 'Movistar',
160
+ 514494999 => 'Movistar',
161
+ 515195080 => 'Movistar',
162
+ 515195081 => 'Movistar',
163
+ 515195082 => 'Movistar',
164
+ 515195083 => 'Movistar',
165
+ 51519509 => 'Movistar',
166
+ 51519510 => 'Movistar',
167
+ 51519511 => 'Claro',
168
+ 51519512 => 'Claro',
169
+ 51519513 => 'Claro',
170
+ 51519514 => 'Movistar',
171
+ 515195150 => 'Movistar',
172
+ 515195151 => 'Movistar',
173
+ 515195152 => 'Movistar',
174
+ 515195153 => 'Movistar',
175
+ 515195154 => 'Movistar',
176
+ 515195155 => 'Movistar',
177
+ 515195156 => 'Movistar',
178
+ 515195157 => 'Movistar',
179
+ 515195158 => 'Movistar',
180
+ 51519516 => 'Movistar',
181
+ 51519517 => 'Claro',
182
+ 51519518 => 'Movistar',
183
+ 515195190 => 'Movistar',
184
+ 515195191 => 'Movistar',
185
+ 515195193 => 'Movistar',
186
+ 515195194 => 'Movistar',
187
+ 515195195 => 'Movistar',
188
+ 515195196 => 'Movistar',
189
+ 515195197 => 'Movistar',
190
+ 515195198 => 'Movistar',
191
+ 515195199 => 'Movistar',
192
+ 51529523 => 'Claro',
193
+ 515295250 => 'Movistar',
194
+ 515295251 => 'Movistar',
195
+ 515295252 => 'Movistar',
196
+ 515295253 => 'Movistar',
197
+ 515295254 => 'Movistar',
198
+ 51529526 => 'Movistar',
199
+ 515295270 => 'Claro',
200
+ 515295271 => 'Claro',
201
+ 51529528 => 'Movistar',
202
+ 515295292 => 'Movistar',
203
+ 515295293 => 'Movistar',
204
+ 515295294 => 'Movistar',
205
+ 515295295 => 'Movistar',
206
+ 515295296 => 'Movistar',
207
+ 515295297 => 'Movistar',
208
+ 515295298 => 'Movistar',
209
+ 515295299 => 'Movistar',
210
+ 515395350 => 'Claro',
211
+ 515395352 => 'Movistar',
212
+ 515395361 => 'Movistar',
213
+ 515395363 => 'Movistar',
214
+ 515395364 => 'Movistar',
215
+ 515395366 => 'Movistar',
216
+ 515395367 => 'Movistar',
217
+ 515395368 => 'Movistar',
218
+ 515395370 => 'Claro',
219
+ 515395371 => 'Claro',
220
+ 515395372 => 'Claro',
221
+ 515395373 => 'Claro',
222
+ 515395374 => 'Claro',
223
+ 515395375 => 'Claro',
224
+ 515395376 => 'Claro',
225
+ 51539539 => 'Movistar',
226
+ 515495800 => 'Movistar',
227
+ 515495801 => 'Movistar',
228
+ 515495802 => 'Movistar',
229
+ 515495803 => 'Movistar',
230
+ 515495804 => 'Movistar',
231
+ 515495805 => 'Claro',
232
+ 515495806 => 'Claro',
233
+ 515495807 => 'Claro',
234
+ 515495808 => 'Claro',
235
+ 515495809 => 'Claro',
236
+ 515495810 => 'Claro',
237
+ 515495811 => 'Claro',
238
+ 515495820 => 'Claro',
239
+ 515495821 => 'Claro',
240
+ 515495823 => 'Claro',
241
+ 515495824 => 'Claro',
242
+ 515495825 => 'Claro',
243
+ 515495826 => 'Claro',
244
+ 515495827 => 'Claro',
245
+ 515495828 => 'Claro',
246
+ 515495829 => 'Claro',
247
+ 51549583 => 'Claro',
248
+ 515495840 => 'Movistar',
249
+ 515495841 => 'Movistar',
250
+ 515495842 => 'Movistar',
251
+ 515495843 => 'Movistar',
252
+ 51549585 => 'Movistar',
253
+ 51549586 => 'Movistar',
254
+ 51549587 => 'Claro',
255
+ 51549588 => 'Movistar',
256
+ 515495890 => 'Movistar',
257
+ 515495891 => 'Movistar',
258
+ 515495892 => 'Movistar',
259
+ 515495893 => 'Movistar',
260
+ 515495894 => 'Movistar',
261
+ 515495895 => 'Claro',
262
+ 515495896 => 'Claro',
263
+ 515495898 => 'Claro',
264
+ 51549590 => 'Movistar',
265
+ 51549591 => 'Claro',
266
+ 515495920 => 'Claro',
267
+ 515495921 => 'Claro',
268
+ 515495922 => 'Claro',
269
+ 515495923 => 'Claro',
270
+ 515495924 => 'Claro',
271
+ 515495925 => 'Claro',
272
+ 515495926 => 'Claro',
273
+ 515495927 => 'Claro',
274
+ 515495928 => 'Movistar',
275
+ 515495929 => 'Movistar',
276
+ 51549593 => 'Claro',
277
+ 51549594 => 'Movistar',
278
+ 515495950 => 'Movistar',
279
+ 515495951 => 'Movistar',
280
+ 515495952 => 'Movistar',
281
+ 515495953 => 'Movistar',
282
+ 515495954 => 'Movistar',
283
+ 515495955 => 'Movistar',
284
+ 515495956 => 'Movistar',
285
+ 515495957 => 'Movistar',
286
+ 515495958 => 'Movistar',
287
+ 51549596 => 'Movistar',
288
+ 51549597 => 'Claro',
289
+ 515495980 => 'Movistar',
290
+ 515495981 => 'Movistar',
291
+ 515495982 => 'Movistar',
292
+ 515495984 => 'Movistar',
293
+ 515495985 => 'Movistar',
294
+ 515495986 => 'Movistar',
295
+ 515495987 => 'Movistar',
296
+ 515495988 => 'Movistar',
297
+ 515495989 => 'Movistar',
298
+ 515495991 => 'Movistar',
299
+ 515495992 => 'Movistar',
300
+ 515495996 => 'Movistar',
301
+ 515495997 => 'Movistar',
302
+ 515495998 => 'Movistar',
303
+ 515495999 => 'Movistar',
304
+ 51569560 => 'Movistar',
305
+ 515695610 => 'Movistar',
306
+ 515695611 => 'Movistar',
307
+ 515695612 => 'Movistar',
308
+ 515695613 => 'Movistar',
309
+ 515695614 => 'Movistar',
310
+ 515695615 => 'Movistar',
311
+ 515695616 => 'Movistar',
312
+ 515695620 => 'Claro',
313
+ 515695621 => 'Claro',
314
+ 515695622 => 'Claro',
315
+ 515695623 => 'Claro',
316
+ 515695624 => 'Claro',
317
+ 515695625 => 'Claro',
318
+ 515695626 => 'Claro',
319
+ 51569563 => 'Claro',
320
+ 51569564 => 'Movistar',
321
+ 51569565 => 'Movistar',
322
+ 51569566 => 'Movistar',
323
+ 51569567 => 'Claro',
324
+ 51569568 => 'Movistar',
325
+ 51569569 => 'Movistar',
326
+ 516196150 => 'Movistar',
327
+ 516196151 => 'Movistar',
328
+ 516196152 => 'Movistar',
329
+ 516196153 => 'Movistar',
330
+ 516196154 => 'Movistar',
331
+ 516196155 => 'Movistar',
332
+ 51619616 => 'Movistar',
333
+ 516196170 => 'Claro',
334
+ 516196171 => 'Claro',
335
+ 516196172 => 'Claro',
336
+ 516196173 => 'Claro',
337
+ 516196174 => 'Claro',
338
+ 516196175 => 'Claro',
339
+ 51619619 => 'Movistar',
340
+ 51619627 => 'Claro',
341
+ 516296250 => 'Movistar',
342
+ 516296251 => 'Movistar',
343
+ 516296252 => 'Movistar',
344
+ 516296253 => 'Movistar',
345
+ 516296254 => 'Movistar',
346
+ 51629626 => 'Movistar',
347
+ 51629629 => 'Movistar',
348
+ 516396360 => 'Movistar',
349
+ 516396361 => 'Movistar',
350
+ 516396362 => 'Movistar',
351
+ 516396363 => 'Movistar',
352
+ 516396364 => 'Movistar',
353
+ 516396365 => 'Movistar',
354
+ 516396369 => 'Movistar',
355
+ 516396370 => 'Claro',
356
+ 516396371 => 'Claro',
357
+ 516396372 => 'Claro',
358
+ 516396373 => 'Claro',
359
+ 516396390 => 'Movistar',
360
+ 516396391 => 'Movistar',
361
+ 516396392 => 'Movistar',
362
+ 516396393 => 'Movistar',
363
+ 516396394 => 'Movistar',
364
+ 516396395 => 'Movistar',
365
+ 516396398 => 'Movistar',
366
+ 516396399 => 'Movistar',
367
+ 516495410 => 'Claro',
368
+ 516495411 => 'Claro',
369
+ 516495412 => 'Claro',
370
+ 516495440 => 'Movistar',
371
+ 516495441 => 'Movistar',
372
+ 516495442 => 'Movistar',
373
+ 516495443 => 'Movistar',
374
+ 516495444 => 'Movistar',
375
+ 516495445 => 'Movistar',
376
+ 516495446 => 'Movistar',
377
+ 516495447 => 'Movistar',
378
+ 516495448 => 'Movistar',
379
+ 51649640 => 'Movistar',
380
+ 51649641 => 'Claro',
381
+ 51649642 => 'Claro',
382
+ 51649643 => 'Claro',
383
+ 51649644 => 'Movistar',
384
+ 51649645 => 'Movistar',
385
+ 51649646 => 'Movistar',
386
+ 51649647 => 'Movistar',
387
+ 51649648 => 'Movistar',
388
+ 516496490 => 'Movistar',
389
+ 516496491 => 'Movistar',
390
+ 516496492 => 'Movistar',
391
+ 516496496 => 'Movistar',
392
+ 516496497 => 'Movistar',
393
+ 516496498 => 'Movistar',
394
+ 516496499 => 'Movistar',
395
+ 516596530 => 'Claro',
396
+ 516596531 => 'Claro',
397
+ 516596532 => 'Claro',
398
+ 516596533 => 'Claro',
399
+ 516596534 => 'Claro',
400
+ 51659656 => 'Movistar',
401
+ 51659657 => 'Claro',
402
+ 516596590 => 'Movistar',
403
+ 516596591 => 'Movistar',
404
+ 516596592 => 'Movistar',
405
+ 516596596 => 'Movistar',
406
+ 516596597 => 'Movistar',
407
+ 516596598 => 'Movistar',
408
+ 516596599 => 'Movistar',
409
+ 516696600 => 'Movistar',
410
+ 51669666 => 'Movistar',
411
+ 51669667 => 'Claro',
412
+ 51669668 => 'Movistar',
413
+ 51669669 => 'Movistar',
414
+ 51679674 => 'Claro',
415
+ 516796765 => 'Movistar',
416
+ 516796766 => 'Movistar',
417
+ 516796768 => 'Movistar',
418
+ 516796769 => 'Movistar',
419
+ 516796770 => 'Claro',
420
+ 516796771 => 'Claro',
421
+ 516796772 => 'Claro',
422
+ 516796773 => 'Claro',
423
+ 516796798 => 'Movistar',
424
+ 517297260 => 'Movistar',
425
+ 517297261 => 'Movistar',
426
+ 517297262 => 'Movistar',
427
+ 517297263 => 'Movistar',
428
+ 517297268 => 'Movistar',
429
+ 517297269 => 'Movistar',
430
+ 517297270 => 'Claro',
431
+ 517297271 => 'Claro',
432
+ 517297272 => 'Claro',
433
+ 517297273 => 'Claro',
434
+ 51729728 => 'Movistar',
435
+ 517297290 => 'Movistar',
436
+ 517297291 => 'Movistar',
437
+ 517297292 => 'Movistar',
438
+ 517297296 => 'Movistar',
439
+ 517297297 => 'Movistar',
440
+ 517297298 => 'Movistar',
441
+ 517396840 => 'Movistar',
442
+ 517396841 => 'Movistar',
443
+ 517396842 => 'Movistar',
444
+ 517396843 => 'Movistar',
445
+ 517396844 => 'Movistar',
446
+ 517396870 => 'Claro',
447
+ 517396871 => 'Claro',
448
+ 517396872 => 'Claro',
449
+ 517396873 => 'Claro',
450
+ 517396875 => 'Claro',
451
+ 517396876 => 'Claro',
452
+ 517396877 => 'Claro',
453
+ 517396878 => 'Claro',
454
+ 517396879 => 'Claro',
455
+ 51739688 => 'Movistar',
456
+ 51739689 => 'Movistar',
457
+ 51739690 => 'Movistar',
458
+ 51739691 => 'Movistar',
459
+ 51739692 => 'Movistar',
460
+ 51739694 => 'Movistar',
461
+ 517396950 => 'Movistar',
462
+ 517396951 => 'Movistar',
463
+ 517396952 => 'Movistar',
464
+ 517396953 => 'Movistar',
465
+ 517396954 => 'Movistar',
466
+ 517396955 => 'Movistar',
467
+ 517396956 => 'Movistar',
468
+ 517396957 => 'Movistar',
469
+ 51739696 => 'Movistar',
470
+ 51739698 => 'Movistar',
471
+ 517396990 => 'Movistar',
472
+ 517396991 => 'Movistar',
473
+ 517396994 => 'Movistar',
474
+ 517396995 => 'Movistar',
475
+ 517396996 => 'Movistar',
476
+ 517396997 => 'Movistar',
477
+ 517396998 => 'Movistar',
478
+ 517396999 => 'Movistar',
479
+ 517497840 => 'Movistar',
480
+ 517497841 => 'Movistar',
481
+ 517497842 => 'Movistar',
482
+ 517497843 => 'Movistar',
483
+ 517497870 => 'Claro',
484
+ 517497871 => 'Claro',
485
+ 517497872 => 'Claro',
486
+ 517497873 => 'Claro',
487
+ 517497874 => 'Claro',
488
+ 517497875 => 'Claro',
489
+ 517497876 => 'Claro',
490
+ 517497877 => 'Claro',
491
+ 51749788 => 'Movistar',
492
+ 51749789 => 'Movistar',
493
+ 51749790 => 'Movistar',
494
+ 51749791 => 'Movistar',
495
+ 51749792 => 'Movistar',
496
+ 51749793 => 'Claro',
497
+ 517497956 => 'Movistar',
498
+ 517497957 => 'Movistar',
499
+ 51749796 => 'Movistar',
500
+ 51749797 => 'Claro',
501
+ 51749798 => 'Movistar',
502
+ 517497990 => 'Movistar',
503
+ 517497991 => 'Movistar',
504
+ 517497992 => 'Movistar',
505
+ 517497993 => 'Movistar',
506
+ 517497996 => 'Movistar',
507
+ 517497997 => 'Movistar',
508
+ 517497998 => 'Movistar',
509
+ 517497999 => 'Movistar',
510
+ 517697600 => 'Movistar',
511
+ 517697601 => 'Movistar',
512
+ 517697602 => 'Movistar',
513
+ 517697603 => 'Movistar',
514
+ 517697604 => 'Movistar',
515
+ 517697605 => 'Movistar',
516
+ 517697606 => 'Movistar',
517
+ 517697621 => 'Claro',
518
+ 517697622 => 'Claro',
519
+ 51769763 => 'Claro',
520
+ 51769764 => 'Movistar',
521
+ 517697650 => 'Movistar',
522
+ 517697651 => 'Movistar',
523
+ 517697652 => 'Movistar',
524
+ 517697653 => 'Movistar',
525
+ 517697654 => 'Movistar',
526
+ 517697655 => 'Movistar',
527
+ 517697656 => 'Movistar',
528
+ 517697657 => 'Movistar',
529
+ 517697658 => 'Movistar',
530
+ 51769766 => 'Movistar',
531
+ 51769767 => 'Movistar',
532
+ 51769768 => 'Movistar',
533
+ 517697692 => 'Movistar',
534
+ 517697693 => 'Movistar',
535
+ 517697694 => 'Movistar',
536
+ 517697695 => 'Movistar',
537
+ 517697696 => 'Movistar',
538
+ 517697697 => 'Movistar',
539
+ 517697698 => 'Movistar',
540
+ 517697699 => 'Movistar',
541
+ 518298230 => 'Claro',
542
+ 518298231 => 'Claro',
543
+ 518298232 => 'Claro',
544
+ 518298260 => 'Movistar',
545
+ 518298261 => 'Movistar',
546
+ 518298268 => 'Movistar',
547
+ 51829827 => 'Claro',
548
+ 518298298 => 'Movistar',
549
+ 51839836 => 'Movistar',
550
+ 51839837 => 'Claro',
551
+ 518398398 => 'Movistar',
552
+ 518398399 => 'Movistar',
553
+ 51849742 => 'Claro',
554
+ 518497430 => 'Claro',
555
+ 518497431 => 'Claro',
556
+ 518497435 => 'Claro',
557
+ 518497436 => 'Claro',
558
+ 518497437 => 'Claro',
559
+ 518497438 => 'Claro',
560
+ 518497439 => 'Claro',
561
+ 51849747 => 'Claro',
562
+ 518498400 => 'Movistar',
563
+ 518498401 => 'Movistar',
564
+ 518498402 => 'Movistar',
565
+ 518498403 => 'Movistar',
566
+ 518498404 => 'Movistar',
567
+ 518498405 => 'Movistar',
568
+ 518498406 => 'Movistar',
569
+ 51849841 => 'Claro',
570
+ 51849842 => 'Claro',
571
+ 51849843 => 'Claro',
572
+ 51849844 => 'Claro',
573
+ 51849845 => 'Movistar',
574
+ 51849846 => 'Movistar',
575
+ 51849847 => 'Claro',
576
+ 51849848 => 'Movistar',
577
+ 51849849 => 'Movistar',
578
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/53.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 535 => 'CUBACEL',
9
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/54.php ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 549113 => 'Personal',
9
+ 549114 => 'Personal',
10
+ 549115 => 'Personal',
11
+ 549116 => 'Personal',
12
+ 549220 => 'Personal',
13
+ 549221 => 'Personal',
14
+ 549222 => 'Personal',
15
+ 549223 => 'Personal',
16
+ 549224 => 'Personal',
17
+ 549225 => 'Personal',
18
+ 549226 => 'Personal',
19
+ 549227 => 'Personal',
20
+ 549228 => 'Personal',
21
+ 549229 => 'Personal',
22
+ 549230 => 'Personal',
23
+ 549231 => 'Personal',
24
+ 549232 => 'Personal',
25
+ 549233 => 'Personal',
26
+ 549234 => 'Personal',
27
+ 549235 => 'Personal',
28
+ 549236 => 'Personal',
29
+ 549239 => 'Personal',
30
+ 549247 => 'Personal',
31
+ 549249 => 'Personal',
32
+ 549260 => 'Personal',
33
+ 549261 => 'Personal',
34
+ 549262 => 'Personal',
35
+ 549263 => 'Personal',
36
+ 549264 => 'Personal',
37
+ 549265 => 'Personal',
38
+ 549266 => 'Personal',
39
+ 549280 => 'Personal',
40
+ 549290 => 'Personal',
41
+ 549291 => 'Personal',
42
+ 549292 => 'Personal',
43
+ 549293 => 'Personal',
44
+ 549294 => 'Personal',
45
+ 549295 => 'Personal',
46
+ 549296 => 'Personal',
47
+ 549297 => 'Personal',
48
+ 549298 => 'Personal',
49
+ 549299 => 'Personal',
50
+ 549332 => 'Personal',
51
+ 549336 => 'Personal',
52
+ 549338 => 'Personal',
53
+ 549340 => 'Personal',
54
+ 549341 => 'Personal',
55
+ 549342 => 'Personal',
56
+ 549343 => 'Personal',
57
+ 549344 => 'Personal',
58
+ 549345 => 'Personal',
59
+ 549346 => 'Personal',
60
+ 549347 => 'Personal',
61
+ 549348 => 'Personal',
62
+ 549349 => 'Personal',
63
+ 549351 => 'Personal',
64
+ 549352 => 'Personal',
65
+ 549353 => 'Personal',
66
+ 549354 => 'Personal',
67
+ 549356 => 'Personal',
68
+ 549357 => 'Personal',
69
+ 549358 => 'Personal',
70
+ 549362 => 'Personal',
71
+ 549364 => 'Personal',
72
+ 549370 => 'Personal',
73
+ 549371 => 'Personal',
74
+ 549372 => 'Personal',
75
+ 549373 => 'Personal',
76
+ 549374 => 'Personal',
77
+ 549375 => 'Personal',
78
+ 549376 => 'Personal',
79
+ 549377 => 'Personal',
80
+ 549378 => 'Personal',
81
+ 549379 => 'Personal',
82
+ 549380 => 'Personal',
83
+ 549381 => 'Personal',
84
+ 549382 => 'Personal',
85
+ 549383 => 'Personal',
86
+ 549384 => 'Personal',
87
+ 549385 => 'Personal',
88
+ 549386 => 'Personal',
89
+ 549387 => 'Personal',
90
+ 549388 => 'Personal',
91
+ 549389 => 'Personal',
92
+ );
app/code/local/Mocean/moceansms/vendor/giggsey/libphonenumber-for-php/src/libphonenumber/carrier/data/en/55.php ADDED
@@ -0,0 +1,9473 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file is automatically @generated by {@link GeneratePhonePrefixData}.
4
+ * Please don't modify it directly.
5
+ */
6
+
7
+ return array (
8
+ 551195472 => 'Vivo',
9
+ 551195473 => 'Vivo',
10
+ 551195474 => 'Vivo',
11
+ 551195769 => 'Vivo',
12
+ 55119577 => 'Vivo',
13
+ 551195780 => 'Vivo',
14
+ 551195781 => 'Vivo',
15
+ 551195782 => 'Vivo',
16
+ 551195783 => 'Vivo',
17
+ 551195784 => 'Vivo',
18
+ 551195785 => 'Vivo',
19
+ 551195786 => 'Vivo',
20
+ 551196057 => 'Vivo',
21
+ 551196058 => 'Vivo',
22
+ 551196059 => 'Vivo',
23
+ 551196060 => 'Vivo',
24
+ 551196168 => 'Claro BR',
25
+ 551196169 => 'Claro BR',
26
+ 55119617 => 'Claro BR',
27
+ 551196180 => 'Claro BR',
28
+ 551196181 => 'Claro BR',
29
+ 551196182 => 'Vivo',
30
+ 551196183 => 'Vivo',
31
+ 551196184 => 'Vivo',
32
+ 551196185 => 'Vivo',
33
+ 551196186 => 'Vivo',
34
+ 551196187 => 'Vivo',
35
+ 551196188 => 'Vivo',
36
+ 551196189 => 'Vivo',
37
+ 55119619 => 'Vivo',
38
+ 55119630 => 'Claro BR',
39
+ 55119631 => 'Claro BR',
40
+ 55119632 => 'Claro BR',
41
+ 55119633 => 'Claro BR',
42
+ 55119637 => 'Vivo',
43
+ 55119638 => 'Vivo',
44
+ 55119639 => 'Vivo',
45
+ 55119640 => 'Vivo',
46
+ 55119641 => 'Vivo',
47
+ 55119647 => 'Vivo',
48
+ 55119648 => 'Vivo',
49
+ 55119649 => 'Vivo',
50
+ 55119657 => 'Claro BR',
51
+ 55119658 => 'Claro BR',
52
+ 55119659 => 'Claro BR',
53
+ 55119660 => 'Claro BR',
54
+ 55119661 => 'Claro BR',
55
+ 55119662 => 'Claro BR',
56
+ 55119663 => 'Claro BR',
57
+ 55119664 => 'Claro BR',
58
+ 551196650 => 'Claro BR',
59
+ 55119684 => 'Vivo',
60
+ 55119685 => 'Vivo',
61
+ 551196860 => 'Vivo',
62
+ 551196861 => 'Vivo',
63
+ 551196862 => 'Vivo',
64
+ 551196863 => 'Vivo',
65
+ 551196864 => 'Vivo',
66
+ 551196865 => 'Vivo',
67
+ 551196866 => 'Vivo',
68
+ 55119690 => 'Vivo',
69
+ 551196910 => 'Vivo',
70
+ 551196911 => 'Vivo',
71
+ 551196912 => 'Vivo',
72
+ 551196913 => 'Vivo',
73
+ 551196914 => 'Claro BR',
74
+ 551196915 => 'Claro BR',
75
+ 551196916 => 'Claro BR',
76
+ 551196917 => 'Claro BR',
77
+ 551196918 => 'Claro BR',
78
+ 551196919 => 'Claro BR',
79
+ 55119692 => 'Claro BR',
80
+ 551196930 => 'Claro BR',
81
+ 551196931 => 'Claro BR',
82
+ 551197011 => 'TIM',
83
+ 551197012 => 'TIM',
84
+ 551197013 => 'TIM',
85
+ 551197014 => 'TIM',
86
+ 551197015 => 'TIM',
87
+ 551197016 => 'TIM',
88
+ 551197017 => 'TIM',
89
+ 551197018 => 'TIM',
90
+ 551197019 => 'TIM',
91
+ 55119702 => 'TIM',
92
+ 551197030 => 'TIM',
93
+ 551197031 => 'TIM',
94
+ 551197032 => 'TIM',
95
+ 551197033 => 'TIM',
96
+ 551197034 => 'TIM',
97
+ 551197035 => 'TIM',
98
+ 551197036 => 'TIM',
99
+ 551197037 => 'TIM',
100
+ 551197038 => 'TIM',
101
+ 551197049 => 'TIM',
102
+ 551197050 => 'TIM',
103
+ 551197051 => 'TIM',
104
+ 551197052 => 'Claro BR',
105
+ 551197053 => 'Claro BR',
106
+ 551197054 => 'Claro BR',
107
+ 551197055 => 'Claro BR',
108
+ 551197056 => 'Claro BR',
109
+ 551197057 => 'Claro BR',
110
+ 551197058 => 'Claro BR',
111
+ 551197059 => 'Claro BR',
112
+ 55119706 => 'Claro BR',
113
+ 55119707 => 'Claro BR',
114
+ 551197080 => 'Claro BR',
115
+ 551197081 => 'Claro BR',
116
+ 551197082 => 'Claro BR',
117
+ 551197083 => 'Claro BR',
118
+ 551197084 => 'Claro BR',
119
+ 551197085 => 'Claro BR',
120
+ 551197086 => 'Claro BR',
121
+ 551197087 => 'Vivo',
122
+ 551197088 => 'Vivo',
123
+ 551197089 => 'Vivo',
124
+ 55119709 => 'Vivo',
125
+ 5511971 => 'Vivo',
126
+ 5511972 => 'Vivo',
127
+ 5511973 => 'Vivo',
128
+ 5511974 => 'Vivo',
129
+ 5511975 => 'Vivo',
130
+ 5511976 => 'Claro BR',
131
+ 551197968 => 'Claro BR',
132
+ 551197969 => 'Claro BR',
133
+ 551197970 => 'Claro BR',
134
+ 551197971 => 'Oi',
135
+ 551197972 => 'Oi',
136
+ 551197973 => 'Oi',
137
+ 551197974 => 'Oi',
138
+ 551197975 => 'Oi',
139
+ 551197976 => 'Oi',
140
+ 551197977 => 'Oi',
141
+ 551197978 => 'Oi',
142
+ 551197979 => 'Oi',
143
+ 55119798 => 'Oi',
144
+ 551197990 => 'Oi',
145
+ 551197991 => 'Oi',
146
+ 551197992 => 'Oi',
147
+ 551197993 => 'Oi',
148
+ 551197994 => 'Oi',
149
+ 551197995 => 'Oi',
150
+ 551198023 => 'Oi',
151
+ 551198024 => 'Oi',
152
+ 551198025 => 'Oi',
153
+ 551198026 => 'Oi',
154
+ 551198027 => 'Oi',
155
+ 551198028 => 'Oi',
156
+ 551198029 => 'Oi',
157
+ 55119803 => 'Oi',
158
+ 55119804 => 'Oi',
159
+ 55119805 => 'Oi',
160
+ 55119806 => 'Oi',
161
+ 55119807 => 'Oi',
162
+ 55119808 => 'Oi',
163
+ 55119809 => 'Oi',
164
+ 5511981 => 'TIM',
165
+ 5511982 => 'TIM',
166
+ 5511983 => 'TIM',
167
+ 5511984 => 'TIM',
168
+ 5511985 => 'TIM',
169
+ 5511986 => 'TIM',
170
+ 5511987 => 'TIM',
171
+ 5511988 => 'Claro BR',
172
+ 5511989 => 'Claro BR',
173
+ 5511991 => 'Claro BR',
174
+ 5511992 => 'Claro BR',
175
+ 5511993 => 'Claro BR',
176
+ 5511994 => 'Claro BR',
177
+ 5511995 => 'Vivo',
178
+ 5511996 => 'Vivo',
179
+ 5511997 => 'Vivo',
180
+ 5511998 => 'Vivo',
181
+ 5511999 => 'Vivo',
182
+ 551298111 => 'TIM',
183
+ 551298112 => 'TIM',
184
+ 551298113 => 'TIM',
185
+ 551298114 => 'TIM',
186
+ 551298115 => 'TIM',
187
+ 551298116 => 'TIM',
188
+ 551298117 => 'TIM',
189
+ 551298118 => 'TIM',
190
+ 551298119 => 'TIM',
191
+ 551298121 => 'TIM',
192
+ 551298122 => 'TIM',
193
+ 551298123 => 'TIM',
194
+ 551298124 => 'TIM',
195
+ 551298125 => 'TIM',
196
+ 551298126 => 'TIM',
197
+ 551298127 => 'TIM',
198
+ 551298128 => 'TIM',
199
+ 551298129 => 'TIM',
200
+ 551298131 => 'TIM',
201
+ 551298132 => 'TIM',
202
+ 551298133 => 'TIM',
203
+ 551298134 => 'TIM',
204
+ 551298135 => 'TIM',
205
+ 551298136 => 'TIM',
206
+ 551298137 => 'TIM',
207
+ 551298138 => 'TIM',
208
+ 551298139 => 'TIM',
209
+ 551298141 => 'TIM',
210
+ 551298142 => 'TIM',
211
+ 551298143 => 'TIM',
212
+ 551298144 => 'TIM',
213
+ 551298145 => 'TIM',
214
+ 551298146 => 'TIM',
215
+ 551298147 => 'TIM',
216
+ 551298148 => 'TIM',
217
+ 551298149 => 'TIM',
218
+ 551298151 => 'TIM',
219
+ 551298152 => 'TIM',
220
+ 551298153 => 'TIM',
221
+ 551298154 => 'TIM',
222
+ 551298155 => 'TIM',
223
+ 551298156 => 'TIM',
224
+ 551298157 => 'TIM',
225
+ 551298158 => 'TIM',
226
+ 551298159 => 'TIM',
227
+ 551298161 => 'TIM',
228
+ 551298162 => 'TIM',
229
+ 551298163 => 'TIM',
230
+ 551298164 => 'TIM',
231
+ 551298165 => 'TIM',
232
+ 551298166 => 'TIM',
233
+ 551298167 => 'TIM',
234
+ 551298168 => 'TIM',
235
+ 551298169 => 'TIM',
236
+ 551298171 => 'TIM',
237
+ 551298172 => 'TIM',
238
+ 551298173 => 'TIM',
239
+ 551298174 => 'TIM',
240
+ 551298175 => 'TIM',
241
+ 551298176 => 'TIM',
242
+ 551298177 => 'TIM',
243
+ 551298178 => 'TIM',
244
+ 551298179 => 'TIM',
245
+ 551298181 => 'TIM',
246
+ 551298182 => 'TIM',
247
+ 551298808 => 'Oi',
248
+ 551298809 => 'Oi',
249
+ 55129881 => 'Oi',
250
+ 551298820 => 'Oi',
251
+ 551298821 => 'Oi',
252
+ 551298822 => 'Oi',
253
+ 551298823 => 'Oi',
254
+ 5512991 => 'Claro BR',
255
+ 55129920 => 'Claro BR',
256
+ 55129921 => 'Claro BR',
257
+ 55129922 => 'Claro BR',
258
+ 55129923 => 'Claro BR',
259
+ 551299240 => 'Claro BR',
260
+ 551299241 => 'Claro BR',
261
+ 551299242 => 'Claro BR',
262
+ 551299243 => 'Claro BR',
263
+ 551299244 => 'Claro BR',
264
+ 551299245 => 'Claro BR',
265
+ 55129960 => 'Vivo',
266
+ 55129961 => 'Vivo',
267
+ 55129962 => 'Vivo',
268
+ 551299630 => 'Vivo',
269
+ 551299631 => 'Vivo',
270
+ 551299632 => 'Vivo',
271
+ 5512997 => 'Vivo',
272
+ 551398111 => 'TIM',
273
+ 551398112 => 'TIM',
274
+ 551398113 => 'TIM',
275
+ 551398114 => 'TIM',
276
+ 551398115 => 'TIM',
277
+ 551398116 => 'TIM',
278
+ 551398117 => 'TIM',
279
+ 551398118 => 'TIM',
280
+ 551398119 => 'TIM',
281
+ 551398121 => 'TIM',
282
+ 551398122 => 'TIM',
283
+ 551398123 => 'TIM',
284
+ 551398124 => 'TIM',
285
+ 551398125 => 'TIM',
286
+ 551398126 => 'TIM',
287
+ 551398127 => 'TIM',
288
+ 551398128 => 'TIM',
289
+ 551398129 => 'TIM',
290
+ 551398131 => 'TIM',
291
+ 551398132 => 'TIM',
292
+ 551398133 => 'TIM',
293
+ 551398134 => 'TIM',
294
+ 551398135 => 'TIM',
295
+ 551398136 => 'TIM',
296
+ 551398137 => 'TIM',
297
+ 551398138 => 'TIM',
298
+ 551398139 => 'TIM',
299
+ 551398141 => 'TIM',
300
+ 551398142 => 'TIM',
301
+ 551398143 => 'TIM',
302
+ 551398144 => 'TIM',
303
+ 551398145 => 'TIM',
304
+ 551398146 => 'TIM',
305
+ 551398147 => 'TIM',
306
+ 551398149 => 'TIM',
307
+ 551398151 => 'TIM',
308
+ 551398152 => 'TIM',
309
+ 551398153 => 'TIM',
310
+ 551398154 => 'TIM',
311
+ 551398155 => 'TIM',
312
+ 551398156 => 'TIM',
313
+ 551398157 => 'TIM',
314
+ 551398158 => 'TIM',
315
+ 551398159 => 'TIM',
316
+ 551398161 => 'TIM',
317
+ 551398803 => 'Oi',
318
+ 551398804 => 'Oi',
319
+ 551398805 => 'Oi',
320
+ 551398806 => 'Oi',
321
+ 551398807 => 'Oi',
322
+ 551398808 => 'Oi',
323
+ 551398809 => 'Oi',
324
+ 55139881 => 'Oi',
325
+ 551398820 => 'Oi',
326
+ 5513991 => 'Claro BR',
327
+ 55139920 => 'Claro BR',
328
+ 551399210 => 'Claro BR',
329
+ 551399211 => 'Claro BR',
330
+ 55139960 => 'Vivo',
331
+ 55139961 => 'Vivo',
332
+ 55139962 => 'Vivo',
333
+ 551399630 => 'Vivo',
334
+ 551399631 => 'Vivo',
335
+ 551399632 => 'Vivo',
336
+ 551399633 => 'Vivo',
337
+ 551399634 => 'Vivo',
338
+ 551399635 => 'Vivo',
339
+ 551399636 => 'Vivo',
340
+ 551399637 => 'Vivo',
341
+ 5513997 => 'Vivo',
342
+ 551498111 => 'TIM',
343
+ 551498112 => 'TIM',
344
+ 551498113 => 'TIM',
345
+ 551498114 => 'TIM',
346
+ 551498115 => 'TIM',
347
+ 551498116 => 'TIM',
348
+ 551498117 => 'TIM',
349
+ 551498118 => 'TIM',
350
+ 551498119 => 'TIM',
351
+ 551498121 => 'TIM',
352
+ 551498122 => 'TIM',
353
+ 551498123 => 'TIM',
354
+ 551498124 => 'TIM',
355
+ 551498125 => 'TIM',
356
+ 551498126 => 'TIM',
357
+ 551498127 => 'TIM',
358
+ 551498128 => 'TIM',
359
+ 551498129 => 'TIM',
360
+ 551498131 => 'TIM',
361
+ 551498132 => 'TIM',
362
+ 551498133 => 'TIM',
363
+ 551498134 => 'TIM',
364
+ 551498135 => 'TIM',
365
+ 551498136 => 'TIM',
366
+ 551498137 => 'TIM',
367
+ 551498138 => 'TIM',
368
+ 551498139 => 'TIM',
369
+ 551498141 => 'TIM',
370
+ 551498142 => 'TIM',
371
+ 551498143 => 'TIM',
372
+ 551498144 => 'TIM',
373
+ 551498145 => 'TIM',
374
+ 551498146 => 'TIM',
375
+ 551498147 => 'TIM',
376
+ 551498148 => 'TIM',
377
+ 551498149 => 'TIM',
378
+ 551498151 => 'TIM',
379
+ 551498152 => 'TIM',
380
+ 551498153 => 'TIM',
381
+ 551498154 => 'TIM',
382
+ 551498155 => 'TIM',
383
+ 551498156 => 'TIM',
384
+ 551498157 => 'TIM',
385
+ 551498158 => 'TIM',
386
+ 551498159 => 'TIM',
387
+ 551498161 => 'TIM',
388
+ 551498162 => 'TIM',
389
+ 551498163 => 'TIM',
390
+ 551498164 => 'TIM',
391
+ 551498165 => 'TIM',
392
+ 551498166 => 'TIM',
393
+ 551498806 => 'Oi',
394
+ 551498807 => 'Oi',
395
+ 551498808 => 'Oi',
396
+ 551498809 => 'Oi',
397
+ 551498810 => 'Oi',
398
+ 551498811 => 'Oi',
399
+ 551498812 => 'Oi',
400
+ 551498813 => 'Oi',
401
+ 551498814 => 'Oi',
402
+ 551499101 => 'Claro BR',
403
+ 551499102 => 'Claro BR',
404
+ 551499103 => 'Claro BR',
405
+ 551499104 => 'Claro BR',
406
+ 551499105 => 'Claro BR',
407
+ 551499106 => 'Claro BR',
408
+ 551499107 => 'Claro BR',
409
+ 551499108 => 'Claro BR',
410
+ 551499109 => 'Claro BR',
411
+ 551499111 => 'Claro BR',
412
+ 551499112 => 'Claro BR',
413
+ 551499113 => 'Claro BR',
414
+ 551499114 => 'Claro BR',
415
+ 551499115 => 'Claro BR',
416
+ 551499116 => 'Claro BR',
417
+ 551499117 => 'Claro BR',
418
+ 551499118 => 'Claro BR',
419
+ 551499119 => 'Claro BR',
420
+ 551499121 => 'Claro BR',
421
+ 551499122 => 'Claro BR',
422
+ 551499123 => 'Claro BR',
423
+ 551499124 => 'Claro BR',
424
+ 551499125 => 'Claro BR',
425
+ 551499126 => 'Claro BR',
426
+ 551499127 => 'Claro BR',
427
+ 551499128 => 'Claro BR',
428
+ 551499129 => 'Claro BR',
429
+ 551499131 => 'Claro BR',
430
+ 551499132 => 'Claro BR',
431
+ 551499133 => 'Claro BR',
432
+ 551499134 => 'Claro BR',
433
+ 551499135 => 'Claro BR',
434
+ 551499136 => 'Claro BR',
435
+ 551499137 => 'Claro BR',
436
+ 551499138 => 'Claro BR',
437
+ 551499141 => 'Claro BR',
438
+ 551499142 => 'Claro BR',
439
+ 551499143 => 'Claro BR',
440
+ 551499146 => 'Claro BR',
441
+ 551499147 => 'Claro BR',
442
+ 551499148 => 'Claro BR',
443
+ 551499149 => 'Claro BR',
444
+ 551499151 => 'Claro BR',
445
+ 551499152 => 'Claro BR',
446
+ 551499153 => 'Claro BR',
447
+ 551499154 => 'Claro BR',
448
+ 551499155 => 'Claro BR',
449
+ 551499156 => 'Claro BR',
450
+ 551499157 => 'Claro BR',
451
+ 551499161 => 'Claro BR',
452
+ 551499162 => 'Claro BR',
453
+ 551499163 => 'Claro BR',
454
+ 551499164 => 'Claro BR',
455
+ 551499165 => 'Claro BR',
456
+ 551499166 => 'Claro BR',
457
+ 551499167 => 'Claro BR',
458
+ 551499168 => 'Claro BR',
459
+ 551499169 => 'Claro BR',
460
+ 551499171 => 'Claro BR',
461
+ 551499172 => 'Claro BR',
462
+ 551499173 => 'Claro BR',
463
+ 551499174 => 'Claro BR',
464
+ 551499175 => 'Claro BR',
465
+ 551499176 => 'Claro BR',
466
+ 551499177 => 'Claro BR',
467
+ 551499178 => 'Claro BR',
468
+ 551499179 => 'Claro BR',
469
+ 551499181 => 'Claro BR',
470
+ 551499182 => 'Claro BR',
471
+ 551499183 => 'Claro BR',
472
+ 551499184 => 'Claro BR',
473
+ 551499185 => 'Claro BR',
474
+ 551499186 => 'Claro BR',
475
+ 551499187 => 'Claro BR',
476
+ 551499188 => 'Claro BR',
477
+ 551499189 => 'Claro BR',
478
+ 551499191 => 'Claro BR',
479
+ 551499192 => 'Claro BR',
480
+ 551499193 => 'Claro BR',
481
+ 551499194 => 'Claro BR',
482
+ 551499195 => 'Claro BR',
483
+ 551499196 => 'Claro BR',
484
+ 551499197 => 'Claro BR',
485
+ 5514996 => 'Vivo',
486
+ 5514997 => 'Vivo',
487
+ 55149980 => 'Vivo',
488
+ 55149981 => 'Vivo',
489
+ 55149982 => 'Vivo',
490
+ 551499830 => 'Vivo',
491
+ 551499831 => 'Vivo',
492
+ 551499832 => 'Vivo',
493
+ 551598111 => 'TIM',
494
+ 551598112 => 'TIM',
495
+ 551598113 => 'TIM',
496
+ 551598114 => 'TIM',
497
+ 551598115 => 'TIM',
498
+ 551598116 => 'TIM',
499
+ 551598117 => 'TIM',
500
+ 551598118 => 'TIM',
501
+ 551598119 => 'TIM',
502
+ 551598121 => 'TIM',
503
+ 551598122 => 'TIM',
504
+ 551598123 => 'TIM',
505
+ 551598124 => 'TIM',
506
+ 551598125 => 'TIM',
507
+ 551598126 => 'TIM',
508
+ 551598127 => 'TIM',
509
+ 551598128 => 'TIM',
510
+ 551598129 => 'TIM',
511
+ 551598131 => 'TIM',
512
+ 551598132 => 'TIM',
513
+ 551598133 => 'TIM',
514
+ 551598134 => 'TIM',
515
+ 551598135 => 'TIM',
516
+ 551598136 => 'TIM',
517
+ 551598138 => 'TIM',
518
+ 551598139 => 'TIM',
519
+ 551598141 => 'TIM',
520
+ 551598804 => 'Oi',
521
+ 551598805 => 'Oi',
522
+ 551598806 => 'Oi',
523
+ 551598807 => 'Oi',
524
+ 551598808 => 'Oi',
525
+ 551598809 => 'Oi',
526
+ 551598810 => 'Oi',
527
+ 551598813 => 'Oi',
528
+ 551598814 => 'Oi',
529
+ 551598815 => 'Oi',
530
+ 551599101 => 'Claro BR',
531
+ 551599102 => 'Claro BR',
532
+ 551599103 => 'Claro BR',
533
+ 551599104 => 'Claro BR',
534
+ 551599105 => 'Claro BR',
535
+ 551599106 => 'Claro BR',
536
+ 551599107 => 'Claro BR',
537
+ 551599108 => 'Claro BR',
538
+ 551599109 => 'Claro BR',
539
+ 551599111 => 'Claro BR',
540
+ 551599112 => 'Claro BR',
541
+ 551599113 => 'Claro BR',
542
+ 551599114 => 'Claro BR',
543
+ 551599115 => 'Claro BR',
544
+ 551599116 => 'Claro BR',
545
+ 551599117 => 'Claro BR',
546
+ 551599118 => 'Claro BR',
547
+ 551599119 => 'Claro BR',
548
+ 551599121 => 'Claro BR',
549
+ 551599122 => 'Claro BR',
550
+ 551599123 => 'Claro BR',
551
+ 551599124 => 'Claro BR',
552
+ 551599125 => 'Claro BR',
553
+ 551599126 => 'Claro BR',
554
+ 551599127 => 'Claro BR',
555
+ 551599128 => 'Claro BR',
556
+ 551599129 => 'Claro BR',
557
+ 551599131 => 'Claro BR',
558
+ 551599132 => 'Claro BR',
559
+ 551599133 => 'Claro BR',
560
+ 551599134 => 'Claro BR',
561
+ 551599135 => 'Claro BR',
562
+ 551599136 => 'Claro BR',
563
+ 551599137 => 'Claro BR',
564
+ 551599138 => 'Claro BR',
565
+ 551599139 => 'Claro BR',
566
+ 551599141 => 'Claro BR',
567
+ 551599142 => 'Claro BR',
568
+ 551599143 => 'Claro BR',
569
+ 551599144 => 'Claro BR',
570
+ 551599145 => 'Claro BR',
571
+ 551599146 => 'Claro BR',
572
+ 551599147 => 'Claro BR',
573
+ 551599148 => 'Claro BR',
574
+ 551599149 => 'Claro BR',
575
+ 551599151 => 'Claro BR',
576
+ 551599152 => 'Claro BR',
577
+ 551599153 => 'Claro BR',
578
+ 551599154 => 'Claro BR',
579
+ 551599155 => 'Claro BR',
580
+ 551599156 => 'Claro BR',
581
+ 551599157 => 'Claro BR',
582
+ 551599158 => 'Claro BR',
583
+ 551599159 => 'Claro BR',
584
+ 551599161 => 'Claro BR',
585
+ 551599162 => 'Claro BR',
586
+ 551599163 => 'Claro BR',
587
+ 551599164 => 'Claro BR',
588
+ 551599165 => 'Claro BR',
589
+ 551599166 => 'Claro BR',
590
+ 551599167 => 'Claro BR',
591
+ 551599168 => 'Claro BR',
592
+ 551599169 => 'Claro BR',
593
+ 551599171 => 'Claro BR',
594
+ 551599172 => 'Claro BR',
595
+ 551599173 => 'Claro BR',
596
+ 551599174 => 'Claro BR',
597
+ 551599175 => 'Claro BR',
598
+ 551599176 => 'Claro BR',
599
+ 551599177 => 'Claro BR',
600
+ 551599178 => 'Claro BR',
601
+ 551599179 => 'Claro BR',
602
+ 551599181 => 'Claro BR',
603
+ 551599182 => 'Claro BR',
604
+ 551599183 => 'Claro BR',
605
+ 551599184 => 'Claro BR',
606
+ 551599185 => 'Claro BR',
607
+ 551599186 => 'Claro BR',
608
+ 551599187 => 'Claro BR',
609
+ 551599188 => 'Claro BR',
610
+ 551599201 => 'Claro BR',
611
+ 55159960 => 'Vivo',
612
+ 55159961 => 'Vivo',
613
+ 55159962 => 'Vivo',
614
+ 55159963 => 'Vivo',
615
+ 55159964 => 'Vivo',
616
+ 55159965 => 'Vivo',
617
+ 55159966 => 'Vivo',
618
+ 55159967 => 'Vivo',
619
+ 55159968 => 'Vivo',
620
+ 551599690 => 'Vivo',
621
+ 551599691 => 'Vivo',
622
+ 551599692 => 'Vivo',
623
+ 551599693 => 'Vivo',
624
+ 551599694 => 'Vivo',
625
+ 551599695 => 'Vivo',
626
+ 551599696 => 'Vivo',
627
+ 551599697 => 'Vivo',
628
+ 5515997 => 'Vivo',
629
+ 551698111 => 'TIM',
630
+ 551698112 => 'TIM',
631
+ 551698113 => 'TIM',
632
+ 551698114 => 'TIM',
633
+ 551698115 => 'TIM',
634
+ 551698116 => 'TIM',
635
+ 551698117 => 'TIM',
636
+ 551698118 => 'TIM',
637
+ 551698119 => 'TIM',
638
+ 551698121 => 'TIM',
639
+ 551698122 => 'TIM',
640
+ 551698123 => 'TIM',
641
+ 551698124 => 'TIM',
642
+ 551698125 => 'TIM',
643
+ 551698126 => 'TIM',
644
+ 551698127 => 'TIM',
645
+ 551698128 => 'TIM',
646
+ 551698129 => 'TIM',
647
+ 551698131 => 'TIM',
648
+ 551698132 => 'TIM',
649
+ 551698133 => 'TIM',
650
+ 551698134 => 'TIM',
651
+ 551698135 => 'TIM',
652
+ 551698136 => 'TIM',
653
+ 551698137 => 'TIM',
654
+ 551698138 => 'TIM',
655
+ 551698139 => 'TIM',
656
+ 551698141 => 'TIM',
657
+ 551698142 => 'TIM',
658
+ 551698143 => 'TIM',
659
+ 551698144 => 'TIM',
660
+ 551698145 => 'TIM',
661
+ 551698146 => 'TIM',
662
+ 551698147 => 'TIM',
663
+ 551698148 => 'TIM',
664
+ 551698149 => 'TIM',
665
+ 551698151 => 'TIM',
666
+ 551698152 => 'TIM',
667
+ 551698153 => 'TIM',
668
+ 551698154 => 'TIM',
669
+ 551698155 => 'TIM',
670
+ 551698156 => 'TIM',
671
+ 551698157 => 'TIM',
672
+ 551698158 => 'TIM',
673
+ 551698159 => 'TIM',
674
+ 551698161 => 'TIM',
675
+ 551698162 => 'TIM',
676
+ 551698163 => 'TIM',
677
+ 551698164 => 'TIM',
678
+ 551698165 => 'TIM',
679
+ 551698166 => 'TIM',
680
+ 551698167 => 'TIM',
681
+ 551698168 => 'TIM',
682
+ 551698169 => 'TIM',
683
+ 551698171 => 'TIM',
684
+ 551698172 => 'TIM',
685
+ 551698173 => 'TIM',
686
+ 551698174 => 'TIM',
687
+ 551698175 => 'TIM',
688
+ 551698176 => 'TIM',
689
+ 551698177 => 'TIM',
690
+ 551698178 => 'TIM',
691
+ 551698179 => 'TIM',
692
+ 551698181 => 'TIM',
693
+ 551698182 => 'TIM',
694
+ 551698183 => 'TIM',
695
+ 551698184 => 'TIM',
696
+ 551698803 => 'Oi',
697
+ 551698804 => 'Oi',
698
+ 551698805 => 'Oi',
699
+ 551698806 => 'Oi',
700
+ 551698807 => 'Oi',
701
+ 551698808 => 'Oi',
702
+ 551698809 => 'Oi',
703
+ 55169881 => 'Oi',
704
+ 551698820 => 'Oi',
705
+ 551698821 => 'Oi',
706
+ 551698822 => 'Oi',
707
+ 551698823 => 'Oi',
708
+ 5516991 => 'Claro BR',
709
+ 5516992 => 'Claro BR',
710
+ 55169930 => 'Claro BR',
711
+ 55169931 => 'Claro BR',
712
+ 55169932 => 'Claro BR',
713
+ 55169933 => 'Claro BR',
714
+ 55169934 => 'Claro BR',
715
+ 55169935 => 'Claro BR',
716
+ 551699360 => 'Claro BR',
717
+ 551699361 => 'Claro BR',
718
+ 551699362 => 'Claro BR',
719
+ 551699363 => 'Claro BR',
720
+ 551699364 => 'Claro BR',
721
+ 551699601 => 'Vivo',
722
+ 551699606 => 'Vivo',
723
+ 551699607 => 'Vivo',
724
+ 551699608 => 'Vivo',
725
+ 551699609 => 'Vivo',
726
+ 551699701 => 'Vivo',
727
+ 551699702 => 'Vivo',
728
+ 551699703 => 'Vivo',
729
+ 551699704 => 'Vivo',
730
+ 551699705 => 'Vivo',
731
+ 551699706 => 'Vivo',
732
+ 551699707 => 'Vivo',
733
+ 551699708 => 'Vivo',
734
+ 551699709 => 'Vivo',
735
+ 551699711 => 'Vivo',
736
+ 551699712 => 'Vivo',
737
+ 551699713 => 'Vivo',
738
+ 551699714 => 'Vivo',
739
+ 551699715 => 'Vivo',
740
+ 551699716 => 'Vivo',
741
+ 551699717 => 'Vivo',
742
+ 551699718 => 'Vivo',
743
+ 551699719 => 'Vivo',
744
+ 551699721 => 'Vivo',
745
+ 551699722 => 'Vivo',
746
+ 551699723 => 'Vivo',
747
+ 551699724 => 'Vivo',
748
+ 551699725 => 'Vivo',
749
+ 551699726 => 'Vivo',
750
+ 551699727 => 'Vivo',
751
+ 551699728 => 'Vivo',
752
+ 551699729 => 'Vivo',
753
+ 551699731 => 'Vivo',
754
+ 551699732 => 'Vivo',
755
+ 551699733 => 'Vivo',
756
+ 551699734 => 'Vivo',
757
+ 551699735 => 'Vivo',
758
+ 551699736 => 'Vivo',
759
+ 551699737 => 'Vivo',
760
+ 551699738 => 'Vivo',
761
+ 551699739 => 'Vivo',
762
+ 551699741 => 'Vivo',
763
+ 551699742 => 'Vivo',
764
+ 551699743 => 'Vivo',
765
+ 551699744 => 'Vivo',
766
+ 551699745 => 'Vivo',
767
+ 551699746 => 'Vivo',
768
+ 551699747 => 'Vivo',
769
+ 551699748 => 'Vivo',
770
+ 551699749 => 'Vivo',
771
+ 551699751 => 'Vivo',
772
+ 551699752 => 'Vivo',
773
+ 551699753 => 'Vivo',
774
+ 551699754 => 'Vivo',
775
+ 551699755 => 'Vivo',
776
+ 551699756 => 'Vivo',
777
+ 551699757 => 'Vivo',
778
+ 551699758 => 'Vivo',
779
+ 551699759 => 'Vivo',
780
+ 551699761 => 'Vivo',
781
+ 551699762 => 'Vivo',
782
+ 551699763 => 'Vivo',
783
+ 551699764 => 'Vivo',
784
+ 551699765 => 'Vivo',
785
+ 551699766 => 'Vivo',
786
+ 551699767 => 'Vivo',
787
+ 551699768 => 'Vivo',
788
+ 551699769 => 'Vivo',
789
+ 551699770 => 'Vivo',
790
+ 551699771 => 'Vivo',
791
+ 551699772 => 'Vivo',
792
+ 551699773 => 'Vivo',
793
+ 551699774 => 'Vivo',
794
+ 551699775 => 'Vivo',
795
+ 551699776 => 'Vivo',
796
+ 551699777 => 'Vivo',
797
+ 551699778 => 'Vivo',
798
+ 551699780 => 'Vivo',
799
+ 551699781 => 'Vivo',
800
+ 551699782 => 'Vivo',
801
+ 551699783 => 'Vivo',
802
+ 551699784 => 'Vivo',
803
+ 551699785 => 'Vivo',
804
+ 551699786 => 'Vivo',
805
+ 551699787 => 'Vivo',
806
+ 551699788 => 'Vivo',
807
+ 551699791 => 'Vivo',
808
+ 551699792 => 'Vivo',
809
+ 551699793 => 'Vivo',
810
+ 551699794 => 'Vivo',
811
+ 551699796 => 'Vivo',
812
+ 551699961 => 'Vivo',
813
+ 551699962 => 'Vivo',
814
+ 551699963 => 'Vivo',
815
+ 551699964 => 'Vivo',
816
+ 551699975 => 'Vivo',
817
+ 551699991 => 'Vivo',
818
+ 551699992 => 'Vivo',
819
+ 551699993 => 'Vivo',
820
+ 551699994 => 'Vivo',
821
+ 551798111 => 'TIM',
822
+ 551798112 => 'TIM',
823
+ 551798113 => 'TIM',
824
+ 551798114 => 'TIM',
825
+ 551798115 => 'TIM',
826
+ 551798116 => 'TIM',
827
+ 551798117 => 'TIM',
828
+ 551798118 => 'TIM',
829
+ 551798119 => 'TIM',
830
+ 551798121 => 'TIM',
831
+ 551798122 => 'TIM',
832
+ 551798123 => 'TIM',
833
+ 551798124 => 'TIM',
834
+ 551798125 => 'TIM',
835
+ 551798126 => 'TIM',
836
+ 551798127 => 'TIM',
837
+ 551798128 => 'TIM',
838
+ 551798129 => 'TIM',
839
+ 551798131 => 'TIM',
840
+ 551798132 => 'TIM',
841
+ 551798133 => 'TIM',
842
+ 551798134 => 'TIM',
843
+ 551798135 => 'TIM',
844
+ 551798136 => 'TIM',
845
+ 551798137 => 'TIM',
846
+ 551798138 => 'TIM',
847
+ 551798139 => 'TIM',
848
+ 551798141 => 'TIM',
849
+ 551798142 => 'TIM',
850
+ 551798143 => 'TIM',
851
+ 551798144 => 'TIM',
852
+ 551798145 => 'TIM',
853
+ 551798146 => 'TIM',
854
+