Merge branch 'MDL-81924-main' of https://github.com/HuongNV13/moodle

This commit is contained in:
Huong Nguyen
2024-09-23 11:33:14 +07:00
362 changed files with 52915 additions and 463 deletions
@@ -0,0 +1,9 @@
issueNumber: MDL-80962
notes:
factor_sms:
- message: >
The following classes are removed as the SMS feature now takes advantage of core_sms API:
- sms_sent (admin/tool/mfa/factor/sms/classes/event/sms_sent.php)
- aws_sns (admin/tool/mfa/factor/sms/classes/local/smsgateway/aws_sns.php)
- gateway_interface (admin/tool/mfa/factor/sms/classes/local/smsgateway/gateway_interface.php)
type: removed
@@ -0,0 +1,9 @@
issueNumber: MDL-80962
notes:
core:
- message: >
The following classes are deprecated as they are handled by core_sms API and smsgateway_aws plugin:
- admin_settings_aws_region (lib/classes/aws/admin_settings_aws_region.php)
- aws_helper (lib/classes/aws/aws_helper.php)
- client_factory (lib/classes/aws/client_factory.php)
type: deprecated
@@ -0,0 +1,8 @@
issueNumber: MDL-80962
notes:
core:
- message: >
The following test classes are removed as their base classes are deprecated:
- admin_settings_aws_region_test (lib/tests/aws/admin_settings_aws_region_test.php)
- aws_helper_test (lib/tests/aws/aws_helper_test.php)
type: removed
@@ -0,0 +1,5 @@
issueNumber: MDL-81924
notes:
core_sms:
- message: A new `\core_sms` subsystem has been created
type: improved
+31
View File
@@ -836,6 +836,37 @@ if ($hassiteconfig && core_communication\api::is_available()) {
}
}
// SMS plugins.
if ($hassiteconfig) {
$ADMIN->add(
'modules',
new admin_category(
'sms',
new lang_string('sms', 'core_sms'),
),
);
$ADMIN->add(
'sms',
new admin_externalpage(
'smsgateway',
new lang_string('manage_sms_gateways', 'core_sms'),
$CFG->wwwroot . '/sms/sms_gateways.php',
),
);
foreach (core_component::get_plugin_list('smsgateway') as $plugin => $path) {
$settingspath = $path . '/settings.php';
if (file_exists($settingspath)) {
$settings = new admin_settingpage(
'smsgateway_' . $plugin . '_settings',
new lang_string('pluginname', 'smsgateway_' . $plugin),
'moodle/site:config',
);
include($settingspath);
$ADMIN->add('smsgateway', $settings);
}
}
}
// Content bank content types.
if ($hassiteconfig) {
$ADMIN->add('modules', new admin_category('contentbanksettings', new lang_string('contentbank')));
@@ -125,7 +125,12 @@ class admin_setting_managemfa extends \admin_setting {
foreach ($factors as $factor) {
$settingsparams = ['section' => 'factor_'.$factor->name];
$settingsurl = new \moodle_url('settings.php', $settingsparams);
$settingslink = \html_writer::link($settingsurl, $txt->settings);
$settingslinkattrtext = get_string('editfactor', 'tool_mfa', $factor->get_display_name());
$settingslinkattr = [
'title' => $settingslinkattrtext,
'aria-label' => $settingslinkattrtext,
];
$settingslink = \html_writer::link($settingsurl, $txt->settings, $settingslinkattr);
if ($factor->is_enabled()) {
$hideshowparams = ['action' => 'disable', 'factor' => $factor->name, 'sesskey' => $sesskey];
@@ -1,62 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace factor_sms\event;
/**
* Event for a sent SMS
*
* @package factor_sms
* @author Alex Morris <[email protected]>
* @copyright Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class sms_sent extends \core\event\base {
/**
* Init sms sent event
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_OTHER;
}
/**
* Returns non-localised event description with id's for admin use only.
*
* @return string
*/
public function get_description(): string {
$content = [
'userid' => $this->other['userid'],
'debuginfo' => is_array($this->other['debug']) ? json_encode($this->other['debug']) : $this->other['debug'],
];
return get_string('event:smssentdescription', 'factor_sms', $content);
}
/**
* Returns localised general event name.
*
* Override in subclass, we can not make it static and abstract at the same time.
*
* @return string
*/
public static function get_name(): string {
return get_string('event:smssent', 'factor_sms');
}
}
+16 -15
View File
@@ -19,6 +19,7 @@ namespace factor_sms;
use moodle_url;
use stdClass;
use tool_mfa\local\factor\object_factor_base;
use tool_mfa\local\secret_manager;
/**
* SMS Factor implementation.
@@ -231,7 +232,7 @@ class factor extends object_factor_base {
unset($SESSION->tool_mfa_sms_number);
}
// Clean temp secrets code.
$secretmanager = new \tool_mfa\local\secret_manager('sms');
$secretmanager = new secret_manager('sms');
$secretmanager->cleanup_temp_secrets();
}
@@ -323,14 +324,6 @@ class factor extends object_factor_base {
* @return bool
*/
public function is_enabled(): bool {
if (empty(get_config('factor_sms', 'gateway'))) {
return false;
}
$class = '\factor_sms\local\smsgateway\\' . get_config('factor_sms', 'gateway');
if (!call_user_func($class . '::is_gateway_enabled')) {
return false;
}
return parent::is_enabled();
}
@@ -412,9 +405,17 @@ class factor extends object_factor_base {
];
$message = get_string('smsstring', 'factor_sms', $content);
$class = '\factor_sms\local\smsgateway\\' . get_config('factor_sms', 'gateway');
$gateway = new $class();
$gateway->send_sms_message($message, $phonenumber);
$manager = \core\di::get(\core_sms\manager::class);
$manager->send(
recipientnumber: $phonenumber,
content: $message,
component: 'factor_sms',
messagetype: 'mfa',
recipientuserid: null,
issensitive: true,
async: false,
gatewayid: get_config('factor_sms', 'smsgateway'),
);
}
/**
@@ -424,7 +425,7 @@ class factor extends object_factor_base {
* @return bool
*/
private function check_verification_code(string $enteredcode): bool {
return ($this->secretmanager->validate_secret($enteredcode) === \tool_mfa\local\secret_manager::VALID) ? true : false;
return $this->secretmanager->validate_secret($enteredcode) === secret_manager::VALID;
}
/**
@@ -453,8 +454,8 @@ class factor extends object_factor_base {
if (empty($phonenumber)) {
return get_string('errorsmssent', 'factor_sms');
} else {
return get_string('logindesc', 'factor_' . $this->name, $phonenumber);
}
return get_string('logindesc', 'factor_' . $this->name, $phonenumber);
}
}
@@ -0,0 +1,50 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace factor_sms;
use core_sms\hook\before_gateway_deleted;
use core_sms\hook\before_gateway_disabled;
/**
* Hook listener for SMS factor.
*
* @package factor_sms
* @copyright 2024 Safat Shahin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class hook_listener {
/**
* Hook listener before a gateway is deleted or disabled.
*
* This listener will check if the SMS gateway is currently in use before disabling or deleting the gateway.
*
* @param before_gateway_deleted|before_gateway_disabled $hook Hook instance before the gateway is deleted
*/
public static function check_gateway_usage_in_mfa(
before_gateway_deleted|before_gateway_disabled $hook,
): void {
try {
$smsgatewayid = (int)get_config('factor_sms', 'smsgateway');
if ($smsgatewayid && $smsgatewayid === (int)$hook->gateway->id) {
$hook->stop_propagation();
}
} catch (\dml_exception $exception) {
$hook->stop_propagation();
}
}
}
@@ -1,151 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace factor_sms\local\smsgateway;
use core\aws\admin_settings_aws_region;
use core\aws\aws_helper;
use factor_sms\event\sms_sent;
/**
* AWS SNS SMS Gateway class
*
* @package factor_sms
* @author Peter Burnett <[email protected]>
* @copyright Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class aws_sns implements gateway_interface {
/**
* Create an instance of this class.
*/
public function __construct() {
global $CFG;
require_once($CFG->libdir . '/aws-sdk/src/functions.php');
}
/**
* Sends a message using the AWS SNS API
*
* @param string $messagecontent the content to send in the SMS message.
* @param string $phonenumber the destination for the message.
* @return bool true on message send success
*/
public function send_sms_message(string $messagecontent, string $phonenumber): bool {
global $SITE, $USER;
$config = get_config('factor_sms');
// Setup client params and instantiate client.
$params = [
'version' => 'latest',
'region' => $config->api_region,
'http' => ['proxy' => aws_helper::get_proxy_string()],
];
if (!$config->usecredchain) {
$params['credentials'] = [
'key' => $config->api_key,
'secret' => $config->api_secret,
];
}
$client = new \Aws\Sns\SnsClient($params);
// Transform the phone number to international standard.
$phonenumber = \factor_sms\helper::format_number($phonenumber);
// Setup the sender information.
$senderid = $SITE->shortname;
// Remove spaces and non-alphanumeric characters from ID.
$senderid = preg_replace("/[^A-Za-z0-9]/", '', trim($senderid));
// We have to truncate the senderID to 11 chars.
$senderid = substr($senderid, 0, 11);
if (defined('BEHAT_SITE_RUNNING')) {
// Fake SMS sending in behat.
return true;
}
try {
// These messages need to be transactional.
$client->SetSMSAttributes([
'attributes' => [
'DefaultSMSType' => 'Transactional',
'DefaultSenderID' => $senderid,
],
]);
// Actually send the message.
$result = $client->publish([
'Message' => $messagecontent,
'PhoneNumber' => $phonenumber,
]);
$data = [
'relateduserid' => null,
'context' => \context_user::instance($USER->id),
'other' => [
'userid' => $USER->id,
'debug' => [
'messageid' => $result->get('MessageId'),
],
],
];
$event = sms_sent::create($data);
$event->trigger();
return true;
} catch (\Aws\Exception\AwsException $e) {
throw new \moodle_exception('errorawsconection', 'factor_sms', '', $e->getAwsErrorMessage());
}
}
/**
* Add gateway specific settings to the SMS factor settings page.
*
* @param \admin_settingpage $settings
* @return void
*/
public static function add_settings(\admin_settingpage $settings): void {
$settings->add(new \admin_setting_configcheckbox('factor_sms/usecredchain',
get_string('settings:aws:usecredchain', 'factor_sms'), '', 0));
if (!get_config('factor_sms', 'usecredchain')) {
// AWS Settings.
$settings->add(new \admin_setting_configtext('factor_sms/api_key',
get_string('settings:aws:key', 'factor_sms'),
get_string('settings:aws:key_help', 'factor_sms'), ''));
$settings->add(new \admin_setting_configpasswordunmask('factor_sms/api_secret',
get_string('settings:aws:secret', 'factor_sms'),
get_string('settings:aws:secret_help', 'factor_sms'), ''));
}
$settings->add(new admin_settings_aws_region('factor_sms/api_region',
get_string('settings:aws:region', 'factor_sms'),
get_string('settings:aws:region_help', 'factor_sms'),
'ap-southeast-2'));
}
/**
* Returns whether or not the gateway is enabled
*
* @return bool
*/
public static function is_gateway_enabled(): bool {
return true;
}
}
@@ -0,0 +1,57 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace factor_sms\task;
use core\task\adhoc_task;
use moodle_url;
/**
* Notification for admins to notify about the migration of SMS setup from MFA to SMS gateway plugins.
*
* @package factor_sms
* @copyright 2024 Safat Shahin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class sms_gateway_migration_notification extends adhoc_task {
public function execute(): void {
$siteadmins = get_admins();
foreach ($siteadmins as $siteadmin) {
$smsconfigureurl = new moodle_url('/sms/sms_gateways.php');
$messagebody = get_string('notification:smsgatewaymigrationinfo', 'factor_sms', $smsconfigureurl);
$messagesubject = get_string('notification:smsgatewaymigration', 'factor_sms');
$message = new \core\message\message();
$message->component = 'moodle';
$message->name = 'notices';
$message->userfrom = \core_user::get_noreply_user();
$message->subject = $messagesubject;
$message->fullmessageformat = FORMAT_HTML;
$message->notification = 1;
$message->userto = $siteadmin;
$message->smallmessage = $messagesubject;
$message->fullmessagehtml = $messagebody;
$message->fullmessage = html_to_text($messagebody);
$message->contexturl = $smsconfigureurl;
$message->contexturlname = $messagesubject;
// Send message.
message_send($message);
}
}
}
+36
View File
@@ -0,0 +1,36 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Hooks register for SMS factor.
*
* @package factor_sms
* @copyright 2024 Safat Shahin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$callbacks = [
[
'hook' => \core_sms\hook\before_gateway_deleted::class,
'callback' => \factor_sms\hook_listener::class . '::check_gateway_usage_in_mfa',
],
[
'hook' => \core_sms\hook\before_gateway_disabled::class,
'callback' => \factor_sms\hook_listener::class . '::check_gateway_usage_in_mfa',
],
];
+77
View File
@@ -0,0 +1,77 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* factor_sms upgrade library.
*
* @package factor_sms
* @copyright 2024 Safat Shahin <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Factor sms upgrade helper.
*
* @param int $oldversion Previous version of the plugin.
* @return bool
*/
function xmldb_factor_sms_upgrade(int $oldversion): bool {
if ($oldversion < 2024082200) {
$config = get_config('factor_sms');
// If the sms factor is enabled, then do the migration to the sms subsystem.
if ((int)$config->enabled === 1) {
// SMS gateway configs.
$smsconfig = new stdClass();
$smsconfig->countrycode = $config->countrycode;
$smsconfig->gateway = $config->gateway;
$smsconfig->usecredchain = $config->usecredchain;
$smsconfig->api_key = $config->api_key;
$smsconfig->api_secret = $config->api_secret;
$smsconfig->api_region = $config->api_region;
// Now insert the record.
$manager = \core\di::get(\core_sms\manager::class);
$gateway = $manager->create_gateway_instance(
classname: \smsgateway_aws\gateway::class,
name: 'MFA AWS',
enabled: $config->enabled,
config: $smsconfig,
);
// Set the mfa config for the sms gateway.
set_config('smsgateway', $gateway->id, 'factor_sms');
// Now add the task to send notification to admins about this migration.
$task = new \factor_sms\task\sms_gateway_migration_notification();
\core\task\manager::queue_adhoc_task($task, true);
}
// MFA savepoint reached.
upgrade_plugin_savepoint(true, 2024082200, 'factor', 'sms');
}
if ($oldversion < 2024082201) {
// Unset the removed admin settings.
unset_config('countrycode', 'factor_sms');
unset_config('gateway', 'factor_sms');
unset_config('usecredchain', 'factor_sms');
unset_config('api_key', 'factor_sms');
unset_config('api_secret', 'factor_sms');
unset_config('api_region', 'factor_sms');
// MFA savepoint reached.
upgrade_plugin_savepoint(true, 2024082201, 'factor', 'sms');
}
return true;
}
@@ -0,0 +1,15 @@
settings:countrycode,factor_sms
settings:countrycode_help,factor_sms
settings:aws,factor_sms
settings:aws:key,factor_sms
settings:aws:key_help,factor_sms
settings:aws:region,factor_sms
settings:aws:region_help,factor_sms
settings:aws:secret,factor_sms
settings:aws:secret_help,factor_sms
settings:aws:usecredchain,factor_sms
settings:gateway,factor_sms
settings:gateway_help,factor_sms
errorawsconection,factor_sms
event:smssentdescription,factor_sms
event:smssent,factor_sms
@@ -29,13 +29,10 @@ $string['addnumber'] = 'Mobile number';
$string['clientnotfound'] = 'AWS service client not found. Client must be fully qualified classname e.g. \Aws\S3\S3Client.';
$string['editphonenumber'] = 'Edit phone number';
$string['editphonenumberinfo'] = 'If you didn\'t receive the code or entered the wrong number, please edit the number and try again.';
$string['errorawsconection'] = 'Error connecting to AWS server: {$a}';
$string['errorsmssent'] = 'Error sending a SMS message containing your verification code.';
$string['error:emptyverification'] = 'Empty code. Try again.';
$string['error:wrongphonenumber'] = 'The phone number you provided is not in a valid format.';
$string['error:wrongverification'] = 'Wrong code. Try again.';
$string['event:smssent'] = 'SMS message sent.';
$string['event:smssentdescription'] = 'The user with ID {$a->userid} was sent a verification code via SMS. Information: {$a->debuginfo}';
$string['info'] = 'Have a verification code sent to the mobile number you choose.';
$string['logindesc'] = 'SMS message containing a 6-digit code sent to mobile number {$a}';
$string['loginoption'] = 'Have a code sent to your mobile phone';
@@ -44,27 +41,23 @@ $string['loginsubmit'] = 'Continue';
$string['managefactor'] = 'Manage SMS';
$string['managefactorbutton'] = 'Manage';
$string['manageinfo'] = 'You are using \'{$a}\' to authenticate.';
$string['notification:smsgatewaymigration'] = 'SMS settings have moved';
$string['notification:smsgatewaymigrationinfo'] = 'A new SMS subsystem is now available for managing and configuring all SMS-related functions. Your existing SMS configurations have been seamlessly migrated. You can find and manage them on the new <a href="{$a}">SMS Gateways page</a>.';
$string['logintitle'] = 'Enter the verification code sent to your mobile';
$string['phonehelp'] = 'Enter your mobile number (including country code) to receive a verification code.';
$string['pluginname'] = 'SMS mobile phone';
$string['privacy:metadata'] = 'The SMS mobile phone factor plugin does not store any personal data.';
$string['revokefactorconfirmation'] = 'Remove \'{$a}\' SMS?';
$string['settings:aws'] = 'AWS SNS';
$string['settings:aws:key'] = 'Key';
$string['settings:aws:key_help'] = 'Amazon API key credential.';
$string['settings:aws:region'] = 'Region';
$string['settings:aws:region_help'] = 'Amazon API gateway region.';
$string['settings:aws:secret'] = 'Secret';
$string['settings:aws:secret_help'] = 'Amazon API secret credential.';
$string['settings:aws:usecredchain'] = 'Find AWS credentials using the default credential provider chain';
$string['settings:countrycode'] = 'Country number code';
$string['settings:countrycode_help'] = 'The calling code without the leading + as a default if users do not enter an international number with a + prefix.
See this link for a list of calling codes: {$a}';
$string['settings:duration'] = 'Validity duration';
$string['settings:duration_help'] = 'The period of time that the code is valid.';
$string['settings:gateway'] = 'SMS gateway';
$string['settings:gateway_help'] = 'The SMS provider you wish to send messages via';
$string['settings:heading'] = 'Users will receive an SMS with 6-digit code during login, which they must enter to complete the login process.
Users will need to register their mobile phone number first.';
$string['settings:setupdesc'] = '<br><br>To use SMS as an authentication factor, you first need to <a href="{$a}">set up an SMS gateway</a>.';
$string['settings:smsgateway'] = 'SMS gateway';
$string['settings:smsgateway_help'] = 'Select a gateway from the list, or <a href="{$a}">create a new gateway</a>.';
$string['setupfactor'] = 'Set up SMS';
$string['setupfactorbutton'] = 'Set up';
$string['setupsubmitcode'] = 'Save';
@@ -73,3 +66,22 @@ $string['smsstring'] = '{$a->code} is your {$a->fullname} one-time security code
@{$a->url} #{$a->code}';
$string['summarycondition'] = 'Using an SMS one-time security code';
// Deprecated since Moodle 4.5.
$string['settings:countrycode'] = 'Country number code';
$string['settings:countrycode_help'] = 'The calling code without the leading + as a default if users do not enter an international number with a + prefix.
See this link for a list of calling codes: {$a}';
$string['settings:aws'] = 'AWS SNS';
$string['settings:aws:key'] = 'Key';
$string['settings:aws:key_help'] = 'Amazon API key credential.';
$string['settings:aws:region'] = 'Region';
$string['settings:aws:region_help'] = 'Amazon API gateway region.';
$string['settings:aws:secret'] = 'Secret';
$string['settings:aws:secret_help'] = 'Amazon API secret credential.';
$string['settings:aws:usecredchain'] = 'Find AWS credentials using the default credential provider chain';
$string['settings:gateway'] = 'SMS Gateway';
$string['settings:gateway_help'] = 'The SMS provider you wish to send messages via';
$string['errorawsconection'] = 'Error connecting to AWS server: {$a}';
$string['event:smssentdescription'] = 'The user with ID {$a->userid} was sent a verification code via SMS. Information: {$a->debuginfo}';
$string['event:smssent'] = 'SMS message sent.';
+86 -33
View File
@@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Settings
* Settings for SMS MFA factor.
*
* @package factor_sms
* @author Peter Burnett <[email protected]>
@@ -24,43 +24,96 @@
*/
defined('MOODLE_INTERNAL') || die();
global $CFG, $OUTPUT;
$enabled = new admin_setting_configcheckbox('factor_sms/enabled',
new lang_string('settings:enablefactor', 'tool_mfa'),
new lang_string('settings:enablefactor_help', 'tool_mfa'), 0);
$enabled->set_updatedcallback(function () {
\tool_mfa\manager::do_factor_action('sms', get_config('factor_sms', 'enabled') ? 'enable' : 'disable');
});
$settings->add($enabled);
global $CFG;
// Get the gateway records.
$manager = \core\di::get(\core_sms\manager::class);
$gatewayrecords = $manager->get_gateway_records(['enabled' => 1]);
$smsconfigureurl = new moodle_url(
'/sms/configure.php',
[
'returnurl' => new moodle_url(
'/admin/settings.php',
['section' => 'factor_sms'],
),
],
);
$smsconfigureurl = $smsconfigureurl->out();
$settings->add(new admin_setting_configtext('factor_sms/weight',
new lang_string('settings:weight', 'tool_mfa'),
new lang_string('settings:weight_help', 'tool_mfa'), 100, PARAM_INT));
$settings->add(
new admin_setting_heading(
'factor_sms/heading',
'',
new lang_string(
'settings:heading',
'factor_sms',
),
),
);
$settings->add(new admin_setting_configduration('factor_sms/duration',
get_string('settings:duration', 'tool_mfa'),
get_string('settings:duration_help', 'tool_mfa'), 30 * MINSECS, MINSECS));
if (count($gatewayrecords) > 0) {
$gateways = [0 => new lang_string('none')];
foreach ($gatewayrecords as $record) {
$values = explode('\\', $record->gateway);
$gatewayname = new lang_string('pluginname', $values[0]);
$gateways[$record->id] = $record->name . ' (' . $gatewayname . ')';
}
$codeslink = 'https://en.wikipedia.org/wiki/List_of_country_calling_codes';
$link = \html_writer::link($codeslink, $codeslink);
$settings->add(
new admin_setting_configselect(
'factor_sms/smsgateway',
new lang_string('settings:smsgateway', 'factor_sms'),
new lang_string('settings:smsgateway_help', 'factor_sms', $smsconfigureurl),
0,
$gateways,
),
);
$settings->add(new admin_setting_configtext('factor_sms/countrycode',
get_string('settings:countrycode', 'factor_sms'),
get_string('settings:countrycode_help', 'factor_sms', $link), '', PARAM_INT));
$enabled = new admin_setting_configcheckbox(
'factor_sms/enabled',
new lang_string('settings:enablefactor', 'tool_mfa'),
new lang_string('settings:enablefactor_help', 'tool_mfa'),
0,
);
$enabled->set_updatedcallback(function () {
\tool_mfa\manager::do_factor_action(
'sms',
get_config('factor_sms', 'enabled') ? 'enable' : 'disable',
);
});
$settings->add($enabled);
$gateways = [
'aws_sns' => get_string('settings:aws', 'factor_sms'),
];
$settings->add(
new admin_setting_configtext(
'factor_sms/weight',
new lang_string('settings:weight', 'tool_mfa'),
new lang_string('settings:weight_help', 'tool_mfa'),
100,
PARAM_INT,
),
);
$settings->hide_if('factor_sms/weight', 'factor_sms/enabled');
$settings->add(new admin_setting_configselect('factor_sms/gateway',
get_string('settings:gateway', 'factor_sms'),
get_string('settings:gateway_help', 'factor_sms'),
'aws_sns', $gateways));
if (empty(get_config('factor_sms', 'gateway'))) {
return;
$settings->add(
new admin_setting_configduration(
'factor_sms/duration',
new lang_string('settings:duration', 'tool_mfa'),
new lang_string('settings:duration_help', 'tool_mfa'),
30 * MINSECS,
MINSECS,
),
);
$settings->hide_if('factor_sms/duration', 'factor_sms/enabled');
} else {
$settings->add(
new admin_setting_description(
'factor_sms/setupdesc',
'',
new lang_string(
'settings:setupdesc',
'factor_sms',
$smsconfigureurl,
),
),
);
}
$class = '\factor_sms\local\smsgateway\\' . get_config('factor_sms', 'gateway');
call_user_func($class . '::add_settings', $settings);
@@ -6,11 +6,21 @@ Feature: Login user with sms authentication factor
Background:
Given I log in as "admin"
And the following "core_sms > sms_gateways" exist:
| name | classname | enabled | config |
| Dummy gateway | smsgateway_aws\gateway | 1 | {"countrycode":"+61", "gateway":"aws_sns", "api_region":"ap-southeast-2", "api_key":"abc", "api_secret":"123"} |
And the following config values are set as admin:
| enabled | 1 | tool_mfa |
| lockout | 3 | tool_mfa |
And the following config values are set as admin:
| enabled | 1 | factor_sms |
| enabled | 1 | factor_sms |
| weight | 100 | factor_sms |
| duration | 1800 | factor_sms |
And I navigate to "Plugins > Admin tools > Multi-factor authentication" in site administration
And I follow "Edit settings for the SMS mobile phone factor"
And I set the field "SMS gateway" to "Dummy gateway (AWS)"
And I press "Save changes"
And I should see "Changes saved"
# Set up user SMS factor in user preferences.
When I follow "Preferences" in the user menu
And I click on "Multi-factor authentication preferences" "link"
@@ -6,10 +6,26 @@ Feature: Set up SMS factor in user preferences
Background:
Given I log in as "admin"
And I navigate to "Plugins > SMS > Manage SMS gateways" in site administration
And I follow "Create a new SMS gateway"
And I set the following fields to these values:
| SMS gateway provider | AWS |
| Gateway name | Dummy gateway |
| Access key | key123 |
| Secret access key | secret456 |
And I press "Save changes"
And the following config values are set as admin:
| enabled | 1 | tool_mfa |
| lockout | 3 | tool_mfa |
And the following config values are set as admin:
| enabled | 1 | factor_sms |
| enabled | 1 | factor_sms |
| weight | 100 | factor_sms |
| duration | 1800 | factor_sms |
And I navigate to "Plugins > Admin tools > Multi-factor authentication" in site administration
And I follow "Edit settings for the SMS mobile phone factor"
And I set the field "SMS gateway" to "Dummy gateway (AWS)"
And I press "Save changes"
And I should see "Changes saved"
When I follow "Preferences" in the user menu
And I click on "Multi-factor authentication preferences" "link"
And I click on "Set up" "button"
@@ -0,0 +1,44 @@
@tool @tool_mfa @factor_sms
Feature: Set up SMS factor when relevant gateway is not configured
In order configure the SMS factor
As an admin
I want to be directed to the SMS gateway setup when necessary
Scenario: Configuring gateways from the SMS factor settings
Given I log in as "admin"
And the following config values are set as admin:
| enabled | 1 | tool_mfa |
| lockout | 3 | tool_mfa |
And the following config values are set as admin:
| enabled | 1 | factor_sms |
| weight | 100 | factor_sms |
| duration | 1800 | factor_sms |
When I navigate to "Plugins > Admin tools > Multi-factor authentication" in site administration
And I follow "Edit settings for the SMS mobile phone factor"
Then I should see "To use SMS as an authentication factor, you first need to set up an SMS gateway."
And I should see "set up an SMS gateway"
And I follow "set up an SMS gateway"
And I should see "Configure SMS gateway"
And I set the following fields to these values:
| SMS gateway provider | AWS |
| Gateway name | First AWS gateway |
| Country code | 61 |
| Access key | key123 |
| Secret access key | secret456 |
| Amazon API gateway region | ap-southeast-2 |
And I press "Save changes"
And I should see "SMS mobile phone"
And the "SMS gateway" select box should contain "First AWS gateway (AWS)"
And I follow "create a new gateway"
And I should see "Configure SMS gateway"
And I set the following fields to these values:
| SMS gateway provider | AWS |
| Gateway name | Second one |
| Country code | 1 |
| Access key | key1234 |
| Secret access key | secret4567 |
| Amazon API gateway region | ap-southeast-2 |
And I press "Save changes"
And I should see "SMS mobile phone"
And the "SMS gateway" select box should contain "First AWS gateway (AWS)"
And the "SMS gateway" select box should contain "Second one (AWS)"
+1 -1
View File
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2024042200; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2024082201; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2024041600; // Requires this Moodle version.
$plugin->component = 'factor_sms'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE;
+1
View File
@@ -36,6 +36,7 @@ $string['confirmationrevoke'] = 'You will no longer be able to use \'{$a}\' to l
$string['connector'] = 'AND';
$string['debugmode:heading'] = 'Debug mode';
$string['devicename'] = 'Device';
$string['editfactor'] = 'Edit settings for the {$a} factor';
$string['entercode'] = 'Enter code';
$string['email:subject'] = 'Unable to log in to {$a}';
$string['enablefactor'] = 'Enable factor';
+57
View File
@@ -0,0 +1,57 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Strings for component 'sms', language 'en'
*
* @package core
* @category string
* @copyright 2024 Andrew Lyons <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['actions'] = 'Actions';
$string['configure_sms_gateway'] = 'Configure SMS gateway';
$string['countrycode'] = 'Country code';
$string['countrycode_help'] = 'Set the default phone number format to exclude the "+" symbol if user does not enter an international number with it.';
$string['createnewgateway'] = 'Create a new SMS gateway';
$string['delete_sms_gateway'] = 'Delete SMS gateway';
$string['delete_sms_gateway_confirmation'] = 'Are you sure you want to delete the {$a->gateway} SMS gateway?';
$string['gateway'] = 'Gateway';
$string['gateway_name'] = 'Gateway name';
$string['manage_sms_gateways'] = 'Manage SMS gateways';
$string['phonenumbernotvalid'] = 'Format of phone number not recognised: {$a->message}';
$string['privacy:metadata:sms_messages'] = 'Stores messages sent via SMS';
$string['privacy:metadata:sms_messages:content'] = 'The message text';
$string['privacy:metadata:sms_messages:id'] = 'The ID of the message';
$string['privacy:metadata:sms_messages:recipient'] = 'The phone number that the message was sent to';
$string['privacy:metadata:sms_messages:recipientuserid'] = 'The user who the message was sent to, if known';
$string['privacy:metadata:sms_messages:status'] = 'The status of the message';
$string['privacy:metadata:sms_messages:timecreated'] = 'The time the message was created';
$string['privacy:sms:sensitive_not_shown'] = 'The content of this message was not stored as it was marked as containing sensitive content.';
$string['sms'] = 'SMS';
$string['sms_form_information'] = 'This page allow you to set up and manage your SMS gateway for sending text messages.';
$string['status:gateway_failed'] = 'The gateway has failed to send the message';
$string['status:gateway_not_available'] = 'The gateway is not available to send the message';
$string['status:gateway_queued'] = 'The message is queued to be sent by the gateway';
$string['status:gateway_rejected'] = 'The gateway has rejected the message';
$string['status:gateway_sent'] = 'The message has been sent by the gateway';
$string['status:message_over_size'] = 'The message is too large to be sent by the gateway';
$string['status:unknown'] = 'Unable to determine the status of the message';
$string['sms_gateways'] = 'SMS gateways';
$string['sms_gateway_deleted'] = '{$a->gateway} SMS gateway has been deleted';
$string['sms_gateway_delete_failed'] = 'Cannot delete the {$a->gateway} SMS gateway. The gateway is either in use or there\'s a database issue. Check if the gateway is active or contact your database administrator for help.';
$string['sms_gateway_disable_failed'] = 'Cannot disable the SMS gateway. The gateway is either in use or there\'s a database issue. Check if the gateway is active or contact your database administrator for help.';
$string['select_sms_gateways'] = 'SMS gateway provider';
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Admin setting for AWS regions.
*
* @package core
* @author Dmitrii Metelkin <[email protected]>
* @copyright 2020 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core\aws;
defined('MOODLE_INTERNAL') || die();
@@ -35,6 +26,8 @@ require_once($CFG->dirroot . '/lib/adminlib.php');
* @package core
* @copyright 2020 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @deprecated Since Moodle 4.5
* @todo MDL-82459 Final deprecation in Moodle 5.0.
*/
class admin_settings_aws_region extends \admin_setting_configtext {
@@ -44,8 +37,15 @@ class admin_settings_aws_region extends \admin_setting_configtext {
* @param mixed $data array or string depending on setting
* @param string $query
* @return string
* @deprecated Since Moodle 4.5
*/
#[\core\attribute\deprecated(
'admin_settings_aws_region::output_html()',
since: '4.5',
mdl: 'MDL-80962',
)]
public function output_html($data, $query='') {
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]);
global $CFG, $OUTPUT;
$default = $this->get_defaultsetting();
+23 -9
View File
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* AWS helper class. Contains useful functions when interacting with the SDK.
*
* @package core
* @author Peter Burnett <[email protected]>
* @copyright 2020 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core\aws;
use Aws\CommandInterface;
@@ -34,6 +25,8 @@ use Psr\Http\Message\RequestInterface;
*
* @copyright 2020 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @deprecated Since Moodle 4.5
* @todo MDL-82459 Final deprecation in Moodle 5.0.
*/
class aws_helper {
@@ -41,8 +34,15 @@ class aws_helper {
* This creates a proxy string suitable for use with the AWS SDK.
*
* @return string the string to use for proxy settings.
* @deprecated Since Moodle 4.5
*/
#[\core\attribute\deprecated(
'aws_helper::get_proxy_string()',
since: '4.5',
mdl: 'MDL-80962',
)]
public static function get_proxy_string(): string {
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
global $CFG;
$proxy = '';
if (empty($CFG->proxytype)) {
@@ -71,8 +71,15 @@ class aws_helper {
*
* @param AwsClient $client
* @return AwsClient
* @deprecated Since Moodle 4.5
*/
#[\core\attribute\deprecated(
'aws_helper::configure_client_proxy()',
since: '4.5',
mdl: 'MDL-80962',
)]
public static function configure_client_proxy(AwsClient $client): AwsClient {
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
$client->getHandlerList()->appendBuild(self::add_proxy_when_required(), 'proxy_bypass');
return $client;
}
@@ -81,8 +88,15 @@ class aws_helper {
* Generate a middleware higher order function to wrap the handler and append proxy configuration based on target.
*
* @return callable Middleware high order callable.
* @deprecated Since Moodle 4.5
*/
#[\core\attribute\deprecated(
'aws_helper::add_proxy_when_required()',
since: '4.5',
mdl: 'MDL-80962',
)]
protected static function add_proxy_when_required(): callable {
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
return function (callable $fn) {
return function (CommandInterface $command, ?RequestInterface $request = null) use ($fn) {
if (isset($request)) {
+9 -9
View File
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* AWS Client factory. Retrieves a client with moodle specific HTTP configuration.
*
* @package core
* @author Peter Burnett <[email protected]>
* @copyright 2022 Catalyst IT
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core\aws;
use Aws\AwsClient;
@@ -32,6 +23,8 @@ use Aws\AwsClient;
* @copyright 2022 Catalyst IT
* @author Peter Burnett <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @deprecated Since Moodle 4.5
* @todo MDL-82459 Final deprecation in Moodle 5.0.
*/
class client_factory {
/**
@@ -40,8 +33,15 @@ class client_factory {
* @param string $class Fully qualified AWS classname e.g. \Aws\S3\S3Client
* @param array $opts array of constructor options for AWS Client.
* @return AwsClient
* @deprecated Since Moodle 4.5
*/
#[\core\attribute\deprecated(
'client_factory::get_client()',
since: '4.5',
mdl: 'MDL-80962',
)]
public static function get_client(string $class, array $opts): AwsClient {
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
// Modify the opts to add HTTP timeouts.
if (empty($opts['http'])) {
$opts['http'] = ['connect_timeout' => HOURSECS];
+2
View File
@@ -149,6 +149,8 @@ class component {
\Invoker::class => 'lib/php-di/invoker/src',
\FastRoute::class => 'lib/nikic/fast-route/src',
\Slim::class => 'lib/slim/slim/Slim',
\libphonenumber::class => 'lib/giggsey/libphonenumber-for-php-lite/src',
\Spatie\Cloneable::class => 'lib/spatie/php-cloneable/src',
];
/**
+3
View File
@@ -122,6 +122,9 @@ class di {
// Alias the PSR-20 clock interface to the Moodle clock. They are compatible.
\core\clock::class => fn() => new \core\system_clock(),
\Psr\Clock\ClockInterface::class => \DI\get(\core\clock::class),
// Note: libphonenumber PhoneNumberUtil uses a singleton.
\libphonenumber\PhoneNumberUtil::class => fn() => \libphonenumber\PhoneNumberUtil::getInstance(),
]);
// Add any additional definitions using hooks.
+99
View File
@@ -0,0 +1,99 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core\plugininfo;
use core_plugin_manager;
use moodle_url;
/**
* SMS gateway subplugin info class.
*
* @package core
* @copyright 2024 Andrew Lyons <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class smsgateway extends base {
#[\Override]
public function is_uninstall_allowed(): bool {
return true;
}
#[\Override]
public function get_settings_section_name(): string {
return "smsgateway{$this->name}";
}
#[\Override]
public function load_settings(
\part_of_admin_tree $adminroot,
$parentnodename,
$hassiteconfig,
): void {
global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them.
/** @var \admin_root $ADMIN */
$ADMIN = $adminroot; // May be used in settings.php.
$plugininfo = $this; // Also can be used inside settings.php.
if (!$this->is_installed_and_upgraded()) {
return;
}
if (!$hassiteconfig) {
return;
}
$section = $this->get_settings_section_name();
$settings = null;
if (file_exists($this->full_path('settings.php'))) {
$settings = new \admin_settingpage($section, $this->displayname, 'moodle/site:config', $this->is_enabled() === false);
include($this->full_path('settings.php')); // This may also set $settings to null.
}
if ($settings) {
$ADMIN->add($parentnodename, $settings);
}
}
#[\Override]
public static function get_manage_url(): moodle_url {
return new \moodle_url('/admin/settings.php', [
'section' => 'smsgateway',
]);
}
#[\Override]
public static function get_enabled_plugins(): ?array {
$pluginmanager = core_plugin_manager::instance();
$plugins = $pluginmanager->get_installed_plugins('smsgateway');
if (!$plugins) {
return [];
}
$plugins = array_keys($plugins);
// Filter to return only enabled plugins.
$enabled = [];
foreach ($plugins as $plugin) {
$disabled = get_config('smsgateway_' . $plugin, 'disabled');
if (empty($disabled)) {
$enabled[$plugin] = $plugin;
}
}
return $enabled;
}
}
+3 -1
View File
@@ -43,7 +43,8 @@
"theme": "theme",
"local": "local",
"h5plib": "h5p\/h5plib",
"paygw": "payment\/gateway"
"paygw": "payment\/gateway",
"smsgateway": "sms/gateway"
},
"subsystems": {
"ai": "ai",
@@ -118,6 +119,7 @@
"rss": "rss",
"role": "admin\/roles",
"search": "search",
"sms": "sms",
"table": "lib\/table",
"tag": "tag",
"timezones": null,
+31 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20240916" COMMENT="XMLDB file for core Moodle tables"
<XMLDB PATH="lib/db" VERSION="20240923" COMMENT="XMLDB file for core Moodle tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
@@ -4939,5 +4939,35 @@
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="sms_messages" COMMENT="SMS Messages sent via the SMS subsystem">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="recipientnumber" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="content" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="messagetype" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="recipientuserid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="issensitive" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="gatewayid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="status" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="gateway" TYPE="foreign" FIELDS="gatewayid" REFTABLE="sms_gateways" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="sms_gateways" COMMENT="Instances of SMS gateways">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="gateway" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="enabled" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="config" TYPE="text" NOTNULL="true" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
+6
View File
@@ -3264,6 +3264,12 @@ $functions = array(
'type' => 'write',
'ajax' => true,
],
'core_sms_set_gateway_status' => [
'classname' => 'core_sms\external\sms_gateway_status',
'description' => 'Set the sms gateway status',
'type' => 'write',
'ajax' => true,
],
);
$services = array(
+48
View File
@@ -1373,5 +1373,53 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2024091700.01);
}
if ($oldversion < 2024092000.01) {
// Define table sms_messages to be created.
$table = new xmldb_table('sms_messages');
// Adding fields to table sms_messages.
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('recipientnumber', XMLDB_TYPE_CHAR, '30', null, XMLDB_NOTNULL, null, null);
$table->add_field('content', XMLDB_TYPE_TEXT, null, null, null, null, null);
$table->add_field('component', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null);
$table->add_field('messagetype', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, null);
$table->add_field('recipientuserid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
$table->add_field('issensitive', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0');
$table->add_field('gatewayid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
$table->add_field('status', XMLDB_TYPE_CHAR, '100', null, null, null, null);
$table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
// Adding keys to table sms_messages.
$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);
$table->add_key('gateway', XMLDB_KEY_FOREIGN, ['gatewayid'], 'sms_gateways', ['id']);
// Conditionally launch create table for sms_messages.
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}
// Define table sms_gateways to be created.
$table = new xmldb_table('sms_gateways');
// Adding fields to table sms_gateways.
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_field('gateway', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
$table->add_field('enabled', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '1');
$table->add_field('config', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null);
// Adding keys to table sms_gateways.
$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);
// Conditionally launch create table for sms_gateways.
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2024092000.01);
}
return true;
}
@@ -0,0 +1,177 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
@@ -0,0 +1,146 @@
# libphonenumber for PHP (Lite) [![Build Status](https://github.com/giggsey/libphonenumber-for-php-lite/workflows/Tests/badge.svg)](https://github.com/giggsey/libphonenumber-for-php-lite/actions?query=workflow%3A%22Tests%22) [![codecov](https://codecov.io/gh/giggsey/libphonenumber-for-php-lite/branch/main/graph/badge.svg?token=S0TV2TAXOQ)](https://codecov.io/gh/giggsey/libphonenumber-for-php-lite) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fgiggsey%2Flibphonenumber-for-php-lite%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/giggsey/libphonenumber-for-php-lite/main)
[![Total Downloads](https://poser.pugx.org/giggsey/libphonenumber-for-php-lite/downloads?format=flat-square)](https://packagist.org/packages/giggsey/libphonenumber-for-php-lite)
[![Downloads per month](https://img.shields.io/packagist/dm/giggsey/libphonenumber-for-php-lite.svg?style=flat-square)](https://packagist.org/packages/giggsey/libphonenumber-for-php-lite)
[![Latest Stable Version](https://img.shields.io/packagist/v/giggsey/libphonenumber-for-php-lite.svg?style=flat-square)](https://packagist.org/packages/giggsey/libphonenumber-for-php-lite)
[![License](https://img.shields.io/badge/license-Apache%202.0-red.svg?style=flat-square)](https://packagist.org/packages/giggsey/libphonenumber-for-php-lite)
## What is it?
A PHP library for parsing, formatting, storing and validating international phone numbers. This library is based on Google's [libphonenumber](https://github.com/google/libphonenumber).
This is a lite version that only includes the core Phone Number Utils. To make full use of the library, including geolocation, carrier information and short number info, use [giggsey/libphonenumber-for-php](https://github.com/giggsey/libphonenumber-for-php)
- [Installation](#installation)
- [Documentation](#documentation)
- [Highlights of functionality](#highlights-of-functionality)
- [Versioning](#versioning)
- [Quick Examples](#quick-examples)
- [FAQ](#faq)
- [Problems with Invalid Numbers?](#problems-with-invalid-numbers)
- [Generating data](#generating-data)
## Installation
PHP versions 8.0 and above are supported.
The PECL [mbstring](http://php.net/mbstring) extension is required.
It is recommended to use [composer](https://getcomposer.org) to install the library.
```bash
$ composer require giggsey/libphonenumber-for-php-lite
```
You can also use any other [PSR-4](http://www.php-fig.org/psr/psr-4/) compliant autoloader.
### PHP Version Policy
This library will be updated to use [supported versions of PHP](https://www.php.net/supported-versions.php) only. At the moment, the main [giggsey/libphonenumber-for-php](https://github.com/giggsey/libphonenumber-for-php) library supports older PHP versions.
## Documentation
- [PhoneNumber Util](docs/PhoneNumberUtil.md)
# Highlights of functionality
* Parsing/formatting/validating phone numbers for all countries/regions of the world.
* `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).
* `isNumberMatch` - gets a confidence level on whether two numbers could be the same.
* `getExampleNumber`/`getExampleNumberByType` - provides valid example numbers for all countries/regions, with the option of specifying which type of example phone number is needed.
* `isValidNumber` - full validation of a phone number for a region using length and prefix information.
## Versioning
This library will try to follow the same version numbers as Google. There could be additional releases where needed to fix critical issues that can not wait until the next release from Google.
This does mean that this project may 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
incompatible changes. Please read the release notes for such releases.
Google try to release their versions according to Semantic Versioning, as laid out of in their [Versioning Guide](https://github.com/google/libphonenumber#versioning-and-announcements).
## Quick Examples
Let's say you have a string representing a phone number from Switzerland. This is how you parse/normalize it into a PhoneNumber object:
```php
$swissNumberStr = "044 668 18 00";
$phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
try {
$swissNumberProto = $phoneUtil->parse($swissNumberStr, "CH");
var_dump($swissNumberProto);
} catch (\libphonenumber\NumberParseException $e) {
var_dump($e);
}
```
At this point, swissNumberProto contains:
class libphonenumber\PhoneNumber#9 (7) {
private $countryCode =>
int(41)
private $nationalNumber =>
double(446681800)
private $extension =>
NULL
private $italianLeadingZero =>
NULL
private $rawInput =>
NULL
private $countryCodeSource =>
NULL
private $preferredDomesticCarrierCode =>
NULL
}
Now let us validate whether the number is valid:
```php
$isValid = $phoneUtil->isValidNumber($swissNumberProto);
var_dump($isValid); // true
```
There are a few formats supported by the formatting method, as illustrated below:
```php
// Produces "+41446681800"
echo $phoneUtil->format($swissNumberProto, \libphonenumber\PhoneNumberFormat::E164);
// Produces "044 668 18 00"
echo $phoneUtil->format($swissNumberProto, \libphonenumber\PhoneNumberFormat::NATIONAL);
// Produces "+41 44 668 18 00"
echo $phoneUtil->format($swissNumberProto, \libphonenumber\PhoneNumberFormat::INTERNATIONAL);
```
You could also choose to format the number in the way it is dialled from another country:
```php
// Produces "011 41 44 668 1800", the number when it is dialled in the United States.
echo $phoneUtil->formatOutOfCountryCallingNumber($swissNumberProto, "US");
// Produces "00 41 44 668 18 00", the number when it is dialled in Great Britain.
echo $phoneUtil->formatOutOfCountryCallingNumber($swissNumberProto, "GB");
```
## FAQ
#### Problems with Invalid Numbers?
This library uses phone number metadata from Google's [libphonenumber](https://github.com/google/libphonenumber). If this library is working as intended, it should provide the same result as the Java version of Google's project.
If you believe that a phone number is returning an incorrect result, first test it with [libphonenumber](https://github.com/google/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.
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 on the [giggsey/libphonenumber-for-php](https://github.com/giggsey/libphonenumber-for-php) project.
If [giggsey/libphonenumber-for-php](https://github.com/giggsey/libphonenumber-for-php) differs from this library, please raise an issue here instead.
## Generating data
Generating the data is not normally needed, as this repository will generally always have the up to data metadata.
If you do need to generate the data, the commands are provided by [Phing](https://www.phing.info). Ensure you have all the dev composer dependencies installed, then run
```bash
$ vendor/bin/phing compile
```
This compile process clones the [libphonenumber](https://github.com/google/libphonenumber) project at the version specified in [METADATA-VERSION.txt](METADATA-VERSION.txt).
@@ -0,0 +1,12 @@
# libphonenumber-for-php-lite
## Installation
1. Visit https://github.com/giggsey/libphonenumber-for-php-lite/
2. Download the latest release
3. Unzip in this folder
4. Update `thirdpartylibs.xml`
5. Remove any unnecessary files, including:
- Any tests
- CHANGELOG.md
- composer.json
@@ -0,0 +1,34 @@
<?php
namespace libphonenumber;
/**
* Country code source from number
*/
class CountryCodeSource
{
/**
* The country_code is derived based on a phone number with a leading "+", e.g. the French
* number "+33 1 42 68 53 00".
*/
public const FROM_NUMBER_WITH_PLUS_SIGN = 0;
/**
* The country_code is derived based on a phone number with a leading IDD, e.g. the French
* number "011 33 1 42 68 53 00", as it is dialled from US.
*/
public const FROM_NUMBER_WITH_IDD = 1;
/**
* The country_code is derived based on a phone number without a leading "+", e.g. the French
* number "33 1 42 68 53 00" when defaultCountry is supplied as France.
*/
public const FROM_NUMBER_WITHOUT_PLUS_SIGN = 2;
/**
* The country_code is derived NOT based on the phone number itself, but from the defaultCountry
* parameter provided in the parsing function by the clients. This happens mostly for numbers
* written in the national format (without country code). For example, this would be set when
* parsing the French number "01 42 68 53 00", when defaultCountry is supplied as France.
*/
public const FROM_DEFAULT_COUNTRY = 3;
public const UNSPECIFIED = 4;
}
@@ -0,0 +1,920 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
namespace libphonenumber;
class CountryCodeToRegionCodeMap
{
// A mapping from a country code to the region codes which denote the
// country/region represented by that country code. In the case of multiple
// countries sharing a calling code, such as the NANPA countries, the one
// indicated with "isMainCountryForCode" in the metadata should be first.
public const COUNTRY_CODE_TO_REGION_CODE_MAP = [
1 =>
[
0 => 'US',
1 => 'AG',
2 => 'AI',
3 => 'AS',
4 => 'BB',
5 => 'BM',
6 => 'BS',
7 => 'CA',
8 => 'DM',
9 => 'DO',
10 => 'GD',
11 => 'GU',
12 => 'JM',
13 => 'KN',
14 => 'KY',
15 => 'LC',
16 => 'MP',
17 => 'MS',
18 => 'PR',
19 => 'SX',
20 => 'TC',
21 => 'TT',
22 => 'VC',
23 => 'VG',
24 => 'VI',
],
7 =>
[
0 => 'RU',
1 => 'KZ',
],
20 =>
[
0 => 'EG',
],
27 =>
[
0 => 'ZA',
],
30 =>
[
0 => 'GR',
],
31 =>
[
0 => 'NL',
],
32 =>
[
0 => 'BE',
],
33 =>
[
0 => 'FR',
],
34 =>
[
0 => 'ES',
],
36 =>
[
0 => 'HU',
],
39 =>
[
0 => 'IT',
1 => 'VA',
],
40 =>
[
0 => 'RO',
],
41 =>
[
0 => 'CH',
],
43 =>
[
0 => 'AT',
],
44 =>
[
0 => 'GB',
1 => 'GG',
2 => 'IM',
3 => 'JE',
],
45 =>
[
0 => 'DK',
],
46 =>
[
0 => 'SE',
],
47 =>
[
0 => 'NO',
1 => 'SJ',
],
48 =>
[
0 => 'PL',
],
49 =>
[
0 => 'DE',
],
51 =>
[
0 => 'PE',
],
52 =>
[
0 => 'MX',
],
53 =>
[
0 => 'CU',
],
54 =>
[
0 => 'AR',
],
55 =>
[
0 => 'BR',
],
56 =>
[
0 => 'CL',
],
57 =>
[
0 => 'CO',
],
58 =>
[
0 => 'VE',
],
60 =>
[
0 => 'MY',
],
61 =>
[
0 => 'AU',
1 => 'CC',
2 => 'CX',
],
62 =>
[
0 => 'ID',
],
63 =>
[
0 => 'PH',
],
64 =>
[
0 => 'NZ',
],
65 =>
[
0 => 'SG',
],
66 =>
[
0 => 'TH',
],
81 =>
[
0 => 'JP',
],
82 =>
[
0 => 'KR',
],
84 =>
[
0 => 'VN',
],
86 =>
[
0 => 'CN',
],
90 =>
[
0 => 'TR',
],
91 =>
[
0 => 'IN',
],
92 =>
[
0 => 'PK',
],
93 =>
[
0 => 'AF',
],
94 =>
[
0 => 'LK',
],
95 =>
[
0 => 'MM',
],
98 =>
[
0 => 'IR',
],
211 =>
[
0 => 'SS',
],
212 =>
[
0 => 'MA',
1 => 'EH',
],
213 =>
[
0 => 'DZ',
],
216 =>
[
0 => 'TN',
],
218 =>
[
0 => 'LY',
],
220 =>
[
0 => 'GM',
],
221 =>
[
0 => 'SN',
],
222 =>
[
0 => 'MR',
],
223 =>
[
0 => 'ML',
],
224 =>
[
0 => 'GN',
],
225 =>
[
0 => 'CI',
],
226 =>
[
0 => 'BF',
],
227 =>
[
0 => 'NE',
],
228 =>
[
0 => 'TG',
],
229 =>
[
0 => 'BJ',
],
230 =>
[
0 => 'MU',
],
231 =>
[
0 => 'LR',
],
232 =>
[
0 => 'SL',
],
233 =>
[
0 => 'GH',
],
234 =>
[
0 => 'NG',
],
235 =>
[
0 => 'TD',
],
236 =>
[
0 => 'CF',
],
237 =>
[
0 => 'CM',
],
238 =>
[
0 => 'CV',
],
239 =>
[
0 => 'ST',
],
240 =>
[
0 => 'GQ',
],
241 =>
[
0 => 'GA',
],
242 =>
[
0 => 'CG',
],
243 =>
[
0 => 'CD',
],
244 =>
[
0 => 'AO',
],
245 =>
[
0 => 'GW',
],
246 =>
[
0 => 'IO',
],
247 =>
[
0 => 'AC',
],
248 =>
[
0 => 'SC',
],
249 =>
[
0 => 'SD',
],
250 =>
[
0 => 'RW',
],
251 =>
[
0 => 'ET',
],
252 =>
[
0 => 'SO',
],
253 =>
[
0 => 'DJ',
],
254 =>
[
0 => 'KE',
],
255 =>
[
0 => 'TZ',
],
256 =>
[
0 => 'UG',
],
257 =>
[
0 => 'BI',
],
258 =>
[
0 => 'MZ',
],
260 =>
[
0 => 'ZM',
],
261 =>
[
0 => 'MG',
],
262 =>
[
0 => 'RE',
1 => 'YT',
],
263 =>
[
0 => 'ZW',
],
264 =>
[
0 => 'NA',
],
265 =>
[
0 => 'MW',
],
266 =>
[
0 => 'LS',
],
267 =>
[
0 => 'BW',
],
268 =>
[
0 => 'SZ',
],
269 =>
[
0 => 'KM',
],
290 =>
[
0 => 'SH',
1 => 'TA',
],
291 =>
[
0 => 'ER',
],
297 =>
[
0 => 'AW',
],
298 =>
[
0 => 'FO',
],
299 =>
[
0 => 'GL',
],
350 =>
[
0 => 'GI',
],
351 =>
[
0 => 'PT',
],
352 =>
[
0 => 'LU',
],
353 =>
[
0 => 'IE',
],
354 =>
[
0 => 'IS',
],
355 =>
[
0 => 'AL',
],
356 =>
[
0 => 'MT',
],
357 =>
[
0 => 'CY',
],
358 =>
[
0 => 'FI',
1 => 'AX',
],
359 =>
[
0 => 'BG',
],
370 =>
[
0 => 'LT',
],
371 =>
[
0 => 'LV',
],
372 =>
[
0 => 'EE',
],
373 =>
[
0 => 'MD',
],
374 =>
[
0 => 'AM',
],
375 =>
[
0 => 'BY',
],
376 =>
[
0 => 'AD',
],
377 =>
[
0 => 'MC',
],
378 =>
[
0 => 'SM',
],
380 =>
[
0 => 'UA',
],
381 =>
[
0 => 'RS',
],
382 =>
[
0 => 'ME',
],
383 =>
[
0 => 'XK',
],
385 =>
[
0 => 'HR',
],
386 =>
[
0 => 'SI',
],
387 =>
[
0 => 'BA',
],
389 =>
[
0 => 'MK',
],
420 =>
[
0 => 'CZ',
],
421 =>
[
0 => 'SK',
],
423 =>
[
0 => 'LI',
],
500 =>
[
0 => 'FK',
],
501 =>
[
0 => 'BZ',
],
502 =>
[
0 => 'GT',
],
503 =>
[
0 => 'SV',
],
504 =>
[
0 => 'HN',
],
505 =>
[
0 => 'NI',
],
506 =>
[
0 => 'CR',
],
507 =>
[
0 => 'PA',
],
508 =>
[
0 => 'PM',
],
509 =>
[
0 => 'HT',
],
590 =>
[
0 => 'GP',
1 => 'BL',
2 => 'MF',
],
591 =>
[
0 => 'BO',
],
592 =>
[
0 => 'GY',
],
593 =>
[
0 => 'EC',
],
594 =>
[
0 => 'GF',
],
595 =>
[
0 => 'PY',
],
596 =>
[
0 => 'MQ',
],
597 =>
[
0 => 'SR',
],
598 =>
[
0 => 'UY',
],
599 =>
[
0 => 'CW',
1 => 'BQ',
],
670 =>
[
0 => 'TL',
],
672 =>
[
0 => 'NF',
],
673 =>
[
0 => 'BN',
],
674 =>
[
0 => 'NR',
],
675 =>
[
0 => 'PG',
],
676 =>
[
0 => 'TO',
],
677 =>
[
0 => 'SB',
],
678 =>
[
0 => 'VU',
],
679 =>
[
0 => 'FJ',
],
680 =>
[
0 => 'PW',
],
681 =>
[
0 => 'WF',
],
682 =>
[
0 => 'CK',
],
683 =>
[
0 => 'NU',
],
685 =>
[
0 => 'WS',
],
686 =>
[
0 => 'KI',
],
687 =>
[
0 => 'NC',
],
688 =>
[
0 => 'TV',
],
689 =>
[
0 => 'PF',
],
690 =>
[
0 => 'TK',
],
691 =>
[
0 => 'FM',
],
692 =>
[
0 => 'MH',
],
800 =>
[
0 => '001',
],
808 =>
[
0 => '001',
],
850 =>
[
0 => 'KP',
],
852 =>
[
0 => 'HK',
],
853 =>
[
0 => 'MO',
],
855 =>
[
0 => 'KH',
],
856 =>
[
0 => 'LA',
],
870 =>
[
0 => '001',
],
878 =>
[
0 => '001',
],
880 =>
[
0 => 'BD',
],
881 =>
[
0 => '001',
],
882 =>
[
0 => '001',
],
883 =>
[
0 => '001',
],
886 =>
[
0 => 'TW',
],
888 =>
[
0 => '001',
],
960 =>
[
0 => 'MV',
],
961 =>
[
0 => 'LB',
],
962 =>
[
0 => 'JO',
],
963 =>
[
0 => 'SY',
],
964 =>
[
0 => 'IQ',
],
965 =>
[
0 => 'KW',
],
966 =>
[
0 => 'SA',
],
967 =>
[
0 => 'YE',
],
968 =>
[
0 => 'OM',
],
970 =>
[
0 => 'PS',
],
971 =>
[
0 => 'AE',
],
972 =>
[
0 => 'IL',
],
973 =>
[
0 => 'BH',
],
974 =>
[
0 => 'QA',
],
975 =>
[
0 => 'BT',
],
976 =>
[
0 => 'MN',
],
977 =>
[
0 => 'NP',
],
979 =>
[
0 => '001',
],
992 =>
[
0 => 'TJ',
],
993 =>
[
0 => 'TM',
],
994 =>
[
0 => 'AZ',
],
995 =>
[
0 => 'GE',
],
996 =>
[
0 => 'KG',
],
998 =>
[
0 => 'UZ',
],
];
}
@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
class DefaultMetadataLoader implements MetadataLoaderInterface
{
public function loadMetadata(string $metadataFileName): array
{
return include $metadataFileName;
}
}
@@ -0,0 +1,16 @@
<?php
namespace libphonenumber;
/**
* Types of phone number matches
* See detailed description beside the isNumberMatch() method
*/
class MatchType
{
public const NOT_A_NUMBER = 0;
public const NO_MATCH = 1;
public const SHORT_NSN_MATCH = 2;
public const NSN_MATCH = 3;
public const EXACT_MATCH = 4;
}
@@ -0,0 +1,156 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
/**
* Matcher for various regex matching
*
* Note that this is NOT the same as Google's java PhoneNumberMatcher class.
* This class is a minimal port of java's built-in matcher class, whereas PhoneNumberMatcher
* is designed to recognize phone numbers embedded in any text.
*
* @internal
*/
class Matcher
{
protected string $pattern;
protected string $subject = '';
/**
* @var array<array{string,int}>
*/
protected array $groups = [];
private int $searchIndex = 0;
/**
* @param string $pattern
* @param string $subject
*/
public function __construct(string $pattern, string $subject)
{
$this->pattern = str_replace('/', '\/', $pattern);
$this->subject = $subject;
}
/**
* @param string $type
* @param int $offset
* @return bool
*/
protected function doMatch(string $type = 'find', int $offset = 0): bool
{
$final_pattern = '(?:' . $this->pattern . ')';
switch ($type) {
case 'matches':
$final_pattern = '^' . $final_pattern . '$';
break;
case 'lookingAt':
$final_pattern = '^' . $final_pattern;
break;
case 'find':
default:
// no changes
break;
}
$final_pattern = '/' . $final_pattern . '/ui';
$search = mb_substr($this->subject, $offset);
$result = preg_match($final_pattern, $search, $groups, PREG_OFFSET_CAPTURE);
if ($result === 1) {
// Expand $groups into $this->groups, but being multi-byte aware
$positions = [];
foreach ($groups as $group) {
$positions[] = [
$group[0],
$offset + mb_strlen(substr($search, 0, $group[1])),
];
}
$this->groups = $positions;
}
return ($result === 1);
}
public function matches(): bool
{
return $this->doMatch('matches');
}
public function lookingAt(): bool
{
return $this->doMatch('lookingAt');
}
public function find(?int $offset = null): bool
{
if ($offset === null) {
$offset = $this->searchIndex;
}
// Increment search index for the next time we call this
$this->searchIndex++;
return $this->doMatch('find', $offset);
}
public function groupCount(): ?int
{
if (empty($this->groups)) {
return null;
}
return count($this->groups) - 1;
}
public function group(?int $group = null): ?string
{
if ($group === null) {
$group = 0;
}
return $this->groups[$group][0] ?? null;
}
public function end(?int $group = null): ?int
{
if ($group === null) {
$group = 0;
}
if (!isset($this->groups[$group])) {
return null;
}
return $this->groups[$group][1] + mb_strlen($this->groups[$group][0]);
}
public function start(int $group = 0): ?int
{
if (!isset($this->groups[$group])) {
return null;
}
return $this->groups[$group][1];
}
public function replaceFirst(string $replacement): string
{
return preg_replace('/' . $this->pattern . '/x', $replacement, $this->subject, 1);
}
public function replaceAll(string $replacement): string
{
return preg_replace('/' . $this->pattern . '/x', $replacement, $this->subject);
}
public function reset(string $input = ''): self
{
$this->subject = $input;
return $this;
}
}
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
/**
* Interface MatcherAPIInterface
*
* Internal phonenumber matching API used to isolate the underlying implementation of the
* matcher and allow different implementations to be swapped in easily.
*
* @package libphonenumber
* @internal
*/
interface MatcherAPIInterface
{
/**
* Returns whether the given national number (a string containing only decimal digits) matches
* the national number pattern defined in the given {@code PhoneNumberDesc} message.
*/
public function matchNationalNumber(string $number, PhoneNumberDesc $numberDesc, bool $allowPrefixMatch): bool;
}
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
/**
* @interal
* @phpstan-import-type PhoneMetadataArray from PhoneMetadata
*/
interface MetadataLoaderInterface
{
/**
* @param string $metadataFileName File name (including path) of metadata to load.
* @return PhoneMetadataArray
*/
public function loadMetadata(string $metadataFileName): array;
}
@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
interface MetadataSourceInterface
{
/**
* Gets phone metadata for a region.
* @param string $regionCode the region code.
* @return PhoneMetadata the phone metadata for that region, or null if there is none.
*/
public function getMetadataForRegion(string $regionCode): PhoneMetadata;
/**
* Gets phone metadata for a non-geographical region.
* @param int $countryCallingCode the country calling code.
* @return PhoneMetadata the phone metadata for that region, or null if there is none.
*/
public function getMetadataForNonGeographicalRegion(int $countryCallingCode): PhoneMetadata;
}
@@ -0,0 +1,95 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
/**
* @internal
*/
class MultiFileMetadataSourceImpl implements MetadataSourceInterface
{
protected static string $metaDataFilePrefix = PhoneNumberUtil::META_DATA_FILE_PREFIX;
/**
* A mapping from a region code to the PhoneMetadata for that region.
* @var PhoneMetadata[]
*/
protected array $regionToMetadataMap = [];
/**
* A mapping from a country calling code for a non-geographical entity to the PhoneMetadata for
* that country calling code. Examples of the country calling codes include 800 (International
* Toll Free Service) and 808 (International Shared Cost Service).
* @var PhoneMetadata[]
*/
protected array $countryCodeToNonGeographicalMetadataMap = [];
/**
* The prefix of the metadata files from which region data is loaded.
*/
protected ?string $currentFilePrefix;
public function __construct(protected MetadataLoaderInterface $metadataLoader, ?string $currentFilePrefix = null)
{
if ($currentFilePrefix === null) {
$currentFilePrefix = static::$metaDataFilePrefix;
}
$this->currentFilePrefix = $currentFilePrefix;
}
/**
* @inheritdoc
*/
public function getMetadataForRegion(string $regionCode): PhoneMetadata
{
$regionCode = strtoupper($regionCode);
if (!array_key_exists($regionCode, $this->regionToMetadataMap)) {
// The regionCode here will be valid and won't be '001', so we don't need to worry about
// what to pass in for the country calling code.
$this->loadMetadataFromFile($this->currentFilePrefix, $regionCode, 0, $this->metadataLoader);
}
return $this->regionToMetadataMap[$regionCode];
}
/**
* @inheritdoc
*/
public function getMetadataForNonGeographicalRegion(int $countryCallingCode): PhoneMetadata
{
if (!array_key_exists($countryCallingCode, $this->countryCodeToNonGeographicalMetadataMap)) {
$this->loadMetadataFromFile($this->currentFilePrefix, PhoneNumberUtil::REGION_CODE_FOR_NON_GEO_ENTITY, $countryCallingCode, $this->metadataLoader);
}
return $this->countryCodeToNonGeographicalMetadataMap[$countryCallingCode];
}
/**
* @param string $filePrefix
* @param string $regionCode
* @param int $countryCallingCode
* @param MetadataLoaderInterface $metadataLoader
*/
public function loadMetadataFromFile(string $filePrefix, string $regionCode, int $countryCallingCode, MetadataLoaderInterface $metadataLoader): void
{
$regionCode = strtoupper($regionCode);
$isNonGeoRegion = PhoneNumberUtil::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCode;
$fileName = $filePrefix . '_' . ($isNonGeoRegion ? $countryCallingCode : $regionCode) . '.php';
if (!is_readable($fileName)) {
throw new \RuntimeException('missing metadata: ' . $fileName);
}
$data = $metadataLoader->loadMetadata($fileName);
$metadata = new PhoneMetadata();
$metadata->fromArray($data);
if ($isNonGeoRegion) {
$this->countryCodeToNonGeographicalMetadataMap[$countryCallingCode] = $metadata;
} else {
$this->regionToMetadataMap[$regionCode] = $metadata;
}
}
}
@@ -0,0 +1,252 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
/**
* Number Format
* @interal
* @phpstan-type NumberFormatArray array{pattern:string|null,format:string|null,leadingDigitsPatterns:array<string>,nationalPrefixFormattingRule?:string,domesticCarrierCodeFormattingRule?:string,nationalPrefixOptionalWhenFormatting?:bool}
*/
class NumberFormat
{
protected ?string $pattern;
protected bool $hasPattern = false;
protected ?string $format;
protected bool $hasFormat = false;
/**
* @var array<string>
*/
protected array $leadingDigitsPattern = [];
protected string $nationalPrefixFormattingRule = '';
protected bool $hasNationalPrefixFormattingRule = false;
protected bool $nationalPrefixOptionalWhenFormatting = false;
protected bool $hasNationalPrefixOptionalWhenFormatting = false;
protected string $domesticCarrierCodeFormattingRule = '';
protected bool $hasDomesticCarrierCodeFormattingRule = false;
public function __construct()
{
$this->clear();
}
/**
* @return NumberFormat
*/
public function clear(): NumberFormat
{
$this->hasPattern = false;
$this->pattern = null;
$this->hasFormat = false;
$this->format = null;
$this->leadingDigitsPattern = [];
$this->hasNationalPrefixFormattingRule = false;
$this->nationalPrefixFormattingRule = '';
$this->hasNationalPrefixOptionalWhenFormatting = false;
$this->nationalPrefixOptionalWhenFormatting = false;
$this->hasDomesticCarrierCodeFormattingRule = false;
$this->domesticCarrierCodeFormattingRule = '';
return $this;
}
public function hasPattern(): bool
{
return $this->hasPattern;
}
public function getPattern(): ?string
{
return $this->pattern;
}
public function setPattern(string $value): NumberFormat
{
$this->hasPattern = true;
$this->pattern = $value;
return $this;
}
public function hasNationalPrefixOptionalWhenFormatting(): bool
{
return $this->hasNationalPrefixOptionalWhenFormatting;
}
public function getNationalPrefixOptionalWhenFormatting(): bool
{
return $this->nationalPrefixOptionalWhenFormatting;
}
public function setNationalPrefixOptionalWhenFormatting(bool $nationalPrefixOptionalWhenFormatting): void
{
$this->hasNationalPrefixOptionalWhenFormatting = true;
$this->nationalPrefixOptionalWhenFormatting = $nationalPrefixOptionalWhenFormatting;
}
public function hasFormat(): bool
{
return $this->hasFormat;
}
public function getFormat(): ?string
{
return $this->format;
}
public function setFormat(string $value): NumberFormat
{
$this->hasFormat = true;
$this->format = $value;
return $this;
}
/**
* @return string[]
*/
public function leadingDigitPatterns(): array
{
return $this->leadingDigitsPattern;
}
public function leadingDigitsPatternSize(): int
{
return count($this->leadingDigitsPattern);
}
public function getLeadingDigitsPattern(int $index): string
{
return $this->leadingDigitsPattern[$index];
}
public function addLeadingDigitsPattern(string $value): NumberFormat
{
$this->leadingDigitsPattern[] = $value;
return $this;
}
public function hasNationalPrefixFormattingRule(): bool
{
return $this->hasNationalPrefixFormattingRule;
}
public function getNationalPrefixFormattingRule(): string
{
return $this->nationalPrefixFormattingRule;
}
public function setNationalPrefixFormattingRule(string $value): NumberFormat
{
$this->hasNationalPrefixFormattingRule = true;
$this->nationalPrefixFormattingRule = $value;
return $this;
}
public function clearNationalPrefixFormattingRule(): NumberFormat
{
$this->nationalPrefixFormattingRule = '';
return $this;
}
public function hasDomesticCarrierCodeFormattingRule(): bool
{
return $this->hasDomesticCarrierCodeFormattingRule;
}
public function getDomesticCarrierCodeFormattingRule(): string
{
return $this->domesticCarrierCodeFormattingRule;
}
public function setDomesticCarrierCodeFormattingRule(string $value): NumberFormat
{
$this->hasDomesticCarrierCodeFormattingRule = true;
$this->domesticCarrierCodeFormattingRule = $value;
return $this;
}
public function mergeFrom(NumberFormat $other): NumberFormat
{
if ($other->hasPattern()) {
$this->setPattern($other->getPattern());
}
if ($other->hasFormat()) {
$this->setFormat($other->getFormat());
}
$leadingDigitsPatternSize = $other->leadingDigitsPatternSize();
for ($i = 0; $i < $leadingDigitsPatternSize; $i++) {
$this->addLeadingDigitsPattern($other->getLeadingDigitsPattern($i));
}
if ($other->hasNationalPrefixFormattingRule()) {
$this->setNationalPrefixFormattingRule($other->getNationalPrefixFormattingRule());
}
if ($other->hasDomesticCarrierCodeFormattingRule()) {
$this->setDomesticCarrierCodeFormattingRule($other->getDomesticCarrierCodeFormattingRule());
}
if ($other->hasNationalPrefixOptionalWhenFormatting()) {
$this->setNationalPrefixOptionalWhenFormatting($other->getNationalPrefixOptionalWhenFormatting());
}
return $this;
}
/**
* @return NumberFormatArray
*/
public function toArray(): array
{
$output = [];
$output['pattern'] = $this->getPattern();
$output['format'] = $this->getFormat();
$output['leadingDigitsPatterns'] = $this->leadingDigitPatterns();
if ($this->hasNationalPrefixFormattingRule()) {
$output['nationalPrefixFormattingRule'] = $this->getNationalPrefixFormattingRule();
}
if ($this->hasDomesticCarrierCodeFormattingRule()) {
$output['domesticCarrierCodeFormattingRule'] = $this->getDomesticCarrierCodeFormattingRule();
}
if ($this->hasNationalPrefixOptionalWhenFormatting()) {
$output['nationalPrefixOptionalWhenFormatting'] = $this->getNationalPrefixOptionalWhenFormatting();
}
return $output;
}
/**
* @param NumberFormatArray $input
*/
public function fromArray(array $input): void
{
$this->setPattern($input['pattern']);
$this->setFormat($input['format']);
foreach ($input['leadingDigitsPatterns'] as $leadingDigitsPattern) {
$this->addLeadingDigitsPattern($leadingDigitsPattern);
}
if (isset($input['nationalPrefixFormattingRule']) && $input['nationalPrefixFormattingRule'] !== '') {
$this->setNationalPrefixFormattingRule($input['nationalPrefixFormattingRule']);
}
if (isset($input['domesticCarrierCodeFormattingRule']) && $input['domesticCarrierCodeFormattingRule'] !== '') {
$this->setDomesticCarrierCodeFormattingRule($input['domesticCarrierCodeFormattingRule']);
}
if (isset($input['nationalPrefixOptionalWhenFormatting'])) {
$this->setNationalPrefixOptionalWhenFormatting($input['nationalPrefixOptionalWhenFormatting']);
}
}
}
@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
/**
* Generic exception class for errors encountered when parsing phone numbers.
*/
class NumberParseException extends \Exception implements \Stringable
{
/**
* The country code supplied did not belong to a supported country or non-geographical entity.
*/
public const INVALID_COUNTRY_CODE = 0;
/**
* This indicates the string passed is not a valid number. Either the string had less than 3
* digits in it or had an invalid phone-context parameter. More specifically, the number failed
* to match the regular expression VALID_PHONE_NUMBER, RFC3966_GLOBAL_NUMBER_DIGITS, or
* RFC3966_DOMAINNAME in PhoneNumberUtil
*/
public const NOT_A_NUMBER = 1;
/**
* This indicates the string started with an international dialing prefix, but after this was
* stripped from the number, had less digits than any valid phone number (including country
* code) could have.
*/
public const TOO_SHORT_AFTER_IDD = 2;
/**
* This indicates the string, after any country code has been stripped, had less digits than any
* valid phone number could have.
*/
public const TOO_SHORT_NSN = 3;
/**
* This indicates the string had more digits than any valid phone number could have.
*/
public const TOO_LONG = 4;
protected int $errorType;
public function __construct(int $errorType, string $message, ?\Throwable $previous = null)
{
parent::__construct($message, $errorType, $previous);
$this->message = $message;
$this->errorType = $errorType;
}
/**
* Returns the error type of the exception that has been thrown.
*/
public function getErrorType(): int
{
return $this->errorType;
}
public function __toString(): string
{
return 'Error type: ' . $this->errorType . '. ' . $this->message;
}
}
@@ -0,0 +1,907 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
/**
* Class PhoneMetadata
* @package libphonenumber
* @internal Used internally, and can change at any time
* @phpstan-import-type PhoneNumberDescArray from PhoneNumberDesc
* @phpstan-import-type NumberFormatArray from NumberFormat
* @phpstan-type PhoneMetadataArray array{generalDesc?:PhoneNumberDescArray,fixedLine?:PhoneNumberDescArray,mobile?:PhoneNumberDescArray,tollFree?:PhoneNumberDescArray,premiumRate?:PhoneNumberDescArray,sharedCost?:PhoneNumberDescArray,personalNumber?:PhoneNumberDescArray,voip?:PhoneNumberDescArray,pager?:PhoneNumberDescArray,uan?:PhoneNumberDescArray,emergency?:PhoneNumberDescArray,voicemail?:PhoneNumberDescArray,shortCode?:PhoneNumberDescArray,standardRate?:PhoneNumberDescArray,carrierSpecific?:PhoneNumberDescArray,smsServices?:PhoneNumberDescArray,noInternationalDialling?:PhoneNumberDescArray,id:string|null,countryCode?:int,internationalPrefix?:string,preferredInternationalPrefix?:string,nationalPrefix?:string,preferredExtnPrefix?:string,nationalPrefixForParsing?:string,nationalPrefixTransformRule?:string,sameMobileAndFixedLinePattern?:bool,numberFormat:NumberFormatArray[],intlNumberFormat?:NumberFormatArray[],mainCountryForCode:bool,leadingDigits?:string,mobileNumberPortableRegion?:bool}
*/
class PhoneMetadata
{
protected ?string $id = null;
protected ?int $countryCode = null;
protected string $leadingDigits;
protected string $internationalPrefix;
protected ?string $preferredInternationalPrefix = null;
protected ?string $nationalPrefixForParsing = null;
protected ?string $nationalPrefixTransformRule = null;
protected ?string $nationalPrefix = null;
protected ?string $preferredExtnPrefix = null;
protected bool $mainCountryForCode = false;
protected bool $mobileNumberPortableRegion = false;
protected ?PhoneNumberDesc $generalDesc = null;
protected ?PhoneNumberDesc $mobile = null;
protected ?PhoneNumberDesc $premiumRate = null;
protected ?PhoneNumberDesc $fixedLine = null;
protected bool $sameMobileAndFixedLinePattern = false;
/**
* @var NumberFormat[]
*/
protected array $numberFormat = [];
protected ?PhoneNumberDesc $tollFree = null;
protected ?PhoneNumberDesc $sharedCost = null;
protected ?PhoneNumberDesc $personalNumber = null;
protected ?PhoneNumberDesc $voip = null;
protected ?PhoneNumberDesc $pager = null;
protected ?PhoneNumberDesc $uan = null;
protected ?PhoneNumberDesc $emergency = null;
protected ?PhoneNumberDesc $voicemail = null;
protected ?PhoneNumberDesc $short_code = null;
protected ?PhoneNumberDesc $standard_rate = null;
protected ?PhoneNumberDesc $carrierSpecific = null;
protected ?PhoneNumberDesc $smsServices = null;
protected ?PhoneNumberDesc $noInternationalDialling = null;
/**
* @var NumberFormat[]
*/
protected array $intlNumberFormat = [];
public function hasId(): bool
{
return isset($this->id);
}
public function hasMainCountryForCode(): bool
{
return isset($this->mainCountryForCode);
}
public function isMainCountryForCode(): bool
{
return $this->mainCountryForCode;
}
public function getMainCountryForCode(): bool
{
return $this->mainCountryForCode;
}
public function setMainCountryForCode(bool $value): PhoneMetadata
{
$this->mainCountryForCode = $value;
return $this;
}
public function clearMainCountryForCode(): PhoneMetadata
{
$this->mainCountryForCode = false;
return $this;
}
public function numberFormatSize(): int
{
return \count($this->numberFormat);
}
/**
* @param int $index
* @return NumberFormat
*/
public function getNumberFormat(int $index): NumberFormat
{
return $this->numberFormat[$index];
}
public function intlNumberFormatSize(): int
{
return \count($this->intlNumberFormat);
}
public function getIntlNumberFormat(int $index): NumberFormat
{
return $this->intlNumberFormat[$index];
}
public function clearIntlNumberFormat(): PhoneMetadata
{
$this->intlNumberFormat = [];
return $this;
}
/**
* @return PhoneMetadataArray
*/
public function toArray(): array
{
$output = [];
if ($this->hasGeneralDesc()) {
$output['generalDesc'] = $this->getGeneralDesc()->toArray();
}
if ($this->hasFixedLine()) {
$output['fixedLine'] = $this->getFixedLine()->toArray();
}
if ($this->hasMobile()) {
$output['mobile'] = $this->getMobile()->toArray();
}
if ($this->hasTollFree()) {
$output['tollFree'] = $this->getTollFree()->toArray();
}
if ($this->hasPremiumRate()) {
$output['premiumRate'] = $this->getPremiumRate()->toArray();
}
if ($this->hasSharedCost()) {
$output['sharedCost'] = $this->getSharedCost()->toArray();
}
if ($this->hasPersonalNumber()) {
$output['personalNumber'] = $this->getPersonalNumber()->toArray();
}
if ($this->hasVoip()) {
$output['voip'] = $this->getVoip()->toArray();
}
if ($this->hasPager()) {
$output['pager'] = $this->getPager()->toArray();
}
if ($this->hasUan()) {
$output['uan'] = $this->getUan()->toArray();
}
if ($this->hasEmergency()) {
$output['emergency'] = $this->getEmergency()->toArray();
}
if ($this->hasVoicemail()) {
$output['voicemail'] = $this->getVoicemail()->toArray();
}
if ($this->hasShortCode()) {
$output['shortCode'] = $this->getShortCode()->toArray();
}
if ($this->hasStandardRate()) {
$output['standardRate'] = $this->getStandardRate()->toArray();
}
if ($this->hasCarrierSpecific()) {
$output['carrierSpecific'] = $this->getCarrierSpecific()->toArray();
}
if ($this->hasSmsServices()) {
$output['smsServices'] = $this->getSmsServices()->toArray();
}
if ($this->hasNoInternationalDialling()) {
$output['noInternationalDialling'] = $this->getNoInternationalDialling()->toArray();
}
$output['id'] = $this->getId();
if ($this->hasCountryCode()) {
$output['countryCode'] = $this->getCountryCode();
}
if ($this->hasInternationalPrefix()) {
$output['internationalPrefix'] = $this->getInternationalPrefix();
}
if ($this->hasPreferredInternationalPrefix()) {
$output['preferredInternationalPrefix'] = $this->getPreferredInternationalPrefix();
}
if ($this->hasNationalPrefix()) {
$output['nationalPrefix'] = $this->getNationalPrefix();
}
if ($this->hasPreferredExtnPrefix()) {
$output['preferredExtnPrefix'] = $this->getPreferredExtnPrefix();
}
if ($this->hasNationalPrefixForParsing()) {
$output['nationalPrefixForParsing'] = $this->getNationalPrefixForParsing();
}
if ($this->hasNationalPrefixTransformRule()) {
$output['nationalPrefixTransformRule'] = $this->getNationalPrefixTransformRule();
}
if ($this->hasSameMobileAndFixedLinePattern()) {
$output['sameMobileAndFixedLinePattern'] = $this->getSameMobileAndFixedLinePattern();
}
$output['numberFormat'] = [];
foreach ($this->numberFormats() as $numberFormat) {
$output['numberFormat'][] = $numberFormat->toArray();
}
if (!empty($this->intlNumberFormats())) {
$output['intlNumberFormat'] = [];
foreach ($this->intlNumberFormats() as $intlNumberFormat) {
$output['intlNumberFormat'][] = $intlNumberFormat->toArray();
}
}
$output['mainCountryForCode'] = $this->getMainCountryForCode();
if ($this->hasLeadingDigits()) {
$output['leadingDigits'] = $this->getLeadingDigits();
}
if ($this->hasMobileNumberPortableRegion()) {
$output['mobileNumberPortableRegion'] = $this->isMobileNumberPortableRegion();
}
return $output;
}
public function hasGeneralDesc(): bool
{
return isset($this->generalDesc);
}
public function getGeneralDesc(): ?PhoneNumberDesc
{
return $this->generalDesc;
}
public function setGeneralDesc(PhoneNumberDesc $value): PhoneMetadata
{
$this->generalDesc = $value;
return $this;
}
public function hasFixedLine(): bool
{
return isset($this->fixedLine);
}
public function getFixedLine(): ?PhoneNumberDesc
{
return $this->fixedLine;
}
public function setFixedLine(PhoneNumberDesc $value): PhoneMetadata
{
$this->fixedLine = $value;
return $this;
}
public function hasMobile(): bool
{
return isset($this->mobile);
}
public function getMobile(): ?PhoneNumberDesc
{
return $this->mobile;
}
public function setMobile(PhoneNumberDesc $value): PhoneMetadata
{
$this->mobile = $value;
return $this;
}
public function hasTollFree(): bool
{
return isset($this->tollFree);
}
public function getTollFree(): ?PhoneNumberDesc
{
return $this->tollFree;
}
public function setTollFree(PhoneNumberDesc $value): PhoneMetadata
{
$this->tollFree = $value;
return $this;
}
public function hasPremiumRate(): bool
{
return isset($this->premiumRate);
}
public function getPremiumRate(): ?PhoneNumberDesc
{
return $this->premiumRate;
}
public function setPremiumRate(PhoneNumberDesc $value): PhoneMetadata
{
$this->premiumRate = $value;
return $this;
}
public function hasSharedCost(): bool
{
return isset($this->sharedCost);
}
public function getSharedCost(): ?PhoneNumberDesc
{
return $this->sharedCost;
}
public function setSharedCost(PhoneNumberDesc $value): PhoneMetadata
{
$this->sharedCost = $value;
return $this;
}
public function hasPersonalNumber(): bool
{
return isset($this->personalNumber);
}
public function getPersonalNumber(): ?PhoneNumberDesc
{
return $this->personalNumber;
}
public function setPersonalNumber(PhoneNumberDesc $value): PhoneMetadata
{
$this->personalNumber = $value;
return $this;
}
public function hasVoip(): bool
{
return isset($this->voip);
}
public function getVoip(): ?PhoneNumberDesc
{
return $this->voip;
}
public function setVoip(PhoneNumberDesc $value): PhoneMetadata
{
$this->voip = $value;
return $this;
}
public function hasPager(): bool
{
return isset($this->pager);
}
public function getPager(): ?PhoneNumberDesc
{
return $this->pager;
}
public function setPager(PhoneNumberDesc $value): PhoneMetadata
{
$this->pager = $value;
return $this;
}
public function hasUan(): bool
{
return isset($this->uan);
}
public function getUan(): ?PhoneNumberDesc
{
return $this->uan;
}
public function setUan(PhoneNumberDesc $value): PhoneMetadata
{
$this->uan = $value;
return $this;
}
public function hasEmergency(): bool
{
return isset($this->emergency);
}
public function getEmergency(): ?PhoneNumberDesc
{
return $this->emergency;
}
public function setEmergency(PhoneNumberDesc $value): PhoneMetadata
{
$this->emergency = $value;
return $this;
}
public function hasVoicemail(): bool
{
return isset($this->voicemail);
}
public function getVoicemail(): ?PhoneNumberDesc
{
return $this->voicemail;
}
public function setVoicemail(PhoneNumberDesc $value): PhoneMetadata
{
$this->voicemail = $value;
return $this;
}
public function hasShortCode(): bool
{
return isset($this->short_code);
}
public function getShortCode(): ?PhoneNumberDesc
{
return $this->short_code;
}
public function setShortCode(PhoneNumberDesc $value): PhoneMetadata
{
$this->short_code = $value;
return $this;
}
public function hasStandardRate(): bool
{
return isset($this->standard_rate);
}
public function getStandardRate(): ?PhoneNumberDesc
{
return $this->standard_rate;
}
public function setStandardRate(PhoneNumberDesc $value): PhoneMetadata
{
$this->standard_rate = $value;
return $this;
}
public function hasCarrierSpecific(): bool
{
return isset($this->carrierSpecific);
}
public function getCarrierSpecific(): ?PhoneNumberDesc
{
return $this->carrierSpecific;
}
public function setCarrierSpecific(PhoneNumberDesc $value): PhoneMetadata
{
$this->carrierSpecific = $value;
return $this;
}
public function hasSmsServices(): bool
{
return isset($this->smsServices);
}
public function getSmsServices(): ?PhoneNumberDesc
{
return $this->smsServices;
}
public function setSmsServices(PhoneNumberDesc $value): PhoneMetadata
{
$this->smsServices = $value;
return $this;
}
public function hasNoInternationalDialling(): bool
{
return isset($this->noInternationalDialling);
}
public function getNoInternationalDialling(): ?PhoneNumberDesc
{
return $this->noInternationalDialling;
}
public function setNoInternationalDialling(PhoneNumberDesc $value): PhoneMetadata
{
$this->noInternationalDialling = $value;
return $this;
}
public function getId(): ?string
{
return $this->id;
}
public function setId(string $value): PhoneMetadata
{
$this->id = $value;
return $this;
}
/** @phpstan-assert-if-true !null $this->getCountryCode() */
public function hasCountryCode(): bool
{
return isset($this->countryCode);
}
public function getCountryCode(): ?int
{
return $this->countryCode;
}
public function setCountryCode(int $value): PhoneMetadata
{
$this->countryCode = $value;
return $this;
}
public function hasInternationalPrefix(): bool
{
return isset($this->internationalPrefix);
}
public function getInternationalPrefix(): string
{
return $this->internationalPrefix;
}
public function setInternationalPrefix(string $value): PhoneMetadata
{
$this->internationalPrefix = $value;
return $this;
}
/** @phpstan-assert-if-true !null $this->getPreferredInternationalPrefix() */
public function hasPreferredInternationalPrefix(): bool
{
return isset($this->preferredInternationalPrefix);
}
public function getPreferredInternationalPrefix(): ?string
{
return $this->preferredInternationalPrefix;
}
public function setPreferredInternationalPrefix(string $value): PhoneMetadata
{
$this->preferredInternationalPrefix = $value;
return $this;
}
/** @phpstan-assert-if-true !null $this->getNationalPrefix() */
public function hasNationalPrefix(): bool
{
return isset($this->nationalPrefix);
}
public function getNationalPrefix(): ?string
{
return $this->nationalPrefix;
}
public function setNationalPrefix(string $value): PhoneMetadata
{
$this->nationalPrefix = $value;
return $this;
}
/** @phpstan-assert-if-true !null $this->getPreferredExtnPrefix() */
public function hasPreferredExtnPrefix(): bool
{
return isset($this->preferredExtnPrefix);
}
public function getPreferredExtnPrefix(): ?string
{
return $this->preferredExtnPrefix;
}
public function setPreferredExtnPrefix(string $value): PhoneMetadata
{
$this->preferredExtnPrefix = $value;
return $this;
}
/** @phpstan-assert-if-true !null $this->getNationalPrefixForParsing() */
public function hasNationalPrefixForParsing(): bool
{
return isset($this->nationalPrefixForParsing);
}
public function getNationalPrefixForParsing(): ?string
{
return $this->nationalPrefixForParsing;
}
public function setNationalPrefixForParsing(string $value): PhoneMetadata
{
$this->nationalPrefixForParsing = $value;
return $this;
}
/** @phpstan-assert-if-true !null $this->getNationalPrefixTransformRule() */
public function hasNationalPrefixTransformRule(): bool
{
return isset($this->nationalPrefixTransformRule);
}
public function getNationalPrefixTransformRule(): ?string
{
return $this->nationalPrefixTransformRule;
}
public function setNationalPrefixTransformRule(string $value): PhoneMetadata
{
$this->nationalPrefixTransformRule = $value;
return $this;
}
public function hasSameMobileAndFixedLinePattern(): bool
{
return isset($this->sameMobileAndFixedLinePattern);
}
public function getSameMobileAndFixedLinePattern(): bool
{
return $this->sameMobileAndFixedLinePattern;
}
public function setSameMobileAndFixedLinePattern(bool $value): PhoneMetadata
{
$this->sameMobileAndFixedLinePattern = $value;
return $this;
}
/**
* @return NumberFormat[]
*/
public function numberFormats(): array
{
return $this->numberFormat;
}
/**
* @return NumberFormat[]
*/
public function intlNumberFormats(): array
{
return $this->intlNumberFormat;
}
public function hasLeadingDigits(): bool
{
return isset($this->leadingDigits);
}
public function getLeadingDigits(): string
{
return $this->leadingDigits;
}
public function setLeadingDigits(string $value): PhoneMetadata
{
$this->leadingDigits = $value;
return $this;
}
public function hasMobileNumberPortableRegion(): bool
{
return isset($this->mobileNumberPortableRegion);
}
public function isMobileNumberPortableRegion(): bool
{
return $this->mobileNumberPortableRegion;
}
public function setMobileNumberPortableRegion(bool $value): PhoneMetadata
{
$this->mobileNumberPortableRegion = $value;
return $this;
}
public function clearPreferredInternationalPrefix(): PhoneMetadata
{
unset($this->preferredInternationalPrefix);
return $this;
}
public function clearNationalPrefix(): PhoneMetadata
{
unset($this->nationalPrefix);
return $this;
}
public function clearPreferredExtnPrefix(): PhoneMetadata
{
unset($this->preferredExtnPrefix);
return $this;
}
public function clearNationalPrefixTransformRule(): PhoneMetadata
{
unset($this->nationalPrefixTransformRule);
return $this;
}
public function clearSameMobileAndFixedLinePattern(): PhoneMetadata
{
$this->sameMobileAndFixedLinePattern = false;
return $this;
}
public function clearMobileNumberPortableRegion(): PhoneMetadata
{
$this->mobileNumberPortableRegion = false;
return $this;
}
/**
* @param PhoneMetadataArray $input
*/
public function fromArray(array $input): PhoneMetadata
{
if (isset($input['generalDesc'])) {
$desc = new PhoneNumberDesc();
$this->setGeneralDesc($desc->fromArray($input['generalDesc']));
}
if (isset($input['fixedLine'])) {
$desc = new PhoneNumberDesc();
$this->setFixedLine($desc->fromArray($input['fixedLine']));
}
if (isset($input['mobile'])) {
$desc = new PhoneNumberDesc();
$this->setMobile($desc->fromArray($input['mobile']));
}
if (isset($input['tollFree'])) {
$desc = new PhoneNumberDesc();
$this->setTollFree($desc->fromArray($input['tollFree']));
}
if (isset($input['premiumRate'])) {
$desc = new PhoneNumberDesc();
$this->setPremiumRate($desc->fromArray($input['premiumRate']));
}
if (isset($input['sharedCost'])) {
$desc = new PhoneNumberDesc();
$this->setSharedCost($desc->fromArray($input['sharedCost']));
}
if (isset($input['personalNumber'])) {
$desc = new PhoneNumberDesc();
$this->setPersonalNumber($desc->fromArray($input['personalNumber']));
}
if (isset($input['voip'])) {
$desc = new PhoneNumberDesc();
$this->setVoip($desc->fromArray($input['voip']));
}
if (isset($input['pager'])) {
$desc = new PhoneNumberDesc();
$this->setPager($desc->fromArray($input['pager']));
}
if (isset($input['uan'])) {
$desc = new PhoneNumberDesc();
$this->setUan($desc->fromArray($input['uan']));
}
if (isset($input['emergency'])) {
$desc = new PhoneNumberDesc();
$this->setEmergency($desc->fromArray($input['emergency']));
}
if (isset($input['voicemail'])) {
$desc = new PhoneNumberDesc();
$this->setVoicemail($desc->fromArray($input['voicemail']));
}
if (isset($input['shortCode'])) {
$desc = new PhoneNumberDesc();
$this->setShortCode($desc->fromArray($input['shortCode']));
}
if (isset($input['standardRate'])) {
$desc = new PhoneNumberDesc();
$this->setStandardRate($desc->fromArray($input['standardRate']));
}
if (isset($input['carrierSpecific'])) {
$desc = new PhoneNumberDesc();
$this->setCarrierSpecific($desc->fromArray($input['carrierSpecific']));
}
if (isset($input['smsServices'])) {
$desc = new PhoneNumberDesc();
$this->setSmsServices($desc->fromArray($input['smsServices']));
}
if (isset($input['noInternationalDialling'])) {
$desc = new PhoneNumberDesc();
$this->setNoInternationalDialling($desc->fromArray($input['noInternationalDialling']));
}
$this->setId($input['id']);
if (isset($input['countryCode'])) {
$this->setCountryCode($input['countryCode']);
}
if (isset($input['internationalPrefix'])) {
$this->setInternationalPrefix($input['internationalPrefix']);
}
if (isset($input['preferredInternationalPrefix'])) {
$this->setPreferredInternationalPrefix($input['preferredInternationalPrefix']);
}
if (isset($input['nationalPrefix'])) {
$this->setNationalPrefix($input['nationalPrefix']);
}
if (isset($input['preferredExtnPrefix'])) {
$this->setPreferredExtnPrefix($input['preferredExtnPrefix']);
}
if (isset($input['nationalPrefixForParsing'])) {
$this->setNationalPrefixForParsing($input['nationalPrefixForParsing']);
}
if (isset($input['nationalPrefixTransformRule'])) {
$this->setNationalPrefixTransformRule($input['nationalPrefixTransformRule']);
}
foreach ($input['numberFormat'] ?? [] as $numberFormatElt) {
$numberFormat = new NumberFormat();
$numberFormat->fromArray($numberFormatElt);
$this->addNumberFormat($numberFormat);
}
foreach ($input['intlNumberFormat'] ?? [] as $intlNumberFormatElt) {
$numberFormat = new NumberFormat();
$numberFormat->fromArray($intlNumberFormatElt);
$this->addIntlNumberFormat($numberFormat);
}
$this->setMainCountryForCode($input['mainCountryForCode']);
if (isset($input['leadingDigits'])) {
$this->setLeadingDigits($input['leadingDigits']);
}
if (isset($input['mobileNumberPortableRegion'])) {
$this->setMobileNumberPortableRegion($input['mobileNumberPortableRegion']);
}
return $this;
}
public function addNumberFormat(NumberFormat $value): PhoneMetadata
{
$this->numberFormat[] = $value;
return $this;
}
public function addIntlNumberFormat(NumberFormat $value): PhoneMetadata
{
$this->intlNumberFormat[] = $value;
return $this;
}
}
@@ -0,0 +1,586 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
class PhoneNumber implements \Serializable, \Stringable
{
/**
* The country calling code for this number, as defined by the International Telecommunication Union
* (ITU). For example, this would be 1 for NANPA countries, and 33 for France.
*/
protected ?int $countryCode = null;
/**
* National (significant) Number is defined in International Telecommunication Union (ITU)
* Recommendation E.164. It is a language/country-neutral representation of a phone number at a
* country level. For countries which have the concept of an "area code" or "national destination
* code", this is included in the National (significant) Number. Although the ITU says the maximum
* length should be 15, we have found longer numbers in some countries e.g. Germany.
*
* Note that the National (significant) Number does not contain the National(trunk) prefix.
*/
protected ?string $nationalNumber = null;
/**
* Extension is not standardized in ITU recommendations, except for being defined as a series of
* numbers with a maximum length of 40 digits. It is defined as a string here to accommodate for the
* possible use of a leading zero in the extension (organizations have complete freedom to do so,
* as there is no standard defined). However, only ASCII digits should be stored here.
*/
protected ?string $extension = null;
/**
* In some countries, the national (significant) number starts with one or more "0"s without this
* being a national prefix or trunk code of some kind. For example, the leading zero in the national
* (significant) number of an Italian phone number indicates the number is a fixed-line number.
* There have been plans to migrate fixed-line numbers to start with the digit two since December
* 2000, but it has not happened yet. See http://en.wikipedia.org/wiki/%2B39 for more details.
*
* These fields can be safely ignored (there is no need to set them) for most countries. Some
* limited number of countries behave like Italy - for these cases, if the leading zero(s) of a
* number would be retained even when dialling internationally, set this flag to true, and also
* set the number of leading zeros.
*
* Clients who use the parsing functionality of the i18n phone number libraries
* will have these fields set if necessary automatically.
*/
protected ?bool $italianLeadingZero = null;
/**
* This field is used to store the raw input string containing phone numbers before it was
* canonicalized by the library. For example, it could be used to store alphanumerical numbers
* such as "1-800-GOOG-411".
*/
protected ?string $rawInput = null;
/**
* The source from which the country_code is derived. This is not set in the general parsing method,
* but in the method that parses and keeps raw_input. New fields could be added upon request.
*
* @see CountryCodeSource
*
* This must be one of the CountryCodeSource constants.
*/
protected int $countryCodeSource = CountryCodeSource::UNSPECIFIED;
/**
* The carrier selection code that is preferred when calling this phone number domestically. This
* also includes codes that need to be dialed in some countries when calling from landlines to
* mobiles or vice versa. For example, in Columbia, a "3" needs to be dialed before the phone number
* itself when calling from a mobile phone to a domestic landline phone and vice versa.
*
* Note this is the "preferred" code, which means other codes may work as well.
*/
protected ?string $preferredDomesticCarrierCode = null;
/**
* Whether this phone number has a number of leading zeros set.
*/
protected bool $hasNumberOfLeadingZeros = false;
/**
* The number of leading zeros of this phone number.
*/
protected int $numberOfLeadingZeros = 1;
/**
* Clears this phone number.
*
* This effectively resets this phone number to the state of a new instance.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function clear(): PhoneNumber
{
$this->clearCountryCode();
$this->clearNationalNumber();
$this->clearExtension();
$this->clearItalianLeadingZero();
$this->clearNumberOfLeadingZeros();
$this->clearRawInput();
$this->clearCountryCodeSource();
$this->clearPreferredDomesticCarrierCode();
return $this;
}
/**
* Clears the country code of this phone number.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function clearCountryCode(): PhoneNumber
{
$this->countryCode = null;
return $this;
}
/**
* Clears the national number of this phone number.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function clearNationalNumber(): PhoneNumber
{
$this->nationalNumber = null;
return $this;
}
/**
* Clears the extension of this phone number.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function clearExtension(): PhoneNumber
{
$this->extension = null;
return $this;
}
/**
* Clears the italian leading zero information of this phone number.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function clearItalianLeadingZero(): PhoneNumber
{
$this->italianLeadingZero = null;
return $this;
}
/**
* Clears the number of leading zeros of this phone number.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function clearNumberOfLeadingZeros(): PhoneNumber
{
$this->hasNumberOfLeadingZeros = false;
$this->numberOfLeadingZeros = 1;
return $this;
}
/**
* Clears the raw input of this phone number.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function clearRawInput(): PhoneNumber
{
$this->rawInput = null;
return $this;
}
/**
* Clears the country code source of this phone number.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function clearCountryCodeSource(): PhoneNumber
{
$this->countryCodeSource = CountryCodeSource::UNSPECIFIED;
return $this;
}
/**
* Clears the preferred domestic carrier code of this phone number.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function clearPreferredDomesticCarrierCode(): PhoneNumber
{
$this->preferredDomesticCarrierCode = null;
return $this;
}
/**
* Merges the information from another phone number into this phone number.
*
* @param PhoneNumber $other The phone number to copy.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function mergeFrom(PhoneNumber $other): PhoneNumber
{
if ($other->hasCountryCode()) {
$this->setCountryCode($other->getCountryCode());
}
if ($other->hasNationalNumber()) {
$this->setNationalNumber($other->getNationalNumber());
}
if ($other->hasExtension()) {
$this->setExtension($other->getExtension());
}
if ($other->hasItalianLeadingZero()) {
$this->setItalianLeadingZero($other->isItalianLeadingZero());
}
if ($other->hasNumberOfLeadingZeros()) {
$this->setNumberOfLeadingZeros($other->getNumberOfLeadingZeros());
}
if ($other->hasRawInput()) {
$this->setRawInput($other->getRawInput());
}
if ($other->hasCountryCodeSource()) {
$this->setCountryCodeSource($other->getCountryCodeSource());
}
if ($other->hasPreferredDomesticCarrierCode()) {
$this->setPreferredDomesticCarrierCode($other->getPreferredDomesticCarrierCode());
}
return $this;
}
/**
* Returns whether this phone number has a country code set.
*
* @return bool True if a country code is set, false otherwise.
*/
public function hasCountryCode(): bool
{
return $this->countryCode !== null;
}
/**
* Returns the country code of this phone number.
*
* @return int|null The country code, or null if not set.
*/
public function getCountryCode(): ?int
{
return $this->countryCode;
}
/**
* Sets the country code of this phone number.
*
* @param int $value The country code.
*
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function setCountryCode(int $value): PhoneNumber
{
$this->countryCode = $value;
return $this;
}
/**
* Returns whether this phone number has a national number set.
*
* @return bool True if a national number is set, false otherwise.
*/
public function hasNationalNumber(): bool
{
return $this->nationalNumber !== null;
}
/**
* Returns the national number of this phone number.
*
* @return string|null The national number, or null if not set.
*/
public function getNationalNumber(): ?string
{
return $this->nationalNumber;
}
/**
* Sets the national number of this phone number.
*
* @param string $value The national number.
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function setNationalNumber(string $value): PhoneNumber
{
$this->nationalNumber = $value;
return $this;
}
/**
* Returns whether this phone number has an extension set.
*
* @return bool True if an extension is set, false otherwise.
*/
public function hasExtension(): bool
{
return $this->extension !== null;
}
/**
* Returns the extension of this phone number.
*
* @return string|null The extension, or null if not set.
*/
public function getExtension(): ?string
{
return $this->extension;
}
/**
* Sets the extension of this phone number.
*
* @param string $value The extension.
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function setExtension(string $value): PhoneNumber
{
$this->extension = $value;
return $this;
}
/**
* Returns whether this phone number has the italian leading zero information set.
*
* @return bool
*/
public function hasItalianLeadingZero(): bool
{
return $this->italianLeadingZero !== null;
}
/**
* Sets whether this phone number uses an italian leading zero.
*
* @param bool $value True to use italian leading zero, false otherwise.
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function setItalianLeadingZero(bool $value): PhoneNumber
{
$this->italianLeadingZero = $value;
return $this;
}
/**
* Returns whether this phone number uses an italian leading zero.
*
* @return bool|null True if it uses an italian leading zero, false if it does not, null if not set.
*/
public function isItalianLeadingZero(): ?bool
{
return $this->italianLeadingZero;
}
/**
* Returns whether this phone number has a number of leading zeros set.
*
* @return bool True if a number of leading zeros is set, false otherwise.
*/
public function hasNumberOfLeadingZeros(): bool
{
return $this->hasNumberOfLeadingZeros;
}
/**
* Returns the number of leading zeros of this phone number.
*
* @return int The number of leading zeros.
*/
public function getNumberOfLeadingZeros(): int
{
return $this->numberOfLeadingZeros;
}
/**
* Sets the number of leading zeros of this phone number.
*
* @param int $value The number of leading zeros.
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function setNumberOfLeadingZeros(int $value): PhoneNumber
{
$this->hasNumberOfLeadingZeros = true;
$this->numberOfLeadingZeros = $value;
return $this;
}
/**
* Returns whether this phone number has a raw input.
*
* @return bool True if a raw input is set, false otherwise.
*/
public function hasRawInput(): bool
{
return $this->rawInput !== null;
}
/**
* Returns the raw input of this phone number.
*
* @return string|null The raw input, or null if not set.
*/
public function getRawInput(): ?string
{
return $this->rawInput;
}
/**
* Sets the raw input of this phone number.
*
* @param string $value The raw input.
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function setRawInput(string $value): PhoneNumber
{
$this->rawInput = $value;
return $this;
}
/**
* Returns whether this phone number has a country code source.
*
* @return bool True if a country code source is set, false otherwise.
*/
public function hasCountryCodeSource(): bool
{
return $this->countryCodeSource !== CountryCodeSource::UNSPECIFIED;
}
/**
* Returns the country code source of this phone number.
*
* @return int|null A CountryCodeSource constant, or null if not set.
*/
public function getCountryCodeSource(): ?int
{
return $this->countryCodeSource;
}
/**
* Sets the country code source of this phone number.
*
* @param int $value A CountryCodeSource constant.
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function setCountryCodeSource(int $value): PhoneNumber
{
$this->countryCodeSource = $value;
return $this;
}
/**
* Returns whether this phone number has a preferred domestic carrier code.
*
* @return bool True if a preferred domestic carrier code is set, false otherwise.
*/
public function hasPreferredDomesticCarrierCode(): bool
{
return $this->preferredDomesticCarrierCode !== null;
}
/**
* Returns the preferred domestic carrier code of this phone number.
*
* @return string|null The preferred domestic carrier code, or null if not set.
*/
public function getPreferredDomesticCarrierCode(): ?string
{
return $this->preferredDomesticCarrierCode;
}
/**
* Sets the preferred domestic carrier code of this phone number.
*
* @param string $value The preferred domestic carrier code.
* @return PhoneNumber This PhoneNumber instance, for chaining method calls.
*/
public function setPreferredDomesticCarrierCode(string $value): PhoneNumber
{
$this->preferredDomesticCarrierCode = $value;
return $this;
}
/**
* Returns whether this phone number is equal to another.
*
* @param PhoneNumber $other The phone number to compare.
*
* @return bool True if the phone numbers are equal, false otherwise.
*/
public function equals(PhoneNumber $other): bool
{
if ($this === $other) {
return true;
}
return $this->countryCode === $other->countryCode
&& $this->nationalNumber === $other->nationalNumber
&& $this->extension === $other->extension
&& $this->italianLeadingZero === $other->italianLeadingZero
&& $this->numberOfLeadingZeros === $other->numberOfLeadingZeros
&& $this->rawInput === $other->rawInput
&& $this->countryCodeSource === $other->countryCodeSource
&& $this->preferredDomesticCarrierCode === $other->preferredDomesticCarrierCode;
}
/**
* Returns a string representation of this phone number.
* @return string
*/
public function __toString(): string
{
$outputString = 'Country Code: ' . $this->countryCode;
$outputString .= ' National Number: ' . $this->nationalNumber;
if ($this->hasItalianLeadingZero()) {
$outputString .= ' Leading Zero(s): true';
}
if ($this->hasNumberOfLeadingZeros()) {
$outputString .= ' Number of leading zeros: ' . $this->numberOfLeadingZeros;
}
if ($this->hasExtension()) {
$outputString .= ' Extension: ' . $this->extension;
}
if ($this->hasCountryCodeSource()) {
$outputString .= ' Country Code Source: ' . $this->countryCodeSource;
}
if ($this->hasPreferredDomesticCarrierCode()) {
$outputString .= ' Preferred Domestic Carrier Code: ' . $this->preferredDomesticCarrierCode;
}
return $outputString;
}
/**
* @inheritDoc
*/
public function serialize(): ?string
{
return serialize($this->__serialize());
}
/**
* @return array{?int,?string,?string,?bool,int,?string,int,?string}
*/
public function __serialize(): array
{
return [
$this->countryCode,
$this->nationalNumber,
$this->extension,
$this->italianLeadingZero,
$this->numberOfLeadingZeros,
$this->rawInput,
$this->countryCodeSource,
$this->preferredDomesticCarrierCode,
];
}
/**
* @inheritDoc
*/
public function unserialize($data)
{
$this->__unserialize(unserialize($data, ['allowed_classes' => [__CLASS__]]));
}
/**
* @param array{int,?string,?string,?bool,int,?string,int,?string} $data
*/
public function __unserialize(array $data): void
{
[
$this->countryCode,
$this->nationalNumber,
$this->extension,
$this->italianLeadingZero,
$this->numberOfLeadingZeros,
$this->rawInput,
$this->countryCodeSource,
$this->preferredDomesticCarrierCode
] = $data;
if ($this->numberOfLeadingZeros > 1) {
$this->hasNumberOfLeadingZeros = true;
}
}
}
@@ -0,0 +1,216 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
/**
* Phone Number Description
* @interal
* @phpstan-type PhoneNumberDescArray array{NationalNumberPattern?:string,ExampleNumber?:string,PossibleLength?:int[],PossibleLengthLocalOnly?:int[]}
*/
class PhoneNumberDesc
{
protected bool $hasNationalNumberPattern = false;
protected string $nationalNumberPattern = '';
protected bool $hasExampleNumber = false;
protected string $exampleNumber = '';
/**
* @var int[]
*/
protected array $possibleLength = [];
/**
* @var int[]
*/
protected array $possibleLengthLocalOnly = [];
public function __construct()
{
$this->clear();
}
public function clear(): PhoneNumberDesc
{
$this->clearNationalNumberPattern();
$this->clearPossibleLength();
$this->clearPossibleLengthLocalOnly();
$this->clearExampleNumber();
return $this;
}
/**
* @return int[]
*/
public function getPossibleLength(): array
{
return $this->possibleLength;
}
/**
* @param int[] $possibleLength
*/
public function setPossibleLength(array $possibleLength): void
{
$this->possibleLength = $possibleLength;
}
public function addPossibleLength(int $possibleLength): void
{
if (!in_array($possibleLength, $this->possibleLength)) {
$this->possibleLength[] = $possibleLength;
}
}
public function clearPossibleLength(): void
{
$this->possibleLength = [];
}
/**
* @return int[]
*/
public function getPossibleLengthLocalOnly(): array
{
return $this->possibleLengthLocalOnly;
}
/**
* @param int[] $possibleLengthLocalOnly
*/
public function setPossibleLengthLocalOnly(array $possibleLengthLocalOnly): void
{
$this->possibleLengthLocalOnly = $possibleLengthLocalOnly;
}
public function addPossibleLengthLocalOnly(int $possibleLengthLocalOnly): void
{
if (!in_array($possibleLengthLocalOnly, $this->possibleLengthLocalOnly)) {
$this->possibleLengthLocalOnly[] = $possibleLengthLocalOnly;
}
}
public function clearPossibleLengthLocalOnly(): void
{
$this->possibleLengthLocalOnly = [];
}
public function hasNationalNumberPattern(): bool
{
return $this->hasNationalNumberPattern;
}
public function getNationalNumberPattern(): string
{
return $this->nationalNumberPattern;
}
public function setNationalNumberPattern(string $value): PhoneNumberDesc
{
$this->hasNationalNumberPattern = true;
$this->nationalNumberPattern = $value;
return $this;
}
public function clearNationalNumberPattern(): PhoneNumberDesc
{
$this->hasNationalNumberPattern = false;
$this->nationalNumberPattern = '';
return $this;
}
public function hasExampleNumber(): bool
{
return $this->hasExampleNumber;
}
public function getExampleNumber(): string
{
return $this->exampleNumber;
}
public function setExampleNumber(string $value): PhoneNumberDesc
{
$this->hasExampleNumber = true;
$this->exampleNumber = $value;
return $this;
}
public function clearExampleNumber(): self
{
$this->hasExampleNumber = false;
$this->exampleNumber = '';
return $this;
}
public function mergeFrom(PhoneNumberDesc $other): self
{
if ($other->hasNationalNumberPattern()) {
$this->setNationalNumberPattern($other->getNationalNumberPattern());
}
if ($other->hasExampleNumber()) {
$this->setExampleNumber($other->getExampleNumber());
}
$this->setPossibleLength($other->getPossibleLength());
$this->setPossibleLengthLocalOnly($other->getPossibleLengthLocalOnly());
return $this;
}
public function exactlySameAs(PhoneNumberDesc $other): bool
{
return $this->nationalNumberPattern === $other->nationalNumberPattern &&
$this->exampleNumber === $other->exampleNumber;
}
/**
* @return PhoneNumberDescArray
*/
public function toArray(): array
{
$data = [];
if ($this->hasNationalNumberPattern()) {
$data['NationalNumberPattern'] = $this->getNationalNumberPattern();
}
if ($this->hasExampleNumber()) {
$data['ExampleNumber'] = $this->getExampleNumber();
}
$possibleLength = $this->getPossibleLength();
if (!empty($possibleLength)) {
$data['PossibleLength'] = $possibleLength;
}
$possibleLengthLocalOnly = $this->getPossibleLengthLocalOnly();
if (!empty($possibleLengthLocalOnly)) {
$data['PossibleLengthLocalOnly'] = $possibleLengthLocalOnly;
}
return $data;
}
/**
* @param PhoneNumberDescArray $input
* @return $this
*/
public function fromArray(array $input): static
{
if (isset($input['NationalNumberPattern']) && $input['NationalNumberPattern'] !== '') {
$this->setNationalNumberPattern($input['NationalNumberPattern']);
}
if (isset($input['ExampleNumber']) && $input['ExampleNumber'] !== '') {
$this->setExampleNumber($input['ExampleNumber']);
}
if (isset($input['PossibleLength'])) {
$this->setPossibleLength($input['PossibleLength']);
}
if (isset($input['PossibleLengthLocalOnly'])) {
$this->setPossibleLengthLocalOnly($input['PossibleLengthLocalOnly']);
}
return $this;
}
}
@@ -0,0 +1,23 @@
<?php
namespace libphonenumber;
/**
* INTERNATIONAL and NATIONAL formats are consistent with the definition in ITU-T Recommendation
* E123. For example, the number of the Google Switzerland office will be written as
* "+41 44 668 1800" in INTERNATIONAL format, and as "044 668 1800" in NATIONAL format.
* E164 format is as per INTERNATIONAL format but with no formatting applied, e.g.
* "+41446681800". RFC3966 is as per INTERNATIONAL format, but with all spaces and other
* separating symbols replaced with a hyphen, and with any phone number extension appended with
* ";ext=". It also will have a prefix of "tel:" added, e.g. "tel:+41-44-668-1800".
*
* Note: If you are considering storing the number in a neutral format, you are highly advised to
* use the PhoneNumber class.
*/
class PhoneNumberFormat
{
public const E164 = 0;
public const INTERNATIONAL = 1;
public const NATIONAL = 2;
public const RFC3966 = 3;
}
@@ -0,0 +1,76 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
class PhoneNumberMatch implements \Stringable
{
/**
* The start index into the text.
*/
private int $start;
/**
* The raw substring matched.
*/
private string $rawString;
/**
* Creates a new match
*
* @param int $start The start index into the target text
* @param string $rawString The matched substring of the target text
* @param PhoneNumber $number The matched phone number
*/
public function __construct(int $start, string $rawString, private PhoneNumber $number)
{
if ($start < 0) {
throw new \InvalidArgumentException('Start index must be >= 0.');
}
$this->start = $start;
$this->rawString = $rawString;
}
/**
* Returns the phone number matched by the receiver.
* @return PhoneNumber
*/
public function number(): PhoneNumber
{
return $this->number;
}
/**
* Returns the start index of the matched phone number within the searched text.
* @return int
*/
public function start(): int
{
return $this->start;
}
/**
* Returns the exclusive end index of the matched phone number within the searched text.
* @return int
*/
public function end(): int
{
return $this->start + \mb_strlen($this->rawString);
}
/**
* Returns the raw string matched as a phone number in the searched text.
* @return string
*/
public function rawString(): string
{
return $this->rawString;
}
public function __toString(): string
{
return "PhoneNumberMatch [{$this->start()},{$this->end()}) {$this->rawString}";
}
}
@@ -0,0 +1,71 @@
<?php
namespace libphonenumber;
/**
* Type of phone numbers.
*/
class PhoneNumberType
{
public const FIXED_LINE = 0;
public const MOBILE = 1;
// In some regions (e.g. the USA), it is impossible to distinguish between fixed-line and
// mobile numbers by looking at the phone number itself.
public const FIXED_LINE_OR_MOBILE = 2;
// Freephone lines
public const TOLL_FREE = 3;
public const PREMIUM_RATE = 4;
// The cost of this call is shared between the caller and the recipient, and is hence typically
// less than PREMIUM_RATE calls. See // http://en.wikipedia.org/wiki/Shared_Cost_Service for
// more information.
public const SHARED_COST = 5;
// Voice over IP numbers. This includes TSoIP (Telephony Service over IP).
public const VOIP = 6;
// A personal number is associated with a particular person, and may be routed to either a
// MOBILE or FIXED_LINE number. Some more information can be found here:
// http://en.wikipedia.org/wiki/Personal_Numbers
public const PERSONAL_NUMBER = 7;
public const PAGER = 8;
// Used for "Universal Access Numbers" or "Company Numbers". They may be further routed to
// specific offices, but allow one number to be used for a company.
public const UAN = 9;
// A phone number is of type UNKNOWN when it does not fit any of the known patterns for a
// specific region.
public const UNKNOWN = 10;
// Emergency
public const EMERGENCY = 27;
// Voicemail
public const VOICEMAIL = 28;
// Short Code
public const SHORT_CODE = 29;
// Standard Rate
public const STANDARD_RATE = 30;
/**
* @return array<int,string>
*/
public static function values(): array
{
return [
self::FIXED_LINE => 'FIXED_LINE',
self::MOBILE => 'MOBILE',
self::FIXED_LINE_OR_MOBILE => 'FIXED_LINE_OR_MOBILE',
self::TOLL_FREE => 'TOLL_FREE',
self::PREMIUM_RATE => 'PREMIUM_RATE',
self::SHARED_COST => 'SHARED_COST',
self::VOIP => 'VOIP',
self::PERSONAL_NUMBER => 'PERSONAL_NUMBER',
self::PAGER => 'PAGER',
self::UAN => 'UAN',
self::UNKNOWN => 'UNKNOWN',
self::EMERGENCY => 'EMERGENCY',
self::VOICEMAIL => 'VOICEMAIL',
self::SHORT_CODE => 'SHORT_CODE',
self::STANDARD_RATE => 'STANDARD_RATE',
];
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace libphonenumber;
/**
* Class RegexBasedMatcher
* @package libphonenumber
* @internal
*/
class RegexBasedMatcher implements MatcherAPIInterface
{
public static function create(): static
{
return new static();
}
// Keep PHPStan happy (Unsafe usage of new static())
final public function __construct()
{
}
/**
* Returns whether the given national number (a string containing only decimal digits) matches
* the national number pattern defined in the given {@code PhoneNumberDesc} message.
*/
public function matchNationalNumber(string $number, PhoneNumberDesc $numberDesc, bool $allowPrefixMatch): bool
{
$nationalNumberPattern = $numberDesc->getNationalNumberPattern();
// We don't want to consider it a prefix match when matching non-empty input against an empty
// pattern
if ($nationalNumberPattern === '') {
return false;
}
return $this->match($number, $nationalNumberPattern, $allowPrefixMatch);
}
private function match(string $number, string $pattern, bool $allowPrefixMatch): bool
{
$matcher = new Matcher($pattern, $number);
if (!$matcher->lookingAt()) {
return false;
}
return $matcher->matches() ? true : $allowPrefixMatch;
}
}
@@ -0,0 +1,45 @@
<?php
namespace libphonenumber;
/**
* Possible outcomes when testing if a PhoneNumber is possible.
*/
class ValidationResult
{
/**
* The number length matches that of valid numbers for this region
*/
public const IS_POSSIBLE = 0;
/**
* The number has an invalid country calling code.
*/
public const INVALID_COUNTRY_CODE = 1;
/**
* The number is shorter than all valid numbers for this region.
*/
public const TOO_SHORT = 2;
/**
* The number is longer than all valid numbers for this region.
*/
public const TOO_LONG = 3;
/**
* The number length matches that of local numbers for this region only (i.e. numbers that may
* be able to be dialled within an area, but do not have all the information to be dialled from
* anywhere inside or outside the country).
*/
public const IS_POSSIBLE_LOCAL_ONLY = 4;
/**
* The number is longer than the shortest valid numbers for this region, shorter than the
* longest valid numbers for this region, and does not itself have a number length that matches
* valid numbers for this region. This can also be returned in the case where
* isPossibleNumberForTypeWithReason was called, and there are no numbers of this type at all
* for this region.
*/
public const INVALID_LENGTH = 5;
}
@@ -0,0 +1,114 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:00|[1-9]\\d)\\d{6}',
'PossibleLength' =>
[
0 => 8,
],
],
'fixedLine' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'mobile' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '(?:00|[1-9]\\d)\\d{6}',
'ExampleNumber' => '12345678',
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => '001',
'countryCode' => 800,
'internationalPrefix' => '',
'sameMobileAndFixedLinePattern' => true,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{4})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '\\d',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,114 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[1-9]\\d{7}',
'PossibleLength' =>
[
0 => 8,
],
],
'fixedLine' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'mobile' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'NationalNumberPattern' => '[1-9]\\d{7}',
'ExampleNumber' => '12345678',
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => '001',
'countryCode' => 808,
'internationalPrefix' => '',
'sameMobileAndFixedLinePattern' => true,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{4})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[1-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,115 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '7\\d{11}|[35-7]\\d{8}',
'PossibleLength' =>
[
0 => 9,
1 => 12,
],
],
'fixedLine' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'mobile' =>
[
'NationalNumberPattern' => '(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}',
'ExampleNumber' => '301234567',
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => '001',
'countryCode' => 870,
'internationalPrefix' => '',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[35-7]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,114 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '10\\d{10}',
'PossibleLength' =>
[
0 => 12,
],
],
'fixedLine' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'mobile' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '10\\d{10}',
'ExampleNumber' => '101234567890',
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => '001',
'countryCode' => 878,
'internationalPrefix' => '',
'sameMobileAndFixedLinePattern' => true,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{5})(\\d{5})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '1',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,127 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '6\\d{9}|[0-36-9]\\d{8}',
'PossibleLength' =>
[
0 => 9,
1 => 10,
],
],
'fixedLine' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'mobile' =>
[
'NationalNumberPattern' => '6\\d{9}|[0-36-9]\\d{8}',
'ExampleNumber' => '612345678',
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => '001',
'countryCode' => 881,
'internationalPrefix' => '',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{5})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[0-37-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{5,6})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '6',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,211 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?',
'PossibleLength' =>
[
0 => 7,
1 => 8,
2 => 9,
3 => 10,
4 => 11,
5 => 12,
],
],
'fixedLine' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'mobile' =>
[
'NationalNumberPattern' => '342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}',
'ExampleNumber' => '3421234',
'PossibleLength' =>
[
0 => 7,
1 => 8,
2 => 9,
3 => 10,
4 => 12,
],
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}',
'ExampleNumber' => '390123456789',
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'NationalNumberPattern' => '348[57]\\d{7}',
'ExampleNumber' => '34851234567',
'PossibleLength' =>
[
0 => 11,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => '001',
'countryCode' => 882,
'internationalPrefix' => '',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{5})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '16|342',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{6})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '49',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '1[36]|9',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{2})(\\d{4})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '3[23]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '16',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
5 =>
[
'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '10|23|3(?:[15]|4[57])|4|51',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
6 =>
[
'pattern' => '(\\d{3})(\\d{4})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '34',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
7 =>
[
'pattern' => '(\\d{2})(\\d{4,5})(\\d{5})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[1-35]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,166 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[1-4]\\d|51)\\d{6,10}',
'PossibleLength' =>
[
0 => 8,
1 => 9,
2 => 10,
3 => 11,
4 => 12,
],
],
'fixedLine' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'mobile' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}',
'ExampleNumber' => '510012345',
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => '001',
'countryCode' => 883,
'internationalPrefix' => '',
'sameMobileAndFixedLinePattern' => true,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{2,8})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[14]|2[24-689]|3[02-689]|51[24-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '510',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '21',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{4})(\\d{4})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '51[13]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '[235]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,113 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '\\d{11}',
'PossibleLength' =>
[
0 => 11,
],
],
'fixedLine' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'mobile' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '\\d{11}',
'ExampleNumber' => '12345678901',
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => '001',
'countryCode' => 888,
'internationalPrefix' => '',
'sameMobileAndFixedLinePattern' => true,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{5})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,122 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[1359]\\d{8}',
'PossibleLength' =>
[
0 => 9,
],
'PossibleLengthLocalOnly' =>
[
0 => 8,
],
],
'fixedLine' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'mobile' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '[1359]\\d{8}',
'ExampleNumber' => '123456789',
'PossibleLengthLocalOnly' =>
[
0 => 8,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => '001',
'countryCode' => 979,
'internationalPrefix' => '',
'sameMobileAndFixedLinePattern' => true,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d)(\\d{4})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[1359]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,111 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[01589]\\d|[46])\\d{4}',
'PossibleLength' =>
[
0 => 5,
1 => 6,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '6[2-467]\\d{3}',
'ExampleNumber' => '62889',
'PossibleLength' =>
[
0 => 5,
],
],
'mobile' =>
[
'NationalNumberPattern' => '4\\d{4}',
'ExampleNumber' => '40123',
'PossibleLength' =>
[
0 => 5,
],
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '(?:0[1-9]|[1589]\\d)\\d{4}',
'ExampleNumber' => '542011',
'PossibleLength' =>
[
0 => 6,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AC',
'countryCode' => 247,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,152 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:1|6\\d)\\d{7}|[135-9]\\d{5}',
'PossibleLength' =>
[
0 => 6,
1 => 8,
2 => 9,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '[78]\\d{5}',
'ExampleNumber' => '712345',
'PossibleLength' =>
[
0 => 6,
],
],
'mobile' =>
[
'NationalNumberPattern' => '690\\d{6}|[356]\\d{5}',
'ExampleNumber' => '312345',
'PossibleLength' =>
[
0 => 6,
1 => 9,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '180[02]\\d{4}',
'ExampleNumber' => '18001234',
'PossibleLength' =>
[
0 => 8,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '[19]\\d{5}',
'ExampleNumber' => '912345',
'PossibleLength' =>
[
0 => 6,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'NationalNumberPattern' => '1800\\d{4}',
'PossibleLength' =>
[
0 => 8,
],
],
'id' => 'AD',
'countryCode' => 376,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{3})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[135-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{4})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '1',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '6',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,173 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}',
'PossibleLength' =>
[
0 => 5,
1 => 6,
2 => 7,
3 => 8,
4 => 9,
5 => 10,
6 => 11,
7 => 12,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '[2-4679][2-8]\\d{6}',
'ExampleNumber' => '22345678',
'PossibleLength' =>
[
0 => 8,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '5[024-68]\\d{7}',
'ExampleNumber' => '501234567',
'PossibleLength' =>
[
0 => 9,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '400\\d{6}|800\\d{2,9}',
'ExampleNumber' => '800123456',
],
'premiumRate' =>
[
'NationalNumberPattern' => '900[02]\\d{5}',
'ExampleNumber' => '900234567',
'PossibleLength' =>
[
0 => 9,
],
],
'sharedCost' =>
[
'NationalNumberPattern' => '700[05]\\d{5}',
'ExampleNumber' => '700012345',
'PossibleLength' =>
[
0 => 9,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '600[25]\\d{5}',
'ExampleNumber' => '600212345',
'PossibleLength' =>
[
0 => 9,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AE',
'countryCode' => 971,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{2,9})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '60|8',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[236]|[479][2-8]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{3})(\\d)(\\d{5})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[479]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '5',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,153 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[2-7]\\d{8}',
'PossibleLength' =>
[
0 => 9,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}',
'ExampleNumber' => '234567890',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '7\\d{8}',
'ExampleNumber' => '701234567',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AF',
'countryCode' => 93,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[1-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[2-7]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'intlNumberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[2-7]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,114 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:268|[58]\\d\\d|900)\\d{7}',
'PossibleLength' =>
[
0 => 10,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}',
'ExampleNumber' => '2684601234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}',
'ExampleNumber' => '2684641234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '8002123456',
],
'premiumRate' =>
[
'NationalNumberPattern' => '900[2-9]\\d{6}',
'ExampleNumber' => '9002123456',
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '5002345678',
],
'voip' =>
[
'NationalNumberPattern' => '26848[01]\\d{4}',
'ExampleNumber' => '2684801234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'pager' =>
[
'NationalNumberPattern' => '26840[69]\\d{4}',
'ExampleNumber' => '2684061234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AG',
'countryCode' => 1,
'internationalPrefix' => '011',
'nationalPrefix' => '1',
'nationalPrefixForParsing' => '([457]\\d{6})$|1',
'nationalPrefixTransformRule' => '268$1',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'leadingDigits' => '268',
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,112 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:264|[58]\\d\\d|900)\\d{7}',
'PossibleLength' =>
[
0 => 10,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '264(?:292|4(?:6[12]|9[78]))\\d{4}',
'ExampleNumber' => '2644612345',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}',
'ExampleNumber' => '2642351234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '8002123456',
],
'premiumRate' =>
[
'NationalNumberPattern' => '900[2-9]\\d{6}',
'ExampleNumber' => '9002123456',
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '5002345678',
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'NationalNumberPattern' => '264724\\d{4}',
'ExampleNumber' => '2647241234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AI',
'countryCode' => 1,
'internationalPrefix' => '011',
'nationalPrefix' => '1',
'nationalPrefixForParsing' => '([2457]\\d{6})$|1',
'nationalPrefixTransformRule' => '264$1',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'leadingDigits' => '264',
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,191 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}',
'PossibleLength' =>
[
0 => 6,
1 => 7,
2 => 8,
3 => 9,
],
'PossibleLengthLocalOnly' =>
[
0 => 5,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d{4}|(?:[2358][2-5][2-9]|4(?:[2-57-9][2-9]|6\\d))\\d{5}',
'ExampleNumber' => '22345678',
'PossibleLength' =>
[
0 => 8,
],
'PossibleLengthLocalOnly' =>
[
0 => 5,
1 => 6,
2 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '6(?:[78][2-9]|9\\d)\\d{6}',
'ExampleNumber' => '672123456',
'PossibleLength' =>
[
0 => 9,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '800\\d{4}',
'ExampleNumber' => '8001234',
'PossibleLength' =>
[
0 => 7,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '900[1-9]\\d\\d',
'ExampleNumber' => '900123',
'PossibleLength' =>
[
0 => 6,
],
],
'sharedCost' =>
[
'NationalNumberPattern' => '808[1-9]\\d\\d',
'ExampleNumber' => '808123',
'PossibleLength' =>
[
0 => 6,
],
],
'personalNumber' =>
[
'NationalNumberPattern' => '700[2-9]\\d{4}',
'ExampleNumber' => '70021234',
'PossibleLength' =>
[
0 => 8,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AL',
'countryCode' => 355,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{3,4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '80|9',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '4[2-6]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[2358][2-5]|4',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{3})(\\d{5})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[23578]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '6',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,152 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[1-489]\\d|55|60|77)\\d{6}',
'PossibleLength' =>
[
0 => 8,
],
'PossibleLengthLocalOnly' =>
[
0 => 5,
1 => 6,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:(?:1[0-25]|47)\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}',
'ExampleNumber' => '10123456',
'PossibleLengthLocalOnly' =>
[
0 => 5,
1 => 6,
],
],
'mobile' =>
[
'NationalNumberPattern' => '(?:33|4[1349]|55|77|88|9[13-9])\\d{6}',
'ExampleNumber' => '77123456',
],
'tollFree' =>
[
'NationalNumberPattern' => '800\\d{5}',
'ExampleNumber' => '80012345',
],
'premiumRate' =>
[
'NationalNumberPattern' => '90[016]\\d{5}',
'ExampleNumber' => '90012345',
],
'sharedCost' =>
[
'NationalNumberPattern' => '80[1-4]\\d{5}',
'ExampleNumber' => '80112345',
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|9[0-2])\\d{4}',
'ExampleNumber' => '60271234',
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AM',
'countryCode' => 374,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[89]0',
],
'nationalPrefixFormattingRule' => '0 $1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{3})(\\d{5})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '2|3[12]',
],
'nationalPrefixFormattingRule' => '(0$1)',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{6})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '1|47',
],
'nationalPrefixFormattingRule' => '(0$1)',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{2})(\\d{6})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[3-9]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,112 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[29]\\d{8}',
'PossibleLength' =>
[
0 => 9,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}',
'ExampleNumber' => '222123456',
],
'mobile' =>
[
'NationalNumberPattern' => '9[1-59]\\d{7}',
'ExampleNumber' => '923123456',
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AO',
'countryCode' => 244,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[29]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,377 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}',
'PossibleLength' =>
[
0 => 10,
1 => 11,
],
'PossibleLengthLocalOnly' =>
[
0 => 6,
1 => 7,
2 => 8,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '3888[013-9]\\d{5}|3(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|(?:2(?:657|9(?:54|66))|3(?:7(?:55|77)|865))[2-8]\\d{5}|(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|(?:2(?:284|3(?:02|23)|920)|3(?:4(?:46|8[27]|92)|541|878))[2-7]\\d{5}|(?:2(?:(?:26|62)2|320|477|9(?:42|83))|3(?:329|4(?:62|76|89)|564))[2-6]\\d{5}|(?:(?:11[1-8]|670)\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[235][4-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|[17][2-6]|3[4-6]|[58][3-6])))\\d{6}|2(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|475|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|(?:2(?:2(?:57|81)|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])))[3-6]\\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[03-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[145]|4[13]|5[468]|7[2-5]|8[26])|8(?:2[5-7]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}',
'ExampleNumber' => '1123456789',
'PossibleLength' =>
[
0 => 10,
],
'PossibleLengthLocalOnly' =>
[
0 => 6,
1 => 7,
2 => 8,
],
],
'mobile' =>
[
'NationalNumberPattern' => '93(?:7(?:1[15]|81)[46]|8(?:(?:21|4[16]|69|9[12])[46]|88[013-9]))\\d{5}|9(?:2(?:657|9(?:54|66))|3(?:7(?:55|77)|865))[2-8]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:284|3(?:02|23)|920)|3(?:4(?:46|8[27]|92)|541|878))[2-7]\\d{5}|9(?:2(?:(?:26|62)2|320|477|9(?:42|83))|3(?:329|4(?:62|76|89)|564))[2-6]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[235][4-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|[17][2-6]|3[4-6]|[58][3-6]))))\\d{6}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|475|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:2(?:57|81)|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[03-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[145]|4[13]|5[468]|7[2-5]|8[26])|8(?:2[5-7]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}',
'ExampleNumber' => '91123456789',
'PossibleLengthLocalOnly' =>
[
0 => 6,
1 => 7,
2 => 8,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '800\\d{7,8}',
'ExampleNumber' => '8001234567',
],
'premiumRate' =>
[
'NationalNumberPattern' => '60[04579]\\d{7}',
'ExampleNumber' => '6001234567',
'PossibleLength' =>
[
0 => 10,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '810\\d{7}',
'ExampleNumber' => '8101234567',
'PossibleLength' =>
[
0 => 10,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'NationalNumberPattern' => '810\\d{7}',
'PossibleLength' =>
[
0 => 10,
],
],
'id' => 'AR',
'countryCode' => 54,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?',
'nationalPrefixTransformRule' => '9$1',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})',
'format' => '$1',
'leadingDigitsPatterns' =>
[
0 => '0|1(?:0[0-35-7]|1[02-5]|2[015]|3[47]|4[478])|911',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{4})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '[1-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{3})(\\d{4})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '[2-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{4})(\\d{4})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '[1-8]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{4})(\\d{2})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])',
1 => '2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)',
2 => '2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]',
3 => '2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => true,
],
5 =>
[
'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '1',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => true,
],
6 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
'format' => '$1-$2-$3',
'leadingDigitsPatterns' =>
[
0 => '[68]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
7 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '[23]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => true,
],
8 =>
[
'pattern' => '(\\d)(\\d{4})(\\d{2})(\\d{4})',
'format' => '$2 15-$3-$4',
'leadingDigitsPatterns' =>
[
0 => '9(?:2[2-469]|3[3-578])',
1 => '9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))',
2 => '9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)',
3 => '9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]',
4 => '9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
9 =>
[
'pattern' => '(\\d)(\\d{2})(\\d{4})(\\d{4})',
'format' => '$2 15-$3-$4',
'leadingDigitsPatterns' =>
[
0 => '91',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
10 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{5})',
'format' => '$1-$2-$3',
'leadingDigitsPatterns' =>
[
0 => '8',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
11 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{4})',
'format' => '$2 15-$3-$4',
'leadingDigitsPatterns' =>
[
0 => '9',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'intlNumberFormat' =>
[
0 =>
[
'pattern' => '(\\d{4})(\\d{2})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])',
1 => '2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)',
2 => '2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]',
3 => '2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => true,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '1',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => true,
],
2 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
'format' => '$1-$2-$3',
'leadingDigitsPatterns' =>
[
0 => '[68]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '[23]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => true,
],
4 =>
[
'pattern' => '(\\d)(\\d{4})(\\d{2})(\\d{4})',
'format' => '$1 $2 $3-$4',
'leadingDigitsPatterns' =>
[
0 => '9(?:2[2-469]|3[3-578])',
1 => '9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))',
2 => '9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)',
3 => '9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]',
4 => '9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]',
],
],
5 =>
[
'pattern' => '(\\d)(\\d{2})(\\d{4})(\\d{4})',
'format' => '$1 $2 $3-$4',
'leadingDigitsPatterns' =>
[
0 => '91',
],
],
6 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{5})',
'format' => '$1-$2-$3',
'leadingDigitsPatterns' =>
[
0 => '8',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
7 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{4})',
'format' => '$1 $2 $3-$4',
'leadingDigitsPatterns' =>
[
0 => '9',
],
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,110 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[58]\\d\\d|684|900)\\d{7}',
'PossibleLength' =>
[
0 => 10,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '6846(?:22|33|44|55|77|88|9[19])\\d{4}',
'ExampleNumber' => '6846221234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '684(?:2(?:48|5[2468]|7[26])|7(?:3[13]|70|82))\\d{4}',
'ExampleNumber' => '6847331234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '8002123456',
],
'premiumRate' =>
[
'NationalNumberPattern' => '900[2-9]\\d{6}',
'ExampleNumber' => '9002123456',
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '5002345678',
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AS',
'countryCode' => 1,
'internationalPrefix' => '011',
'nationalPrefix' => '1',
'nationalPrefixForParsing' => '([267]\\d{6})$|1',
'nationalPrefixTransformRule' => '684$1',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'leadingDigits' => '684',
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,353 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}',
'PossibleLength' =>
[
0 => 4,
1 => 5,
2 => 6,
3 => 7,
4 => 8,
5 => 9,
6 => 10,
7 => 11,
8 => 12,
9 => 13,
],
'PossibleLengthLocalOnly' =>
[
0 => 3,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '1(?:11\\d|[2-9]\\d{3,11})|(?:316|463|(?:51|66|73)2)\\d{3,10}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-578]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|7[1368]|8[2457])|5(?:2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[135-8]|5[468])|7(?:2[1-8]|35|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{4,10}',
'ExampleNumber' => '1234567890',
'PossibleLengthLocalOnly' =>
[
0 => 3,
],
],
'mobile' =>
[
'NationalNumberPattern' => '6(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}',
'ExampleNumber' => '664123456',
'PossibleLength' =>
[
0 => 7,
1 => 8,
2 => 9,
3 => 10,
4 => 11,
5 => 12,
6 => 13,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '800\\d{6,10}',
'ExampleNumber' => '800123456',
'PossibleLength' =>
[
0 => 9,
1 => 10,
2 => 11,
3 => 12,
4 => 13,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '(?:8[69][2-68]|9(?:0[01]|3[019]))\\d{6,10}',
'ExampleNumber' => '900123456',
'PossibleLength' =>
[
0 => 9,
1 => 10,
2 => 11,
3 => 12,
4 => 13,
],
],
'sharedCost' =>
[
'NationalNumberPattern' => '8(?:10|2[018])\\d{6,10}|828\\d{5}',
'ExampleNumber' => '810123456',
'PossibleLength' =>
[
0 => 8,
1 => 9,
2 => 10,
3 => 11,
4 => 12,
5 => 13,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '5(?:0[1-9]|17|[79]\\d)\\d{2,10}|7[28]0\\d{6,10}',
'ExampleNumber' => '780123456',
'PossibleLength' =>
[
0 => 5,
1 => 6,
2 => 7,
3 => 8,
4 => 9,
5 => 10,
6 => 11,
7 => 12,
8 => 13,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AT',
'countryCode' => 43,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{4})',
'format' => '$1',
'leadingDigitsPatterns' =>
[
0 => '14',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d)(\\d{3,12})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '1(?:11|[2-9])',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{3})(\\d{2})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '517',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{2})(\\d{3,5})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '5[079]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{6})',
'format' => '$1',
'leadingDigitsPatterns' =>
[
0 => '[18]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
5 =>
[
'pattern' => '(\\d{3})(\\d{3,10})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
6 =>
[
'pattern' => '(\\d{4})(\\d{3,9})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[2-467]|5[2-6]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
7 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '5',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
8 =>
[
'pattern' => '(\\d{2})(\\d{4})(\\d{4,7})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '5',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'intlNumberFormat' =>
[
0 =>
[
'pattern' => '(\\d)(\\d{3,12})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '1(?:11|[2-9])',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{3})(\\d{2})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '517',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{3,5})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '5[079]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{3})(\\d{3,10})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{4})(\\d{3,9})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[2-467]|5[2-6]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
5 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '5',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
6 =>
[
'pattern' => '(\\d{2})(\\d{4})(\\d{4,7})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '5',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,328 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}',
'PossibleLength' =>
[
0 => 5,
1 => 6,
2 => 7,
3 => 8,
4 => 9,
5 => 10,
6 => 12,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}',
'ExampleNumber' => '212345678',
'PossibleLength' =>
[
0 => 9,
],
'PossibleLengthLocalOnly' =>
[
0 => 8,
],
],
'mobile' =>
[
'NationalNumberPattern' => '4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}',
'ExampleNumber' => '412345678',
'PossibleLength' =>
[
0 => 9,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '180(?:0\\d{3}|2)\\d{3}',
'ExampleNumber' => '1800123456',
'PossibleLength' =>
[
0 => 7,
1 => 10,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '190[0-26]\\d{6}',
'ExampleNumber' => '1900123456',
'PossibleLength' =>
[
0 => 10,
],
],
'sharedCost' =>
[
'NationalNumberPattern' => '13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}',
'ExampleNumber' => '1300123456',
'PossibleLength' =>
[
0 => 6,
1 => 8,
2 => 10,
3 => 12,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}',
'ExampleNumber' => '147101234',
'PossibleLength' =>
[
0 => 9,
],
],
'pager' =>
[
'NationalNumberPattern' => '163\\d{2,6}',
'ExampleNumber' => '1631234',
'PossibleLength' =>
[
0 => 5,
1 => 6,
2 => 7,
3 => 8,
4 => 9,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'NationalNumberPattern' => '1(?:3(?:00\\d{5}|45[0-4])|802)\\d{3}|1[38]00\\d{6}|13\\d{4}',
'PossibleLength' =>
[
0 => 6,
1 => 7,
2 => 8,
3 => 10,
4 => 12,
],
],
'id' => 'AU',
'countryCode' => 61,
'internationalPrefix' => '001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011',
'preferredInternationalPrefix' => '0011',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '(183[12])|0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{3,4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '16',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '13',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{3})(\\d{3})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '19',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{3})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '180',
1 => '1802',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{4})(\\d{3,4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '19',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
5 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{2,4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '16',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
6 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '14|4',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
7 =>
[
'pattern' => '(\\d)(\\d{4})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[2378]',
],
'nationalPrefixFormattingRule' => '(0$1)',
'domesticCarrierCodeFormattingRule' => '$CC ($1)',
'nationalPrefixOptionalWhenFormatting' => false,
],
8 =>
[
'pattern' => '(\\d{4})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '1(?:30|[89])',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
9 =>
[
'pattern' => '(\\d{4})(\\d{4})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '130',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'intlNumberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{3,4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '16',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{2,4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '16',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '14|4',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d)(\\d{4})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[2378]',
],
'nationalPrefixFormattingRule' => '(0$1)',
'domesticCarrierCodeFormattingRule' => '$CC ($1)',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{4})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '1(?:30|[89])',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => true,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,106 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[25-79]\\d\\d|800)\\d{4}',
'PossibleLength' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '5(?:2\\d|8[1-9])\\d{4}',
'ExampleNumber' => '5212345',
],
'mobile' =>
[
'NationalNumberPattern' => '(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}',
'ExampleNumber' => '5601234',
],
'tollFree' =>
[
'NationalNumberPattern' => '800\\d{4}',
'ExampleNumber' => '8001234',
],
'premiumRate' =>
[
'NationalNumberPattern' => '900\\d{4}',
'ExampleNumber' => '9001234',
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '(?:28\\d|501)\\d{4}',
'ExampleNumber' => '5011234',
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AW',
'countryCode' => 297,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[25-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,131 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}',
'PossibleLength' =>
[
0 => 5,
1 => 6,
2 => 7,
3 => 8,
4 => 9,
5 => 10,
6 => 11,
7 => 12,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '18[1-8]\\d{3,6}',
'ExampleNumber' => '181234567',
'PossibleLength' =>
[
0 => 6,
1 => 7,
2 => 8,
3 => 9,
],
],
'mobile' =>
[
'NationalNumberPattern' => '4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}',
'ExampleNumber' => '412345678',
'PossibleLength' =>
[
0 => 6,
1 => 7,
2 => 8,
3 => 9,
4 => 10,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '800\\d{4,6}',
'ExampleNumber' => '800123456',
'PossibleLength' =>
[
0 => 7,
1 => 8,
2 => 9,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '[67]00\\d{5,6}',
'ExampleNumber' => '600123456',
'PossibleLength' =>
[
0 => 8,
1 => 9,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}',
'ExampleNumber' => '10112345',
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AX',
'countryCode' => 358,
'internationalPrefix' => '00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))',
'preferredInternationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'leadingDigits' => '18',
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,197 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '365\\d{6}|(?:[124579]\\d|60|88)\\d{7}',
'PossibleLength' =>
[
0 => 9,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:2[12]428|3655[02])\\d{4}|(?:2(?:22[0-79]|63[0-28])|3654)\\d{5}|(?:(?:1[28]|46)\\d|2(?:[014-6]2|[23]3))\\d{6}',
'ExampleNumber' => '123123456',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}',
'ExampleNumber' => '401234567',
],
'tollFree' =>
[
'NationalNumberPattern' => '88\\d{7}',
'ExampleNumber' => '881234567',
],
'premiumRate' =>
[
'NationalNumberPattern' => '900200\\d{3}',
'ExampleNumber' => '900200123',
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'AZ',
'countryCode' => 994,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[1-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '90',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '1[28]|2|365|46',
1 => '1[28]|2|365[45]|46',
2 => '1[28]|2|365(?:4|5[02])|46',
],
'nationalPrefixFormattingRule' => '(0$1)',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '[13-9]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'intlNumberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '90',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '1[28]|2|365|46',
1 => '1[28]|2|365[45]|46',
2 => '1[28]|2|365(?:4|5[02])|46',
],
'nationalPrefixFormattingRule' => '(0$1)',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '[13-9]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,210 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '6\\d{8}|(?:[35689]\\d|49|70)\\d{6}',
'PossibleLength' =>
[
0 => 8,
1 => 9,
],
'PossibleLengthLocalOnly' =>
[
0 => 6,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:3(?:[05-79][2-9]|1[4579]|[23][24-9]|4[2-4689]|8[2457-9])|49[2-579]|5(?:0[2-49]|[13][2-9]|[268][2-4679]|4[4689]|5[2-79]|7[2-69]|9[2-4689]))\\d{5}',
'ExampleNumber' => '30212345',
'PossibleLength' =>
[
0 => 8,
],
'PossibleLengthLocalOnly' =>
[
0 => 6,
],
],
'mobile' =>
[
'NationalNumberPattern' => '6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}',
'ExampleNumber' => '61123456',
],
'tollFree' =>
[
'NationalNumberPattern' => '8[08]\\d{6}',
'ExampleNumber' => '80123456',
'PossibleLength' =>
[
0 => 8,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '9[0246]\\d{6}',
'ExampleNumber' => '90123456',
'PossibleLength' =>
[
0 => 8,
],
],
'sharedCost' =>
[
'NationalNumberPattern' => '8[12]\\d{6}',
'ExampleNumber' => '82123456',
'PossibleLength' =>
[
0 => 8,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '703[235]0\\d{3}|70(?:2[0-5]|3[0146]|[56]0)\\d{4}',
'ExampleNumber' => '70341234',
'PossibleLength' =>
[
0 => 8,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BA',
'countryCode' => 387,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{3})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '[2-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '6[1-3]|[7-9]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '[3-5]|6[56]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '6',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'intlNumberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '6[1-3]|[7-9]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '[3-5]|6[56]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '6',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,118 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:246|[58]\\d\\d|900)\\d{7}',
'PossibleLength' =>
[
0 => 10,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '246521[0369]\\d{3}|246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}',
'ExampleNumber' => '2464123456',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}',
'ExampleNumber' => '2462501234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '8002123456',
],
'premiumRate' =>
[
'NationalNumberPattern' => '(?:246976|900[2-9]\\d\\d)\\d{4}',
'ExampleNumber' => '9002123456',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '5002345678',
],
'voip' =>
[
'NationalNumberPattern' => '24631\\d{5}',
'ExampleNumber' => '2463101234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '246(?:292|367|4(?:1[7-9]|3[01]|4[47-9]|67)|7(?:1[2-9]|2\\d|3[016]|53))\\d{4}',
'ExampleNumber' => '2464301234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BB',
'countryCode' => 1,
'internationalPrefix' => '011',
'nationalPrefix' => '1',
'nationalPrefixForParsing' => '([2-9]\\d{6})$|1',
'nationalPrefixTransformRule' => '246$1',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'leadingDigits' => '246',
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,162 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}',
'PossibleLength' =>
[
0 => 6,
1 => 7,
2 => 8,
3 => 9,
4 => 10,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:4(?:31\\d\\d|423)|5222)\\d{3}(?:\\d{2})?|8332[6-9]\\d\\d|(?:3(?:03[56]|224)|4(?:22[25]|653))\\d{3,4}|(?:3(?:42[47]|529|823)|4(?:027|525|65(?:28|8))|562|6257|7(?:1(?:5[3-5]|6[12]|7[156]|89)|22[589]56|32|42675|52(?:[25689](?:56|8)|[347]8)|71(?:6[1267]|75|89)|92374)|82(?:2[59]|32)56|9(?:03[23]56|23(?:256|373)|31|5(?:1|2[4589]56)))\\d{3}|(?:3(?:02[348]|22[35]|324|422)|4(?:22[67]|32[236-9]|6(?:2[46]|5[57])|953)|5526|6(?:024|6655)|81)\\d{4,5}|(?:2(?:7(?:1[0-267]|2[0-289]|3[0-29]|4[01]|5[1-3]|6[013]|7[0178]|91)|8(?:0[125]|1[1-6]|2[0157-9]|3[1-69]|41|6[1-35]|7[1-5]|8[1-8]|9[0-6])|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0136-9]|7[0-7]|8[014-9]))|3(?:0(?:2[025-79]|3[2-4])|181|22[12]|32[2356]|824)|4(?:02[09]|22[348]|32[045]|523|6(?:27|54))|666(?:22|53)|7(?:22[57-9]|42[56]|82[35])8|8(?:0[124-9]|2(?:181|2[02-4679]8)|4[12]|[5-7]2)|9(?:[04]2|2(?:2|328)|81))\\d{4}|(?:2(?:222|[45]\\d)\\d|3(?:1(?:2[5-7]|[5-7])|425|822)|4(?:033|1\\d|[257]1|332|4(?:2[246]|5[25])|6(?:2[35]|56|62)|8(?:23|54)|92[2-5])|5(?:02[03489]|22[457]|32[35-79]|42[46]|6(?:[18]|53)|724|826)|6(?:023|2(?:2[2-5]|5[3-5]|8)|32[3478]|42[34]|52[47]|6(?:[18]|6(?:2[34]|5[24]))|[78]2[2-5]|92[2-6])|7(?:02|21\\d|[3-589]1|6[12]|72[24])|8(?:217|3[12]|[5-7]1)|9[24]1)\\d{5}|(?:(?:3[2-8]|5[2-57-9]|6[03-589])1|4[4689][18])\\d{5}|[59]1\\d{5}',
'ExampleNumber' => '27111234',
],
'mobile' =>
[
'NationalNumberPattern' => '(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}',
'ExampleNumber' => '1812345678',
'PossibleLength' =>
[
0 => 10,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '80[03]\\d{7}',
'ExampleNumber' => '8001234567',
'PossibleLength' =>
[
0 => 10,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '96(?:0[469]|1[0-47]|3[389]|43|6[69]|7[78])\\d{6}',
'ExampleNumber' => '9604123456',
'PossibleLength' =>
[
0 => 10,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BD',
'countryCode' => 880,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{4,6})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '31[5-8]|[459]1',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{3})(\\d{3,7})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{4})(\\d{3,6})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '[13-9]|22',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d)(\\d{7,8})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '2',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,167 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '4\\d{8}|[1-9]\\d{7}',
'PossibleLength' =>
[
0 => 8,
1 => 9,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '80[2-8]\\d{5}|(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}',
'ExampleNumber' => '12345678',
'PossibleLength' =>
[
0 => 8,
],
],
'mobile' =>
[
'NationalNumberPattern' => '4[5-9]\\d{7}',
'ExampleNumber' => '470123456',
'PossibleLength' =>
[
0 => 9,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '800[1-9]\\d{4}',
'ExampleNumber' => '80012345',
'PossibleLength' =>
[
0 => 8,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '(?:70(?:2[0-57]|3[04-7]|44|6[4-69]|7[0579])|90\\d\\d)\\d{4}',
'ExampleNumber' => '90012345',
'PossibleLength' =>
[
0 => 8,
],
],
'sharedCost' =>
[
'NationalNumberPattern' => '7879\\d{4}',
'ExampleNumber' => '78791234',
'PossibleLength' =>
[
0 => 8,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '78(?:0[57]|1[014-8]|2[25]|3[15-8]|48|[56]0|7[06-8]|9\\d)\\d{4}',
'ExampleNumber' => '78102345',
'PossibleLength' =>
[
0 => 8,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BE',
'countryCode' => 32,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '(?:80|9)0',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '[239]|4[23]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '[15-8]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '4',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,112 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[025-7]\\d{7}',
'PossibleLength' =>
[
0 => 8,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '2(?:0(?:49|5[23]|6[5-7]|9[016-9])|4(?:4[569]|5[4-6]|6[5-7]|7[0179])|5(?:[34]\\d|50|6[5-7]))\\d{4}',
'ExampleNumber' => '20491234',
],
'mobile' =>
[
'NationalNumberPattern' => '(?:0[1-35-7]|5[0-8]|[67]\\d)\\d{6}',
'ExampleNumber' => '70123456',
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BF',
'countryCode' => 226,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '[025-7]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,341 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}',
'PossibleLength' =>
[
0 => 6,
1 => 7,
2 => 8,
3 => 9,
4 => 12,
],
'PossibleLengthLocalOnly' =>
[
0 => 4,
1 => 5,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '2\\d{5,7}|(?:43[1-6]|70[1-9])\\d{4,5}|(?:[36]\\d|4[124-7]|[57][1-9]|8[1-6]|9[1-7])\\d{5,6}',
'ExampleNumber' => '2123456',
'PossibleLength' =>
[
0 => 6,
1 => 7,
2 => 8,
],
'PossibleLengthLocalOnly' =>
[
0 => 4,
1 => 5,
],
],
'mobile' =>
[
'NationalNumberPattern' => '(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}',
'ExampleNumber' => '43012345',
'PossibleLength' =>
[
0 => 8,
1 => 9,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '(?:00800\\d\\d|800)\\d{5}',
'ExampleNumber' => '80012345',
'PossibleLength' =>
[
0 => 8,
1 => 12,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '90\\d{6}',
'ExampleNumber' => '90123456',
'PossibleLength' =>
[
0 => 8,
],
],
'sharedCost' =>
[
'NationalNumberPattern' => '700\\d{5}',
'ExampleNumber' => '70012345',
'PossibleLength' =>
[
0 => 8,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BG',
'countryCode' => 359,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{6})',
'format' => '$1',
'leadingDigitsPatterns' =>
[
0 => '1',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d)(\\d)(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '2',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{3})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '43[1-6]|70[1-9]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{3,4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '2',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{2,3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
5 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '(?:70|8)0',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
6 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{2})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '43[1-7]|7',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
7 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[48]|9[08]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
8 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '9',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'intlNumberFormat' =>
[
0 =>
[
'pattern' => '(\\d)(\\d)(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '2',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{3})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '43[1-6]|70[1-9]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{3,4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '2',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{2,3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '(?:70|8)0',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
5 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{2})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '43[1-7]|7',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
6 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[48]|9[08]',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
7 =>
[
'pattern' => '(\\d{3})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '9',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,106 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[136-9]\\d{7}',
'PossibleLength' =>
[
0 => 8,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|55|7[7-9]|88)|9[69][69])|7(?:[07]\\d\\d|1(?:11|78)))\\d{4}',
'ExampleNumber' => '17001234',
],
'mobile' =>
[
'NationalNumberPattern' => '(?:3(?:[0-79]\\d|8[0-57-9])\\d|6(?:3(?:00|33|6[16])|441|6(?:3[03-9]|[69]\\d|7[0-689])))\\d{4}',
'ExampleNumber' => '36001234',
],
'tollFree' =>
[
'NationalNumberPattern' => '8[02369]\\d{6}',
'ExampleNumber' => '80123456',
],
'premiumRate' =>
[
'NationalNumberPattern' => '(?:87|9[0-8])\\d{6}',
'ExampleNumber' => '90123456',
],
'sharedCost' =>
[
'NationalNumberPattern' => '84\\d{6}',
'ExampleNumber' => '84123456',
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BH',
'countryCode' => 973,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{4})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[13679]|8[02-4679]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,112 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[267]\\d|31)\\d{6}',
'PossibleLength' =>
[
0 => 8,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:22|31)\\d{6}',
'ExampleNumber' => '22201234',
],
'mobile' =>
[
'NationalNumberPattern' => '(?:29|[67][125-9])\\d{6}',
'ExampleNumber' => '79561234',
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BI',
'countryCode' => 257,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '[2367]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,108 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[24-689]\\d{7}',
'PossibleLength' =>
[
0 => 8,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '2(?:02|1[037]|2[45]|3[68]|4\\d)\\d{5}',
'ExampleNumber' => '20211234',
],
'mobile' =>
[
'NationalNumberPattern' => '(?:4[0-7]|[56]\\d|9[013-9])\\d{6}',
'ExampleNumber' => '90011234',
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '857[58]\\d{4}',
'ExampleNumber' => '85751234',
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '81\\d{6}',
'ExampleNumber' => '81123456',
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BJ',
'countryCode' => 229,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '[24-689]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,98 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '590\\d{6}|(?:69|80|9\\d)\\d{7}',
'PossibleLength' =>
[
0 => 9,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}',
'ExampleNumber' => '590271234',
],
'mobile' =>
[
'NationalNumberPattern' => '69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}',
'ExampleNumber' => '690001234',
],
'tollFree' =>
[
'NationalNumberPattern' => '80[0-5]\\d{6}',
'ExampleNumber' => '800012345',
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}',
'ExampleNumber' => '976012345',
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BL',
'countryCode' => 590,
'internationalPrefix' => '00',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,110 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:441|[58]\\d\\d|900)\\d{7}',
'PossibleLength' =>
[
0 => 10,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '441(?:[46]\\d\\d|5(?:4\\d|60|89))\\d{4}',
'ExampleNumber' => '4414123456',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '441(?:[2378]\\d|5[0-39]|9[02])\\d{5}',
'ExampleNumber' => '4413701234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '8002123456',
],
'premiumRate' =>
[
'NationalNumberPattern' => '900[2-9]\\d{6}',
'ExampleNumber' => '9002123456',
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '5002345678',
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BM',
'countryCode' => 1,
'internationalPrefix' => '011',
'nationalPrefix' => '1',
'nationalPrefixForParsing' => '([2-9]\\d{6})$|1',
'nationalPrefixTransformRule' => '441$1',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'leadingDigits' => '441',
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,110 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[2-578]\\d{6}',
'PossibleLength' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '22[0-7]\\d{4}|(?:2[013-9]|[34]\\d|5[0-25-9])\\d{5}',
'ExampleNumber' => '2345678',
],
'mobile' =>
[
'NationalNumberPattern' => '(?:22[89]|[78]\\d\\d)\\d{4}',
'ExampleNumber' => '7123456',
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '5[34]\\d{5}',
'ExampleNumber' => '5345678',
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BN',
'countryCode' => 673,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[2-578]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,158 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[2-467]\\d\\d|8001)\\d{5}',
'PossibleLength' =>
[
0 => 8,
1 => 9,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:2(?:2\\d\\d|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d\\d|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:[27]\\d|3[2-4]|4[248]|5[24]|6[2-6]))|4(?:4\\d\\d|6(?:11|[24689]\\d|72)))\\d{4}',
'ExampleNumber' => '22123456',
'PossibleLength' =>
[
0 => 8,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '[67]\\d{7}',
'ExampleNumber' => '71234567',
'PossibleLength' =>
[
0 => 8,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '8001[07]\\d{4}',
'ExampleNumber' => '800171234',
'PossibleLength' =>
[
0 => 9,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'NationalNumberPattern' => '8001[07]\\d{4}',
'PossibleLength' =>
[
0 => 9,
],
],
'id' => 'BO',
'countryCode' => 591,
'internationalPrefix' => '00(?:1\\d)?',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '0(1\\d)?',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d)(\\d{7})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[23]|4[46]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '0$CC $1',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{8})',
'format' => '$1',
'leadingDigitsPatterns' =>
[
0 => '[67]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '0$CC $1',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '8',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '0$CC $1',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,101 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[34]1|7\\d)\\d{5}',
'PossibleLength' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:318[023]|41(?:6[023]|70)|7(?:1[578]|2[05]|50)\\d)\\d{3}',
'ExampleNumber' => '7151234',
],
'mobile' =>
[
'NationalNumberPattern' => '(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}',
'ExampleNumber' => '3181234',
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BQ',
'countryCode' => 599,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'leadingDigits' => '[347]',
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,274 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}',
'PossibleLength' =>
[
0 => 8,
1 => 9,
2 => 10,
3 => 11,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}',
'ExampleNumber' => '1123456789',
'PossibleLength' =>
[
0 => 10,
],
'PossibleLengthLocalOnly' =>
[
0 => 8,
],
],
'mobile' =>
[
'NationalNumberPattern' => '(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}',
'ExampleNumber' => '11961234567',
'PossibleLength' =>
[
0 => 10,
1 => 11,
],
'PossibleLengthLocalOnly' =>
[
0 => 8,
1 => 9,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '800\\d{6,7}',
'ExampleNumber' => '800123456',
'PossibleLength' =>
[
0 => 9,
1 => 10,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '300\\d{6}|[59]00\\d{6,7}',
'ExampleNumber' => '300123456',
'PossibleLength' =>
[
0 => 9,
1 => 10,
],
],
'sharedCost' =>
[
'NationalNumberPattern' => '(?:30[03]\\d{3}|4(?:0(?:0\\d|20)|370))\\d{4}|300\\d{5}',
'ExampleNumber' => '40041234',
'PossibleLength' =>
[
0 => 8,
1 => 10,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'NationalNumberPattern' => '30(?:0\\d{5,7}|3\\d{7})|40(?:0\\d|20)\\d{4}|800\\d{6,7}',
'PossibleLength' =>
[
0 => 8,
1 => 9,
2 => 10,
],
],
'id' => 'BR',
'countryCode' => 55,
'internationalPrefix' => '00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)',
'nationalPrefix' => '0',
'nationalPrefixForParsing' => '(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?',
'nationalPrefixTransformRule' => '$2',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3,6})',
'format' => '$1',
'leadingDigitsPatterns' =>
[
0 => '1(?:1[25-8]|2[357-9]|3[02-68]|4[12568]|5|6[0-8]|8[015]|9[0-47-9])|321|610',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{4})(\\d{4})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '300|4(?:0[02]|37)',
1 => '4(?:02|37)0|[34]00',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{4})(\\d{4})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '[2-57]',
1 => '[2357]|4(?:[0-24-9]|3(?:[0-689]|7[1-9]))',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{3})(\\d{2,3})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '(?:[358]|90)0',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{5})(\\d{4})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '9',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
5 =>
[
'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]',
],
'nationalPrefixFormattingRule' => '($1)',
'domesticCarrierCodeFormattingRule' => '0 $CC ($1)',
'nationalPrefixOptionalWhenFormatting' => false,
],
6 =>
[
'pattern' => '(\\d{2})(\\d{5})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '[16][1-9]|[2-57-9]',
],
'nationalPrefixFormattingRule' => '($1)',
'domesticCarrierCodeFormattingRule' => '0 $CC ($1)',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'intlNumberFormat' =>
[
0 =>
[
'pattern' => '(\\d{4})(\\d{4})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '300|4(?:0[02]|37)',
1 => '4(?:02|37)0|[34]00',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{3})(\\d{2,3})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '(?:[358]|90)0',
],
'nationalPrefixFormattingRule' => '0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{4})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]',
],
'nationalPrefixFormattingRule' => '($1)',
'domesticCarrierCodeFormattingRule' => '0 $CC ($1)',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{2})(\\d{5})(\\d{4})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '[16][1-9]|[2-57-9]',
],
'nationalPrefixFormattingRule' => '($1)',
'domesticCarrierCodeFormattingRule' => '0 $CC ($1)',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,112 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:242|[58]\\d\\d|900)\\d{7}',
'PossibleLength' =>
[
0 => 10,
],
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-5]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}',
'ExampleNumber' => '2423456789',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|3[0-4]|[89]9))\\d{4}',
'ExampleNumber' => '2423591234',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '242300\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '8002123456',
'PossibleLengthLocalOnly' =>
[
0 => 7,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '900[2-9]\\d{6}',
'ExampleNumber' => '9002123456',
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'NationalNumberPattern' => '52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}',
'ExampleNumber' => '5002345678',
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'NationalNumberPattern' => '242225\\d{4}',
'ExampleNumber' => '2422250123',
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BS',
'countryCode' => 1,
'internationalPrefix' => '011',
'nationalPrefix' => '1',
'nationalPrefixForParsing' => '([3-8]\\d{6})$|1',
'nationalPrefixTransformRule' => '242$1',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
],
'mainCountryForCode' => false,
'leadingDigits' => '242',
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,180 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '[17]\\d{7}|[2-8]\\d{6}',
'PossibleLength' =>
[
0 => 7,
1 => 8,
],
'PossibleLengthLocalOnly' =>
[
0 => 6,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}',
'ExampleNumber' => '2345678',
'PossibleLength' =>
[
0 => 7,
],
'PossibleLengthLocalOnly' =>
[
0 => 6,
],
],
'mobile' =>
[
'NationalNumberPattern' => '(?:1[67]|77)\\d{6}',
'ExampleNumber' => '17123456',
'PossibleLength' =>
[
0 => 8,
],
],
'tollFree' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BT',
'countryCode' => 975,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{3})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[2-7]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[2-68]|7[246]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '1[67]|7',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'intlNumberFormat' =>
[
0 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[2-68]|7[246]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2 $3 $4',
'leadingDigitsPatterns' =>
[
0 => '1[67]|7',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,176 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}',
'PossibleLength' =>
[
0 => 7,
1 => 8,
2 => 10,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013]|81)|4(?:6[03]|7[1267]|9[0-5])|5(?:3[03489]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\d{4}',
'ExampleNumber' => '2401234',
'PossibleLength' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '(?:321|7[1-8]\\d)\\d{5}',
'ExampleNumber' => '71123456',
'PossibleLength' =>
[
0 => 8,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '(?:0800|800\\d)\\d{6}',
'ExampleNumber' => '0800012345',
'PossibleLength' =>
[
0 => 10,
],
],
'premiumRate' =>
[
'NationalNumberPattern' => '90\\d{5}',
'ExampleNumber' => '9012345',
'PossibleLength' =>
[
0 => 7,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '79(?:1(?:[01]\\d|2[0-8])|2[0-7]\\d)\\d{3}',
'ExampleNumber' => '79101234',
'PossibleLength' =>
[
0 => 8,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BW',
'countryCode' => 267,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{2})(\\d{5})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '90',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{3})(\\d{4})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '[24-6]|3[15-9]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[37]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{4})(\\d{3})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '0',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{3})(\\d{4})(\\d{3})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '8',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];
@@ -0,0 +1,198 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}',
'PossibleLength' =>
[
0 => 6,
1 => 7,
2 => 8,
3 => 9,
4 => 10,
5 => 11,
],
'PossibleLengthLocalOnly' =>
[
0 => 5,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d\\d)|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}',
'ExampleNumber' => '152450911',
'PossibleLength' =>
[
0 => 9,
],
'PossibleLengthLocalOnly' =>
[
0 => 5,
1 => 6,
2 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}',
'ExampleNumber' => '294911911',
'PossibleLength' =>
[
0 => 9,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '800\\d{3,7}|8(?:0[13]|20\\d)\\d{7}',
'ExampleNumber' => '8011234567',
],
'premiumRate' =>
[
'NationalNumberPattern' => '(?:810|902)\\d{7}',
'ExampleNumber' => '9021234567',
'PossibleLength' =>
[
0 => 10,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'NationalNumberPattern' => '249\\d{6}',
'ExampleNumber' => '249123456',
'PossibleLength' =>
[
0 => 9,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'NationalNumberPattern' => '800\\d{3,7}|(?:8(?:0[13]|10|20\\d)|902)\\d{7}',
],
'id' => 'BY',
'countryCode' => 375,
'internationalPrefix' => '810',
'preferredInternationalPrefix' => '8~10',
'nationalPrefix' => '8',
'nationalPrefixForParsing' => '0|80?',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{3})',
'format' => '$1 $2',
'leadingDigitsPatterns' =>
[
0 => '800',
],
'nationalPrefixFormattingRule' => '8 $1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{2,4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '800',
],
'nationalPrefixFormattingRule' => '8 $1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
2 =>
[
'pattern' => '(\\d{4})(\\d{2})(\\d{3})',
'format' => '$1 $2-$3',
'leadingDigitsPatterns' =>
[
0 => '1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])',
1 => '1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])',
],
'nationalPrefixFormattingRule' => '8 0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
3 =>
[
'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})',
'format' => '$1 $2-$3-$4',
'leadingDigitsPatterns' =>
[
0 => '1(?:[56]|7[467])|2[1-3]',
],
'nationalPrefixFormattingRule' => '8 0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
4 =>
[
'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})',
'format' => '$1 $2-$3-$4',
'leadingDigitsPatterns' =>
[
0 => '[1-4]',
],
'nationalPrefixFormattingRule' => '8 0$1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
5 =>
[
'pattern' => '(\\d{3})(\\d{3,4})(\\d{4})',
'format' => '$1 $2 $3',
'leadingDigitsPatterns' =>
[
0 => '[89]',
],
'nationalPrefixFormattingRule' => '8 $1',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => true,
];
@@ -0,0 +1,135 @@
<?php
/**
* libphonenumber-for-php-lite data file
* This file has been @generated from libphonenumber data
* Do not modify!
* @internal
*/
return [
'generalDesc' =>
[
'NationalNumberPattern' => '(?:0800\\d|[2-8])\\d{6}',
'PossibleLength' =>
[
0 => 7,
1 => 11,
],
],
'fixedLine' =>
[
'NationalNumberPattern' => '(?:2(?:[02]\\d|36|[68]0)|[3-58](?:[02]\\d|[68]0)|7(?:[02]\\d|32|[68]0))\\d{4}',
'ExampleNumber' => '2221234',
'PossibleLength' =>
[
0 => 7,
],
],
'mobile' =>
[
'NationalNumberPattern' => '6[0-35-7]\\d{5}',
'ExampleNumber' => '6221234',
'PossibleLength' =>
[
0 => 7,
],
],
'tollFree' =>
[
'NationalNumberPattern' => '0800\\d{7}',
'ExampleNumber' => '08001234123',
'PossibleLength' =>
[
0 => 11,
],
],
'premiumRate' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'sharedCost' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'personalNumber' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voip' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'pager' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'uan' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'voicemail' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'noInternationalDialling' =>
[
'PossibleLength' =>
[
0 => -1,
],
],
'id' => 'BZ',
'countryCode' => 501,
'internationalPrefix' => '00',
'sameMobileAndFixedLinePattern' => false,
'numberFormat' =>
[
0 =>
[
'pattern' => '(\\d{3})(\\d{4})',
'format' => '$1-$2',
'leadingDigitsPatterns' =>
[
0 => '[2-8]',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
1 =>
[
'pattern' => '(\\d)(\\d{3})(\\d{4})(\\d{3})',
'format' => '$1-$2-$3-$4',
'leadingDigitsPatterns' =>
[
0 => '0',
],
'nationalPrefixFormattingRule' => '',
'domesticCarrierCodeFormattingRule' => '',
'nationalPrefixOptionalWhenFormatting' => false,
],
],
'mainCountryForCode' => false,
'mobileNumberPortableRegion' => false,
];

Some files were not shown because too many files have changed in this diff Show More