diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 494e33ce..53a1e231 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -1,8 +1,22 @@ name: Payplug Woocommerce CI on: [ push ] jobs: + Trigger-PHP-Linter: + name: 1) Execute PHP CS Fixer Linter + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Installer PHP 7.2 + uses: shivammathur/setup-php@v2 + with: + php-version: '7.3' + - name: Installer les dépendances Composer + run: composer install --prefer-dist --no-interaction --no-progress + - name: Run linter + run: chmod +x ./vendor/bin/php-cs-fixer && ./vendor/bin/php-cs-fixer fix -vvv --dry-run --using-cache=no + Generate-Zip-File: - name: 1) Generate-Zip-File + name: 2) Generate-Zip-File runs-on: ubuntu-latest steps: - name: Check out repository code ${{ github.workflow }} @@ -16,7 +30,7 @@ jobs: - run: echo "🍏 This job's status is ${{ job.status }}." Check-PHP-Compatibility-5-6: - name: 2) Check PHP Compatibility 5.6 + name: 3) Check PHP Compatibility 5.6 runs-on: ubuntu-latest steps: - name: Check out repository code ${{ github.workflow }} @@ -31,7 +45,7 @@ jobs: run: vendor/bin/phpcs --colors -s ./src/ --standard=PHPCompatibility --runtime-set testVersion 5.6 Check-PHP-Compatibility-7-0: - name: 3) Check PHP Compatibility 7.0 + name: 4) Check PHP Compatibility 7.0 runs-on: ubuntu-latest steps: - name: Check out repository code ${{ github.workflow }} @@ -46,7 +60,7 @@ jobs: run: vendor/bin/phpcs --colors -s ./src/ --standard=PHPCompatibility --runtime-set testVersion 7.0 Check-PHP-Compatibility-7-1: - name: 4) Check PHP Compatibility 7.1 + name: 5) Check PHP Compatibility 7.1 runs-on: ubuntu-latest steps: - name: Check out repository code ${{ github.workflow }} @@ -61,7 +75,7 @@ jobs: run: vendor/bin/phpcs --colors -s ./src/ --standard=PHPCompatibility --runtime-set testVersion 7.1 Check-PHP-Compatibility-7-2: - name: 5) Check PHP Compatibility 7.2 + name: 6) Check PHP Compatibility 7.2 runs-on: ubuntu-latest steps: - name: Check out repository code ${{ github.workflow }} @@ -76,7 +90,7 @@ jobs: run: vendor/bin/phpcs --colors -s ./src/ --standard=PHPCompatibility --runtime-set testVersion 7.2 Check-PHP-Compatibility-7-3: - name: 6) Check PHP Compatibility 7.3 + name: 7) Check PHP Compatibility 7.3 runs-on: ubuntu-latest steps: - name: Check out repository code ${{ github.workflow }} @@ -91,7 +105,7 @@ jobs: run: vendor/bin/phpcs --colors -s ./src/ --standard=PHPCompatibility --runtime-set testVersion 7.3 Check-PHP-Compatibility-7-4: - name: 7) Check PHP Compatibility 7.4 + name: 8) Check PHP Compatibility 7.4 runs-on: ubuntu-latest steps: - name: Check out repository code ${{ github.workflow }} @@ -106,7 +120,7 @@ jobs: run: vendor/bin/phpcs --colors -s ./src/ --standard=PHPCompatibility --runtime-set testVersion 7.4 Check-PHP-Compatibility-8-0: - name: 8) Check PHP Compatibility 8.0 + name: 9) Check PHP Compatibility 8.0 runs-on: ubuntu-latest steps: - name: Check out repository code ${{ github.workflow }} @@ -121,7 +135,7 @@ jobs: run: vendor/bin/phpcs --colors -s ./src/ --standard=PHPCompatibility --runtime-set testVersion 8.0 Check-PHP-Compatibility-8-1: - name: 9) Check PHP Compatibility 8.1 + name: 10) Check PHP Compatibility 8.1 runs-on: ubuntu-latest steps: - name: Check out repository code ${{ github.workflow }} diff --git a/.gitignore b/.gitignore index 2bde88b6..e9726705 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ tests # Temporary files *~ /cypress/ + +# Php cs fixer cache file +.php-cs-fixer.cache diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 00000000..b03ee509 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,42 @@ +exclude('bin') + ->exclude('tests') + ->in(__DIR__); + +return (new PhpCsFixer\Config()) + ->setUsingCache(true) + ->setRules([ + '@PSR12' => true, + '@PhpCsFixer' => true, + 'phpdoc_summary' => true, + 'yoda_style' => true, + 'visibility_required' => false, + 'single_blank_line_before_namespace' => true, + 'no_blank_lines_after_phpdoc' => true, + 'single_space_after_construct' => true, + 'no_spaces_after_function_name' => true, + 'concat_space' => ['spacing' => 'one'], + 'include' => true, + 'trailing_comma_in_multiline' => true, + 'binary_operator_spaces' => true, + 'no_unneeded_control_parentheses' => false, + 'cast_spaces' => true, + 'blank_line_before_statement' => ['statements' => ['break', 'case', 'continue', 'declare', 'default', 'exit', 'goto', 'include', 'include_once', 'require', 'require_once', 'return', 'switch', 'throw', 'try', 'yield', 'yield_from']], + 'no_alias_language_construct_call' => true, + 'no_extra_blank_lines' => ['tokens' => ['break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use', 'use_trait']], + 'array_syntax' => ['syntax' => 'short'], + 'phpdoc_separation' => true, + 'no_superfluous_elseif' => false, + 'multiline_whitespace_before_semicolons' => false, + 'array_indentation' => true, + 'phpdoc_order' => true, + 'phpdoc_trim' => true, + 'single_line_comment_style' => true, + 'phpdoc_align' => ['align' => 'left'], + 'php_unit_internal_class' => false, + 'php_unit_test_class_requires_covers' => false, + 'phpdoc_types_order' => ['sort_algorithm' => 'alpha', 'null_adjustment' => 'always_last'], + ]) + ->setFinder($finder); diff --git a/assets/images/integrated/index.php b/assets/images/integrated/index.php index c075ad63..4df72b24 100644 --- a/assets/images/integrated/index.php +++ b/assets/images/integrated/index.php @@ -1,6 +1,6 @@ array('jquery', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-html-entities', 'wp-i18n'), 'version' => 'b30f2764519f68059176'); + ['jquery', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-html-entities', 'wp-i18n'], 'version' => 'b30f2764519f68059176']; diff --git a/assets/js/blocks/wc-payplug-apple_pay-blocks.asset.php b/assets/js/blocks/wc-payplug-apple_pay-blocks.asset.php index 24be5c3f..a0120166 100644 --- a/assets/js/blocks/wc-payplug-apple_pay-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-apple_pay-blocks.asset.php @@ -1 +1,3 @@ - array('jquery', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-html-entities', 'wp-i18n'), 'version' => 'de1e436fab8a1ba4df71'); + ['jquery', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-html-entities', 'wp-i18n'], 'version' => 'de1e436fab8a1ba4df71']; diff --git a/assets/js/blocks/wc-payplug-bancontact-blocks.asset.php b/assets/js/blocks/wc-payplug-bancontact-blocks.asset.php index 151d2520..c472d6f4 100644 --- a/assets/js/blocks/wc-payplug-bancontact-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-bancontact-blocks.asset.php @@ -1 +1,3 @@ - array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => 'ab4fd56bd3137ee8268d'); + ['react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'], 'version' => 'ab4fd56bd3137ee8268d']; diff --git a/assets/js/blocks/wc-payplug-ideal-blocks.asset.php b/assets/js/blocks/wc-payplug-ideal-blocks.asset.php index 63773b51..1b5c1310 100644 --- a/assets/js/blocks/wc-payplug-ideal-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-ideal-blocks.asset.php @@ -1 +1,3 @@ - array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => '858bd7f5d35c3b197adc'); + ['react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'], 'version' => '858bd7f5d35c3b197adc']; diff --git a/assets/js/blocks/wc-payplug-mybank-blocks.asset.php b/assets/js/blocks/wc-payplug-mybank-blocks.asset.php index ffedf555..7192ef60 100644 --- a/assets/js/blocks/wc-payplug-mybank-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-mybank-blocks.asset.php @@ -1 +1,3 @@ - array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => '673f5e3c1e29f710d882'); + ['react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'], 'version' => '673f5e3c1e29f710d882']; diff --git a/assets/js/blocks/wc-payplug-oney_x3_with_fees-blocks.asset.php b/assets/js/blocks/wc-payplug-oney_x3_with_fees-blocks.asset.php index 4674f4b9..380dd4e8 100644 --- a/assets/js/blocks/wc-payplug-oney_x3_with_fees-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-oney_x3_with_fees-blocks.asset.php @@ -1 +1,3 @@ - array('react', 'react-dom', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => 'ffabeb30ead14c1a25c4'); + ['react', 'react-dom', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'], 'version' => 'ffabeb30ead14c1a25c4']; diff --git a/assets/js/blocks/wc-payplug-oney_x3_without_fees-blocks.asset.php b/assets/js/blocks/wc-payplug-oney_x3_without_fees-blocks.asset.php index 7817a7ef..b62addcf 100644 --- a/assets/js/blocks/wc-payplug-oney_x3_without_fees-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-oney_x3_without_fees-blocks.asset.php @@ -1 +1,3 @@ - array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => '162e3d59289288260a64'); + ['react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'], 'version' => '162e3d59289288260a64']; diff --git a/assets/js/blocks/wc-payplug-oney_x4_with_fees-blocks.asset.php b/assets/js/blocks/wc-payplug-oney_x4_with_fees-blocks.asset.php index c88d7117..d50a472f 100644 --- a/assets/js/blocks/wc-payplug-oney_x4_with_fees-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-oney_x4_with_fees-blocks.asset.php @@ -1 +1,3 @@ - array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => 'c120773d4ec95ed5b91c'); + ['react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'], 'version' => 'c120773d4ec95ed5b91c']; diff --git a/assets/js/blocks/wc-payplug-oney_x4_without_fees-blocks.asset.php b/assets/js/blocks/wc-payplug-oney_x4_without_fees-blocks.asset.php index 32283c70..ea1e4f71 100644 --- a/assets/js/blocks/wc-payplug-oney_x4_without_fees-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-oney_x4_without_fees-blocks.asset.php @@ -1 +1,3 @@ - array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => '871a5e056e2a5cbb6aaa'); + ['react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'], 'version' => '871a5e056e2a5cbb6aaa']; diff --git a/assets/js/blocks/wc-payplug-payplug-blocks.asset.php b/assets/js/blocks/wc-payplug-payplug-blocks.asset.php index a65681f3..3ace090d 100644 --- a/assets/js/blocks/wc-payplug-payplug-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-payplug-blocks.asset.php @@ -1 +1,3 @@ - array('jquery', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-html-entities', 'wp-i18n'), 'version' => '3b288ad3e9baf35dd095'); + ['jquery', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-html-entities', 'wp-i18n'], 'version' => '3b288ad3e9baf35dd095']; diff --git a/assets/js/blocks/wc-payplug-satispay-blocks.asset.php b/assets/js/blocks/wc-payplug-satispay-blocks.asset.php index e8b770c4..a4d49971 100644 --- a/assets/js/blocks/wc-payplug-satispay-blocks.asset.php +++ b/assets/js/blocks/wc-payplug-satispay-blocks.asset.php @@ -1 +1,3 @@ - array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => 'ca274d257dfb395e5f5b'); + ['react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'], 'version' => 'ca274d257dfb395e5f5b']; diff --git a/blocks/js/frontend/blocks.asset.php b/blocks/js/frontend/blocks.asset.php index 54bed5bd..ace8f148 100644 --- a/blocks/js/frontend/blocks.asset.php +++ b/blocks/js/frontend/blocks.asset.php @@ -1 +1,3 @@ - array('wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => '90bb9677e0e35fd0ffce'); + ['wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'], 'version' => '90bb9677e0e35fd0ffce']; diff --git a/composer.json b/composer.json index 0c5dce5f..13e9511e 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "payplug/payplug-woocommerce", "description": "", + "version": "2.15.0", "license": "GPL-3.0-or-later", "type": "wordpress-plugin", "keywords": ["payplug", "woocommerce", "gateway"], @@ -17,7 +18,8 @@ "require": { "php": ">=5.6.0", "composer/installers": "^1.9", - "payplug/payplug-php": "^3.7.1" + "payplug/payplug-php": "^4.0.0", + "friendsofphp/php-cs-fixer": "^3.4" }, "require-dev": { "phpdocumentor/phpdocumentor": "3.*", diff --git a/composer.lock b/composer.lock index 47ea5d5d..446f1bd3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ea7f42cb7e4cd52c6d93f7e59dda26be", + "content-hash": "16e880611689621c33330acd715a9897", "packages": [ { "name": "composer/installers", @@ -158,35 +158,36 @@ "time": "2021-09-13T08:19:44+00:00" }, { - "name": "payplug/payplug-php", - "version": "3.7.1", + "name": "composer/pcre", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/payplug/payplug-php.git", - "reference": "d5e75b2d0545c63eec06c454d5fe9907c2733fd7" + "url": "https://github.com/composer/pcre.git", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/payplug/payplug-php/zipball/d5e75b2d0545c63eec06c454d5fe9907c2733fd7", - "reference": "d5e75b2d0545c63eec06c454d5fe9907c2733fd7", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", "shasum": "" }, "require": { - "ext-curl": "*", - "ext-openssl": "*", - "php": ">=5.3.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "5.7.*" + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, "autoload": { - "psr-0": { - "Payplug\\": "lib/" - }, "psr-4": { - "Payplug\\": "lib/Payplug" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -195,213 +196,285 @@ ], "authors": [ { - "name": "PayPlug", - "email": "support@payplug.com" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "A simple PHP library for PayPlug public API.", - "homepage": "https://www.payplug.com", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], "support": { - "issues": "https://github.com/payplug/payplug-php/issues", - "source": "https://github.com/payplug/payplug-php/tree/3.7.1" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.1" }, - "time": "2015-05-06T00:00:00+00:00" - } - ], - "packages-dev": [ + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-21T20:24:37+00:00" + }, { - "name": "automattic/jetpack-changelogger", - "version": "v3.0.2", + "name": "composer/semver", + "version": "3.4.4", "source": { "type": "git", - "url": "https://github.com/Automattic/jetpack-changelogger.git", - "reference": "b76f9cb4c22ec08490eff91a2e0e5aa586ee04b3" + "url": "https://github.com/composer/semver.git", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/b76f9cb4c22ec08490eff91a2e0e5aa586ee04b3", - "reference": "b76f9cb4c22ec08490eff91a2e0e5aa586ee04b3", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", "shasum": "" }, "require": { - "php": ">=5.6", - "symfony/console": "^3.4 | ^5.2", - "symfony/process": "^3.4 | ^5.2", - "wikimedia/at-ease": "^1.2 | ^2.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "wikimedia/testing-access-wrapper": "^1.0 | ^2.0", - "yoast/phpunit-polyfills": "1.0.2" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, - "bin": [ - "bin/changelogger" - ], - "type": "project", + "type": "library", "extra": { - "autotagger": true, - "mirror-repo": "Automattic/jetpack-changelogger", "branch-alias": { - "dev-master": "3.0.x-dev" - }, - "changelogger": { - "link-template": "https://github.com/Automattic/jetpack-changelogger/compare/${old}...${new}" - }, - "version-constants": { - "::VERSION": "src/Application.php" + "dev-main": "3.x-dev" } }, "autoload": { "psr-4": { - "Automattic\\Jetpack\\Changelog\\": "lib", - "Automattic\\Jetpack\\Changelogger\\": "src" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-2.0-or-later" + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" ], - "description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.", "support": { - "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.0.2" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.4" }, - "time": "2021-11-02T14:06:49+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2025-08-20T19:15:30+00:00" }, { - "name": "bamarni/composer-bin-plugin", - "version": "1.8.2", + "name": "composer/xdebug-handler", + "version": "2.0.5", "source": { "type": "git", - "url": "https://github.com/bamarni/composer-bin-plugin.git", - "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880", - "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", + "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", "shasum": "" }, "require": { - "composer-plugin-api": "^2.0", - "php": "^7.2.5 || ^8.0" + "composer/pcre": "^1", + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "composer/composer": "^2.0", - "ext-json": "*", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9.5", - "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Bamarni\\Composer\\Bin\\BamarniBinPlugin" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" }, + "type": "library", "autoload": { "psr-4": { - "Bamarni\\Composer\\Bin\\": "src" + "Composer\\XdebugHandler\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "No conflicts for your bin dependencies", + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", "keywords": [ - "composer", - "conflict", - "dependency", - "executable", - "isolation", - "tool" + "Xdebug", + "performance" ], "support": { - "issues": "https://github.com/bamarni/composer-bin-plugin/issues", - "source": "https://github.com/bamarni/composer-bin-plugin/tree/1.8.2" + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" }, - "time": "2022-10-31T08:38:03+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-24T20:20:32+00:00" }, { - "name": "doctrine/deprecations", - "version": "1.1.5", + "name": "doctrine/annotations", + "version": "1.14.4", "source": { "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" + "url": "https://github.com/doctrine/annotations.git", + "reference": "253dca476f70808a5aeed3a47cc2cc88c5cab915" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", - "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/253dca476f70808a5aeed3a47cc2cc88c5cab915", + "reference": "253dca476f70808a5aeed3a47cc2cc88c5cab915", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "phpunit/phpunit": "<=7.5 || >=13" + "doctrine/lexer": "^1 || ^2", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^12 || ^13", - "phpstan/phpstan": "1.4.10 || 2.1.11", - "phpstan/phpstan-phpunit": "^1.0 || ^2", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", - "psr/log": "^1 || ^2 || ^3" + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "~1.4.10 || ^1.10.28", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7", + "vimeo/psalm": "^4.30 || ^5.14" }, "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "src" + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.5" + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.14.4" }, - "time": "2025-04-07T20:06:18+00:00" + "abandoned": true, + "time": "2024-09-05T10:15:52+00:00" }, { - "name": "doctrine/event-manager", - "version": "1.2.0", + "name": "doctrine/lexer", + "version": "1.2.3", "source": { "type": "git", - "url": "https://github.com/doctrine/event-manager.git", - "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520" + "url": "https://github.com/doctrine/lexer.git", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520", - "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", "shasum": "" }, "require": { - "doctrine/deprecations": "^0.5.3 || ^1", "php": "^7.1 || ^8.0" }, - "conflict": { - "doctrine/common": "<2.9" - }, "require-dev": { - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.8", + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "^1.3", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.24" + "vimeo/psalm": "^4.11" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\": "src" + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -417,35 +490,23 @@ "name": "Roman Borschel", "email": "roman@code-factory.org" }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" } ], - "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", - "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ - "event", - "event dispatcher", - "event manager", - "event system", - "events" + "annotations", + "docblock", + "lexer", + "parser", + "php" ], "support": { - "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/1.2.0" + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.3" }, "funding": [ { @@ -457,43 +518,72 @@ "type": "patreon" }, { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", "type": "tidelift" } ], - "time": "2022-10-12T20:51:15+00:00" + "time": "2022-02-28T11:07:21+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.5.0", + "name": "friendsofphp/php-cs-fixer", + "version": "v3.4.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "47177af1cfb9dab5d1cc4daf91b7179c2efe7fad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/47177af1cfb9dab5d1cc4daf91b7179c2efe7fad", + "reference": "47177af1cfb9dab5d1cc4daf91b7179c2efe7fad", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "composer/semver": "^3.2", + "composer/xdebug-handler": "^2.0", + "doctrine/annotations": "^1.12", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.2.5 || ^8.0", + "php-cs-fixer/diff": "^2.0", + "symfony/console": "^4.4.20 || ^5.1.3 || ^6.0", + "symfony/event-dispatcher": "^4.4.20 || ^5.0 || ^6.0", + "symfony/filesystem": "^4.4.20 || ^5.0 || ^6.0", + "symfony/finder": "^4.4.20 || ^5.0 || ^6.0", + "symfony/options-resolver": "^4.4.20 || ^5.0 || ^6.0", + "symfony/polyfill-mbstring": "^1.23", + "symfony/polyfill-php80": "^1.23", + "symfony/polyfill-php81": "^1.23", + "symfony/process": "^4.4.20 || ^5.0 || ^6.0", + "symfony/stopwatch": "^4.4.20 || ^5.0 || ^6.0" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^1.5", + "mikey179/vfsstream": "^1.6.8", + "php-coveralls/php-coveralls": "^2.5.2", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.15", + "phpspec/prophecy-phpunit": "^1.1 || ^2.0", + "phpunit/phpunit": "^8.5.21 || ^9.5", + "phpunitgoodpractices/polyfill": "^1.5", + "phpunitgoodpractices/traits": "^1.9.1", + "symfony/phpunit-bridge": "^5.2.4 || ^6.0", + "symfony/yaml": "^4.4.20 || ^5.0 || ^6.0" }, - "type": "library", + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "PhpCsFixer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -502,64 +592,58 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], + "description": "A tool to automatically fix PHP code style", "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.4.0" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" + "url": "https://github.com/keradus", + "type": "github" } ], - "time": "2022-12-30T00:15:36+00:00" + "time": "2021-12-11T16:25:08+00:00" }, { - "name": "doctrine/lexer", - "version": "1.2.3", + "name": "payplug/payplug-php", + "version": "4.0.0", "source": { "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + "url": "https://github.com/payplug/payplug-php.git", + "reference": "ad19dee72100668e14c8c4974a6791ca2d1c8482" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "url": "https://api.github.com/repos/payplug/payplug-php/zipball/ad19dee72100668e14c8c4974a6791ca2d1c8482", + "reference": "ad19dee72100668e14c8c4974a6791ca2d1c8482", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "ext-curl": "*", + "ext-openssl": "*", + "php": ">=5.3.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "phpdocumentor/phpdocumentor": "2.*", + "phpunit/phpunit": "5.7.*", + "rector/rector": "^1.2" }, "type": "library", "autoload": { + "psr-0": { + "Payplug\\": "lib/" + }, "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Payplug\\": "lib/Payplug" } }, "notification-url": "https://packagist.org/downloads/", @@ -568,174 +652,141 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "PayPlug", + "email": "support@payplug.com" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], + "description": "A simple PHP library for PayPlug public API.", + "homepage": "https://www.payplug.com", "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "issues": "https://github.com/payplug/payplug-php/issues", + "source": "https://github.com/payplug/payplug-php/tree/4.0.0" }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2022-02-28T11:07:21+00:00" + "time": "2015-05-06T00:00:00+00:00" }, { - "name": "hamcrest/hamcrest-php", - "version": "v2.1.1", + "name": "php-cs-fixer/diff", + "version": "v2.0.2", "source": { "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487" + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", - "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", "shasum": "" }, "require": { - "php": "^7.4|^8.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" + "php": "^5.6 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, "autoload": { "classmap": [ - "hamcrest" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "description": "This is the PHP port of Hamcrest Matchers", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "sebastian/diff v3 backport support for PHP 5.6+", + "homepage": "https://github.com/PHP-CS-Fixer", "keywords": [ - "test" + "diff" ], "support": { - "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.1.1" + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" }, - "time": "2025-04-30T06:54:44+00:00" + "abandoned": true, + "time": "2020-10-14T08:32:19+00:00" }, { - "name": "jawira/plantuml", - "version": "v1.2025.3", + "name": "psr/cache", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/jawira/plantuml.git", - "reference": "a036dfe6f1fb5f4ea170bf80796ded93afa48187" + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jawira/plantuml/zipball/a036dfe6f1fb5f4ea170bf80796ded93afa48187", - "reference": "a036dfe6f1fb5f4ea170bf80796ded93afa48187", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", "shasum": "" }, - "bin": [ - "bin/plantuml" - ], + "require": { + "php": ">=5.3.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Jawira Portugal" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Provides PlantUML executable and plantuml.jar", + "description": "Common interface for caching libraries", "keywords": [ - "diagram", - "jar", - "plantuml", - "plantuml.jar", - "uml" + "cache", + "psr", + "psr-6" ], "support": { - "issues": "https://github.com/jawira/plantuml/issues", - "source": "https://github.com/jawira/plantuml/tree/v1.2025.3" + "source": "https://github.com/php-fig/cache/tree/master" }, - "time": "2025-06-06T13:00:45+00:00" + "time": "2016-08-06T20:24:11+00:00" }, { - "name": "jean85/pretty-package-versions", - "version": "2.1.1", + "name": "psr/container", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a" + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/4d7aa5dab42e2a76d99559706022885de0e18e1a", - "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "composer-runtime-api": "^2.1.0", - "php": "^7.4|^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.2", - "jean85/composer-provided-replaced-stub-package": "^1.0", - "phpstan/phpstan": "^2.0", - "phpunit/phpunit": "^7.5|^8.5|^9.6", - "rector/rector": "^2.0", - "vimeo/psalm": "^4.3 || ^5.0" + "php": ">=7.2.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { "psr-4": { - "Jean85\\": "src/" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -744,166 +795,101 @@ ], "authors": [ { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "A library to get pretty versions strings of installed dependencies", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "composer", - "package", - "release", - "versions" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], "support": { - "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.1" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" }, - "time": "2025-03-19T14:43:43+00:00" + "time": "2021-03-05T17:36:06+00:00" }, { - "name": "league/commonmark", - "version": "1.6.7", + "name": "psr/event-dispatcher", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/thephpleague/commonmark.git", - "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/2b8185c13bc9578367a5bf901881d1c1b5bbd09b", - "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "ext-mbstring": "*", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "scrutinizer/ocular": "1.7.*" - }, - "require-dev": { - "cebe/markdown": "~1.0", - "commonmark/commonmark.js": "0.29.2", - "erusev/parsedown": "~1.0", - "ext-json": "*", - "github/gfm": "0.29.0", - "michelf/php-markdown": "~1.4", - "mikehaertl/php-shellcommand": "^1.4", - "phpstan/phpstan": "^0.12.90", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", - "scrutinizer/ocular": "^1.5", - "symfony/finder": "^4.2" + "php": ">=7.2.0" }, - "bin": [ - "bin/commonmark" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { "psr-4": { - "League\\CommonMark\\": "src" + "Psr\\EventDispatcher\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com", - "role": "Lead Developer" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and Github-Flavored Markdown (GFM)", - "homepage": "https://commonmark.thephpleague.com", + "description": "Standard interfaces for event handling.", "keywords": [ - "commonmark", - "flavored", - "gfm", - "github", - "github-flavored", - "markdown", - "md", - "parser" + "events", + "psr", + "psr-14" ], "support": { - "docs": "https://commonmark.thephpleague.com/", - "issues": "https://github.com/thephpleague/commonmark/issues", - "rss": "https://github.com/thephpleague/commonmark/releases.atom", - "source": "https://github.com/thephpleague/commonmark" + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" }, - "funding": [ - { - "url": "https://www.colinodell.com/sponsor", - "type": "custom" - }, - { - "url": "https://www.paypal.me/colinpodell/10.00", - "type": "custom" - }, - { - "url": "https://github.com/colinodell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/commonmark", - "type": "tidelift" - } - ], - "time": "2022-01-13T17:18:13+00:00" + "time": "2019-01-08T18:20:26+00:00" }, { - "name": "league/flysystem", - "version": "1.1.10", + "name": "psr/log", + "version": "1.1.4", "source": { "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { - "League\\Flysystem\\": "src/" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -912,70 +898,79 @@ ], "authors": [ { - "name": "Frank de Jonge", - "email": "info@frenky.net" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Filesystem abstraction: Many filesystems, one API.", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" + "log", + "psr", + "psr-3" ], "support": { - "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "time": "2022-10-04T09:16:37+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { - "name": "league/mime-type-detection", - "version": "1.16.0", + "name": "symfony/console", + "version": "v5.4.47", "source": { "type": "git", - "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9" + "url": "https://github.com/symfony/console.git", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/2d6702ff215bf922936ccc1ad31007edc76451b9", - "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "php": "^7.4 || ^8.0" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.2", - "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", "autoload": { "psr-4": { - "League\\MimeTypeDetection\\": "src" - } + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -983,116 +978,191 @@ ], "authors": [ { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Mime-type detection for Flysystem", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], "support": { - "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0" + "source": "https://github.com/symfony/console/tree/v5.4.47" }, "funding": [ { - "url": "https://github.com/frankdejonge", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-21T08:32:55+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { - "name": "league/pipeline", - "version": "1.0.0", + "name": "symfony/contracts", + "version": "v2.5.5", "source": { "type": "git", - "url": "https://github.com/thephpleague/pipeline.git", - "reference": "aa14b0e3133121f8be39e9a3b6ddd011fc5bb9a8" + "url": "https://github.com/symfony/contracts.git", + "reference": "4d727f81a7eede1a3021fc93f02c1cc7ccb32abd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/pipeline/zipball/aa14b0e3133121f8be39e9a3b6ddd011fc5bb9a8", - "reference": "aa14b0e3133121f8be39e9a3b6ddd011fc5bb9a8", + "url": "https://api.github.com/repos/symfony/contracts/zipball/4d727f81a7eede1a3021fc93f02c1cc7ccb32abd", + "reference": "4d727f81a7eede1a3021fc93f02c1cc7ccb32abd", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0|^3.0", + "psr/container": "^1.1", + "psr/event-dispatcher": "^1.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "replace": { + "symfony/cache-contracts": "self.version", + "symfony/deprecation-contracts": "self.version", + "symfony/event-dispatcher-contracts": "self.version", + "symfony/http-client-contracts": "self.version", + "symfony/service-contracts": "self.version", + "symfony/translation-contracts": "self.version" }, "require-dev": { - "leanphp/phpspec-code-coverage": "^4.2", - "phpspec/phpspec": "^4.3" + "symfony/polyfill-intl-idn": "^1.10" + }, + "suggest": { + "symfony/cache-implementation": "", + "symfony/event-dispatcher-implementation": "", + "symfony/http-client-implementation": "", + "symfony/service-implementation": "", + "symfony/translation-implementation": "" }, "type": "library", - "autoload": { - "psr-4": { - "League\\Pipeline\\": "src" + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" } }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ + "autoload": { + "files": [ + "Deprecation/function.php" + ], + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "exclude-from-classmap": [ + "**/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "Frank de Jonge", - "email": "info@frenky.net", - "role": "Author" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Woody Gilk", - "email": "woody.gilk@gmail.com", - "role": "Maintainer" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A plug and play pipeline implementation.", + "description": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", "keywords": [ - "composition", - "design pattern", - "pattern", - "pipeline", - "sequential" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "issues": "https://github.com/thephpleague/pipeline/issues", - "source": "https://github.com/thephpleague/pipeline/tree/master" + "source": "https://github.com/symfony/contracts/tree/v2.5.5" }, - "time": "2018-06-05T21:06:51+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-11-28T08:37:04+00:00" }, { - "name": "league/tactician", - "version": "v1.1.0", + "name": "symfony/event-dispatcher", + "version": "v5.4.45", "source": { "type": "git", - "url": "https://github.com/thephpleague/tactician.git", - "reference": "e79f763170f3d5922ec29e85cffca0bac5cd8975" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/tactician/zipball/e79f763170f3d5922ec29e85cffca0bac5cd8975", - "reference": "e79f763170f3d5922ec29e85cffca0bac5cd8975", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9", + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" }, "require-dev": { - "mockery/mockery": "^1.3", - "phpunit/phpunit": "^7.5.20 || ^9.3.8", - "squizlabs/php_codesniffer": "^3.5.8" + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" }, + "type": "library", "autoload": { "psr-4": { - "League\\Tactician\\": "src" - } + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1100,74 +1170,66 @@ ], "authors": [ { - "name": "Ross Tuck", - "homepage": "http://tactician.thephpleague.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A small, flexible command bus. Handy for building service layers.", - "keywords": [ - "command", - "command bus", - "service layer" - ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/thephpleague/tactician/issues", - "source": "https://github.com/thephpleague/tactician/tree/v1.1.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.45" }, - "time": "2021-02-14T15:29:04+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:11:13+00:00" }, { - "name": "league/tactician-bundle", - "version": "v1.5.2", + "name": "symfony/filesystem", + "version": "v5.4.45", "source": { "type": "git", - "url": "https://github.com/thephpleague/tactician-bundle.git", - "reference": "8acdfffc227295cca945ff1a964f88e4f034cdf9" + "url": "https://github.com/symfony/filesystem.git", + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/tactician-bundle/zipball/8acdfffc227295cca945ff1a964f88e4f034cdf9", - "reference": "8acdfffc227295cca945ff1a964f88e4f034cdf9", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/57c8294ed37d4a055b77057827c67f9558c95c54", + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54", "shasum": "" }, "require": { - "league/tactician": "^1.0", - "league/tactician-container": "^2.0|^3.0", - "league/tactician-logger": "^0.10|^0.11", - "php": ">=7.2", - "symfony/config": "^3.4|^4.4|^5.0|^6.0|^7.0", - "symfony/dependency-injection": "^3.4|^4.4|^5.0|^6.0|^7.0", - "symfony/http-kernel": "^3.4|^4.4|^5.0|^6.0|^7.0", - "symfony/yaml": "^3.4|^4.4|^5.0|^6.0|^7.0" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "require-dev": { - "matthiasnoback/symfony-config-test": "^4.2.1", - "matthiasnoback/symfony-dependency-injection-test": "^4.2.1", - "mockery/mockery": "~1.0", - "phpspec/prophecy": "^1.18", - "phpunit/phpunit": "~8.5", - "symfony/console": "^3.4|^4.4|^5.0|^6.0|^7.0", - "symfony/framework-bundle": "^3.4.31|^4.4|^5.0|^6.0|^7.0", - "symfony/security-bundle": "^3.4|^4.4|^5.0|^6.0|^7.0", - "symfony/security-core": "^3.4|^4.4|^5.0|^6.0|^7.0", - "symfony/validator": "^3.4|^4.4|^5.0|^6.0|^7.0" - }, - "suggest": { - "league/tactician-doctrine": "For doctrine transaction middleware", - "symfony/console": "For debugging command-to-handler routing using the tactician:debug console command", - "symfony/security": "For command security middleware", - "symfony/validator": "For command validator middleware" - }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } + "symfony/process": "^5.4|^6.4" }, + "type": "library", "autoload": { "psr-4": { - "League\\Tactician\\Bundle\\": "src/" - } + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1175,63 +1237,61 @@ ], "authors": [ { - "name": "Rafael Dohms", - "homepage": "http://doh.ms" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Richard Tuin", - "homepage": "http://www.rtuin.nl/" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.45" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "name": "Xander Smalbil", - "email": "xander@videofunk.nl" + "url": "https://github.com/fabpot", + "type": "github" }, { - "name": "Ross Tuck", - "email": "me@rosstuck.com" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "description": "Bundle to integrate Tactician with Symfony projects", - "keywords": [ - "bundle", - "symfony", - "tactician" - ], - "support": { - "issues": "https://github.com/thephpleague/tactician-bundle/issues", - "source": "https://github.com/thephpleague/tactician-bundle/tree/v1.5.2" - }, - "time": "2025-02-19T08:17:44+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { - "name": "league/tactician-container", - "version": "2.0.0", + "name": "symfony/finder", + "version": "v5.3.14", "source": { "type": "git", - "url": "https://github.com/thephpleague/tactician-container.git", - "reference": "d1a5d884e072b8cafbff802d07766076eb2ffcb0" + "url": "https://github.com/symfony/finder.git", + "reference": "5ab1855ebe36c381ccde572f110f3280f88babf5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/tactician-container/zipball/d1a5d884e072b8cafbff802d07766076eb2ffcb0", - "reference": "d1a5d884e072b8cafbff802d07766076eb2ffcb0", + "url": "https://api.github.com/repos/symfony/finder/zipball/5ab1855ebe36c381ccde572f110f3280f88babf5", + "reference": "5ab1855ebe36c381ccde572f110f3280f88babf5", "shasum": "" }, "require": { - "league/tactician": "^1.0", - "php": ">=5.5", - "psr/container": "^1.0" - }, - "require-dev": { - "league/container": "~2.3", - "phpunit/phpunit": "~4.3", - "squizlabs/php_codesniffer": "~2.0" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { "psr-4": { - "League\\Tactician\\Container\\": "src/" - } + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1239,54 +1299,63 @@ ], "authors": [ { - "name": "Nigel Greenway", - "homepage": "http://futurepixels.co.uk" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Tactician integration for any container implementing PSR-11", - "keywords": [ - "container", - "container-interop", - "di", - "interoperable", - "league", - "tactician" - ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/thephpleague/tactician-container/issues", - "source": "https://github.com/thephpleague/tactician-container/tree/master" + "source": "https://github.com/symfony/finder/tree/v5.3.14" }, - "time": "2017-04-13T06:27:12+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:51:59+00:00" }, { - "name": "league/tactician-logger", - "version": "v0.11.1", + "name": "symfony/options-resolver", + "version": "v5.4.45", "source": { "type": "git", - "url": "https://github.com/thephpleague/tactician-logger.git", - "reference": "586a9f9781e9481a527010561ae80c0403d3f23d" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/tactician-logger/zipball/586a9f9781e9481a527010561ae80c0403d3f23d", - "reference": "586a9f9781e9481a527010561ae80c0403d3f23d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", + "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", "shasum": "" }, "require": { - "league/tactician": "^1.1", - "php": ">=7.3", - "psr/log": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "mockery/mockery": "^1.3", - "phpunit/phpunit": "^9.3", - "squizlabs/php_codesniffer": "^3.5.8" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { "psr-4": { - "League\\Tactician\\Logger\\": "src" - } + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1294,71 +1363,76 @@ ], "authors": [ { - "name": "Ross Tuck" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Adds PSR-3 logging support to the Tactician command bus", - "homepage": "https://github.com/thephpleague/tactician-logger", + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", "keywords": [ - "log", - "logging", - "tactician" + "config", + "configuration", + "options" ], "support": { - "issues": "https://github.com/thephpleague/tactician-logger/issues", - "source": "https://github.com/thephpleague/tactician-logger/tree/v0.11.1" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.45" }, - "time": "2025-04-18T13:03:20+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:11:13+00:00" }, { - "name": "league/uri", - "version": "6.7.2", + "name": "symfony/polyfill-ctype", + "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/thephpleague/uri.git", - "reference": "d3b50812dd51f3fbf176344cc2981db03d10fe06" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri/zipball/d3b50812dd51f3fbf176344cc2981db03d10fe06", - "reference": "d3b50812dd51f3fbf176344cc2981db03d10fe06", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "ext-json": "*", - "league/uri-interfaces": "^2.3", - "php": "^7.4 || ^8.0", - "psr/http-message": "^1.0" - }, - "conflict": { - "league/uri-schemes": "^1.0" + "php": ">=7.2" }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^v3.3.2", - "nyholm/psr7": "^1.5", - "php-http/psr7-integration-tests": "^1.1", - "phpstan/phpstan": "^1.2.0", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0.0", - "phpstan/phpstan-strict-rules": "^1.1.0", - "phpunit/phpunit": "^9.5.10", - "psr/http-factory": "^1.0" + "provide": { + "ext-ctype": "*" }, "suggest": { - "ext-fileinfo": "Needed to create Data URI from a filepath", - "ext-intl": "Needed to improve host validation", - "league/uri-components": "Needed to easily manipulate URI objects", - "psr/http-factory": "Needed to use the URI factory" + "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "6.x-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "League\\Uri\\": "src" + "Symfony\\Polyfill\\Ctype\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1367,86 +1441,78 @@ ], "authors": [ { - "name": "Ignace Nyamagana Butera", - "email": "nyamsprod@gmail.com", - "homepage": "https://nyamsprod.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "URI manipulation library", - "homepage": "https://uri.thephpleague.com", + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", "keywords": [ - "data-uri", - "file-uri", - "ftp", - "hostname", - "http", - "https", - "middleware", - "parse_str", - "parse_url", - "psr-7", - "query-string", - "querystring", - "rfc3986", - "rfc3987", - "rfc6570", - "uri", - "uri-template", - "url", - "ws" + "compatibility", + "ctype", + "polyfill", + "portable" ], "support": { - "docs": "https://uri.thephpleague.com", - "forum": "https://thephpleague.slack.com", - "issues": "https://github.com/thephpleague/uri/issues", - "source": "https://github.com/thephpleague/uri/tree/6.7.2" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" }, "funding": [ { - "url": "https://github.com/sponsors/nyamsprod", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2022-09-13T19:50:42+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "league/uri-interfaces", - "version": "2.3.0", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/thephpleague/uri-interfaces.git", - "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", - "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", "shasum": "" }, "require": { - "ext-json": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.19", - "phpstan/phpstan": "^0.12.90", - "phpstan/phpstan-phpunit": "^0.12.19", - "phpstan/phpstan-strict-rules": "^0.12.9", - "phpunit/phpunit": "^8.5.15 || ^9.5" + "php": ">=7.2" }, "suggest": { - "ext-intl": "to use the IDNA feature", - "symfony/intl": "to use the IDNA feature via Symfony Polyfill" + "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.x-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "League\\Uri\\": "src/" + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1455,180 +1521,169 @@ ], "authors": [ { - "name": "Ignace Nyamagana Butera", - "email": "nyamsprod@gmail.com", - "homepage": "https://nyamsprod.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common interface for URI representation", - "homepage": "http://github.com/thephpleague/uri-interfaces", + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", "keywords": [ - "rfc3986", - "rfc3987", - "uri", - "url" + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/thephpleague/uri-interfaces/issues", - "source": "https://github.com/thephpleague/uri-interfaces/tree/2.3.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" }, "funding": [ { - "url": "https://github.com/sponsors/nyamsprod", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" - } - ], - "time": "2021-06-28T04:27:21+00:00" - }, + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-27T09:58:17+00:00" + }, { - "name": "mockery/mockery", - "version": "1.6.12", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", - "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "hamcrest/hamcrest-php": "^2.0.1", - "lib-pcre": ">=7.0", - "php": ">=7.3" - }, - "conflict": { - "phpunit/phpunit": "<8.0" + "php": ">=7.2" }, - "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.6.17", - "symplify/easy-coding-standard": "^12.1.14" + "suggest": { + "ext-intl": "For best performance" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { "files": [ - "library/helpers.php", - "library/Mockery.php" + "bootstrap.php" ], "psr-4": { - "Mockery\\": "library/Mockery" - } + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "https://github.com/padraic", - "role": "Author" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "https://davedevelopment.co.uk", - "role": "Developer" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Nathanael Esayeas", - "email": "nathanael.esayeas@protonmail.com", - "homepage": "https://github.com/ghostwriter", - "role": "Lead Developer" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Mockery is a simple yet flexible PHP mock object framework", - "homepage": "https://github.com/mockery/mockery", + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" ], "support": { - "docs": "https://docs.mockery.io/", - "issues": "https://github.com/mockery/mockery/issues", - "rss": "https://github.com/mockery/mockery/releases.atom", - "security": "https://github.com/mockery/mockery/security/advisories", - "source": "https://github.com/mockery/mockery" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" }, - "time": "2024-05-16T03:13:13+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "monolog/monolog", - "version": "2.10.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "5cf826f2991858b54d5c3809bee745560a1042a7" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7", - "reference": "5cf826f2991858b54d5c3809bee745560a1042a7", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" + "ext-iconv": "*", + "php": ">=7.2" }, "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "elasticsearch/elasticsearch": "^7 || ^8", - "ext-json": "*", - "graylog2/gelf-php": "^1.4.2 || ^2@dev", - "guzzlehttp/guzzle": "^7.4", - "guzzlehttp/psr7": "^2.2", - "mongodb/mongodb": "^1.8", - "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.5.38 || ^9.6.19", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", - "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", - "symfony/mailer": "^5.4 || ^6", - "symfony/mime": "^5.4 || ^6" + "ext-mbstring": "*" }, "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", - "ext-mbstring": "Allow to work properly with unicode symbols", - "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", - "ext-openssl": "Required to send log messages using SSL", - "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + "ext-mbstring": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "2.x-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Monolog\\": "src/Monolog" + "Symfony\\Polyfill\\Mbstring\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1637,649 +1692,1191 @@ ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "https://github.com/Seldaek/monolog", + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", "keywords": [ - "log", - "logging", - "psr-3" + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.10.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" }, "funding": [ { - "url": "https://github.com/Seldaek", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-11-12T12:43:37+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.13.1", + "name": "symfony/polyfill-php73", + "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3 <3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpspec/prophecy": "^1.10", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + "php": ">=7.2" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { "files": [ - "src/DeepCopy/deep_copy.php" + "bootstrap.php" ], "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" - }, + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.33.0" + }, "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-04-29T12:36:36+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "nikic/php-parser", - "version": "v4.19.4", + "name": "symfony/polyfill-php80", + "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=7.1" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "php": ">=7.2" }, - "bin": [ - "bin/php-parse" - ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "4.9-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "PhpParser\\": "lib/PhpParser" - } + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Nikita Popov" + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A PHP parser written in PHP", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "parser", - "php" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" }, - "time": "2024-09-29T15:01:53+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-01-02T08:10:11+00:00" }, { - "name": "phar-io/manifest", - "version": "2.0.4", + "name": "symfony/polyfill-php81", + "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "54750ef60c58e43759730615a392c31c80e23176" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", - "reference": "54750ef60c58e43759730615a392c31c80e23176", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.4" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" }, "funding": [ { - "url": "https://github.com/theseer", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2024-03-03T12:33:53+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "phar-io/version", - "version": "3.2.1", + "name": "symfony/process", + "version": "v5.3.14", "source": { "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + "url": "https://github.com/symfony/process.git", + "reference": "8bbae08c19308b9493ad235386144cbefec83cb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "url": "https://api.github.com/repos/symfony/process/zipball/8bbae08c19308b9493ad235386144cbefec83cb0", + "reference": "8bbae08c19308b9493ad235386144cbefec83cb0", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library for handling version information and constraints", + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" + "source": "https://github.com/symfony/process/tree/v5.3.14" }, - "time": "2022-02-21T01:04:05+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-24T19:35:44+00:00" }, { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "name": "symfony/stopwatch", + "version": "v5.4.45", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "url": "https://github.com/symfony/stopwatch.git", + "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fb2c199cf302eb207f8c23e7ee174c1c31a5c004", + "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^3" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.45" }, - "time": "2019-12-27T09:44:58+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:11:13+00:00" }, { - "name": "phpdocumentor/flyfinder", - "version": "1.1.0", + "name": "symfony/string", + "version": "v5.3.14", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/FlyFinder.git", - "reference": "6e145e676d9fbade7527fd8d4c99ab36b687b958" + "url": "https://github.com/symfony/string.git", + "reference": "006fadf2d23b7b1a0ec5f3a0a5a80e1da2819c94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/FlyFinder/zipball/6e145e676d9fbade7527fd8d4c99ab36b687b958", - "reference": "6e145e676d9fbade7527fd8d4c99ab36b687b958", + "url": "https://api.github.com/repos/symfony/string/zipball/006fadf2d23b7b1a0ec5f3a0a5a80e1da2819c94", + "reference": "006fadf2d23b7b1a0ec5f3a0a5a80e1da2819c94", "shasum": "" }, "require": { - "league/flysystem": "^1.0", - "php": "^7.2||^8.0" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" }, "require-dev": { - "league/flysystem-memory": "~1", - "mockery/mockery": "^1.3" + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { - "Flyfinder\\": [ - "src/" - ] - } + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Flysystem plugin to add file finding capabilities to the Filesystem entity", - "homepage": "http://www.phpdoc.org", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", "keywords": [ - "Flysystem", - "phpdoc" + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" ], "support": { - "issues": "https://github.com/phpDocumentor/FlyFinder/issues", - "source": "https://github.com/phpDocumentor/FlyFinder/tree/1.1.0" + "source": "https://github.com/symfony/string/tree/v5.3.14" }, - "time": "2021-06-04T13:44:40+00:00" - }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-05T13:47:22+00:00" + } + ], + "packages-dev": [ { - "name": "phpdocumentor/graphviz", - "version": "2.1.0", + "name": "automattic/jetpack-changelogger", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/GraphViz.git", - "reference": "115999dc7f31f2392645aa825a94a6b165e1cedf" + "url": "https://github.com/Automattic/jetpack-changelogger.git", + "reference": "b76f9cb4c22ec08490eff91a2e0e5aa586ee04b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/GraphViz/zipball/115999dc7f31f2392645aa825a94a6b165e1cedf", - "reference": "115999dc7f31f2392645aa825a94a6b165e1cedf", + "url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/b76f9cb4c22ec08490eff91a2e0e5aa586ee04b3", + "reference": "b76f9cb4c22ec08490eff91a2e0e5aa586ee04b3", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": ">=5.6", + "symfony/console": "^3.4 | ^5.2", + "symfony/process": "^3.4 | ^5.2", + "wikimedia/at-ease": "^1.2 | ^2.0" }, "require-dev": { - "ext-simplexml": "*", - "mockery/mockery": "^1.2", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^8.2 || ^9.2", - "psalm/phar": "^4.15" + "wikimedia/testing-access-wrapper": "^1.0 | ^2.0", + "yoast/phpunit-polyfills": "1.0.2" }, - "type": "library", + "bin": [ + "bin/changelogger" + ], + "type": "project", "extra": { + "autotagger": true, + "mirror-repo": "Automattic/jetpack-changelogger", "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.0.x-dev" + }, + "changelogger": { + "link-template": "https://github.com/Automattic/jetpack-changelogger/compare/${old}...${new}" + }, + "version-constants": { + "::VERSION": "src/Application.php" } }, "autoload": { "psr-4": { - "phpDocumentor\\GraphViz\\": "src/phpDocumentor/GraphViz", - "phpDocumentor\\GraphViz\\PHPStan\\": "./src/phpDocumentor/PHPStan" + "Automattic\\Jetpack\\Changelog\\": "lib", + "Automattic\\Jetpack\\Changelogger\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } + "GPL-2.0-or-later" ], - "description": "Wrapper for Graphviz", + "description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.", "support": { - "issues": "https://github.com/phpDocumentor/GraphViz/issues", - "source": "https://github.com/phpDocumentor/GraphViz/tree/2.1.0" + "source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.0.2" }, - "time": "2021-12-13T19:03:21+00:00" + "time": "2021-11-02T14:06:49+00:00" }, { - "name": "phpdocumentor/phpdocumentor", - "version": "v3.1.2", + "name": "bamarni/composer-bin-plugin", + "version": "1.8.3", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/phpDocumentor.git", - "reference": "888fd76678506f9638e955218465bada0048e40a" + "url": "https://github.com/bamarni/composer-bin-plugin.git", + "reference": "e7ef9e012667327516c24e5fad9903a3bc91389d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/phpDocumentor/zipball/888fd76678506f9638e955218465bada0048e40a", - "reference": "888fd76678506f9638e955218465bada0048e40a", + "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/e7ef9e012667327516c24e5fad9903a3bc91389d", + "reference": "e7ef9e012667327516c24e5fad9903a3bc91389d", "shasum": "" }, "require": { - "doctrine/event-manager": "^1.1", - "doctrine/lexer": "^1.2", - "ext-ctype": "*", - "ext-hash": "*", - "ext-iconv": "*", + "composer-plugin-api": "^2.0", + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "composer/composer": "^2.0", "ext-json": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "ext-xml": "*", - "jawira/plantuml": "^1.27", - "jean85/pretty-package-versions": "^1.5 || ^2.0.1", - "league/commonmark": "^1.5", - "league/flysystem": "^1.0", - "league/pipeline": "^1.0", - "league/tactician": "^1.0", - "league/tactician-bundle": "^1.2", - "league/uri": "^6.0", - "league/uri-interfaces": "^2.0", - "php": ">=7.2.5||^8.0", - "phpdocumentor/flyfinder": "^1.0", - "phpdocumentor/graphviz": "^2.0", - "phpdocumentor/reflection": "^5.0", - "phpdocumentor/reflection-common": "^2.0", - "phpdocumentor/reflection-docblock": "^5.0", - "phpdocumentor/type-resolver": "^1.0", - "psr/cache": "^1.0", - "psr/log": "^1.1", - "symfony/cache": "^5.0", - "symfony/config": "^5.0", - "symfony/console": "^5.0", - "symfony/contracts": "^2.0", - "symfony/dependency-injection": "^5.0", - "symfony/dom-crawler": "5.2.*", - "symfony/dotenv": "^5.0", - "symfony/event-dispatcher": "^5.0", - "symfony/expression-language": "^5.0", - "symfony/filesystem": "^5.0", - "symfony/finder": "5.3.*", - "symfony/flex": "^1.3.1", - "symfony/framework-bundle": "^5.0", - "symfony/http-foundation": "^5.0.7", - "symfony/http-kernel": "^5.0.8", - "symfony/monolog-bundle": "^3.0", - "symfony/polyfill-intl-idn": "^1.22", - "symfony/process": "5.3.*", - "symfony/routing": "^5.0", - "symfony/stopwatch": "^5.0", - "symfony/string": "5.3.*", - "symfony/yaml": "^5.0", - "twig/twig": "~2.0", - "webmozart/assert": "^1.3" + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.0", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Bamarni\\Composer\\Bin\\BamarniBinPlugin" + }, + "autoload": { + "psr-4": { + "Bamarni\\Composer\\Bin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "No conflicts for your bin dependencies", + "keywords": [ + "composer", + "conflict", + "dependency", + "executable", + "isolation", + "tool" + ], + "support": { + "issues": "https://github.com/bamarni/composer-bin-plugin/issues", + "source": "https://github.com/bamarni/composer-bin-plugin/tree/1.8.3" + }, + "time": "2025-11-24T19:20:55+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=13" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^12 || ^13", + "phpstan/phpstan": "1.4.10 || 2.1.11", + "phpstan/phpstan-phpunit": "^1.0 || ^2", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", + "psr/log": "^1 || ^2 || ^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.5" + }, + "time": "2025-04-07T20:06:18+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/95aa4cb529f1e96576f3fda9f5705ada4056a520", + "reference": "95aa4cb529f1e96576f3fda9f5705ada4056a520", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3 || ^1", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.24" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/1.2.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2022-10-12T20:51:15+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + }, + "time": "2020-07-09T08:09:16+00:00" + }, + { + "name": "jawira/plantuml", + "version": "v1.2025.10", + "source": { + "type": "git", + "url": "https://github.com/jawira/plantuml.git", + "reference": "8e1ad6f1a4288d195c9b295636b79decb9085fcc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jawira/plantuml/zipball/8e1ad6f1a4288d195c9b295636b79decb9085fcc", + "reference": "8e1ad6f1a4288d195c9b295636b79decb9085fcc", + "shasum": "" + }, + "bin": [ + "bin/plantuml" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Jawira Portugal" + } + ], + "description": "Provides PlantUML executable and plantuml.jar", + "keywords": [ + "diagram", + "jar", + "plantuml", + "plantuml.jar", + "uml" + ], + "support": { + "issues": "https://github.com/jawira/plantuml/issues", + "source": "https://github.com/jawira/plantuml/tree/v1.2025.10" }, - "conflict": { - "symfony/symfony": "*" + "time": "2025-11-07T14:00:51+00:00" + }, + { + "name": "jean85/pretty-package-versions", + "version": "2.0.6", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4" }, - "replace": { - "paragonie/random_compat": "2.*", - "symfony/polyfill-iconv": "*", - "symfony/polyfill-php56": "*", - "symfony/polyfill-php70": "*", - "symfony/polyfill-php71": "*", - "symfony/polyfill-php72": "*" + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/f9fdd29ad8e6d024f52678b570e5593759b550b4", + "reference": "f9fdd29ad8e6d024f52678b570e5593759b550b4", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.0.0", + "php": "^7.1|^8.0" }, "require-dev": { - "fzaninotto/faker": "^1.9", - "mikey179/vfsstream": "^1.2", - "mockery/mockery": "^1.0" + "friendsofphp/php-cs-fixer": "^3.2", + "jean85/composer-provided-replaced-stub-package": "^1.0", + "phpstan/phpstan": "^1.4", + "phpunit/phpunit": "^7.5|^8.5|^9.4", + "vimeo/psalm": "^4.3" }, - "bin": [ - "bin/phpdoc.php", - "bin/phpdoc" - ], "type": "library", "extra": { - "symfony": { - "id": "01C32VS9393M1CP9R8TEJMH62G", - "require": "^5.0", - "allow-contrib": false - }, "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\": [ - "src/phpDocumentor/" - ], - "phpDocumentor\\Guides\\": "src/Guides/" + "Jean85\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Documentation Generator for PHP", - "homepage": "https://www.phpdoc.org", + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A library to get pretty versions strings of installed dependencies", "keywords": [ - "api", - "application", - "dga", - "documentation", - "phpdoc" + "composer", + "package", + "release", + "versions" ], "support": { - "issues": "https://github.com/phpDocumentor/phpDocumentor/issues", - "source": "https://github.com/phpDocumentor/phpDocumentor/tree/v3.1.2" + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.0.6" }, - "time": "2021-08-31T20:17:41+00:00" + "time": "2024-03-08T09:58:59+00:00" }, { - "name": "phpdocumentor/reflection", - "version": "5.3.3", + "name": "league/commonmark", + "version": "1.6.7", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/Reflection.git", - "reference": "99926d699634bb16acd5bbf21b4b3b543690304a" + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/99926d699634bb16acd5bbf21b4b3b543690304a", - "reference": "99926d699634bb16acd5bbf21b4b3b543690304a", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/2b8185c13bc9578367a5bf901881d1c1b5bbd09b", + "reference": "2b8185c13bc9578367a5bf901881d1c1b5bbd09b", "shasum": "" }, "require": { - "nikic/php-parser": "~4.14", - "php": "^7.4|8.0.*|8.1.*|8.2.*|8.3.*", - "phpdocumentor/reflection-common": "^2.1", - "phpdocumentor/reflection-docblock": "^5", - "phpdocumentor/type-resolver": "^1.2", - "symfony/polyfill-php80": "^1.28", - "webmozart/assert": "^1.7" + "ext-mbstring": "*", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "scrutinizer/ocular": "1.7.*" }, "require-dev": { - "mikey179/vfsstream": "~1.2", - "mockery/mockery": "~1.6.0", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-php-parser": "^1.1", - "phpstan/phpstan-webmozart-assert": "^1.2", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.18.0", - "vimeo/psalm": "^5.0" + "cebe/markdown": "~1.0", + "commonmark/commonmark.js": "0.29.2", + "erusev/parsedown": "~1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "~1.4", + "mikehaertl/php-shellcommand": "^1.4", + "phpstan/phpstan": "^0.12.90", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", + "scrutinizer/ocular": "^1.5", + "symfony/finder": "^4.2" + }, + "bin": [ + "bin/commonmark" + ], + "type": "library", + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and Github-Flavored Markdown (GFM)", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "flavored", + "gfm", + "github", + "github-flavored", + "markdown", + "md", + "parser" + ], + "support": { + "docs": "https://commonmark.thephpleague.com/", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" + } + ], + "time": "2022-01-13T17:18:13+00:00" + }, + { + "name": "league/flysystem", + "version": "1.1.10", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" + }, + "suggest": { + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" }, "type": "library", "extra": { "branch-alias": { - "dev-5.x": "5.3.x-dev" + "dev-master": "1.1-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\": "src/phpDocumentor" + "League\\Flysystem\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Reflection library to do Static Analysis for PHP Projects", - "homepage": "http://www.phpdoc.org", + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", "keywords": [ - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" ], "support": { - "issues": "https://github.com/phpDocumentor/Reflection/issues", - "source": "https://github.com/phpDocumentor/Reflection/tree/5.3.3" + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" }, - "time": "2023-10-09T18:24:07+00:00" + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], + "time": "2022-10-04T09:16:37+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "league/mime-type-detection", + "version": "1.12.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "c7f2872fb273bf493811473dafc88d60ae829f48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/c7f2872fb273bf493811473dafc88d60ae829f48", + "reference": "c7f2872fb273bf493811473dafc88d60ae829f48", "shasum": "" }, "require": { + "ext-fileinfo": "*", "php": "^7.2 || ^8.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3" }, + "type": "library", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src/" + "League\\MimeTypeDetection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2288,66 +2885,52 @@ ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], + "description": "Mime-type detection for Flysystem", "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.12.0" }, - "time": "2020-06-27T09:03:43+00:00" + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2023-08-03T07:14:11+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "5.6.2", + "name": "league/pipeline", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62" + "url": "https://github.com/thephpleague/pipeline.git", + "reference": "aa14b0e3133121f8be39e9a3b6ddd011fc5bb9a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/92dde6a5919e34835c506ac8c523ef095a95ed62", - "reference": "92dde6a5919e34835c506ac8c523ef095a95ed62", + "url": "https://api.github.com/repos/thephpleague/pipeline/zipball/aa14b0e3133121f8be39e9a3b6ddd011fc5bb9a8", + "reference": "aa14b0e3133121f8be39e9a3b6ddd011fc5bb9a8", "shasum": "" }, "require": { - "doctrine/deprecations": "^1.1", - "ext-filter": "*", - "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7|^2.0", - "webmozart/assert": "^1.9.1" + "php": ">=7.1" }, "require-dev": { - "mockery/mockery": "~1.3.5 || ~1.6.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-webmozart-assert": "^1.2", - "phpunit/phpunit": "^9.5", - "psalm/phar": "^5.26" + "leanphp/phpspec-code-coverage": "^4.2", + "phpspec/phpspec": "^4.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "League\\Pipeline\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2356,60 +2939,61 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Frank de Jonge", + "email": "info@frenky.net", + "role": "Author" }, { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com", + "role": "Maintainer" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "description": "A plug and play pipeline implementation.", + "keywords": [ + "composition", + "design pattern", + "pattern", + "pipeline", + "sequential" + ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.2" + "issues": "https://github.com/thephpleague/pipeline/issues", + "source": "https://github.com/thephpleague/pipeline/tree/master" }, - "time": "2025-04-13T19:20:35+00:00" + "time": "2018-06-05T21:06:51+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.10.0", + "name": "league/tactician", + "version": "v1.1.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" + "url": "https://github.com/thephpleague/tactician.git", + "reference": "e79f763170f3d5922ec29e85cffca0bac5cd8975" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", - "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "url": "https://api.github.com/repos/thephpleague/tactician/zipball/e79f763170f3d5922ec29e85cffca0bac5cd8975", + "reference": "e79f763170f3d5922ec29e85cffca0bac5cd8975", "shasum": "" }, "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.3 || ^8.0", - "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.18|^2.0" + "php": ">=7.1" }, "require-dev": { - "ext-tokenizer": "*", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^7.5.20 || ^9.3.8", + "squizlabs/php_codesniffer": "^3.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "League\\Tactician\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2418,1278 +3002,1399 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Ross Tuck", + "homepage": "http://tactician.thephpleague.com" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "A small, flexible command bus. Handy for building service layers.", + "keywords": [ + "command", + "command bus", + "service layer" + ], "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" + "issues": "https://github.com/thephpleague/tactician/issues", + "source": "https://github.com/thephpleague/tactician/tree/v1.1.0" }, - "time": "2024-11-09T15:12:26+00:00" + "time": "2021-02-14T15:29:04+00:00" }, { - "name": "phpstan/phpdoc-parser", - "version": "2.1.0", + "name": "league/tactician-bundle", + "version": "v1.5.2", "source": { "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68" + "url": "https://github.com/thephpleague/tactician-bundle.git", + "reference": "8acdfffc227295cca945ff1a964f88e4f034cdf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", - "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", + "url": "https://api.github.com/repos/thephpleague/tactician-bundle/zipball/8acdfffc227295cca945ff1a964f88e4f034cdf9", + "reference": "8acdfffc227295cca945ff1a964f88e4f034cdf9", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0" + "league/tactician": "^1.0", + "league/tactician-container": "^2.0|^3.0", + "league/tactician-logger": "^0.10|^0.11", + "php": ">=7.2", + "symfony/config": "^3.4|^4.4|^5.0|^6.0|^7.0", + "symfony/dependency-injection": "^3.4|^4.4|^5.0|^6.0|^7.0", + "symfony/http-kernel": "^3.4|^4.4|^5.0|^6.0|^7.0", + "symfony/yaml": "^3.4|^4.4|^5.0|^6.0|^7.0" }, "require-dev": { - "doctrine/annotations": "^2.0", - "nikic/php-parser": "^5.3.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^2.0", - "phpstan/phpstan-phpunit": "^2.0", - "phpstan/phpstan-strict-rules": "^2.0", - "phpunit/phpunit": "^9.6", - "symfony/process": "^5.2" + "matthiasnoback/symfony-config-test": "^4.2.1", + "matthiasnoback/symfony-dependency-injection-test": "^4.2.1", + "mockery/mockery": "~1.0", + "phpspec/prophecy": "^1.18", + "phpunit/phpunit": "~8.5", + "symfony/console": "^3.4|^4.4|^5.0|^6.0|^7.0", + "symfony/framework-bundle": "^3.4.31|^4.4|^5.0|^6.0|^7.0", + "symfony/security-bundle": "^3.4|^4.4|^5.0|^6.0|^7.0", + "symfony/security-core": "^3.4|^4.4|^5.0|^6.0|^7.0", + "symfony/validator": "^3.4|^4.4|^5.0|^6.0|^7.0" + }, + "suggest": { + "league/tactician-doctrine": "For doctrine transaction middleware", + "symfony/console": "For debugging command-to-handler routing using the tactician:debug console command", + "symfony/security": "For command security middleware", + "symfony/validator": "For command validator middleware" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } }, - "type": "library", "autoload": { "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] + "League\\Tactician\\Bundle\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", + "authors": [ + { + "name": "Rafael Dohms", + "homepage": "http://doh.ms" + }, + { + "name": "Richard Tuin", + "homepage": "http://www.rtuin.nl/" + }, + { + "name": "Xander Smalbil", + "email": "xander@videofunk.nl" + }, + { + "name": "Ross Tuck", + "email": "me@rosstuck.com" + } + ], + "description": "Bundle to integrate Tactician with Symfony projects", + "keywords": [ + "bundle", + "symfony", + "tactician" + ], "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.1.0" + "issues": "https://github.com/thephpleague/tactician-bundle/issues", + "source": "https://github.com/thephpleague/tactician-bundle/tree/v1.5.2" }, - "time": "2025-02-19T13:28:12+00:00" + "time": "2025-02-19T08:17:44+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "name": "league/tactician-container", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "url": "https://github.com/thephpleague/tactician-container.git", + "reference": "d1a5d884e072b8cafbff802d07766076eb2ffcb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/thephpleague/tactician-container/zipball/d1a5d884e072b8cafbff802d07766076eb2ffcb0", + "reference": "d1a5d884e072b8cafbff802d07766076eb2ffcb0", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.19.1 || ^5.1.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", - "theseer/tokenizer": "^1.2.3" + "league/tactician": "^1.0", + "php": ">=5.5", + "psr/container": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^9.6" - }, - "suggest": { - "ext-pcov": "PHP extension that provides line coverage", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "9.2.x-dev" - } + "league/container": "~2.3", + "phpunit/phpunit": "~4.3", + "squizlabs/php_codesniffer": "~2.0" }, + "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "League\\Tactician\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nigel Greenway", + "homepage": "http://futurepixels.co.uk" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Tactician integration for any container implementing PSR-11", "keywords": [ - "coverage", - "testing", - "xunit" + "container", + "container-interop", + "di", + "interoperable", + "league", + "tactician" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + "issues": "https://github.com/thephpleague/tactician-container/issues", + "source": "https://github.com/thephpleague/tactician-container/tree/master" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2017-04-13T06:27:12+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "name": "league/tactician-logger", + "version": "v0.11.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "url": "https://github.com/thephpleague/tactician-logger.git", + "reference": "586a9f9781e9481a527010561ae80c0403d3f23d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/thephpleague/tactician-logger/zipball/586a9f9781e9481a527010561ae80c0403d3f23d", + "reference": "586a9f9781e9481a527010561ae80c0403d3f23d", "shasum": "" }, "require": { - "php": ">=7.3" + "league/tactician": "^1.1", + "php": ">=7.3", + "psr/log": "^1.0|^2.0|^3.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^9.3", + "squizlabs/php_codesniffer": "^3.5.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "League\\Tactician\\Logger\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Ross Tuck" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "Adds PSR-3 logging support to the Tactician command bus", + "homepage": "https://github.com/thephpleague/tactician-logger", "keywords": [ - "filesystem", - "iterator" + "log", + "logging", + "tactician" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "issues": "https://github.com/thephpleague/tactician-logger/issues", + "source": "https://github.com/thephpleague/tactician-logger/tree/v0.11.1" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2025-04-18T13:03:20+00:00" }, { - "name": "phpunit/php-invoker", - "version": "3.1.1", + "name": "league/uri", + "version": "6.5.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "url": "https://github.com/thephpleague/uri.git", + "reference": "c68ca445abb04817d740ddd6d0b3551826ef0c5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/c68ca445abb04817d740ddd6d0b3551826ef0c5a", + "reference": "c68ca445abb04817d740ddd6d0b3551826ef0c5a", "shasum": "" }, "require": { - "php": ">=7.3" + "ext-json": "*", + "league/uri-interfaces": "^2.3", + "php": "^7.3 || ^8.0", + "psr/http-message": "^1.0" + }, + "conflict": { + "league/uri-schemes": "^1.0" }, "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "friendsofphp/php-cs-fixer": "^2.19 || ^3.0", + "phpstan/phpstan": "^0.12.90", + "phpstan/phpstan-phpunit": "^0.12.22", + "phpstan/phpstan-strict-rules": "^0.12.11", + "phpunit/phpunit": "^8.0 || ^9.0", + "psr/http-factory": "^1.0" }, "suggest": { - "ext-pcntl": "*" + "ext-fileinfo": "Needed to create Data URI from a filepath", + "ext-intl": "Needed to improve host validation", + "league/uri-components": "Needed to easily manipulate URI objects", + "psr/http-factory": "Needed to use the URI factory" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "6.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "League\\Uri\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" } ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "description": "URI manipulation library", + "homepage": "http://uri.thephpleague.com", "keywords": [ - "process" + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "uri-template", + "url", + "ws" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri/issues", + "source": "https://github.com/thephpleague/uri/tree/6.5.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/sponsors/nyamsprod", "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2021-08-27T09:54:07+00:00" }, { - "name": "phpunit/php-text-template", - "version": "2.0.4", + "name": "league/uri-interfaces", + "version": "2.3.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", + "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", "shasum": "" }, "require": { - "php": ">=7.3" + "ext-json": "*", + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "friendsofphp/php-cs-fixer": "^2.19", + "phpstan/phpstan": "^0.12.90", + "phpstan/phpstan-phpunit": "^0.12.19", + "phpstan/phpstan-strict-rules": "^0.12.9", + "phpunit/phpunit": "^8.5.15 || ^9.5" + }, + "suggest": { + "ext-intl": "to use the IDNA feature", + "symfony/intl": "to use the IDNA feature via Symfony Polyfill" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "League\\Uri\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Common interface for URI representation", + "homepage": "http://github.com/thephpleague/uri-interfaces", "keywords": [ - "template" + "rfc3986", + "rfc3987", + "uri", + "url" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "issues": "https://github.com/thephpleague/uri-interfaces/issues", + "source": "https://github.com/thephpleague/uri-interfaces/tree/2.3.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/sponsors/nyamsprod", "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2021-06-28T04:27:21+00:00" }, { - "name": "phpunit/php-timer", - "version": "5.0.3", + "name": "mockery/mockery", + "version": "1.6.12", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "url": "https://github.com/mockery/mockery.git", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", "shasum": "" }, "require": { + "hamcrest/hamcrest-php": "^2.0.1", + "lib-pcre": ">=7.0", "php": ">=7.3" }, + "conflict": { + "phpunit/phpunit": "<8.0" + }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" + "autoload": { + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" } }, - "autoload": { - "classmap": [ - "src/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "https://github.com/padraic", + "role": "Author" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", "keywords": [ - "timer" + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "docs": "https://docs.mockery.io/", + "issues": "https://github.com/mockery/mockery/issues", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2024-05-16T03:13:13+00:00" }, { - "name": "phpunit/phpunit", - "version": "9.6.23", + "name": "monolog/monolog", + "version": "2.10.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95" + "url": "https://github.com/Seldaek/monolog.git", + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", - "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7", + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", - "ext-dom": "*", + "php": ">=7.2", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.1", - "phar-io/manifest": "^2.0.4", - "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" + "graylog2/gelf-php": "^1.4.2 || ^2@dev", + "guzzlehttp/guzzle": "^7.4", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "phpspec/prophecy": "^1.15", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.38 || ^9.6.19", + "predis/predis": "^1.1 || ^2.0", + "rollbar/rollbar": "^1.3 || ^2 || ^3", + "ruflin/elastica": "^7", + "swiftmailer/swiftmailer": "^5.3|^6.0", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" }, "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "2.x-dev" } }, "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] + "psr-4": { + "Monolog\\": "src/Monolog" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", "keywords": [ - "phpunit", - "testing", - "xunit" + "log", + "logging", + "psr-3" ], "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.23" + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.10.0" }, "funding": [ { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/Seldaek", "type": "github" }, { - "url": "https://liberapay.com/sebastianbergmann", - "type": "liberapay" - }, - { - "url": "https://thanks.dev/u/gh/sebastianbergmann", - "type": "thanks_dev" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", "type": "tidelift" } ], - "time": "2025-05-02T06:40:34+00:00" + "time": "2024-11-12T12:43:37+00:00" }, { - "name": "psr/cache", - "version": "1.0.1", + "name": "myclabs/deep-copy", + "version": "1.13.4", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.1 || ^8.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, + "type": "library", "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], "psr-4": { - "Psr\\Cache\\": "src/" + "DeepCopy\\": "src/DeepCopy/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", + "description": "Create deep copies (clones) of your objects", "keywords": [ - "cache", - "psr", - "psr-6" + "clone", + "copy", + "duplicate", + "object", + "object graph" ], "support": { - "source": "https://github.com/php-fig/cache/tree/master" + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, - "time": "2016-08-06T20:24:11+00:00" + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2025-08-01T08:46:24+00:00" }, { - "name": "psr/container", - "version": "1.1.2", + "name": "nikic/php-parser", + "version": "v4.19.5", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", + "reference": "51bd93cc741b7fc3d63d20b6bdcd99fdaa359837", "shasum": "" }, "require": { - "php": ">=7.4.0" + "ext-tokenizer": "*", + "php": ">=7.1" }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], "type": "library", "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Nikita Popov" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "A PHP parser written in PHP", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "parser", + "php" ], "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.5" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2025-12-06T11:45:25+00:00" }, { - "name": "psr/event-dispatcher", - "version": "1.0.0", + "name": "phar-io/manifest", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { - "php": ">=7.2.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2019-01-08T18:20:26+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { - "name": "psr/http-message", - "version": "1.1", + "name": "phar-io/version", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], + "description": "Library for handling version information and constraints", "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2023-04-04T09:50:52+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { - "name": "psr/log", - "version": "1.1.4", + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL-3.0-or-later" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", "keywords": [ - "log", - "psr", - "psr-3" + "compatibility", + "phpcs", + "standards" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2019-12-27T09:44:58+00:00" }, { - "name": "sebastian/cli-parser", - "version": "1.0.2", + "name": "phpdocumentor/flyfinder", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + "url": "https://github.com/phpDocumentor/FlyFinder.git", + "reference": "6e145e676d9fbade7527fd8d4c99ab36b687b958" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "url": "https://api.github.com/repos/phpDocumentor/FlyFinder/zipball/6e145e676d9fbade7527fd8d4c99ab36b687b958", + "reference": "6e145e676d9fbade7527fd8d4c99ab36b687b958", "shasum": "" }, "require": { - "php": ">=7.3" + "league/flysystem": "^1.0", + "php": "^7.2||^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "league/flysystem-memory": "~1", + "mockery/mockery": "^1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Flyfinder\\": [ + "src/" + ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } + "description": "Flysystem plugin to add file finding capabilities to the Filesystem entity", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "Flysystem", + "phpdoc" ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + "issues": "https://github.com/phpDocumentor/FlyFinder/issues", + "source": "https://github.com/phpDocumentor/FlyFinder/tree/1.1.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:27:43+00:00" + "time": "2021-06-04T13:44:40+00:00" }, { - "name": "sebastian/code-unit", - "version": "1.0.8", + "name": "phpdocumentor/graphviz", + "version": "2.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "url": "https://github.com/phpDocumentor/GraphViz.git", + "reference": "115999dc7f31f2392645aa825a94a6b165e1cedf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/phpDocumentor/GraphViz/zipball/115999dc7f31f2392645aa825a94a6b165e1cedf", + "reference": "115999dc7f31f2392645aa825a94a6b165e1cedf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "ext-simplexml": "*", + "mockery/mockery": "^1.2", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^8.2 || ^9.2", + "psalm/phar": "^4.15" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\GraphViz\\": "src/phpDocumentor/GraphViz", + "phpDocumentor\\GraphViz\\PHPStan\\": "./src/phpDocumentor/PHPStan" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" } ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", + "description": "Wrapper for Graphviz", "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "issues": "https://github.com/phpDocumentor/GraphViz/issues", + "source": "https://github.com/phpDocumentor/GraphViz/tree/2.1.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2021-12-13T19:03:21+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "name": "phpdocumentor/phpdocumentor", + "version": "v3.1.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "url": "https://github.com/phpDocumentor/phpDocumentor.git", + "reference": "888fd76678506f9638e955218465bada0048e40a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/phpDocumentor/phpDocumentor/zipball/888fd76678506f9638e955218465bada0048e40a", + "reference": "888fd76678506f9638e955218465bada0048e40a", "shasum": "" }, "require": { - "php": ">=7.3" + "doctrine/event-manager": "^1.1", + "doctrine/lexer": "^1.2", + "ext-ctype": "*", + "ext-hash": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "jawira/plantuml": "^1.27", + "jean85/pretty-package-versions": "^1.5 || ^2.0.1", + "league/commonmark": "^1.5", + "league/flysystem": "^1.0", + "league/pipeline": "^1.0", + "league/tactician": "^1.0", + "league/tactician-bundle": "^1.2", + "league/uri": "^6.0", + "league/uri-interfaces": "^2.0", + "php": ">=7.2.5||^8.0", + "phpdocumentor/flyfinder": "^1.0", + "phpdocumentor/graphviz": "^2.0", + "phpdocumentor/reflection": "^5.0", + "phpdocumentor/reflection-common": "^2.0", + "phpdocumentor/reflection-docblock": "^5.0", + "phpdocumentor/type-resolver": "^1.0", + "psr/cache": "^1.0", + "psr/log": "^1.1", + "symfony/cache": "^5.0", + "symfony/config": "^5.0", + "symfony/console": "^5.0", + "symfony/contracts": "^2.0", + "symfony/dependency-injection": "^5.0", + "symfony/dom-crawler": "5.2.*", + "symfony/dotenv": "^5.0", + "symfony/event-dispatcher": "^5.0", + "symfony/expression-language": "^5.0", + "symfony/filesystem": "^5.0", + "symfony/finder": "5.3.*", + "symfony/flex": "^1.3.1", + "symfony/framework-bundle": "^5.0", + "symfony/http-foundation": "^5.0.7", + "symfony/http-kernel": "^5.0.8", + "symfony/monolog-bundle": "^3.0", + "symfony/polyfill-intl-idn": "^1.22", + "symfony/process": "5.3.*", + "symfony/routing": "^5.0", + "symfony/stopwatch": "^5.0", + "symfony/string": "5.3.*", + "symfony/yaml": "^5.0", + "twig/twig": "~2.0", + "webmozart/assert": "^1.3" + }, + "conflict": { + "symfony/symfony": "*" + }, + "replace": { + "paragonie/random_compat": "2.*", + "symfony/polyfill-iconv": "*", + "symfony/polyfill-php56": "*", + "symfony/polyfill-php70": "*", + "symfony/polyfill-php71": "*", + "symfony/polyfill-php72": "*" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "fzaninotto/faker": "^1.9", + "mikey179/vfsstream": "^1.2", + "mockery/mockery": "^1.0" }, + "bin": [ + "bin/phpdoc.php", + "bin/phpdoc" + ], "type": "library", "extra": { + "symfony": { + "id": "01C32VS9393M1CP9R8TEJMH62G", + "require": "^5.0", + "allow-contrib": false + }, "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\": [ + "src/phpDocumentor/" + ], + "phpDocumentor\\Guides\\": "src/Guides/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } + "description": "Documentation Generator for PHP", + "homepage": "https://www.phpdoc.org", + "keywords": [ + "api", + "application", + "dga", + "documentation", + "phpdoc" ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "issues": "https://github.com/phpDocumentor/phpDocumentor/issues", + "source": "https://github.com/phpDocumentor/phpDocumentor/tree/v3.1.2" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2021-08-31T20:17:41+00:00" }, { - "name": "sebastian/comparator", - "version": "4.0.8", + "name": "phpdocumentor/reflection", + "version": "5.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "url": "https://github.com/phpDocumentor/Reflection.git", + "reference": "936e4dde326e6ba42feb46cb7a89688a9425356f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/phpDocumentor/Reflection/zipball/936e4dde326e6ba42feb46cb7a89688a9425356f", + "reference": "936e4dde326e6ba42feb46cb7a89688a9425356f", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "nikic/php-parser": "^4.13", + "php": ">=7.2", + "phpdocumentor/reflection-common": "^2.1", + "phpdocumentor/reflection-docblock": "^5", + "phpdocumentor/type-resolver": "^1.2", + "psr/log": "~1.0", + "webmozart/assert": "^1.7" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "mikey179/vfsstream": "~1.2", + "mockery/mockery": "~1.3.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-4.x": "5.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\": "src/phpDocumentor" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } + "MIT" ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", + "description": "Reflection library to do Static Analysis for PHP Projects", + "homepage": "http://www.phpdoc.org", "keywords": [ - "comparator", - "compare", - "equality" + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" ], "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "issues": "https://github.com/phpDocumentor/Reflection/issues", + "source": "https://github.com/phpDocumentor/Reflection/tree/5.2.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2022-04-02T19:58:37+00:00" }, { - "name": "sebastian/complexity", - "version": "2.0.3", + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-22T06:19:30+00:00" + "time": "2020-06-27T09:03:43+00:00" }, { - "name": "sebastian/diff", - "version": "4.0.6", + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { - "php": ">=7.3" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "5.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" }, { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { - "name": "sebastian/environment", - "version": "5.1.5", + "name": "phpdocumentor/type-resolver", + "version": "1.12.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195", + "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195", "shasum": "" }, "require": { - "php": ">=7.3" + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.18|^2.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.12.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2025-11-21T15:09:14+00:00" }, { - "name": "sebastian/exporter", - "version": "4.0.6", + "name": "phpstan/phpdoc-parser", + "version": "1.33.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" + "MIT" ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2024-10-13T11:25:22+00:00" }, { - "name": "sebastian/global-state", - "version": "5.0.7", + "name": "phpunit/php-code-coverage", + "version": "9.2.32", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { - "ext-uopz": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -3704,17 +4409,21 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "global state" + "coverage", + "testing", + "xunit" ], "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -3722,24 +4431,23 @@ "type": "github" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2024-08-22T04:23:01+00:00" }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.4", + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -3748,7 +4456,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3767,11 +4475,15 @@ "role": "lead" } ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, "funding": [ { @@ -3779,34 +4491,36 @@ "type": "github" } ], - "time": "2023-12-22T06:20:34+00:00" + "time": "2021-12-02T12:48:52+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "4.0.4", + "name": "phpunit/php-invoker", + "version": "3.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=7.3" }, "require-dev": { + "ext-pcntl": "*", "phpunit/phpunit": "^9.3" }, + "suggest": { + "ext-pcntl": "*" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3821,14 +4535,18 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" }, "funding": [ { @@ -3836,20 +4554,20 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2020-09-28T05:58:55+00:00" }, { - "name": "sebastian/object-reflector", + "name": "phpunit/php-text-template", "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { @@ -3876,14 +4594,18 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, "funding": [ { @@ -3891,20 +4613,20 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2020-10-26T05:33:50+00:00" }, { - "name": "sebastian/recursion-context", - "version": "4.0.5", + "name": "phpunit/php-timer", + "version": "5.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { @@ -3916,7 +4638,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -3931,22 +4653,18 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" }, "funding": [ { @@ -3954,35 +4672,68 @@ "type": "github" } ], - "time": "2023-02-03T06:07:39+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { - "name": "sebastian/resource-operations", - "version": "3.0.4", + "name": "phpunit/phpunit", + "version": "9.6.31", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "945d0b7f346a084ce5549e95289962972c4272e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/945d0b7f346a084ce5549e95289962972c4272e5", + "reference": "945d0b7f346a084ce5549e95289962972c4272e5", "shasum": "" }, "require": { - "php": ">=7.3" + "doctrine/instantiator": "^1.5.0 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.9", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.8", + "sebastian/global-state": "^5.0.8", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", + "sebastian/version": "^3.0.2" }, - "require-dev": { - "phpunit/phpunit": "^9.0" + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-master": "9.6-dev" } }, "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], "classmap": [ "src/" ] @@ -3994,99 +4745,123 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.31" }, "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2024-03-14T16:00:52+00:00" + "time": "2025-12-06T07:45:52+00:00" }, { - "name": "sebastian/type", - "version": "3.2.1", + "name": "psr/http-message", + "version": "1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "url": "https://github.com/php-fig/http-message.git", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { - "name": "sebastian/version", - "version": "3.0.2", + "name": "sebastian/cli-parser", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { "php": ">=7.3" }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -4105,11 +4880,11 @@ "role": "lead" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -4117,1418 +4892,1095 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.13.2", + "name": "sebastian/code-unit", + "version": "1.0.8", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5b5e3821314f947dd040c70f7992a64eac89025c" + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c", - "reference": "5b5e3821314f947dd040c70f7992a64eac89025c", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + "phpunit/phpunit": "^9.3" }, - "bin": [ - "bin/phpcbf", - "bin/phpcs" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "1.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { - "name": "Greg Sherwood", - "role": "Former lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "Current lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { - "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", - "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", - "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" }, "funding": [ { - "url": "https://github.com/PHPCSStandards", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - }, - { - "url": "https://thanks.dev/u/gh/phpcsstandards", - "type": "thanks_dev" } ], - "time": "2025-06-17T22:17:01+00:00" + "time": "2020-10-26T13:08:54+00:00" }, { - "name": "symfony/cache", - "version": "v5.4.46", + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/symfony/cache.git", - "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", - "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/cache": "^1.0|^2.0", - "psr/log": "^1.1|^2|^3", - "symfony/cache-contracts": "^1.1.7|^2", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/var-exporter": "^4.4|^5.0|^6.0" - }, - "conflict": { - "doctrine/dbal": "<2.13.1", - "symfony/dependency-injection": "<4.4", - "symfony/http-kernel": "<4.4", - "symfony/var-dumper": "<4.4" - }, - "provide": { - "psr/cache-implementation": "1.0|2.0", - "psr/simple-cache-implementation": "1.0|2.0", - "symfony/cache-implementation": "1.0|2.0" + "php": ">=7.3" }, "require-dev": { - "cache/integration-tests": "dev-master", - "doctrine/cache": "^1.6|^2.0", - "doctrine/dbal": "^2.13.1|^3|^4", - "predis/predis": "^1.1|^2.0", - "psr/simple-cache": "^1.0|^2.0", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Cache\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", - "homepage": "https://symfony.com", - "keywords": [ - "caching", - "psr6" - ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { - "source": "https://github.com/symfony/cache/tree/v5.4.46" + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-11-04T11:43:55+00:00" + "time": "2020-09-28T05:30:19+00:00" }, { - "name": "symfony/config", - "version": "v5.4.46", + "name": "sebastian/comparator", + "version": "4.0.9", "source": { "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "977c88a02d7d3f16904a81907531b19666a08e78" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/977c88a02d7d3f16904a81907531b19666a08e78", - "reference": "977c88a02d7d3f16904a81907531b19666a08e78", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22" - }, - "conflict": { - "symfony/finder": "<4.4" + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" }, "require-dev": { - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/yaml": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" } ], - "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", - "homepage": "https://symfony.com", + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], "support": { - "source": "https://github.com/symfony/config/tree/v5.4.46" + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" + "url": "https://github.com/sebastianbergmann", + "type": "github" }, { - "url": "https://github.com/fabpot", - "type": "github" + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", "type": "tidelift" } ], - "time": "2024-10-30T07:58:02+00:00" + "time": "2025-08-10T06:51:50+00:00" }, { - "name": "symfony/console", - "version": "v5.4.47", + "name": "sebastian/complexity", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", - "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", "support": { - "source": "https://github.com/symfony/console/tree/v5.4.47" + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-11-06T11:30:55+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { - "name": "symfony/contracts", - "version": "v2.5.5", + "name": "sebastian/diff", + "version": "4.0.6", "source": { "type": "git", - "url": "https://github.com/symfony/contracts.git", - "reference": "4d727f81a7eede1a3021fc93f02c1cc7ccb32abd" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/contracts/zipball/4d727f81a7eede1a3021fc93f02c1cc7ccb32abd", - "reference": "4d727f81a7eede1a3021fc93f02c1cc7ccb32abd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/cache": "^1.0|^2.0|^3.0", - "psr/container": "^1.1", - "psr/event-dispatcher": "^1.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "replace": { - "symfony/cache-contracts": "self.version", - "symfony/deprecation-contracts": "self.version", - "symfony/event-dispatcher-contracts": "self.version", - "symfony/http-client-contracts": "self.version", - "symfony/service-contracts": "self.version", - "symfony/translation-contracts": "self.version" + "php": ">=7.3" }, "require-dev": { - "symfony/polyfill-intl-idn": "^1.10" - }, - "suggest": { - "symfony/cache-implementation": "", - "symfony/event-dispatcher-implementation": "", - "symfony/http-client-implementation": "", - "symfony/service-implementation": "", - "symfony/translation-implementation": "" + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-master": "4.0-dev" } }, "autoload": { - "files": [ - "Deprecation/function.php" - ], - "psr-4": { - "Symfony\\Contracts\\": "" - }, - "exclude-from-classmap": [ - "**/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], - "description": "A set of abstractions extracted out of the Symfony components", - "homepage": "https://symfony.com", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "diff", + "udiff", + "unidiff", + "unified diff" ], "support": { - "source": "https://github.com/symfony/contracts/tree/v2.5.5" + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-11-28T08:37:04+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { - "name": "symfony/dependency-injection", - "version": "v5.4.48", + "name": "sebastian/environment", + "version": "5.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "e5ca16dee39ef7d63e552ff0bf0a2526a1142c92" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e5ca16dee39ef7d63e552ff0bf0a2526a1142c92", - "reference": "e5ca16dee39ef7d63e552ff0bf0a2526a1142c92", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22", - "symfony/service-contracts": "^1.1.6|^2" - }, - "conflict": { - "ext-psr": "<1.1|>=2", - "symfony/config": "<5.3", - "symfony/finder": "<4.4", - "symfony/proxy-manager-bridge": "<4.4", - "symfony/yaml": "<4.4.26" - }, - "provide": { - "psr/container-implementation": "1.0", - "symfony/service-implementation": "1.0|2.0" + "php": ">=7.3" }, "require-dev": { - "symfony/config": "^5.3|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4.26|^5.0|^6.0" + "phpunit/phpunit": "^9.3" }, "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "ext-posix": "*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, + "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Allows you to standardize and centralize the way objects are constructed in your application", - "homepage": "https://symfony.com", + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.4.48" + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-11-20T10:51:57+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { - "name": "symfony/dom-crawler", - "version": "v5.2.12", + "name": "sebastian/exporter", + "version": "4.0.8", "source": { "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "c983279c00f723eef8da2a4b1522296c82dc75da" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c983279c00f723eef8da2a4b1522296c82dc75da", - "reference": "c983279c00f723eef8da2a4b1522296c82dc75da", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/14c6ba52f95a36c3d27c835d65efc7123c446e8c", + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "masterminds/html5": "<2.6" + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "masterminds/html5": "^2.6", - "symfony/css-selector": "^4.4|^5.0" - }, - "suggest": { - "symfony/css-selector": "" + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Eases DOM navigation for HTML and XML documents", - "homepage": "https://symfony.com", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.2.12" + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.8" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" + "url": "https://github.com/sebastianbergmann", + "type": "github" }, { - "url": "https://github.com/fabpot", - "type": "github" + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", "type": "tidelift" } ], - "time": "2021-07-23T15:54:19+00:00" + "time": "2025-09-24T06:03:27+00:00" }, { - "name": "symfony/dotenv", - "version": "v5.4.48", + "name": "sebastian/global-state", + "version": "5.0.8", "source": { "type": "git", - "url": "https://github.com/symfony/dotenv.git", - "reference": "08013403089c8a126c968179179b817a552841ab" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/08013403089c8a126c968179179b817a552841ab", - "reference": "08013403089c8a126c968179179b817a552841ab", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0" + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Dotenv\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Registers environment variables from a .env file", - "homepage": "https://symfony.com", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "dotenv", - "env", - "environment" + "global state" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v5.4.48" + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" + "url": "https://github.com/sebastianbergmann", + "type": "github" }, { - "url": "https://github.com/fabpot", - "type": "github" + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", "type": "tidelift" } ], - "time": "2024-11-27T09:33:00+00:00" + "time": "2025-08-10T07:10:35+00:00" }, { - "name": "symfony/error-handler", - "version": "v5.4.46", + "name": "sebastian/lines-of-code", + "version": "1.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/error-handler.git", - "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/d19ede7a2cafb386be9486c580649d0f9e3d0363", - "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/log": "^1|^2|^3", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-kernel": "^4.4|^5.0|^6.0", - "symfony/serializer": "^4.4|^5.0|^6.0" + "phpunit/phpunit": "^9.3" }, - "bin": [ - "Resources/bin/patch-type-declarations" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\ErrorHandler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides tools to manage errors and ease debugging PHP code", - "homepage": "https://symfony.com", + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.46" + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-11-05T14:17:06+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v5.4.45", + "name": "sebastian/object-enumerator", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9", - "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<4.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" }, "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.45" + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2020-10-26T13:12:34+00:00" }, { - "name": "symfony/expression-language", - "version": "v5.4.45", + "name": "sebastian/object-reflector", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/expression-language.git", - "reference": "a784b66edc4c151eb05076d04707906ee2c209a9" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/a784b66edc4c151eb05076d04707906ee2c209a9", - "reference": "a784b66edc4c151eb05076d04707906ee2c209a9", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\ExpressionLanguage\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Provides an engine that can compile and evaluate expressions", - "homepage": "https://symfony.com", + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { - "source": "https://github.com/symfony/expression-language/tree/v5.4.45" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-10-04T14:55:40+00:00" + "time": "2020-10-26T13:14:26+00:00" }, { - "name": "symfony/filesystem", - "version": "v5.4.45", + "name": "sebastian/recursion-context", + "version": "4.0.6", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "57c8294ed37d4a055b77057827c67f9558c95c54" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/57c8294ed37d4a055b77057827c67f9558c95c54", - "reference": "57c8294ed37d4a055b77057827c67f9558c95c54", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "php": ">=7.3" }, "require-dev": { - "symfony/process": "^5.4|^6.4" + "phpunit/phpunit": "^9.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.45" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" + "url": "https://github.com/sebastianbergmann", + "type": "github" }, { - "url": "https://github.com/fabpot", - "type": "github" + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", "type": "tidelift" } ], - "time": "2024-10-22T13:05:35+00:00" + "time": "2025-08-10T06:57:39+00:00" }, { - "name": "symfony/finder", - "version": "v5.3.14", + "name": "sebastian/resource-operations", + "version": "3.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "5ab1855ebe36c381ccde572f110f3280f88babf5" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/5ab1855ebe36c381ccde572f110f3280f88babf5", - "reference": "5ab1855ebe36c381ccde572f110f3280f88babf5", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "source": "https://github.com/symfony/finder/tree/v5.3.14" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2022-01-02T09:51:59+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { - "name": "symfony/flex", - "version": "v1.22.0", + "name": "sebastian/type", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/symfony/flex.git", - "reference": "5cc985971b1a700cb74bedd9e01cfa93eb4747f7" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/5cc985971b1a700cb74bedd9e01cfa93eb4747f7", - "reference": "5cc985971b1a700cb74bedd9e01cfa93eb4747f7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0|^2.0", - "php": ">=7.1" - }, - "conflict": { - "composer/semver": "<1.7.2" + "php": ">=7.3" }, "require-dev": { - "composer/composer": "^1.0.2|^2.0", - "symfony/dotenv": "^4.4|^5.0|^6.0", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/phpunit-bridge": "^4.4.12|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0" + "phpunit/phpunit": "^9.5" }, - "type": "composer-plugin", + "type": "library", "extra": { - "class": "Symfony\\Flex\\Flex" + "branch-alias": { + "dev-master": "3.2-dev" + } }, "autoload": { - "psr-4": { - "Symfony\\Flex\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien.potencier@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Composer plugin for Symfony", + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/symfony/flex/issues", - "source": "https://github.com/symfony/flex/tree/v1.22.0" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2025-03-03T07:50:24+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { - "name": "symfony/framework-bundle", - "version": "v5.4.45", + "name": "sebastian/version", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/framework-bundle.git", - "reference": "3d70f14176422d4d8ee400b6acae4e21f7c25ca2" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/3d70f14176422d4d8ee400b6acae4e21f7c25ca2", - "reference": "3d70f14176422d4d8ee400b6acae4e21f7c25ca2", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "ext-xml": "*", - "php": ">=7.2.5", - "symfony/cache": "^5.2|^6.0", - "symfony/config": "^5.3|^6.0", - "symfony/dependency-injection": "^5.4.44|^6.0.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/error-handler": "^4.4.1|^5.0.1|^6.0", - "symfony/event-dispatcher": "^5.1|^6.0", - "symfony/filesystem": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^5.4.24|^6.2.11", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/polyfill-php81": "^1.22", - "symfony/routing": "^5.3|^6.0" - }, - "conflict": { - "doctrine/annotations": "<1.13.1", - "doctrine/cache": "<1.11", - "doctrine/persistence": "<1.3", - "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", - "symfony/asset": "<5.3", - "symfony/console": "<5.2.5|>=7.0", - "symfony/dom-crawler": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/form": "<5.2", - "symfony/http-client": "<4.4", - "symfony/lock": "<4.4", - "symfony/mailer": "<5.2", - "symfony/messenger": "<5.4", - "symfony/mime": "<4.4", - "symfony/property-access": "<5.3", - "symfony/property-info": "<4.4", - "symfony/runtime": "<5.4.45|>=6.0,<6.4.13|>=7.0,<7.1.6", - "symfony/security-csrf": "<5.3", - "symfony/serializer": "<5.2", - "symfony/service-contracts": ">=3.0", - "symfony/stopwatch": "<4.4", - "symfony/translation": "<5.3", - "symfony/twig-bridge": "<4.4", - "symfony/twig-bundle": "<4.4", - "symfony/validator": "<5.3.11", - "symfony/web-profiler-bundle": "<4.4", - "symfony/workflow": "<5.2" - }, - "require-dev": { - "doctrine/annotations": "^1.13.1|^2", - "doctrine/cache": "^1.11|^2.0", - "doctrine/persistence": "^1.3|^2|^3", - "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "symfony/asset": "^5.3|^6.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/console": "^5.4.9|^6.0.9", - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/dom-crawler": "^4.4.30|^5.3.7|^6.0", - "symfony/dotenv": "^5.1|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/form": "^5.2|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/mailer": "^5.2|^6.0", - "symfony/messenger": "^5.4|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/notifier": "^5.4|^6.0", - "symfony/polyfill-intl-icu": "~1.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/property-info": "^4.4|^5.0|^6.0", - "symfony/rate-limiter": "^5.2|^6.0", - "symfony/security-bundle": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/string": "^5.0|^6.0", - "symfony/translation": "^5.3|^6.0", - "symfony/twig-bundle": "^4.4|^5.0|^6.0", - "symfony/validator": "^5.3.11|^6.0", - "symfony/web-link": "^4.4|^5.0|^6.0", - "symfony/workflow": "^5.2|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0", - "twig/twig": "^2.10|^3.0.4" + "php": ">=7.3" }, - "suggest": { - "ext-apcu": "For best performance of the system caches", - "symfony/console": "For using the console commands", - "symfony/form": "For using forms", - "symfony/property-info": "For using the property_info service", - "symfony/serializer": "For using the serializer service", - "symfony/validator": "For using validation", - "symfony/web-link": "For using web links, features such as preloading, prefetching or prerendering", - "symfony/yaml": "For using the debug:config and lint:yaml commands" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } }, - "type": "symfony-bundle", "autoload": { - "psr-4": { - "Symfony\\Bundle\\FrameworkBundle\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", - "homepage": "https://symfony.com", + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v5.4.45" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2024-10-22T13:05:35+00:00" + "time": "2020-09-28T06:39:44+00:00" }, { - "name": "symfony/http-foundation", - "version": "v5.4.48", + "name": "squizlabs/php_codesniffer", + "version": "3.13.5", "source": { "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "3f38b8af283b830e1363acd79e5bc3412d055341" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3f38b8af283b830e1363acd79e5bc3412d055341", - "reference": "3f38b8af283b830e1363acd79e5bc3412d055341", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4", + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php80": "^1.16" + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" }, "require-dev": { - "predis/predis": "^1.0|^2.0", - "symfony/cache": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/rate-limiter": "^5.2|^6.0" - }, - "suggest": { - "symfony/mime": "To use the file extension guesser" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Greg Sherwood", + "role": "Former lead" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], - "description": "Defines an object-oriented layer for the HTTP specification", - "homepage": "https://symfony.com", + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.48" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" + "url": "https://github.com/PHPCSStandards", + "type": "github" }, { - "url": "https://github.com/fabpot", + "url": "https://github.com/jrfnl", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-11-13T18:58:02+00:00" + "time": "2025-11-04T16:30:35+00:00" }, { - "name": "symfony/http-kernel", - "version": "v5.4.48", + "name": "symfony/cache", + "version": "v5.4.46", "source": { "type": "git", - "url": "https://github.com/symfony/http-kernel.git", - "reference": "c2dbfc92b851404567160d1ecf3fb7d9b7bde9b0" + "url": "https://github.com/symfony/cache.git", + "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c2dbfc92b851404567160d1ecf3fb7d9b7bde9b0", - "reference": "c2dbfc92b851404567160d1ecf3fb7d9b7bde9b0", + "url": "https://api.github.com/repos/symfony/cache/zipball/0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", + "reference": "0fe08ee32cec2748fbfea10c52d3ee02049e0f6b", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/log": "^1|^2", + "psr/cache": "^1.0|^2.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^1.1.7|^2", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^5.0|^6.0", - "symfony/http-foundation": "^5.4.21|^6.2.7", - "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, "conflict": { - "symfony/browser-kit": "<5.4", - "symfony/cache": "<5.0", - "symfony/config": "<5.0", - "symfony/console": "<4.4", - "symfony/dependency-injection": "<5.3", - "symfony/doctrine-bridge": "<5.0", - "symfony/form": "<5.0", - "symfony/http-client": "<5.0", - "symfony/mailer": "<5.0", - "symfony/messenger": "<5.0", - "symfony/translation": "<5.0", - "symfony/twig-bridge": "<5.0", - "symfony/validator": "<5.0", - "twig/twig": "<2.13" + "doctrine/dbal": "<2.13.1", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/cache-implementation": "1.0|2.0", + "psr/simple-cache-implementation": "1.0|2.0", + "symfony/cache-implementation": "1.0|2.0" }, "require-dev": { - "psr/cache": "^1.0|^2.0|^3.0", - "symfony/browser-kit": "^5.4|^6.0", - "symfony/config": "^5.0|^6.0", - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/css-selector": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^5.3|^6.0", - "symfony/dom-crawler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client-contracts": "^1.1|^2|^3", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/routing": "^4.4|^5.0|^6.0", - "symfony/stopwatch": "^4.4|^5.0|^6.0", - "symfony/translation": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2|^3", - "symfony/var-dumper": "^4.4.31|^5.4", - "twig/twig": "^2.13|^3.0.4" - }, - "suggest": { - "symfony/browser-kit": "", - "symfony/config": "", - "symfony/console": "", - "symfony/dependency-injection": "" + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6|^2.0", + "doctrine/dbal": "^2.13.1|^3|^4", + "predis/predis": "^1.1|^2.0", + "psr/simple-cache": "^1.0|^2.0", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\HttpKernel\\": "" + "Symfony\\Component\\Cache\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5540,18 +5992,22 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a structured process for converting a Request into a Response", + "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.48" + "source": "https://github.com/symfony/cache/tree/v5.4.46" }, "funding": [ { @@ -5567,52 +6023,47 @@ "type": "tidelift" } ], - "time": "2024-11-27T12:43:17+00:00" + "time": "2024-11-04T11:43:55+00:00" }, { - "name": "symfony/monolog-bridge", - "version": "v5.4.45", + "name": "symfony/config", + "version": "v5.4.46", "source": { "type": "git", - "url": "https://github.com/symfony/monolog-bridge.git", - "reference": "cf7d75d4d64a41fbb1c0e92301bec404134fa84b" + "url": "https://github.com/symfony/config.git", + "reference": "977c88a02d7d3f16904a81907531b19666a08e78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/cf7d75d4d64a41fbb1c0e92301bec404134fa84b", - "reference": "cf7d75d4d64a41fbb1c0e92301bec404134fa84b", + "url": "https://api.github.com/repos/symfony/config/zipball/977c88a02d7d3f16904a81907531b19666a08e78", + "reference": "977c88a02d7d3f16904a81907531b19666a08e78", "shasum": "" }, "require": { - "monolog/monolog": "^1.25.1|^2", "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/http-kernel": "^5.3|^6.0", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3" + "symfony/polyfill-php81": "^1.22" }, "conflict": { - "symfony/console": "<4.4", - "symfony/http-foundation": "<5.3" + "symfony/finder": "<4.4" }, "require-dev": { - "symfony/console": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/mailer": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", "symfony/messenger": "^4.4|^5.0|^6.0", - "symfony/mime": "^4.4|^5.0|^6.0", - "symfony/security-core": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" }, "suggest": { - "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings.", - "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.", - "symfony/var-dumper": "For using the debugging handlers like the console handler or the log server handler." + "symfony/yaml": "To use the yaml reference dumper" }, - "type": "symfony-bridge", + "type": "library", "autoload": { "psr-4": { - "Symfony\\Bridge\\Monolog\\": "" + "Symfony\\Component\\Config\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5632,10 +6083,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Provides integration for Monolog with various Symfony components", + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/monolog-bridge/tree/v5.4.45" + "source": "https://github.com/symfony/config/tree/v5.4.46" }, "funding": [ { @@ -5651,44 +6102,57 @@ "type": "tidelift" } ], - "time": "2024-10-10T06:37:45+00:00" + "time": "2024-10-30T07:58:02+00:00" }, { - "name": "symfony/monolog-bundle", - "version": "v3.10.0", + "name": "symfony/dependency-injection", + "version": "v5.4.48", "source": { "type": "git", - "url": "https://github.com/symfony/monolog-bundle.git", - "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181" + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "e5ca16dee39ef7d63e552ff0bf0a2526a1142c92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", - "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e5ca16dee39ef7d63e552ff0bf0a2526a1142c92", + "reference": "e5ca16dee39ef7d63e552ff0bf0a2526a1142c92", "shasum": "" }, "require": { - "monolog/monolog": "^1.25.1 || ^2.0 || ^3.0", "php": ">=7.2.5", - "symfony/config": "^5.4 || ^6.0 || ^7.0", - "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", - "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0", - "symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0" + "psr/container": "^1.1.1", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22", + "symfony/service-contracts": "^1.1.6|^2" + }, + "conflict": { + "ext-psr": "<1.1|>=2", + "symfony/config": "<5.3", + "symfony/finder": "<4.4", + "symfony/proxy-manager-bridge": "<4.4", + "symfony/yaml": "<4.4.26" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0|2.0" }, "require-dev": { - "symfony/console": "^5.4 || ^6.0 || ^7.0", - "symfony/phpunit-bridge": "^6.3 || ^7.0", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + "symfony/config": "^5.3|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4.26|^5.0|^6.0" }, - "type": "symfony-bundle", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" }, + "type": "library", "autoload": { "psr-4": { - "Symfony\\Bundle\\MonologBundle\\": "" + "Symfony\\Component\\DependencyInjection\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -5708,15 +6172,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony MonologBundle", + "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", - "keywords": [ - "log", - "logging" - ], "support": { - "issues": "https://github.com/symfony/monolog-bundle/issues", - "source": "https://github.com/symfony/monolog-bundle/tree/v3.10.0" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.48" }, "funding": [ { @@ -5732,45 +6191,46 @@ "type": "tidelift" } ], - "time": "2023-11-06T17:08:13+00:00" + "time": "2024-11-20T10:51:57+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.32.0", + "name": "symfony/dom-crawler", + "version": "v5.2.12", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "c983279c00f723eef8da2a4b1522296c82dc75da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", - "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c983279c00f723eef8da2a4b1522296c82dc75da", + "reference": "c983279c00f723eef8da2a4b1522296c82dc75da", "shasum": "" }, "require": { - "php": ">=7.2" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16" }, - "provide": { - "ext-ctype": "*" + "conflict": { + "masterminds/html5": "<2.6" + }, + "require-dev": { + "masterminds/html5": "^2.6", + "symfony/css-selector": "^4.4|^5.0" }, "suggest": { - "ext-ctype": "For best performance" + "symfony/css-selector": "" }, "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5778,24 +6238,18 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" + "source": "https://github.com/symfony/dom-crawler/tree/v5.2.12" }, "funding": [ { @@ -5811,42 +6265,38 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2021-07-23T15:54:19+00:00" }, { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.32.0", + "name": "symfony/dotenv", + "version": "v5.4.48", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" + "url": "https://github.com/symfony/dotenv.git", + "reference": "08013403089c8a126c968179179b817a552841ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", - "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/08013403089c8a126c968179179b817a552841ab", + "reference": "08013403089c8a126c968179179b817a552841ab", "shasum": "" }, "require": { - "php": ">=7.2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3" }, - "suggest": { - "ext-intl": "For best performance" + "require-dev": { + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0" }, "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } + "Symfony\\Component\\Dotenv\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5854,26 +6304,23 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's grapheme_* functions", + "description": "Registers environment variables from a .env file", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" + "dotenv", + "env", + "environment" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" + "source": "https://github.com/symfony/dotenv/tree/v5.4.48" }, "funding": [ { @@ -5889,43 +6336,43 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-11-27T09:33:00+00:00" }, { - "name": "symfony/polyfill-intl-idn", - "version": "v1.32.0", + "name": "symfony/error-handler", + "version": "v5.4.46", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3" + "url": "https://github.com/symfony/error-handler.git", + "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3", - "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/d19ede7a2cafb386be9486c580649d0f9e3d0363", + "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363", "shasum": "" }, "require": { - "php": ">=7.2", - "symfony/polyfill-intl-normalizer": "^1.10" + "php": ">=7.2.5", + "psr/log": "^1|^2|^3", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, - "suggest": { - "ext-intl": "For best performance" + "require-dev": { + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/serializer": "^4.4|^5.0|^6.0" }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - } + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5933,30 +6380,18 @@ ], "authors": [ { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.32.0" + "source": "https://github.com/symfony/error-handler/tree/v5.4.46" }, "funding": [ { @@ -5972,44 +6407,34 @@ "type": "tidelift" } ], - "time": "2024-09-10T14:38:51+00:00" + "time": "2024-11-05T14:17:06+00:00" }, { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.32.0", + "name": "symfony/expression-language", + "version": "v5.4.45", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "3833d7255cc303546435cb650316bff708a1c75c" + "url": "https://github.com/symfony/expression-language.git", + "reference": "a784b66edc4c151eb05076d04707906ee2c209a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", - "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/a784b66edc4c151eb05076d04707906ee2c209a9", + "reference": "a784b66edc4c151eb05076d04707906ee2c209a9", "shasum": "" }, "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" + "php": ">=7.2.5", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3" }, "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + "Symfony\\Component\\ExpressionLanguage\\": "" }, - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -6018,26 +6443,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", + "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" + "source": "https://github.com/symfony/expression-language/tree/v5.4.45" }, "funding": [ { @@ -6053,45 +6470,43 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-10-04T14:55:40+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.32.0", + "name": "symfony/flex", + "version": "v1.22.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + "url": "https://github.com/symfony/flex.git", + "reference": "5cc985971b1a700cb74bedd9e01cfa93eb4747f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", - "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "url": "https://api.github.com/repos/symfony/flex/zipball/5cc985971b1a700cb74bedd9e01cfa93eb4747f7", + "reference": "5cc985971b1a700cb74bedd9e01cfa93eb4747f7", "shasum": "" }, "require": { - "ext-iconv": "*", - "php": ">=7.2" + "composer-plugin-api": "^1.0|^2.0", + "php": ">=7.1" }, - "provide": { - "ext-mbstring": "*" + "conflict": { + "composer/semver": "<1.7.2" }, - "suggest": { - "ext-mbstring": "For best performance" + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "symfony/dotenv": "^4.4|^5.0|^6.0", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/phpunit-bridge": "^4.4.12|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0" }, - "type": "library", + "type": "composer-plugin", "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } + "class": "Symfony\\Flex\\Flex" }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Flex\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -6100,25 +6515,14 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Fabien Potencier", + "email": "fabien.potencier@gmail.com" } ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], + "description": "Composer plugin for Symfony", "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" + "issues": "https://github.com/symfony/flex/issues", + "source": "https://github.com/symfony/flex/tree/v1.22.0" }, "funding": [ { @@ -6134,41 +6538,122 @@ "type": "tidelift" } ], - "time": "2024-12-23T08:48:59+00:00" + "time": "2025-03-03T07:50:24+00:00" }, { - "name": "symfony/polyfill-php73", - "version": "v1.32.0", + "name": "symfony/framework-bundle", + "version": "v5.4.45", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" + "url": "https://github.com/symfony/framework-bundle.git", + "reference": "3d70f14176422d4d8ee400b6acae4e21f7c25ca2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", - "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/3d70f14176422d4d8ee400b6acae4e21f7c25ca2", + "reference": "3d70f14176422d4d8ee400b6acae4e21f7c25ca2", "shasum": "" }, "require": { - "php": ">=7.2" + "ext-xml": "*", + "php": ">=7.2.5", + "symfony/cache": "^5.2|^6.0", + "symfony/config": "^5.3|^6.0", + "symfony/dependency-injection": "^5.4.44|^6.0.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/error-handler": "^4.4.1|^5.0.1|^6.0", + "symfony/event-dispatcher": "^5.1|^6.0", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^5.4.24|^6.2.11", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22", + "symfony/routing": "^5.3|^6.0" }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } + "conflict": { + "doctrine/annotations": "<1.13.1", + "doctrine/cache": "<1.11", + "doctrine/persistence": "<1.3", + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/asset": "<5.3", + "symfony/console": "<5.2.5|>=7.0", + "symfony/dom-crawler": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/form": "<5.2", + "symfony/http-client": "<4.4", + "symfony/lock": "<4.4", + "symfony/mailer": "<5.2", + "symfony/messenger": "<5.4", + "symfony/mime": "<4.4", + "symfony/property-access": "<5.3", + "symfony/property-info": "<4.4", + "symfony/runtime": "<5.4.45|>=6.0,<6.4.13|>=7.0,<7.1.6", + "symfony/security-csrf": "<5.3", + "symfony/serializer": "<5.2", + "symfony/service-contracts": ">=3.0", + "symfony/stopwatch": "<4.4", + "symfony/translation": "<5.3", + "symfony/twig-bridge": "<4.4", + "symfony/twig-bundle": "<4.4", + "symfony/validator": "<5.3.11", + "symfony/web-profiler-bundle": "<4.4", + "symfony/workflow": "<5.2" + }, + "require-dev": { + "doctrine/annotations": "^1.13.1|^2", + "doctrine/cache": "^1.11|^2.0", + "doctrine/persistence": "^1.3|^2|^3", + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/asset": "^5.3|^6.0", + "symfony/browser-kit": "^5.4|^6.0", + "symfony/console": "^5.4.9|^6.0.9", + "symfony/css-selector": "^4.4|^5.0|^6.0", + "symfony/dom-crawler": "^4.4.30|^5.3.7|^6.0", + "symfony/dotenv": "^5.1|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/form": "^5.2|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/mailer": "^5.2|^6.0", + "symfony/messenger": "^5.4|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/notifier": "^5.4|^6.0", + "symfony/polyfill-intl-icu": "~1.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/property-info": "^4.4|^5.0|^6.0", + "symfony/rate-limiter": "^5.2|^6.0", + "symfony/security-bundle": "^5.4|^6.0", + "symfony/serializer": "^5.4|^6.0", + "symfony/stopwatch": "^4.4|^5.0|^6.0", + "symfony/string": "^5.0|^6.0", + "symfony/translation": "^5.3|^6.0", + "symfony/twig-bundle": "^4.4|^5.0|^6.0", + "symfony/validator": "^5.3.11|^6.0", + "symfony/web-link": "^4.4|^5.0|^6.0", + "symfony/workflow": "^5.2|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0", + "twig/twig": "^2.10|^3.0.4" + }, + "suggest": { + "ext-apcu": "For best performance of the system caches", + "symfony/console": "For using the console commands", + "symfony/form": "For using forms", + "symfony/property-info": "For using the property_info service", + "symfony/serializer": "For using the serializer service", + "symfony/validator": "For using validation", + "symfony/web-link": "For using web links, features such as preloading, prefetching or prerendering", + "symfony/yaml": "For using the debug:config and lint:yaml commands" }, + "type": "symfony-bundle", "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Bundle\\FrameworkBundle\\": "" }, - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -6177,24 +6662,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.32.0" + "source": "https://github.com/symfony/framework-bundle/tree/v5.4.45" }, "funding": [ { @@ -6210,41 +6689,47 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { - "name": "symfony/polyfill-php80", - "version": "v1.32.0", + "name": "symfony/http-foundation", + "version": "v5.4.50", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + "url": "https://github.com/symfony/http-foundation.git", + "reference": "1a0706e8b8041046052ea2695eb8aeee04f97609" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/1a0706e8b8041046052ea2695eb8aeee04f97609", + "reference": "1a0706e8b8041046052ea2695eb8aeee04f97609", "shasum": "" }, "require": { - "php": ">=7.2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } + "require-dev": { + "predis/predis": "^1.0|^2.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/rate-limiter": "^5.2|^6.0" }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "type": "library", "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Component\\HttpFoundation\\": "" }, - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -6253,28 +6738,18 @@ ], "authors": [ { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.50" }, "funding": [ { @@ -6285,46 +6760,93 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2025-01-02T08:10:11+00:00" + "time": "2025-11-03T12:58:48+00:00" }, { - "name": "symfony/polyfill-php81", - "version": "v1.32.0", + "name": "symfony/http-kernel", + "version": "v5.4.50", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + "url": "https://github.com/symfony/http-kernel.git", + "reference": "2fe5cf994d7e1e189258b7f7d3395cc5999a9762" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2fe5cf994d7e1e189258b7f7d3395cc5999a9762", + "reference": "2fe5cf994d7e1e189258b7f7d3395cc5999a9762", "shasum": "" }, "require": { - "php": ">=7.2" + "php": ">=7.2.5", + "psr/log": "^1|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^5.0|^6.0", + "symfony/http-foundation": "^5.4.21|^6.2.7", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16" }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } + "conflict": { + "symfony/browser-kit": "<5.4", + "symfony/cache": "<5.0", + "symfony/config": "<5.0", + "symfony/console": "<4.4", + "symfony/dependency-injection": "<5.3", + "symfony/doctrine-bridge": "<5.0", + "symfony/form": "<5.0", + "symfony/http-client": "<5.0", + "symfony/mailer": "<5.0", + "symfony/messenger": "<5.0", + "symfony/translation": "<5.0", + "symfony/twig-bridge": "<5.0", + "symfony/validator": "<5.0", + "twig/twig": "<2.13" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^5.4|^6.0", + "symfony/config": "^5.0|^6.0", + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/css-selector": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.3|^6.0", + "symfony/dom-crawler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2|^3", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/routing": "^4.4|^5.0|^6.0", + "symfony/stopwatch": "^4.4|^5.0|^6.0", + "symfony/translation": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2|^3", + "symfony/var-dumper": "^4.4.31|^5.4", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "symfony/browser-kit": "", + "symfony/config": "", + "symfony/console": "", + "symfony/dependency-injection": "" }, + "type": "library", "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -6333,24 +6855,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.50" }, "funding": [ { @@ -6361,35 +6877,61 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-11-12T11:09:00+00:00" }, { - "name": "symfony/process", - "version": "v5.3.14", + "name": "symfony/monolog-bridge", + "version": "v5.4.45", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "8bbae08c19308b9493ad235386144cbefec83cb0" + "url": "https://github.com/symfony/monolog-bridge.git", + "reference": "cf7d75d4d64a41fbb1c0e92301bec404134fa84b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8bbae08c19308b9493ad235386144cbefec83cb0", - "reference": "8bbae08c19308b9493ad235386144cbefec83cb0", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/cf7d75d4d64a41fbb1c0e92301bec404134fa84b", + "reference": "cf7d75d4d64a41fbb1c0e92301bec404134fa84b", "shasum": "" }, "require": { + "monolog/monolog": "^1.25.1|^2", "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/http-kernel": "^5.3|^6.0", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3" }, - "type": "library", + "conflict": { + "symfony/console": "<4.4", + "symfony/http-foundation": "<5.3" + }, + "require-dev": { + "symfony/console": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/mailer": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/security-core": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings.", + "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.", + "symfony/var-dumper": "For using the debugging handlers like the console handler or the log server handler." + }, + "type": "symfony-bridge", "autoload": { "psr-4": { - "Symfony\\Component\\Process\\": "" + "Symfony\\Bridge\\Monolog\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -6409,10 +6951,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Executes commands in sub-processes", + "description": "Provides integration for Monolog with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.14" + "source": "https://github.com/symfony/monolog-bridge/tree/v5.4.45" }, "funding": [ { @@ -6428,52 +6970,44 @@ "type": "tidelift" } ], - "time": "2022-01-24T19:35:44+00:00" + "time": "2024-10-10T06:37:45+00:00" }, { - "name": "symfony/routing", - "version": "v5.4.48", + "name": "symfony/monolog-bundle", + "version": "v3.10.0", "source": { "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "dd08c19879a9b37ff14fd30dcbdf99a4cf045db1" + "url": "https://github.com/symfony/monolog-bundle.git", + "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/dd08c19879a9b37ff14fd30dcbdf99a4cf045db1", - "reference": "dd08c19879a9b37ff14fd30dcbdf99a4cf045db1", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", + "reference": "414f951743f4aa1fd0f5bf6a0e9c16af3fe7f181", "shasum": "" }, "require": { + "monolog/monolog": "^1.25.1 || ^2.0 || ^3.0", "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "doctrine/annotations": "<1.12", - "symfony/config": "<5.3", - "symfony/dependency-injection": "<4.4", - "symfony/yaml": "<4.4" + "symfony/config": "^5.4 || ^6.0 || ^7.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0", + "symfony/monolog-bridge": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "doctrine/annotations": "^1.12|^2", - "psr/log": "^1|^2|^3", - "symfony/config": "^5.3|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/phpunit-bridge": "^6.3 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, - "suggest": { - "symfony/config": "For using the all-in-one router or any loader", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } }, - "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Routing\\": "" + "Symfony\\Bundle\\MonologBundle\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -6493,16 +7027,15 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Maps an HTTP request to a set of configuration variables", + "description": "Symfony MonologBundle", "homepage": "https://symfony.com", "keywords": [ - "router", - "routing", - "uri", - "url" + "log", + "logging" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.4.48" + "issues": "https://github.com/symfony/monolog-bundle/issues", + "source": "https://github.com/symfony/monolog-bundle/tree/v3.10.0" }, "funding": [ { @@ -6518,34 +7051,43 @@ "type": "tidelift" } ], - "time": "2024-11-12T18:20:21+00:00" + "time": "2023-11-06T17:08:13+00:00" }, { - "name": "symfony/stopwatch", - "version": "v5.4.45", + "name": "symfony/polyfill-intl-idn", + "version": "v1.33.0", "source": { "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004" + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fb2c199cf302eb207f8c23e7ee174c1c31a5c004", - "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3", + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6553,18 +7095,30 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a way to profile code", + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.45" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.33.0" }, "funding": [ { @@ -6575,51 +7129,61 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2024-09-25T14:11:13+00:00" + "time": "2024-09-10T14:38:51+00:00" }, { - "name": "symfony/string", - "version": "v5.3.14", + "name": "symfony/routing", + "version": "v5.4.48", "source": { "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "006fadf2d23b7b1a0ec5f3a0a5a80e1da2819c94" + "url": "https://github.com/symfony/routing.git", + "reference": "dd08c19879a9b37ff14fd30dcbdf99a4cf045db1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/006fadf2d23b7b1a0ec5f3a0a5a80e1da2819c94", - "reference": "006fadf2d23b7b1a0ec5f3a0a5a80e1da2819c94", + "url": "https://api.github.com/repos/symfony/routing/zipball/dd08c19879a9b37ff14fd30dcbdf99a4cf045db1", + "reference": "dd08c19879a9b37ff14fd30dcbdf99a4cf045db1", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "doctrine/annotations": "<1.12", + "symfony/config": "<5.3", + "symfony/dependency-injection": "<4.4", + "symfony/yaml": "<4.4" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0", - "symfony/http-client": "^4.4|^5.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0" + "doctrine/annotations": "^1.12|^2", + "psr/log": "^1|^2|^3", + "symfony/config": "^5.3|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/config": "For using the all-in-one router or any loader", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" }, "type": "library", "autoload": { - "files": [ - "Resources/functions.php" - ], "psr-4": { - "Symfony\\Component\\String\\": "" + "Symfony\\Component\\Routing\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -6631,26 +7195,24 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "description": "Maps an HTTP request to a set of configuration variables", "homepage": "https://symfony.com", "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" + "router", + "routing", + "uri", + "url" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.14" + "source": "https://github.com/symfony/routing/tree/v5.4.48" }, "funding": [ { @@ -6666,7 +7228,7 @@ "type": "tidelift" } ], - "time": "2022-01-05T13:47:22+00:00" + "time": "2024-11-12T18:20:21+00:00" }, { "name": "symfony/var-dumper", @@ -6907,16 +7469,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.3", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", "shasum": "" }, "require": { @@ -6945,7 +7507,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" }, "funding": [ { @@ -6953,7 +7515,7 @@ "type": "github" } ], - "time": "2024-03-03T12:36:25+00:00" + "time": "2025-11-17T20:03:58+00:00" }, { "name": "twig/twig", @@ -7037,28 +7599,28 @@ }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68", + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", "php": "^7.2 || ^8.0" }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { @@ -7089,9 +7651,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/1.12.1" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2025-10-29T15:56:20+00:00" }, { "name": "wikimedia/at-ease", @@ -7150,16 +7712,16 @@ }, { "name": "wp-phpunit/wp-phpunit", - "version": "6.8.1", + "version": "6.9.0", "source": { "type": "git", "url": "https://github.com/wp-phpunit/wp-phpunit.git", - "reference": "a33d328dab5a4a9ddf0c560bcadbabb58b5ee67f" + "reference": "448dc57a97c7225d2ac6271876682fca4c2ed340" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/a33d328dab5a4a9ddf0c560bcadbabb58b5ee67f", - "reference": "a33d328dab5a4a9ddf0c560bcadbabb58b5ee67f", + "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/448dc57a97c7225d2ac6271876682fca4c2ed340", + "reference": "448dc57a97c7225d2ac6271876682fca4c2ed340", "shasum": "" }, "type": "library", @@ -7194,7 +7756,7 @@ "issues": "https://github.com/wp-phpunit/issues", "source": "https://github.com/wp-phpunit/wp-phpunit" }, - "time": "2025-04-16T01:40:54+00:00" + "time": "2025-12-03T01:19:46+00:00" }, { "name": "yoast/phpunit-polyfills", @@ -7269,5 +7831,5 @@ "php": ">=5.6.0" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.1.0" } diff --git a/lib/libphonenumber/CountryCodeSource.php b/lib/libphonenumber/CountryCodeSource.php index 0459682f..142c0b01 100755 --- a/lib/libphonenumber/CountryCodeSource.php +++ b/lib/libphonenumber/CountryCodeSource.php @@ -3,7 +3,7 @@ namespace libphonenumber; /** - * Country code source from number + * Country code source from number. */ class CountryCodeSource { diff --git a/lib/libphonenumber/CountryCodeToRegionCodeMap.php b/lib/libphonenumber/CountryCodeToRegionCodeMap.php index 093baab1..9b47710a 100755 --- a/lib/libphonenumber/CountryCodeToRegionCodeMap.php +++ b/lib/libphonenumber/CountryCodeToRegionCodeMap.php @@ -10,915 +10,699 @@ * Do not modify this file directly! */ - 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 static $countryCodeToRegionCodeMap = array ( - 1 => - array ( - 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 => - array ( - 0 => 'RU', - 1 => 'KZ', - ), - 20 => - array ( - 0 => 'EG', - ), - 27 => - array ( - 0 => 'ZA', - ), - 30 => - array ( - 0 => 'GR', - ), - 31 => - array ( - 0 => 'NL', - ), - 32 => - array ( - 0 => 'BE', - ), - 33 => - array ( - 0 => 'FR', - ), - 34 => - array ( - 0 => 'ES', - ), - 36 => - array ( - 0 => 'HU', - ), - 39 => - array ( - 0 => 'IT', - 1 => 'VA', - ), - 40 => - array ( - 0 => 'RO', - ), - 41 => - array ( - 0 => 'CH', - ), - 43 => - array ( - 0 => 'AT', - ), - 44 => - array ( - 0 => 'GB', - 1 => 'GG', - 2 => 'IM', - 3 => 'JE', - ), - 45 => - array ( - 0 => 'DK', - ), - 46 => - array ( - 0 => 'SE', - ), - 47 => - array ( - 0 => 'NO', - 1 => 'SJ', - ), - 48 => - array ( - 0 => 'PL', - ), - 49 => - array ( - 0 => 'DE', - ), - 51 => - array ( - 0 => 'PE', - ), - 52 => - array ( - 0 => 'MX', - ), - 53 => - array ( - 0 => 'CU', - ), - 54 => - array ( - 0 => 'AR', - ), - 55 => - array ( - 0 => 'BR', - ), - 56 => - array ( - 0 => 'CL', - ), - 57 => - array ( - 0 => 'CO', - ), - 58 => - array ( - 0 => 'VE', - ), - 60 => - array ( - 0 => 'MY', - ), - 61 => - array ( - 0 => 'AU', - 1 => 'CC', - 2 => 'CX', - ), - 62 => - array ( - 0 => 'ID', - ), - 63 => - array ( - 0 => 'PH', - ), - 64 => - array ( - 0 => 'NZ', - ), - 65 => - array ( - 0 => 'SG', - ), - 66 => - array ( - 0 => 'TH', - ), - 81 => - array ( - 0 => 'JP', - ), - 82 => - array ( - 0 => 'KR', - ), - 84 => - array ( - 0 => 'VN', - ), - 86 => - array ( - 0 => 'CN', - ), - 90 => - array ( - 0 => 'TR', - ), - 91 => - array ( - 0 => 'IN', - ), - 92 => - array ( - 0 => 'PK', - ), - 93 => - array ( - 0 => 'AF', - ), - 94 => - array ( - 0 => 'LK', - ), - 95 => - array ( - 0 => 'MM', - ), - 98 => - array ( - 0 => 'IR', - ), - 211 => - array ( - 0 => 'SS', - ), - 212 => - array ( - 0 => 'MA', - 1 => 'EH', - ), - 213 => - array ( - 0 => 'DZ', - ), - 216 => - array ( - 0 => 'TN', - ), - 218 => - array ( - 0 => 'LY', - ), - 220 => - array ( - 0 => 'GM', - ), - 221 => - array ( - 0 => 'SN', - ), - 222 => - array ( - 0 => 'MR', - ), - 223 => - array ( - 0 => 'ML', - ), - 224 => - array ( - 0 => 'GN', - ), - 225 => - array ( - 0 => 'CI', - ), - 226 => - array ( - 0 => 'BF', - ), - 227 => - array ( - 0 => 'NE', - ), - 228 => - array ( - 0 => 'TG', - ), - 229 => - array ( - 0 => 'BJ', - ), - 230 => - array ( - 0 => 'MU', - ), - 231 => - array ( - 0 => 'LR', - ), - 232 => - array ( - 0 => 'SL', - ), - 233 => - array ( - 0 => 'GH', - ), - 234 => - array ( - 0 => 'NG', - ), - 235 => - array ( - 0 => 'TD', - ), - 236 => - array ( - 0 => 'CF', - ), - 237 => - array ( - 0 => 'CM', - ), - 238 => - array ( - 0 => 'CV', - ), - 239 => - array ( - 0 => 'ST', - ), - 240 => - array ( - 0 => 'GQ', - ), - 241 => - array ( - 0 => 'GA', - ), - 242 => - array ( - 0 => 'CG', - ), - 243 => - array ( - 0 => 'CD', - ), - 244 => - array ( - 0 => 'AO', - ), - 245 => - array ( - 0 => 'GW', - ), - 246 => - array ( - 0 => 'IO', - ), - 247 => - array ( - 0 => 'AC', - ), - 248 => - array ( - 0 => 'SC', - ), - 249 => - array ( - 0 => 'SD', - ), - 250 => - array ( - 0 => 'RW', - ), - 251 => - array ( - 0 => 'ET', - ), - 252 => - array ( - 0 => 'SO', - ), - 253 => - array ( - 0 => 'DJ', - ), - 254 => - array ( - 0 => 'KE', - ), - 255 => - array ( - 0 => 'TZ', - ), - 256 => - array ( - 0 => 'UG', - ), - 257 => - array ( - 0 => 'BI', - ), - 258 => - array ( - 0 => 'MZ', - ), - 260 => - array ( - 0 => 'ZM', - ), - 261 => - array ( - 0 => 'MG', - ), - 262 => - array ( - 0 => 'RE', - 1 => 'YT', - ), - 263 => - array ( - 0 => 'ZW', - ), - 264 => - array ( - 0 => 'NA', - ), - 265 => - array ( - 0 => 'MW', - ), - 266 => - array ( - 0 => 'LS', - ), - 267 => - array ( - 0 => 'BW', - ), - 268 => - array ( - 0 => 'SZ', - ), - 269 => - array ( - 0 => 'KM', - ), - 290 => - array ( - 0 => 'SH', - 1 => 'TA', - ), - 291 => - array ( - 0 => 'ER', - ), - 297 => - array ( - 0 => 'AW', - ), - 298 => - array ( - 0 => 'FO', - ), - 299 => - array ( - 0 => 'GL', - ), - 350 => - array ( - 0 => 'GI', - ), - 351 => - array ( - 0 => 'PT', - ), - 352 => - array ( - 0 => 'LU', - ), - 353 => - array ( - 0 => 'IE', - ), - 354 => - array ( - 0 => 'IS', - ), - 355 => - array ( - 0 => 'AL', - ), - 356 => - array ( - 0 => 'MT', - ), - 357 => - array ( - 0 => 'CY', - ), - 358 => - array ( - 0 => 'FI', - 1 => 'AX', - ), - 359 => - array ( - 0 => 'BG', - ), - 370 => - array ( - 0 => 'LT', - ), - 371 => - array ( - 0 => 'LV', - ), - 372 => - array ( - 0 => 'EE', - ), - 373 => - array ( - 0 => 'MD', - ), - 374 => - array ( - 0 => 'AM', - ), - 375 => - array ( - 0 => 'BY', - ), - 376 => - array ( - 0 => 'AD', - ), - 377 => - array ( - 0 => 'MC', - ), - 378 => - array ( - 0 => 'SM', - ), - 380 => - array ( - 0 => 'UA', - ), - 381 => - array ( - 0 => 'RS', - ), - 382 => - array ( - 0 => 'ME', - ), - 383 => - array ( - 0 => 'XK', - ), - 385 => - array ( - 0 => 'HR', - ), - 386 => - array ( - 0 => 'SI', - ), - 387 => - array ( - 0 => 'BA', - ), - 389 => - array ( - 0 => 'MK', - ), - 420 => - array ( - 0 => 'CZ', - ), - 421 => - array ( - 0 => 'SK', - ), - 423 => - array ( - 0 => 'LI', - ), - 500 => - array ( - 0 => 'FK', - ), - 501 => - array ( - 0 => 'BZ', - ), - 502 => - array ( - 0 => 'GT', - ), - 503 => - array ( - 0 => 'SV', - ), - 504 => - array ( - 0 => 'HN', - ), - 505 => - array ( - 0 => 'NI', - ), - 506 => - array ( - 0 => 'CR', - ), - 507 => - array ( - 0 => 'PA', - ), - 508 => - array ( - 0 => 'PM', - ), - 509 => - array ( - 0 => 'HT', - ), - 590 => - array ( - 0 => 'GP', - 1 => 'BL', - 2 => 'MF', - ), - 591 => - array ( - 0 => 'BO', - ), - 592 => - array ( - 0 => 'GY', - ), - 593 => - array ( - 0 => 'EC', - ), - 594 => - array ( - 0 => 'GF', - ), - 595 => - array ( - 0 => 'PY', - ), - 596 => - array ( - 0 => 'MQ', - ), - 597 => - array ( - 0 => 'SR', - ), - 598 => - array ( - 0 => 'UY', - ), - 599 => - array ( - 0 => 'CW', - 1 => 'BQ', - ), - 670 => - array ( - 0 => 'TL', - ), - 672 => - array ( - 0 => 'NF', - ), - 673 => - array ( - 0 => 'BN', - ), - 674 => - array ( - 0 => 'NR', - ), - 675 => - array ( - 0 => 'PG', - ), - 676 => - array ( - 0 => 'TO', - ), - 677 => - array ( - 0 => 'SB', - ), - 678 => - array ( - 0 => 'VU', - ), - 679 => - array ( - 0 => 'FJ', - ), - 680 => - array ( - 0 => 'PW', - ), - 681 => - array ( - 0 => 'WF', - ), - 682 => - array ( - 0 => 'CK', - ), - 683 => - array ( - 0 => 'NU', - ), - 685 => - array ( - 0 => 'WS', - ), - 686 => - array ( - 0 => 'KI', - ), - 687 => - array ( - 0 => 'NC', - ), - 688 => - array ( - 0 => 'TV', - ), - 689 => - array ( - 0 => 'PF', - ), - 690 => - array ( - 0 => 'TK', - ), - 691 => - array ( - 0 => 'FM', - ), - 692 => - array ( - 0 => 'MH', - ), - 800 => - array ( - 0 => '001', - ), - 808 => - array ( - 0 => '001', - ), - 850 => - array ( - 0 => 'KP', - ), - 852 => - array ( - 0 => 'HK', - ), - 853 => - array ( - 0 => 'MO', - ), - 855 => - array ( - 0 => 'KH', - ), - 856 => - array ( - 0 => 'LA', - ), - 870 => - array ( - 0 => '001', - ), - 878 => - array ( - 0 => '001', - ), - 880 => - array ( - 0 => 'BD', - ), - 881 => - array ( - 0 => '001', - ), - 882 => - array ( - 0 => '001', - ), - 883 => - array ( - 0 => '001', - ), - 886 => - array ( - 0 => 'TW', - ), - 888 => - array ( - 0 => '001', - ), - 960 => - array ( - 0 => 'MV', - ), - 961 => - array ( - 0 => 'LB', - ), - 962 => - array ( - 0 => 'JO', - ), - 963 => - array ( - 0 => 'SY', - ), - 964 => - array ( - 0 => 'IQ', - ), - 965 => - array ( - 0 => 'KW', - ), - 966 => - array ( - 0 => 'SA', - ), - 967 => - array ( - 0 => 'YE', - ), - 968 => - array ( - 0 => 'OM', - ), - 970 => - array ( - 0 => 'PS', - ), - 971 => - array ( - 0 => 'AE', - ), - 972 => - array ( - 0 => 'IL', - ), - 973 => - array ( - 0 => 'BH', - ), - 974 => - array ( - 0 => 'QA', - ), - 975 => - array ( - 0 => 'BT', - ), - 976 => - array ( - 0 => 'MN', - ), - 977 => - array ( - 0 => 'NP', - ), - 979 => - array ( - 0 => '001', - ), - 992 => - array ( - 0 => 'TJ', - ), - 993 => - array ( - 0 => 'TM', - ), - 994 => - array ( - 0 => 'AZ', - ), - 995 => - array ( - 0 => 'GE', - ), - 996 => - array ( - 0 => 'KG', - ), - 998 => - array ( - 0 => 'UZ', - ), -); +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 static $countryCodeToRegionCodeMap = [ + 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', + ], + ]; } diff --git a/lib/libphonenumber/CountryCodeToRegionCodeMapForTesting.php b/lib/libphonenumber/CountryCodeToRegionCodeMapForTesting.php index 030d72d3..c8de22e3 100755 --- a/lib/libphonenumber/CountryCodeToRegionCodeMapForTesting.php +++ b/lib/libphonenumber/CountryCodeToRegionCodeMapForTesting.php @@ -10,139 +10,109 @@ * Do not modify this file directly! */ - namespace libphonenumber; -class CountryCodeToRegionCodeMapForTesting { - - // 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 static $countryCodeToRegionCodeMapForTesting = array ( - 1 => - array ( - 0 => 'US', - 1 => 'BB', - 2 => 'BS', - 3 => 'CA', - ), - 7 => - array ( - 0 => 'RU', - ), - 33 => - array ( - 0 => 'FR', - ), - 36 => - array ( - 0 => 'HU', - ), - 39 => - array ( - 0 => 'IT', - ), - 44 => - array ( - 0 => 'GB', - 1 => 'GG', - ), - 46 => - array ( - 0 => 'SE', - ), - 48 => - array ( - 0 => 'PL', - ), - 49 => - array ( - 0 => 'DE', - ), - 52 => - array ( - 0 => 'MX', - ), - 54 => - array ( - 0 => 'AR', - ), - 55 => - array ( - 0 => 'BR', - ), - 61 => - array ( - 0 => 'AU', - 1 => 'CC', - 2 => 'CX', - ), - 64 => - array ( - 0 => 'NZ', - ), - 65 => - array ( - 0 => 'SG', - ), - 81 => - array ( - 0 => 'JP', - ), - 82 => - array ( - 0 => 'KR', - ), - 86 => - array ( - 0 => 'CN', - ), - 244 => - array ( - 0 => 'AO', - ), - 262 => - array ( - 0 => 'RE', - 1 => 'YT', - ), - 290 => - array ( - 0 => 'TA', - ), - 374 => - array ( - 0 => 'AM', - ), - 375 => - array ( - 0 => 'BY', - ), - 376 => - array ( - 0 => 'AD', - ), - 800 => - array ( - 0 => '001', - ), - 882 => - array ( - 0 => '001', - ), - 971 => - array ( - 0 => 'AE', - ), - 979 => - array ( - 0 => '001', - ), - 998 => - array ( - 0 => 'UZ', - ), -); +class CountryCodeToRegionCodeMapForTesting +{ + // 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 static $countryCodeToRegionCodeMapForTesting = [ + 1 => [ + 0 => 'US', + 1 => 'BB', + 2 => 'BS', + 3 => 'CA', + ], + 7 => [ + 0 => 'RU', + ], + 33 => [ + 0 => 'FR', + ], + 36 => [ + 0 => 'HU', + ], + 39 => [ + 0 => 'IT', + ], + 44 => [ + 0 => 'GB', + 1 => 'GG', + ], + 46 => [ + 0 => 'SE', + ], + 48 => [ + 0 => 'PL', + ], + 49 => [ + 0 => 'DE', + ], + 52 => [ + 0 => 'MX', + ], + 54 => [ + 0 => 'AR', + ], + 55 => [ + 0 => 'BR', + ], + 61 => [ + 0 => 'AU', + 1 => 'CC', + 2 => 'CX', + ], + 64 => [ + 0 => 'NZ', + ], + 65 => [ + 0 => 'SG', + ], + 81 => [ + 0 => 'JP', + ], + 82 => [ + 0 => 'KR', + ], + 86 => [ + 0 => 'CN', + ], + 244 => [ + 0 => 'AO', + ], + 262 => [ + 0 => 'RE', + 1 => 'YT', + ], + 290 => [ + 0 => 'TA', + ], + 374 => [ + 0 => 'AM', + ], + 375 => [ + 0 => 'BY', + ], + 376 => [ + 0 => 'AD', + ], + 800 => [ + 0 => '001', + ], + 882 => [ + 0 => '001', + ], + 971 => [ + 0 => 'AE', + ], + 979 => [ + 0 => '001', + ], + 998 => [ + 0 => 'UZ', + ], + ]; } diff --git a/lib/libphonenumber/Matcher.php b/lib/libphonenumber/Matcher.php index 67e3553b..5d1f38c3 100755 --- a/lib/libphonenumber/Matcher.php +++ b/lib/libphonenumber/Matcher.php @@ -3,7 +3,7 @@ namespace libphonenumber; /** - * Matcher for various regex matching + * 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 @@ -26,7 +26,7 @@ class Matcher /** * @var array */ - protected $groups = array(); + protected $groups = []; private $searchIndex = 0; @@ -40,45 +40,6 @@ public function __construct($pattern, $subject) $this->subject = $subject; } - protected function doMatch($type = 'find', $offset = 0) - { - $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 = array(); - - foreach ($groups as $group) { - $positions[] = array( - $group[0], - $offset + mb_strlen(mb_strcut($search, 0, $group[1])) - ); - } - - $this->groups = $positions; - } - - return ($result === 1); - } - /** * @return bool */ @@ -96,16 +57,19 @@ public function lookingAt() } /** + * @param mixed|null $offset + * * @return bool */ public function find($offset = null) { - if ($offset === null) { + if (null === $offset) { $offset = $this->searchIndex; } // Increment search index for the next time we call this - $this->searchIndex++; + ++$this->searchIndex; + return $this->doMatch('find', $offset); } @@ -123,34 +87,38 @@ public function groupCount() /** * @param int $group + * * @return string */ public function group($group = null) { - if ($group === null) { + if (null === $group) { $group = 0; } + return isset($this->groups[$group][0]) ? $this->groups[$group][0] : null; } /** * @param int|null $group + * * @return int */ public function end($group = null) { - if ($group === null) { + if (null === $group) { $group = 0; } if (!isset($this->groups[$group])) { return null; } + return $this->groups[$group][1] + mb_strlen($this->groups[$group][0]); } public function start($group = null) { - if ($group === null) { + if (null === $group) { $group = 0; } if (!isset($this->groups[$group])) { @@ -162,6 +130,7 @@ public function start($group = null) /** * @param string $replacement + * * @return string */ public function replaceFirst($replacement) @@ -171,6 +140,7 @@ public function replaceFirst($replacement) /** * @param string $replacement + * * @return string */ public function replaceAll($replacement) @@ -180,6 +150,7 @@ public function replaceAll($replacement) /** * @param string $input + * * @return Matcher */ public function reset($input = '') @@ -188,4 +159,48 @@ public function reset($input = '') return $this; } + + protected function doMatch($type = 'find', $offset = 0) + { + $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 (1 === $result) { + // Expand $groups into $this->groups, but being multi-byte aware + + $positions = []; + + foreach ($groups as $group) { + $positions[] = [ + $group[0], + $offset + mb_strlen(mb_strcut($search, 0, $group[1])), + ]; + } + + $this->groups = $positions; + } + + return (1 === $result); + } } diff --git a/lib/libphonenumber/MatcherAPIInterface.php b/lib/libphonenumber/MatcherAPIInterface.php index 565bac36..38ed456d 100755 --- a/lib/libphonenumber/MatcherAPIInterface.php +++ b/lib/libphonenumber/MatcherAPIInterface.php @@ -3,12 +3,11 @@ namespace libphonenumber; /** - * Interface MatcherAPIInterface + * 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 @@ -18,9 +17,9 @@ interface MatcherAPIInterface * the national number pattern defined in the given {@code PhoneNumberDesc} message. * * @param string $number - * @param PhoneNumberDesc $numberDesc - * @param boolean $allowPrefixMatch - * @return boolean + * @param bool $allowPrefixMatch + * + * @return bool */ public function matchNationalNumber($number, PhoneNumberDesc $numberDesc, $allowPrefixMatch); } diff --git a/lib/libphonenumber/MetadataLoaderInterface.php b/lib/libphonenumber/MetadataLoaderInterface.php index 8142027d..f0407283 100755 --- a/lib/libphonenumber/MetadataLoaderInterface.php +++ b/lib/libphonenumber/MetadataLoaderInterface.php @@ -5,7 +5,8 @@ interface MetadataLoaderInterface { /** - * @param string $metadataFileName File name (including path) of metadata to load. + * @param string $metadataFileName file name (including path) of metadata to load + * * @return mixed */ public function loadMetadata($metadataFileName); diff --git a/lib/libphonenumber/MetadataSourceInterface.php b/lib/libphonenumber/MetadataSourceInterface.php index b7a10ad2..6cc5a015 100755 --- a/lib/libphonenumber/MetadataSourceInterface.php +++ b/lib/libphonenumber/MetadataSourceInterface.php @@ -6,15 +6,19 @@ 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. + * + * @param string $regionCode the region code + * + * @return PhoneMetadata the phone metadata for that region, or null if there is none */ public function getMetadataForRegion($regionCode); /** * 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. + * + * @param int $countryCallingCode the country calling code + * + * @return PhoneMetadata the phone metadata for that region, or null if there is none */ public function getMetadataForNonGeographicalRegion($countryCallingCode); } diff --git a/lib/libphonenumber/MultiFileMetadataSourceImpl.php b/lib/libphonenumber/MultiFileMetadataSourceImpl.php index b12b0eda..9cc3f87e 100755 --- a/lib/libphonenumber/MultiFileMetadataSourceImpl.php +++ b/lib/libphonenumber/MultiFileMetadataSourceImpl.php @@ -1,7 +1,5 @@ hasFormat = false; $this->format = null; - $this->leadingDigitsPattern = array(); + $this->leadingDigitsPattern = []; $this->hasNationalPrefixFormattingRule = false; $this->nationalPrefixFormattingRule = null; @@ -91,7 +91,7 @@ public function clear() } /** - * @return boolean + * @return bool */ public function hasPattern() { @@ -108,6 +108,7 @@ public function getPattern() /** * @param string $value + * * @return NumberFormat */ public function setPattern($value) @@ -119,7 +120,7 @@ public function setPattern($value) } /** - * @return boolean + * @return bool */ public function hasNationalPrefixOptionalWhenFormatting() { @@ -127,7 +128,7 @@ public function hasNationalPrefixOptionalWhenFormatting() } /** - * @return boolean + * @return bool */ public function getNationalPrefixOptionalWhenFormatting() { @@ -135,7 +136,7 @@ public function getNationalPrefixOptionalWhenFormatting() } /** - * @param boolean $nationalPrefixOptionalWhenFormatting + * @param bool $nationalPrefixOptionalWhenFormatting */ public function setNationalPrefixOptionalWhenFormatting($nationalPrefixOptionalWhenFormatting) { @@ -144,7 +145,7 @@ public function setNationalPrefixOptionalWhenFormatting($nationalPrefixOptionalW } /** - * @return boolean + * @return bool */ public function hasFormat() { @@ -161,6 +162,7 @@ public function getFormat() /** * @param string $value + * * @return NumberFormat */ public function setFormat($value) @@ -189,6 +191,7 @@ public function leadingDigitsPatternSize() /** * @param int $index + * * @return string */ public function getLeadingDigitsPattern($index) @@ -198,6 +201,7 @@ public function getLeadingDigitsPattern($index) /** * @param string $value + * * @return NumberFormat */ public function addLeadingDigitsPattern($value) @@ -208,7 +212,7 @@ public function addLeadingDigitsPattern($value) } /** - * @return boolean + * @return bool */ public function hasNationalPrefixFormattingRule() { @@ -225,6 +229,7 @@ public function getNationalPrefixFormattingRule() /** * @param string $value + * * @return NumberFormat */ public function setNationalPrefixFormattingRule($value) @@ -246,7 +251,7 @@ public function clearNationalPrefixFormattingRule() } /** - * @return boolean + * @return bool */ public function hasDomesticCarrierCodeFormattingRule() { @@ -263,6 +268,7 @@ public function getDomesticCarrierCodeFormattingRule() /** * @param string $value + * * @return NumberFormat */ public function setDomesticCarrierCodeFormattingRule($value) @@ -274,7 +280,6 @@ public function setDomesticCarrierCodeFormattingRule($value) } /** - * @param NumberFormat $other * @return NumberFormat */ public function mergeFrom(NumberFormat $other) @@ -286,7 +291,7 @@ public function mergeFrom(NumberFormat $other) $this->setFormat($other->getFormat()); } $leadingDigitsPatternSize = $other->leadingDigitsPatternSize(); - for ($i = 0; $i < $leadingDigitsPatternSize; $i++) { + for ($i = 0; $i < $leadingDigitsPatternSize; ++$i) { $this->addLeadingDigitsPattern($other->getLeadingDigitsPattern($i)); } if ($other->hasNationalPrefixFormattingRule()) { @@ -307,7 +312,7 @@ public function mergeFrom(NumberFormat $other) */ public function toArray() { - $output = array(); + $output = []; $output['pattern'] = $this->getPattern(); $output['format'] = $this->getFormat(); @@ -328,9 +333,6 @@ public function toArray() return $output; } - /** - * @param array $input - */ public function fromArray(array $input) { $this->setPattern($input['pattern']); @@ -339,10 +341,10 @@ public function fromArray(array $input) $this->addLeadingDigitsPattern($leadingDigitsPattern); } - if (isset($input['nationalPrefixFormattingRule']) && $input['nationalPrefixFormattingRule'] !== '') { + if (isset($input['nationalPrefixFormattingRule']) && '' !== $input['nationalPrefixFormattingRule']) { $this->setNationalPrefixFormattingRule($input['nationalPrefixFormattingRule']); } - if (isset($input['domesticCarrierCodeFormattingRule']) && $input['domesticCarrierCodeFormattingRule'] !== '') { + if (isset($input['domesticCarrierCodeFormattingRule']) && '' !== $input['domesticCarrierCodeFormattingRule']) { $this->setDomesticCarrierCodeFormattingRule($input['domesticCarrierCodeFormattingRule']); } diff --git a/lib/libphonenumber/NumberParseException.php b/lib/libphonenumber/NumberParseException.php index 161811ee..8beea4da 100755 --- a/lib/libphonenumber/NumberParseException.php +++ b/lib/libphonenumber/NumberParseException.php @@ -4,6 +4,7 @@ /** * Generic exception class for errors encountered when parsing phone numbers. + * * @author Lara Rennie */ class NumberParseException extends \Exception @@ -32,6 +33,11 @@ public function __construct($errorType, $message, $previous = null) $this->errorType = $errorType; } + public function __toString() + { + return 'Error type: ' . $this->errorType . '. ' . $this->message; + } + /** * Returns the error type of the exception that has been thrown. */ @@ -39,9 +45,4 @@ public function getErrorType() { return $this->errorType; } - - public function __toString() - { - return 'Error type: ' . $this->errorType . '. ' . $this->message; - } } diff --git a/lib/libphonenumber/PhoneMetadata.php b/lib/libphonenumber/PhoneMetadata.php index ddfaa350..aab865e6 100755 --- a/lib/libphonenumber/PhoneMetadata.php +++ b/lib/libphonenumber/PhoneMetadata.php @@ -3,8 +3,8 @@ namespace libphonenumber; /** - * Class PhoneMetadata - * @package libphonenumber + * Class PhoneMetadata. + * * @internal Used internally, and can change at any time */ class PhoneMetadata @@ -35,7 +35,7 @@ class PhoneMetadata protected $premiumRate; protected $fixedLine; protected $sameMobileAndFixedLinePattern = false; - protected $numberFormat = array(); + protected $numberFormat = []; protected $tollFree; protected $sharedCost; protected $personalNumber; @@ -65,35 +65,34 @@ class PhoneMetadata */ protected $noInternationalDialling; /** - * * @var NumberFormat[] */ - protected $intlNumberFormat = array(); + protected $intlNumberFormat = []; /** - * @return boolean + * @return bool */ public function hasId() { - return $this->id !== null; + return null !== $this->id; } /** - * @return boolean + * @return bool */ public function hasCountryCode() { - return $this->countryCode !== null; + return null !== $this->countryCode; } public function hasInternationalPrefix() { - return $this->internationalPrefix !== null; + return null !== $this->internationalPrefix; } public function hasMainCountryForCode() { - return $this->mainCountryForCode !== null; + return null !== $this->mainCountryForCode; } public function isMainCountryForCode() @@ -109,28 +108,30 @@ public function getMainCountryForCode() public function setMainCountryForCode($value) { $this->mainCountryForCode = $value; + return $this; } public function clearMainCountryForCode() { $this->mainCountryForCode = false; + return $this; } public function hasLeadingZeroPossible() { - return $this->leadingZeroPossible !== null; + return null !== $this->leadingZeroPossible; } public function hasMobileNumberPortableRegion() { - return $this->mobileNumberPortableRegion !== null; + return null !== $this->mobileNumberPortableRegion; } public function hasSameMobileAndFixedLinePattern() { - return $this->sameMobileAndFixedLinePattern !== null; + return null !== $this->sameMobileAndFixedLinePattern; } public function numberFormatSize() @@ -140,6 +141,7 @@ public function numberFormatSize() /** * @param int $index + * * @return NumberFormat */ public function getNumberFormat($index) @@ -159,13 +161,14 @@ public function getIntlNumberFormat($index) public function clearIntlNumberFormat() { - $this->intlNumberFormat = array(); + $this->intlNumberFormat = []; + return $this; } public function toArray() { - $output = array(); + $output = []; if ($this->hasGeneralDesc()) { $output['generalDesc'] = $this->getGeneralDesc()->toArray(); @@ -272,12 +275,12 @@ public function toArray() $output['sameMobileAndFixedLinePattern'] = $this->getSameMobileAndFixedLinePattern(); } - $output['numberFormat'] = array(); + $output['numberFormat'] = []; foreach ($this->numberFormats() as $numberFormat) { $output['numberFormat'][] = $numberFormat->toArray(); } - $output['intlNumberFormat'] = array(); + $output['intlNumberFormat'] = []; foreach ($this->intlNumberFormats() as $intlNumberFormat) { $output['intlNumberFormat'][] = $intlNumberFormat->toArray(); } @@ -301,7 +304,7 @@ public function toArray() public function hasGeneralDesc() { - return $this->generalDesc !== null; + return null !== $this->generalDesc; } /** @@ -315,12 +318,13 @@ public function getGeneralDesc() public function setGeneralDesc(PhoneNumberDesc $value) { $this->generalDesc = $value; + return $this; } public function hasFixedLine() { - return $this->fixedLine !== null; + return null !== $this->fixedLine; } /** @@ -334,12 +338,13 @@ public function getFixedLine() public function setFixedLine(PhoneNumberDesc $value) { $this->fixedLine = $value; + return $this; } public function hasMobile() { - return $this->mobile !== null; + return null !== $this->mobile; } /** @@ -353,12 +358,13 @@ public function getMobile() public function setMobile(PhoneNumberDesc $value) { $this->mobile = $value; + return $this; } public function hasTollFree() { - return $this->tollFree !== null; + return null !== $this->tollFree; } /** @@ -372,12 +378,13 @@ public function getTollFree() public function setTollFree(PhoneNumberDesc $value) { $this->tollFree = $value; + return $this; } public function hasPremiumRate() { - return $this->premiumRate !== null; + return null !== $this->premiumRate; } /** @@ -391,12 +398,13 @@ public function getPremiumRate() public function setPremiumRate(PhoneNumberDesc $value) { $this->premiumRate = $value; + return $this; } public function hasSharedCost() { - return $this->sharedCost !== null; + return null !== $this->sharedCost; } /** @@ -410,12 +418,13 @@ public function getSharedCost() public function setSharedCost(PhoneNumberDesc $value) { $this->sharedCost = $value; + return $this; } public function hasPersonalNumber() { - return $this->personalNumber !== null; + return null !== $this->personalNumber; } /** @@ -429,12 +438,13 @@ public function getPersonalNumber() public function setPersonalNumber(PhoneNumberDesc $value) { $this->personalNumber = $value; + return $this; } public function hasVoip() { - return $this->voip !== null; + return null !== $this->voip; } /** @@ -448,12 +458,13 @@ public function getVoip() public function setVoip(PhoneNumberDesc $value) { $this->voip = $value; + return $this; } public function hasPager() { - return $this->pager !== null; + return null !== $this->pager; } /** @@ -467,12 +478,13 @@ public function getPager() public function setPager(PhoneNumberDesc $value) { $this->pager = $value; + return $this; } public function hasUan() { - return $this->uan !== null; + return null !== $this->uan; } /** @@ -486,12 +498,13 @@ public function getUan() public function setUan(PhoneNumberDesc $value) { $this->uan = $value; + return $this; } public function hasEmergency() { - return $this->emergency !== null; + return null !== $this->emergency; } /** @@ -505,12 +518,13 @@ public function getEmergency() public function setEmergency(PhoneNumberDesc $value) { $this->emergency = $value; + return $this; } public function hasVoicemail() { - return $this->voicemail !== null; + return null !== $this->voicemail; } /** @@ -524,12 +538,13 @@ public function getVoicemail() public function setVoicemail(PhoneNumberDesc $value) { $this->voicemail = $value; + return $this; } public function hasShortCode() { - return $this->short_code !== null; + return null !== $this->short_code; } public function getShortCode() @@ -540,12 +555,13 @@ public function getShortCode() public function setShortCode(PhoneNumberDesc $value) { $this->short_code = $value; + return $this; } public function hasStandardRate() { - return $this->standard_rate !== null; + return null !== $this->standard_rate; } public function getStandardRate() @@ -556,12 +572,13 @@ public function getStandardRate() public function setStandardRate(PhoneNumberDesc $value) { $this->standard_rate = $value; + return $this; } public function hasCarrierSpecific() { - return $this->carrierSpecific !== null; + return null !== $this->carrierSpecific; } public function getCarrierSpecific() @@ -572,12 +589,13 @@ public function getCarrierSpecific() public function setCarrierSpecific(PhoneNumberDesc $value) { $this->carrierSpecific = $value; + return $this; } public function hasSmsServices() { - return $this->smsServices !== null; + return null !== $this->smsServices; } public function getSmsServices() @@ -588,12 +606,13 @@ public function getSmsServices() public function setSmsServices(PhoneNumberDesc $value) { $this->smsServices = $value; + return $this; } public function hasNoInternationalDialling() { - return $this->noInternationalDialling !== null; + return null !== $this->noInternationalDialling; } public function getNoInternationalDialling() @@ -604,6 +623,7 @@ public function getNoInternationalDialling() public function setNoInternationalDialling(PhoneNumberDesc $value) { $this->noInternationalDialling = $value; + return $this; } @@ -617,11 +637,13 @@ public function getId() /** * @param string $value + * * @return PhoneMetadata */ public function setId($value) { $this->id = $value; + return $this; } @@ -635,11 +657,13 @@ public function getCountryCode() /** * @param int $value + * * @return PhoneMetadata */ public function setCountryCode($value) { $this->countryCode = $value; + return $this; } @@ -651,12 +675,13 @@ public function getInternationalPrefix() public function setInternationalPrefix($value) { $this->internationalPrefix = $value; + return $this; } public function hasPreferredInternationalPrefix() { - return ($this->preferredInternationalPrefix !== null); + return (null !== $this->preferredInternationalPrefix); } public function getPreferredInternationalPrefix() @@ -667,18 +692,20 @@ public function getPreferredInternationalPrefix() public function setPreferredInternationalPrefix($value) { $this->preferredInternationalPrefix = $value; + return $this; } public function clearPreferredInternationalPrefix() { $this->preferredInternationalPrefix = null; + return $this; } public function hasNationalPrefix() { - return $this->nationalPrefix !== null; + return null !== $this->nationalPrefix; } public function getNationalPrefix() @@ -689,18 +716,20 @@ public function getNationalPrefix() public function setNationalPrefix($value) { $this->nationalPrefix = $value; + return $this; } public function clearNationalPrefix() { $this->nationalPrefix = ''; + return $this; } public function hasPreferredExtnPrefix() { - return $this->preferredExtnPrefix !== null; + return null !== $this->preferredExtnPrefix; } public function getPreferredExtnPrefix() @@ -711,18 +740,20 @@ public function getPreferredExtnPrefix() public function setPreferredExtnPrefix($value) { $this->preferredExtnPrefix = $value; + return $this; } public function clearPreferredExtnPrefix() { $this->preferredExtnPrefix = ''; + return $this; } public function hasNationalPrefixForParsing() { - return $this->nationalPrefixForParsing !== null; + return null !== $this->nationalPrefixForParsing; } public function getNationalPrefixForParsing() @@ -733,12 +764,13 @@ public function getNationalPrefixForParsing() public function setNationalPrefixForParsing($value) { $this->nationalPrefixForParsing = $value; + return $this; } public function hasNationalPrefixTransformRule() { - return $this->nationalPrefixTransformRule !== null; + return null !== $this->nationalPrefixTransformRule; } public function getNationalPrefixTransformRule() @@ -749,12 +781,14 @@ public function getNationalPrefixTransformRule() public function setNationalPrefixTransformRule($value) { $this->nationalPrefixTransformRule = $value; + return $this; } public function clearNationalPrefixTransformRule() { $this->nationalPrefixTransformRule = ''; + return $this; } @@ -766,12 +800,14 @@ public function getSameMobileAndFixedLinePattern() public function setSameMobileAndFixedLinePattern($value) { $this->sameMobileAndFixedLinePattern = $value; + return $this; } public function clearSameMobileAndFixedLinePattern() { $this->sameMobileAndFixedLinePattern = false; + return $this; } @@ -793,7 +829,7 @@ public function intlNumberFormats() */ public function hasLeadingDigits() { - return $this->leadingDigits !== null; + return null !== $this->leadingDigits; } public function getLeadingDigits() @@ -804,6 +840,7 @@ public function getLeadingDigits() public function setLeadingDigits($value) { $this->leadingDigits = $value; + return $this; } @@ -815,12 +852,14 @@ public function isLeadingZeroPossible() public function setLeadingZeroPossible($value) { $this->leadingZeroPossible = $value; + return $this; } public function clearLeadingZeroPossible() { $this->leadingZeroPossible = false; + return $this; } @@ -832,17 +871,18 @@ public function isMobileNumberPortableRegion() public function setMobileNumberPortableRegion($value) { $this->mobileNumberPortableRegion = $value; + return $this; } public function clearMobileNumberPortableRegion() { $this->mobileNumberPortableRegion = false; + return $this; } /** - * @param array $input * @return PhoneMetadata */ public function fromArray(array $input) @@ -990,12 +1030,14 @@ public function fromArray(array $input) public function addNumberFormat(NumberFormat $value) { $this->numberFormat[] = $value; + return $this; } public function addIntlNumberFormat(NumberFormat $value) { $this->intlNumberFormat[] = $value; + return $this; } } diff --git a/lib/libphonenumber/PhoneNumber.php b/lib/libphonenumber/PhoneNumber.php index 15a8aacc..6f149533 100755 --- a/lib/libphonenumber/PhoneNumber.php +++ b/lib/libphonenumber/PhoneNumber.php @@ -93,12 +93,54 @@ class PhoneNumber implements \Serializable */ protected $numberOfLeadingZeros = 1; + /** + * Returns a string representation of this phone number. + * + * @return string + */ + public function __toString() + { + $outputString = ''; + + $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; + } + + public function __serialize() + { + return get_object_vars($this); + } + + public function __unserialize($data) + { + foreach ($data as $key => $value) { + $this->{$key} = $value; + } + } + /** * 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. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function clear() { @@ -110,104 +152,113 @@ public function clear() $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. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function clearCountryCode() { $this->countryCode = null; + return $this; } /** * Clears the national number of this phone number. * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function clearNationalNumber() { $this->nationalNumber = null; + return $this; } /** * Clears the extension of this phone number. * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function clearExtension() { $this->extension = null; + return $this; } /** * Clears the italian leading zero information of this phone number. * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function clearItalianLeadingZero() { $this->italianLeadingZero = null; + return $this; } /** * Clears the number of leading zeros of this phone number. * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function clearNumberOfLeadingZeros() { $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. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function clearRawInput() { $this->rawInput = null; + return $this; } /** * Clears the country code source of this phone number. * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function clearCountryCodeSource() { $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. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function clearPreferredDomesticCarrierCode() { $this->preferredDomesticCarrierCode = null; + return $this; } /** * Merges the information from another phone number into this phone number. * - * @param PhoneNumber $other The phone number to copy. + * @param PhoneNumber $other the phone number to copy * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function mergeFrom(PhoneNumber $other) { @@ -235,23 +286,24 @@ public function mergeFrom(PhoneNumber $other) 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. + * @return bool true if a country code is set, false otherwise */ public function hasCountryCode() { - return $this->countryCode !== null; + return null !== $this->countryCode; } /** * Returns the country code of this phone number. * - * @return int|null The country code, or null if not set. + * @return int|null the country code, or null if not set */ public function getCountryCode() { @@ -261,30 +313,31 @@ public function getCountryCode() /** * Sets the country code of this phone number. * - * @param int $value The country code. + * @param int $value the country code * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function setCountryCode($value) { $this->countryCode = (int) $value; + return $this; } /** * Returns whether this phone number has a national number set. * - * @return bool True if a national number is set, false otherwise. + * @return bool true if a national number is set, false otherwise */ public function hasNationalNumber() { - return $this->nationalNumber !== null; + return null !== $this->nationalNumber; } /** * Returns the national number of this phone number. * - * @return string|null The national number, or null if not set. + * @return string|null the national number, or null if not set */ public function getNationalNumber() { @@ -294,30 +347,31 @@ public function getNationalNumber() /** * Sets the national number of this phone number. * - * @param string $value The national number. + * @param string $value the national number * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function setNationalNumber($value) { $this->nationalNumber = (string) $value; + return $this; } /** * Returns whether this phone number has an extension set. * - * @return bool True if an extension is set, false otherwise. + * @return bool true if an extension is set, false otherwise */ public function hasExtension() { - return $this->extension !== null; + return null !== $this->extension; } /** * Returns the extension of this phone number. * - * @return string|null The extension, or null if not set. + * @return string|null the extension, or null if not set */ public function getExtension() { @@ -327,13 +381,14 @@ public function getExtension() /** * Sets the extension of this phone number. * - * @param string $value The extension. + * @param string $value the extension * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function setExtension($value) { $this->extension = (string) $value; + return $this; } @@ -344,26 +399,27 @@ public function setExtension($value) */ public function hasItalianLeadingZero() { - return $this->italianLeadingZero !== null; + return null !== $this->italianLeadingZero; } /** * Sets whether this phone number uses an italian leading zero. * - * @param bool $value True to use italian leading zero, false otherwise. + * @param bool $value true to use italian leading zero, false otherwise * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function setItalianLeadingZero($value) { $this->italianLeadingZero = (bool) $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 it it does not, null if not set. + * @return bool|null true if it uses an italian leading zero, false it it does not, null if not set */ public function isItalianLeadingZero() { @@ -373,7 +429,7 @@ public function isItalianLeadingZero() /** * 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. + * @return bool true if a number of leading zeros is set, false otherwise */ public function hasNumberOfLeadingZeros() { @@ -383,7 +439,7 @@ public function hasNumberOfLeadingZeros() /** * Returns the number of leading zeros of this phone number. * - * @return int The number of leading zeros. + * @return int the number of leading zeros */ public function getNumberOfLeadingZeros() { @@ -393,31 +449,32 @@ public function getNumberOfLeadingZeros() /** * Sets the number of leading zeros of this phone number. * - * @param int $value The number of leading zeros. + * @param int $value the number of leading zeros * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function setNumberOfLeadingZeros($value) { $this->hasNumberOfLeadingZeros = true; $this->numberOfLeadingZeros = (int) $value; + return $this; } /** * Returns whether this phone number has a raw input. * - * @return bool True if a raw input is set, false otherwise. + * @return bool true if a raw input is set, false otherwise */ public function hasRawInput() { - return $this->rawInput !== null; + return null !== $this->rawInput; } /** * Returns the raw input of this phone number. * - * @return string|null The raw input, or null if not set. + * @return string|null the raw input, or null if not set */ public function getRawInput() { @@ -427,30 +484,31 @@ public function getRawInput() /** * Sets the raw input of this phone number. * - * @param string $value The raw input. + * @param string $value the raw input * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function setRawInput($value) { $this->rawInput = (string) $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. + * @return bool true if a country code source is set, false otherwise */ public function hasCountryCodeSource() { - return $this->countryCodeSource !== CountryCodeSource::UNSPECIFIED; + return CountryCodeSource::UNSPECIFIED !== $this->countryCodeSource; } /** * Returns the country code source of this phone number. * - * @return int|null A CountryCodeSource constant, or null if not set. + * @return int|null a CountryCodeSource constant, or null if not set */ public function getCountryCodeSource() { @@ -460,30 +518,31 @@ public function getCountryCodeSource() /** * Sets the country code source of this phone number. * - * @param int $value A CountryCodeSource constant. + * @param int $value a CountryCodeSource constant * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function setCountryCodeSource($value) { $this->countryCodeSource = (int) $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. + * @return bool true if a preferred domestic carrier code is set, false otherwise */ public function hasPreferredDomesticCarrierCode() { - return $this->preferredDomesticCarrierCode !== null; + return null !== $this->preferredDomesticCarrierCode; } /** * Returns the preferred domestic carrier code of this phone number. * - * @return string|null The preferred domestic carrier code, or null if not set. + * @return string|null the preferred domestic carrier code, or null if not set */ public function getPreferredDomesticCarrierCode() { @@ -493,80 +552,54 @@ public function getPreferredDomesticCarrierCode() /** * Sets the preferred domestic carrier code of this phone number. * - * @param string $value The preferred domestic carrier code. + * @param string $value the preferred domestic carrier code * - * @return PhoneNumber This PhoneNumber instance, for chaining method calls. + * @return PhoneNumber this PhoneNumber instance, for chaining method calls */ public function setPreferredDomesticCarrierCode($value) { $this->preferredDomesticCarrierCode = (string) $value; + return $this; } /** * Returns whether this phone number is equal to another. * - * @param PhoneNumber $other The phone number to compare. + * @param PhoneNumber $other the phone number to compare * - * @return bool True if the phone numbers are equal, false otherwise. + * @return bool true if the phone numbers are equal, false otherwise */ public function equals(PhoneNumber $other) { $sameType = get_class($other) == get_class($this); - $sameCountry = $this->hasCountryCode() == $other->hasCountryCode() && - (!$this->hasCountryCode() || $this->getCountryCode() == $other->getCountryCode()); - $sameNational = $this->hasNationalNumber() == $other->hasNationalNumber() && - (!$this->hasNationalNumber() || $this->getNationalNumber() == $other->getNationalNumber()); - $sameExt = $this->hasExtension() == $other->hasExtension() && - (!$this->hasExtension() || $this->hasExtension() == $other->hasExtension()); - $sameLead = $this->hasItalianLeadingZero() == $other->hasItalianLeadingZero() && - (!$this->hasItalianLeadingZero() || $this->isItalianLeadingZero() == $other->isItalianLeadingZero()); + $sameCountry = $this->hasCountryCode() == $other->hasCountryCode() + && (!$this->hasCountryCode() || $this->getCountryCode() == $other->getCountryCode()); + $sameNational = $this->hasNationalNumber() == $other->hasNationalNumber() + && (!$this->hasNationalNumber() || $this->getNationalNumber() == $other->getNationalNumber()); + $sameExt = $this->hasExtension() == $other->hasExtension() + && (!$this->hasExtension() || $this->hasExtension() == $other->hasExtension()); + $sameLead = $this->hasItalianLeadingZero() == $other->hasItalianLeadingZero() + && (!$this->hasItalianLeadingZero() || $this->isItalianLeadingZero() == $other->isItalianLeadingZero()); $sameZeros = $this->getNumberOfLeadingZeros() == $other->getNumberOfLeadingZeros(); - $sameRaw = $this->hasRawInput() == $other->hasRawInput() && - (!$this->hasRawInput() || $this->getRawInput() == $other->getRawInput()); - $sameCountrySource = $this->hasCountryCodeSource() == $other->hasCountryCodeSource() && - (!$this->hasCountryCodeSource() || $this->getCountryCodeSource() == $other->getCountryCodeSource()); - $samePrefCar = $this->hasPreferredDomesticCarrierCode() == $other->hasPreferredDomesticCarrierCode() && - (!$this->hasPreferredDomesticCarrierCode() || $this->getPreferredDomesticCarrierCode( + $sameRaw = $this->hasRawInput() == $other->hasRawInput() + && (!$this->hasRawInput() || $this->getRawInput() == $other->getRawInput()); + $sameCountrySource = $this->hasCountryCodeSource() == $other->hasCountryCodeSource() + && (!$this->hasCountryCodeSource() || $this->getCountryCodeSource() == $other->getCountryCodeSource()); + $samePrefCar = $this->hasPreferredDomesticCarrierCode() == $other->hasPreferredDomesticCarrierCode() + && (!$this->hasPreferredDomesticCarrierCode() || $this->getPreferredDomesticCarrierCode( ) == $other->getPreferredDomesticCarrierCode()); - return $sameType && $sameCountry && $sameNational && $sameExt && $sameLead && $sameZeros && $sameRaw && $sameCountrySource && $samePrefCar; - } - - /** - * Returns a string representation of this phone number. - * @return string - */ - public function __toString() - { - $outputString = ''; - $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; + return $sameType && $sameCountry && $sameNational && $sameExt && $sameLead && $sameZeros && $sameRaw && $sameCountrySource && $samePrefCar; } /** - * @inheritDoc + * {@inheritDoc} */ public function serialize() { return __serialize( - array( + [ $this->countryCode, $this->nationalNumber, $this->extension, @@ -574,13 +607,13 @@ public function serialize() $this->numberOfLeadingZeros, $this->rawInput, $this->countryCodeSource, - $this->preferredDomesticCarrierCode - ) + $this->preferredDomesticCarrierCode, + ] ); } /** - * @inheritDoc + * {@inheritDoc} */ public function unserialize($serialized) { @@ -601,14 +634,4 @@ public function unserialize($serialized) $this->hasNumberOfLeadingZeros = true; } } - - public function __serialize() { - return get_object_vars( $this ); - } - - public function __unserialize( $data ) { - foreach ( $data as $key => $value ) { - $this->$key = $value; - } - } } diff --git a/lib/libphonenumber/PhoneNumberDesc.php b/lib/libphonenumber/PhoneNumberDesc.php index 13d59e70..ce291231 100755 --- a/lib/libphonenumber/PhoneNumberDesc.php +++ b/lib/libphonenumber/PhoneNumberDesc.php @@ -3,7 +3,7 @@ namespace libphonenumber; /** - * Phone Number Description + * Phone Number Description. */ class PhoneNumberDesc { @@ -63,7 +63,7 @@ public function addPossibleLength($possibleLength) public function clearPossibleLength() { - $this->possibleLength = array(); + $this->possibleLength = []; } /** @@ -91,11 +91,11 @@ public function addPossibleLengthLocalOnly($possibleLengthLocalOnly) public function clearPossibleLengthLocalOnly() { - $this->possibleLengthLocalOnly = array(); + $this->possibleLengthLocalOnly = []; } /** - * @return boolean + * @return bool */ public function hasNationalNumberPattern() { @@ -112,6 +112,7 @@ public function getNationalNumberPattern() /** * @param string $value + * * @return PhoneNumberDesc */ public function setNationalNumberPattern($value) @@ -129,6 +130,7 @@ public function clearNationalNumberPattern() { $this->hasNationalNumberPattern = false; $this->nationalNumberPattern = ''; + return $this; } @@ -150,6 +152,7 @@ public function getExampleNumber() /** * @param string $value + * * @return PhoneNumberDesc */ public function setExampleNumber($value) @@ -172,7 +175,6 @@ public function clearExampleNumber() } /** - * @param PhoneNumberDesc $other * @return PhoneNumberDesc */ public function mergeFrom(PhoneNumberDesc $other) @@ -190,13 +192,12 @@ public function mergeFrom(PhoneNumberDesc $other) } /** - * @param PhoneNumberDesc $other - * @return boolean + * @return bool */ public function exactlySameAs(PhoneNumberDesc $other) { - return $this->nationalNumberPattern === $other->nationalNumberPattern && - $this->exampleNumber === $other->exampleNumber; + return $this->nationalNumberPattern === $other->nationalNumberPattern + && $this->exampleNumber === $other->exampleNumber; } /** @@ -204,7 +205,7 @@ public function exactlySameAs(PhoneNumberDesc $other) */ public function toArray() { - $data = array(); + $data = []; if ($this->hasNationalNumberPattern()) { $data['NationalNumberPattern'] = $this->getNationalNumberPattern(); } @@ -219,15 +220,14 @@ public function toArray() } /** - * @param array $input * @return PhoneNumberDesc */ public function fromArray(array $input) { - if (isset($input['NationalNumberPattern']) && $input['NationalNumberPattern'] != '') { + if (isset($input['NationalNumberPattern']) && '' != $input['NationalNumberPattern']) { $this->setNationalNumberPattern($input['NationalNumberPattern']); } - if (isset($input['ExampleNumber']) && $input['NationalNumberPattern'] != '') { + if (isset($input['ExampleNumber']) && '' != $input['NationalNumberPattern']) { $this->setExampleNumber($input['ExampleNumber']); } $this->setPossibleLength($input['PossibleLength']); diff --git a/lib/libphonenumber/PhoneNumberType.php b/lib/libphonenumber/PhoneNumberType.php index 62f1fc97..a8454556 100755 --- a/lib/libphonenumber/PhoneNumberType.php +++ b/lib/libphonenumber/PhoneNumberType.php @@ -47,7 +47,7 @@ class PhoneNumberType public static function values() { - return array( + return [ self::FIXED_LINE => 'FIXED_LINE', self::MOBILE => 'MOBILE', self::FIXED_LINE_OR_MOBILE => 'FIXED_LINE_OR_MOBILE', @@ -63,6 +63,6 @@ public static function values() self::VOICEMAIL => 'VOICEMAIL', self::SHORT_CODE => 'SHORT_CODE', self::STANDARD_RATE => 'STANDARD_RATE', - ); + ]; } } diff --git a/lib/libphonenumber/PhoneNumberUtil.php b/lib/libphonenumber/PhoneNumberUtil.php index 2a43f6af..072de1e7 100755 --- a/lib/libphonenumber/PhoneNumberUtil.php +++ b/lib/libphonenumber/PhoneNumberUtil.php @@ -17,6 +17,7 @@ * http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html * * @author Shaopeng Jia + * * @see https://github.com/googlei18n/libphonenumber */ class PhoneNumberUtil @@ -40,36 +41,35 @@ class PhoneNumberUtil const TEST_META_DATA_FILE_PREFIX = 'PhoneNumberMetadataForTesting'; // Region-code for the unknown region. - const UNKNOWN_REGION = 'ZZ'; + public const UNKNOWN_REGION = 'ZZ'; - const NANPA_COUNTRY_CODE = 1; + public const NANPA_COUNTRY_CODE = 1; /* * The prefix that needs to be inserted in front of a Colombian landline number when dialed from * a mobile number in Colombia. */ - const COLOMBIA_MOBILE_TO_FIXED_LINE_PREFIX = '3'; + public const COLOMBIA_MOBILE_TO_FIXED_LINE_PREFIX = '3'; // The PLUS_SIGN signifies the international prefix. - const PLUS_SIGN = '+'; - const PLUS_CHARS = '++'; - const STAR_SIGN = '*'; + public const PLUS_SIGN = '+'; + public const PLUS_CHARS = '++'; + public const STAR_SIGN = '*'; - const RFC3966_EXTN_PREFIX = ';ext='; - const RFC3966_PREFIX = 'tel:'; - const RFC3966_PHONE_CONTEXT = ';phone-context='; - const RFC3966_ISDN_SUBADDRESS = ';isub='; + public const RFC3966_EXTN_PREFIX = ';ext='; + public const RFC3966_PREFIX = 'tel:'; + public const RFC3966_PHONE_CONTEXT = ';phone-context='; + public const RFC3966_ISDN_SUBADDRESS = ';isub='; // We use this pattern to check if the phone number has at least three letters in it - if so, then // we treat it as a number where some phone-number digits are represented by letters. - const VALID_ALPHA_PHONE_PATTERN = '(?:.*?[A-Za-z]){3}.*'; + public const VALID_ALPHA_PHONE_PATTERN = '(?:.*?[A-Za-z]){3}.*'; // We accept alpha characters in phone numbers, ASCII only, upper and lower case. - const VALID_ALPHA = 'A-Za-z'; - + public const VALID_ALPHA = 'A-Za-z'; // Default extension prefix to use when formatting. This will be put in front of any extension // component of the number, after the main national number is formatted. For example, if you wish // the default extension formatting to be " extn: 3456", then you should specify " extn: " here // as the default extension prefix. This can be overridden by region-specific preferences. - const DEFAULT_EXTN_PREFIX = ' ext. '; + public const DEFAULT_EXTN_PREFIX = ' ext. '; // Regular expression of acceptable punctuation found in phone numbers, used to find numbers in // text and to decide what is a viable phone number. This excludes diallable characters. @@ -77,8 +77,8 @@ class PhoneNumberUtil // square brackets, parentheses and tildes. It also includes the letter 'x' as that is found as a // placeholder for carrier information in some phone numbers. Full-width variants are also // present. - const VALID_PUNCTUATION = "-x\xE2\x80\x90-\xE2\x80\x95\xE2\x88\x92\xE3\x83\xBC\xEF\xBC\x8D-\xEF\xBC\x8F \xC2\xA0\xC2\xAD\xE2\x80\x8B\xE2\x81\xA0\xE3\x80\x80()\xEF\xBC\x88\xEF\xBC\x89\xEF\xBC\xBB\xEF\xBC\xBD.\\[\\]/~\xE2\x81\x93\xE2\x88\xBC"; - const DIGITS = "\\p{Nd}"; + public const VALID_PUNCTUATION = "-x\xE2\x80\x90-\xE2\x80\x95\xE2\x88\x92\xE3\x83\xBC\xEF\xBC\x8D-\xEF\xBC\x8F \xC2\xA0\xC2\xAD\xE2\x80\x8B\xE2\x81\xA0\xE3\x80\x80()\xEF\xBC\x88\xEF\xBC\x89\xEF\xBC\xBB\xEF\xBC\xBD.\\[\\]/~\xE2\x81\x93\xE2\x88\xBC"; + public const DIGITS = '\\p{Nd}'; // Pattern that makes it easy to distinguish whether a region has a single international dialing // prefix or not. If a region has a single international prefix (e.g. 011 in USA), it will be @@ -86,31 +86,37 @@ class PhoneNumberUtil // signals waiting for the tone. If there are multiple available international prefixes in a // region, they will be represented as a regex string that always contains one or more characters // that are not ASCII digits or a tilde. - const SINGLE_INTERNATIONAL_PREFIX = "[\\d]+(?:[~\xE2\x81\x93\xE2\x88\xBC\xEF\xBD\x9E][\\d]+)?"; - const NON_DIGITS_PATTERN = "(\\D+)"; + public const SINGLE_INTERNATIONAL_PREFIX = "[\\d]+(?:[~\xE2\x81\x93\xE2\x88\xBC\xEF\xBD\x9E][\\d]+)?"; + public const NON_DIGITS_PATTERN = '(\\D+)'; // The FIRST_GROUP_PATTERN was originally set to $1 but there are some countries for which the // first group is not used in the national pattern (e.g. Argentina) so the $1 group does not match // correctly. Therefore, we use \d, so that the first group actually used in the pattern will be // matched. - const FIRST_GROUP_PATTERN = "(\\$\\d)"; + public const FIRST_GROUP_PATTERN = '(\$\\d)'; // Constants used in the formatting rules to represent the national prefix, first group and // carrier code respectively. - const NP_STRING = '$NP'; - const FG_STRING = '$FG'; - const CC_STRING = '$CC'; + public const NP_STRING = '$NP'; + public const FG_STRING = '$FG'; + public const CC_STRING = '$CC'; // A pattern that is used to determine if the national prefix formatting rule has the first group // only, i.e., does not start with the national prefix. Note that the pattern explicitly allows // for unbalanced parentheses. - const FIRST_GROUP_ONLY_PREFIX_PATTERN = '\\(?\\$1\\)?'; + public const FIRST_GROUP_ONLY_PREFIX_PATTERN = '\\(?\\$1\\)?'; public static $PLUS_CHARS_PATTERN; + public static $SECOND_NUMBER_START_PATTERN = '[\\\\/] *x'; + public static $UNWANTED_END_CHAR_PATTERN = '[[\\P{N}&&\\P{L}]&&[^#]]+$'; + /** + * @var string + * + * @internal + */ + public static $EXTN_PATTERNS_FOR_MATCHING; protected static $SEPARATOR_PATTERN; protected static $CAPTURING_DIGIT_PATTERN; protected static $VALID_START_CHAR_PATTERN; - public static $SECOND_NUMBER_START_PATTERN = '[\\\\/] *x'; - public static $UNWANTED_END_CHAR_PATTERN = "[[\\P{N}&&\\P{L}]&&[^#]]+$"; - protected static $DIALLABLE_CHAR_MAPPINGS = array(); + protected static $DIALLABLE_CHAR_MAPPINGS = []; protected static $CAPTURING_EXTN_DIGITS; /** @@ -120,9 +126,10 @@ class PhoneNumberUtil /** * Only upper-case variants of alpha characters are stored. + * * @var array */ - protected static $ALPHA_MAPPINGS = array( + protected static $ALPHA_MAPPINGS = [ 'A' => '2', 'B' => '2', 'C' => '2', @@ -149,15 +156,16 @@ class PhoneNumberUtil 'X' => '9', 'Y' => '9', 'Z' => '9', - ); + ]; /** * Map of country calling codes that use a mobile token before the area code. One example of when * this is relevant is when determining the length of the national destination code, which should * be the length of the area code plus the length of the mobile token. + * * @var array */ - protected static $MOBILE_TOKEN_MAPPINGS = array(); + protected static $MOBILE_TOKEN_MAPPINGS = []; /** * Set of country codes that have geographically assigned mobile numbers (see GEO_MOBILE_COUNTRIES @@ -182,6 +190,7 @@ class PhoneNumberUtil /** * For performance reasons, amalgamate both into one map. + * * @var array */ protected static $ALPHA_PHONE_MAPPINGS; @@ -189,6 +198,7 @@ class PhoneNumberUtil /** * Separate map of all symbols that we wish to retain when formatting alpha numbers. This * includes digits, ASCII letters and number grouping symbols such as "-" and " ". + * * @var array */ protected static $ALL_PLUS_NUMBER_GROUPING_SYMBOLS; @@ -196,9 +206,10 @@ class PhoneNumberUtil /** * Simple ASCII digits map used to populate ALPHA_PHONE_MAPPINGS and * ALL_PLUS_NUMBER_GROUPING_SYMBOLS. + * * @var array */ - protected static $asciiDigitMappings = array( + protected static $asciiDigitMappings = [ '0' => '0', '1' => '1', '2' => '2', @@ -209,20 +220,16 @@ class PhoneNumberUtil '7' => '7', '8' => '8', '9' => '9', - ); + ]; /** * Regexp of all possible ways to write extensions, for use when parsing. This will be run as a * case-insensitive regexp match. Wide character versions are also provided after each ASCII * version. - * @var String - */ - protected static $EXTN_PATTERNS_FOR_PARSING; - /** + * * @var string - * @internal */ - public static $EXTN_PATTERNS_FOR_MATCHING; + protected static $EXTN_PATTERNS_FOR_PARSING; protected static $EXTN_PATTERN; protected static $VALID_PHONE_NUMBER_PATTERN; protected static $MIN_LENGTH_PHONE_NUMBER_PATTERN; @@ -235,7 +242,7 @@ class PhoneNumberUtil * the start. * Corresponds to the following: * [digits]{minLengthNsn}| - * plus_sign*(([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])* + * plus_sign*(([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*. * * The first reg-ex is to allow short numbers (two digits long) to be parsed if they are entered * as "15" etc, but only if there is no punctuation in them. The second expression restricts the @@ -243,10 +250,11 @@ class PhoneNumberUtil * have alpha-characters and punctuation. * * Note VALID_PUNCTUATION starts with a -, so must be the first in the range. + * * @var string */ protected static $VALID_PHONE_NUMBER; - protected static $numericCharacters = array( + protected static $numericCharacters = [ "\xef\xbc\x90" => 0, "\xef\xbc\x91" => 1, "\xef\xbc\x92" => 2, @@ -290,32 +298,36 @@ class PhoneNumberUtil "\xe1\xa0\x97" => 7, "\xe1\xa0\x98" => 8, "\xe1\xa0\x99" => 9, - ); + ]; /** * The set of county calling codes that map to the non-geo entity region ("001"). + * * @var array */ - protected $countryCodesForNonGeographicalRegion = array(); + protected $countryCodesForNonGeographicalRegion = []; /** * The set of regions the library supports. + * * @var array */ - protected $supportedRegions = array(); + protected $supportedRegions = []; /** * A mapping from a country calling code to the region codes which denote the region represented * by that country calling code. In the case of multiple regions sharing a calling code, such as * the NANPA regions, the one indicated with "isMainCountryForCode" in the metadata should be * first. + * * @var array */ - protected $countryCallingCodeToRegionCodeMap = array(); + protected $countryCallingCodeToRegionCodeMap = []; /** * The set of regions that share country calling code 1. + * * @var array */ - protected $nanpaRegions = array(); + protected $nanpaRegions = []; /** * @var MetadataSourceInterface @@ -329,7 +341,7 @@ class PhoneNumberUtil /** * This class implements a singleton, so the only constructor is protected. - * @param MetadataSourceInterface $metadataSource + * * @param $countryCallingCodeToRegionCodeMap */ protected function __construct(MetadataSourceInterface $metadataSource, $countryCallingCodeToRegionCodeMap) @@ -348,7 +360,7 @@ protected function __construct(MetadataSourceInterface $metadataSource, $country static::initAlphaPhoneMappings(); static::initDiallableCharMappings(); - static::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS = array(); + static::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS = []; // Put (lower letter -> upper letter) and (upper letter -> upper letter) mappings. foreach (static::$ALPHA_MAPPINGS as $c => $value) { static::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS[strtolower($c)] = $c; @@ -372,17 +384,16 @@ protected function __construct(MetadataSourceInterface $metadataSource, $country static::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS['.'] = '.'; static::$ALL_PLUS_NUMBER_GROUPING_SYMBOLS["\xEF\xBC\x8E"] = '.'; - static::initValidPhoneNumberPatterns(); static::$UNWANTED_END_CHAR_PATTERN = '[^' . static::DIGITS . static::VALID_ALPHA . '#]+$'; static::initMobileTokenMappings(); - static::$GEO_MOBILE_COUNTRIES_WITHOUT_MOBILE_AREA_CODES = array(); + static::$GEO_MOBILE_COUNTRIES_WITHOUT_MOBILE_AREA_CODES = []; static::$GEO_MOBILE_COUNTRIES_WITHOUT_MOBILE_AREA_CODES[] = 86; // China - static::$GEO_MOBILE_COUNTRIES = array(); + static::$GEO_MOBILE_COUNTRIES = []; static::$GEO_MOBILE_COUNTRIES[] = 52; // Mexico static::$GEO_MOBILE_COUNTRIES[] = 54; // Argentina static::$GEO_MOBILE_COUNTRIES[] = 55; // Brazil @@ -400,58 +411,28 @@ protected function __construct(MetadataSourceInterface $metadataSource, $country * multiple times will only result in one instance being created. * * @param string $baseFileLocation - * @param array|null $countryCallingCodeToRegionCodeMap - * @param MetadataLoaderInterface|null $metadataLoader - * @param MetadataSourceInterface|null $metadataSource + * * @return PhoneNumberUtil instance */ public static function getInstance($baseFileLocation = self::META_DATA_FILE_PREFIX, array $countryCallingCodeToRegionCodeMap = null, MetadataLoaderInterface $metadataLoader = null, MetadataSourceInterface $metadataSource = null) { - if (static::$instance === null) { - if ($countryCallingCodeToRegionCodeMap === null) { + if (null === static::$instance) { + if (null === $countryCallingCodeToRegionCodeMap) { $countryCallingCodeToRegionCodeMap = CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap; } - if ($metadataLoader === null) { + if (null === $metadataLoader) { $metadataLoader = new DefaultMetadataLoader(); } - if ($metadataSource === null) { + if (null === $metadataSource) { $metadataSource = new MultiFileMetadataSourceImpl($metadataLoader, __DIR__ . '/data/' . $baseFileLocation); } static::$instance = new static($metadataSource, $countryCallingCodeToRegionCodeMap); } - return static::$instance; - } - - protected function init() - { - $supportedRegions = array(array()); - - foreach ($this->countryCallingCodeToRegionCodeMap as $countryCode => $regionCodes) { - // We can assume that if the country calling code maps to the non-geo entity region code then - // that's the only region code it maps to. - if (count($regionCodes) === 1 && static::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCodes[0]) { - // This is the subset of all country codes that map to the non-geo entity region code. - $this->countryCodesForNonGeographicalRegion[] = $countryCode; - } else { - // The supported regions set does not include the "001" non-geo entity region code. - $supportedRegions[] = $regionCodes; - } - } - - $this->supportedRegions = call_user_func_array('array_merge', $supportedRegions); - - // If the non-geo entity still got added to the set of supported regions it must be because - // there are entries that list the non-geo entity alongside normal regions (which is wrong). - // If we discover this, remove the non-geo entity from the set of supported regions and log. - $idx_region_code_non_geo_entity = array_search(static::REGION_CODE_FOR_NON_GEO_ENTITY, $this->supportedRegions); - if ($idx_region_code_non_geo_entity !== false) { - unset($this->supportedRegions[$idx_region_code_non_geo_entity]); - } - $this->nanpaRegions = $this->countryCallingCodeToRegionCodeMap[static::NANPA_COUNTRY_CODE]; + return static::$instance; } /** @@ -478,70 +459,6 @@ public static function initExtnPatterns() static::$EXTN_PATTERNS_FOR_MATCHING = static::createExtnPattern($singleExtnSymbolsForMatching); } - /** - * Helper initialiser method to create the regular-expression pattern to match extensions, - * allowing the one-char extension symbols provided by {@code singleExtnSymbols}. - * @param string $singleExtnSymbols - * @return string - */ - protected static function createExtnPattern($singleExtnSymbols) - { - // There are three regular expressions here. The first covers RFC 3966 format, where the - // extension is added using ";ext=". The second more generic one starts with optional white - // space and ends with an optional full stop (.), followed by zero or more spaces/tabs/commas - // and then the numbers themselves. The other one covers the special case of American numbers - // where the extension is written with a hash at the end, such as "- 503#" - // Note that the only capturing groups should be around the digits that you want to capture as - // part of the extension, or else parsing will fail! - // Canonical-equivalence doesn't seem to be an option with Android java, so we allow two options - // for representing the accented o - the character itself, and one in the unicode decomposed - // form with the combining acute accent. - return (static::RFC3966_EXTN_PREFIX . static::$CAPTURING_EXTN_DIGITS . '|' . "[ \xC2\xA0\\t,]*" . - "(?:e?xt(?:ensi(?:o\xCC\x81?|\xC3\xB3))?n?|(?:\xEF\xBD\x85)?\xEF\xBD\x98\xEF\xBD\x94(?:\xEF\xBD\x8E)?|" . - 'доб|' . '[' . $singleExtnSymbols . "]|int|\xEF\xBD\x89\xEF\xBD\x8E\xEF\xBD\x94|anexo)" . - "[:\\.\xEF\xBC\x8E]?[ \xC2\xA0\\t,-]*" . static::$CAPTURING_EXTN_DIGITS . "\\#?|" . - '[- ]+(' . static::DIGITS . "{1,5})\\#"); - } - - protected static function initExtnPattern() - { - static::$EXTN_PATTERN = '/(?:' . static::$EXTN_PATTERNS_FOR_PARSING . ')$/' . static::REGEX_FLAGS; - } - - protected static function initValidPhoneNumberPatterns() - { - static::initCapturingExtnDigits(); - static::initExtnPatterns(); - static::$MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' . static::DIGITS . ']{' . static::MIN_LENGTH_FOR_NSN . '}'; - static::$VALID_PHONE_NUMBER = '[' . static::PLUS_CHARS . ']*(?:[' . static::VALID_PUNCTUATION . static::STAR_SIGN . ']*[' . static::DIGITS . ']){3,}[' . static::VALID_PUNCTUATION . static::STAR_SIGN . static::VALID_ALPHA . static::DIGITS . ']*'; - static::$VALID_PHONE_NUMBER_PATTERN = '%^' . static::$MIN_LENGTH_PHONE_NUMBER_PATTERN . '$|^' . static::$VALID_PHONE_NUMBER . '(?:' . static::$EXTN_PATTERNS_FOR_PARSING . ')?$%' . static::REGEX_FLAGS; - } - - protected static function initAlphaPhoneMappings() - { - static::$ALPHA_PHONE_MAPPINGS = static::$ALPHA_MAPPINGS + static::$asciiDigitMappings; - } - - protected static function initValidStartCharPattern() - { - static::$VALID_START_CHAR_PATTERN = '[' . static::PLUS_CHARS . static::DIGITS . ']'; - } - - protected static function initMobileTokenMappings() - { - static::$MOBILE_TOKEN_MAPPINGS = array(); - static::$MOBILE_TOKEN_MAPPINGS['52'] = '1'; - static::$MOBILE_TOKEN_MAPPINGS['54'] = '9'; - } - - protected static function initDiallableCharMappings() - { - static::$DIALLABLE_CHAR_MAPPINGS = static::$asciiDigitMappings; - static::$DIALLABLE_CHAR_MAPPINGS[static::PLUS_SIGN] = static::PLUS_SIGN; - static::$DIALLABLE_CHAR_MAPPINGS['*'] = '*'; - static::$DIALLABLE_CHAR_MAPPINGS['#'] = '#'; - } - /** * Used for testing purposes only to reset the PhoneNumberUtil singleton to null. */ @@ -553,58 +470,36 @@ public static function resetInstance() /** * Converts all alpha characters in a number to their respective digits on a keypad, but retains * existing formatting. + * * @param string $number + * * @return string */ public static function convertAlphaCharactersInNumber($number) { - if (static::$ALPHA_PHONE_MAPPINGS === null) { + if (null === static::$ALPHA_PHONE_MAPPINGS) { static::initAlphaPhoneMappings(); } return static::normalizeHelper($number, static::$ALPHA_PHONE_MAPPINGS, false); } - /** - * Normalizes a string of characters representing a phone number by replacing all characters found - * in the accompanying map with the values therein, and stripping all other characters if - * removeNonMatches is true. - * - * @param string $number a string of characters representing a phone number - * @param array $normalizationReplacements a mapping of characters to what they should be replaced by in - * the normalized version of the phone number - * @param bool $removeNonMatches indicates whether characters that are not able to be replaced - * should be stripped from the number. If this is false, they will be left unchanged in the number. - * @return string the normalized string version of the phone number - */ - protected static function normalizeHelper($number, array $normalizationReplacements, $removeNonMatches) - { - $normalizedNumber = ''; - $strLength = mb_strlen($number, 'UTF-8'); - for ($i = 0; $i < $strLength; $i++) { - $character = mb_substr($number, $i, 1, 'UTF-8'); - if (isset($normalizationReplacements[mb_strtoupper($character, 'UTF-8')])) { - $normalizedNumber .= $normalizationReplacements[mb_strtoupper($character, 'UTF-8')]; - } elseif (!$removeNonMatches) { - $normalizedNumber .= $character; - } - // If neither of the above are true, we remove this character. - } - return $normalizedNumber; - } - /** * Helper function to check if the national prefix formatting rule has the first group only, i.e., * does not start with the national prefix. + * * @param string $nationalPrefixFormattingRule + * * @return bool */ public static function formattingRuleHasFirstGroupOnly($nationalPrefixFormattingRule) { - $firstGroupOnlyPrefixPatternMatcher = new Matcher(static::FIRST_GROUP_ONLY_PREFIX_PATTERN, - $nationalPrefixFormattingRule); + $firstGroupOnlyPrefixPatternMatcher = new Matcher( + static::FIRST_GROUP_ONLY_PREFIX_PATTERN, + $nationalPrefixFormattingRule + ); - return mb_strlen($nationalPrefixFormattingRule) === 0 + return 0 === mb_strlen($nationalPrefixFormattingRule) || $firstGroupOnlyPrefixPatternMatcher->matches(); } @@ -612,7 +507,7 @@ public static function formattingRuleHasFirstGroupOnly($nationalPrefixFormatting * Returns all regions the library has metadata for. * * @return array An unordered array of the two-letter region codes for every geographical region the - * library supports + * library supports */ public function getSupportedRegions() { @@ -623,7 +518,7 @@ public function getSupportedRegions() * Returns all global network calling codes the library has metadata for. * * @return array An unordered array of the country calling codes for every non-geographical entity - * the library supports + * the library supports */ public function getSupportedGlobalNetworkCallingCodes() { @@ -637,68 +532,13 @@ public function getSupportedGlobalNetworkCallingCodes() * instance. * * @return array An unordered array of the country calling codes for every geographical and - * non-geographical entity the library supports + * non-geographical entity the library supports */ public function getSupportedCallingCodes() { return array_keys($this->countryCallingCodeToRegionCodeMap); } - /** - * Returns true if there is any possible number data set for a particular PhoneNumberDesc. - * - * @param PhoneNumberDesc $desc - * @return bool - */ - protected static function descHasPossibleNumberData(PhoneNumberDesc $desc) - { - // If this is empty, it means numbers of this type inherit from the "general desc" -> the value - // '-1' means that no numbers exist for this type. - $possibleLength = $desc->getPossibleLength(); - return count($possibleLength) != 1 || $possibleLength[0] != -1; - } - - /** - * Returns true if there is any data set for a particular PhoneNumberDesc. - * - * @param PhoneNumberDesc $desc - * @return bool - */ - protected static function descHasData(PhoneNumberDesc $desc) - { - // Checking most properties since we don't know what's present, since a custom build may have - // stripped just one of them (e.g. liteBuild strips exampleNumber). We don't bother checking the - // possibleLengthsLocalOnly, since if this is the only thing that's present we don't really - // support the type at all: no type-specific methods will work with only this data. - return $desc->hasExampleNumber() - || static::descHasPossibleNumberData($desc) - || $desc->hasNationalNumberPattern(); - } - - /** - * Returns the types we have metadata for based on the PhoneMetadata object passed in - * - * @param PhoneMetadata $metadata - * @return array - */ - private function getSupportedTypesForMetadata(PhoneMetadata $metadata) - { - $types = array(); - foreach (array_keys(PhoneNumberType::values()) as $type) { - if ($type === PhoneNumberType::FIXED_LINE_OR_MOBILE || $type === PhoneNumberType::UNKNOWN) { - // Never return FIXED_LINE_OR_MOBILE (it is a convenience type, and represents that a - // particular number type can't be determined) or UNKNOWN (the non-type). - continue; - } - - if (self::descHasData($this->getNumberDescByType($metadata, $type))) { - $types[] = $type; - } - } - - return $types; - } - /** * Returns the types for a given region which the library has metadata for. Will not include * FIXED_LINE_OR_MOBILE (if the numbers in this region could be classified as FIXED_LINE_OR_MOBILE, @@ -707,14 +547,16 @@ private function getSupportedTypesForMetadata(PhoneMetadata $metadata) * No types will be returned for invalid or unknown region codes. * * @param string $regionCode + * * @return array */ public function getSupportedTypesForRegion($regionCode) { if (!$this->isValidRegionCode($regionCode)) { - return array(); + return []; } $metadata = $this->getMetadataForRegion($regionCode); + return $this->getSupportedTypesForMetadata($metadata); } @@ -725,13 +567,14 @@ public function getSupportedTypesForRegion($regionCode) * present) and UNKNOWN. * * @param int $countryCallingCode + * * @return array */ public function getSupportedTypesForNonGeoEntity($countryCallingCode) { $metadata = $this->getMetadataForNonGeographicalRegion($countryCallingCode); - if ($metadata === null) { - return array(); + if (null === $metadata) { + return []; } return $this->getSupportedTypesForMetadata($metadata); @@ -742,7 +585,7 @@ public function getSupportedTypesForNonGeoEntity($countryCallingCode) * PhoneNumber object passed in, so that clients could use it to split a national significant * number into geographical area code and subscriber number. It works in such a way that the * resultant subscriber number should be diallable, at least on some devices. An example of how - * this could be used: + * this could be used:. * * * $phoneUtil = PhoneNumberUtil::getInstance(); @@ -772,13 +615,15 @@ public function getSupportedTypesForNonGeoEntity($countryCallingCode) * entities *
  • some geographical numbers have no area codes. * - * @param PhoneNumber $number PhoneNumber object for which clients want to know the length of the area code. - * @return int the length of area code of the PhoneNumber object passed in. + * + * @param PhoneNumber $number phoneNumber object for which clients want to know the length of the area code + * + * @return int the length of area code of the PhoneNumber object passed in */ public function getLengthOfGeographicalAreaCode(PhoneNumber $number) { $metadata = $this->getMetadataForRegion($this->getRegionCodeForNumber($number)); - if ($metadata === null) { + if (null === $metadata) { return 0; } // If a country doesn't use a national prefix, and this number doesn't have an Italian leading @@ -790,7 +635,7 @@ public function getLengthOfGeographicalAreaCode(PhoneNumber $number) $type = $this->getNumberType($number); $countryCallingCode = $number->getCountryCode(); - if ($type === PhoneNumberType::MOBILE + if (PhoneNumberType::MOBILE === $type // Note this is a rough heuristic; it doesn't cover Indonesia well, for example, where area // codes are present for some mobile phones but not for others. We have no better way of // representing this in the metadata at this point. @@ -809,7 +654,9 @@ public function getLengthOfGeographicalAreaCode(PhoneNumber $number) /** * Returns the metadata for the given region code or {@code null} if the region code is invalid * or unknown. + * * @param string $regionCode + * * @return PhoneMetadata */ public function getMetadataForRegion($regionCode) @@ -821,24 +668,15 @@ public function getMetadataForRegion($regionCode) return $this->metadataSource->getMetadataForRegion($regionCode); } - /** - * Helper function to check region code is not unknown or null. - * @param string $regionCode - * @return bool - */ - protected function isValidRegionCode($regionCode) - { - return $regionCode !== null && in_array($regionCode, $this->supportedRegions); - } - /** * Returns the region where a phone number is from. This could be used for geocoding at the region * level. Only guarantees correct results for valid, full numbers (not short-codes, or invalid * numbers). * * @param PhoneNumber $number the phone number whose origin we want to know - * @return null|string the region where the phone number is from, or null if no region matches this calling - * code + * + * @return string|null the region where the phone number is from, or null if no region matches this calling + * code */ public function getRegionCodeForNumber(PhoneNumber $number) { @@ -847,47 +685,19 @@ public function getRegionCodeForNumber(PhoneNumber $number) return null; } $regions = $this->countryCallingCodeToRegionCodeMap[$countryCode]; - if (count($regions) == 1) { + if (1 == count($regions)) { return $regions[0]; } return $this->getRegionCodeForNumberFromRegionList($number, $regions); } - /** - * @param PhoneNumber $number - * @param array $regionCodes - * @return null|string - */ - protected function getRegionCodeForNumberFromRegionList(PhoneNumber $number, array $regionCodes) - { - $nationalNumber = $this->getNationalSignificantNumber($number); - foreach ($regionCodes as $regionCode) { - // If leadingDigits is present, use this. Otherwise, do full validation. - // Metadata cannot be null because the region codes come from the country calling code map. - $metadata = $this->getMetadataForRegion($regionCode); - if ($metadata->hasLeadingDigits()) { - $nbMatches = preg_match( - '/' . $metadata->getLeadingDigits() . '/', - $nationalNumber, - $matches, - PREG_OFFSET_CAPTURE - ); - if ($nbMatches > 0 && $matches[0][1] === 0) { - return $regionCode; - } - } elseif ($this->getNumberTypeHelper($nationalNumber, $metadata) != PhoneNumberType::UNKNOWN) { - return $regionCode; - } - } - return null; - } - /** * Gets the national significant number of the a phone number. Note a national significant number * doesn't contain a national prefix or any formatting. * * @param PhoneNumber $number the phone number for which the national significant number is needed + * * @return string the national significant number of the PhoneNumber object passed in */ public function getNationalSignificantNumber(PhoneNumber $number) @@ -899,87 +709,31 @@ public function getNationalSignificantNumber(PhoneNumber $number) $nationalNumber .= $zeros; } $nationalNumber .= $number->getNationalNumber(); + return $nationalNumber; } /** * @param string $nationalNumber - * @param PhoneMetadata $metadata - * @return int PhoneNumberType constant + * + * @return bool */ - protected function getNumberTypeHelper($nationalNumber, PhoneMetadata $metadata) + public function isNumberMatchingDesc($nationalNumber, PhoneNumberDesc $numberDesc) { - if (!$this->isNumberMatchingDesc($nationalNumber, $metadata->getGeneralDesc())) { - return PhoneNumberType::UNKNOWN; - } - if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getPremiumRate())) { - return PhoneNumberType::PREMIUM_RATE; - } - if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getTollFree())) { - return PhoneNumberType::TOLL_FREE; - } - - - if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getSharedCost())) { - return PhoneNumberType::SHARED_COST; - } - if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getVoip())) { - return PhoneNumberType::VOIP; - } - if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getPersonalNumber())) { - return PhoneNumberType::PERSONAL_NUMBER; - } - if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getPager())) { - return PhoneNumberType::PAGER; - } - if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getUan())) { - return PhoneNumberType::UAN; - } - if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getVoicemail())) { - return PhoneNumberType::VOICEMAIL; - } - $isFixedLine = $this->isNumberMatchingDesc($nationalNumber, $metadata->getFixedLine()); - if ($isFixedLine) { - if ($metadata->getSameMobileAndFixedLinePattern()) { - return PhoneNumberType::FIXED_LINE_OR_MOBILE; - } - - if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getMobile())) { - return PhoneNumberType::FIXED_LINE_OR_MOBILE; - } - return PhoneNumberType::FIXED_LINE; - } - // Otherwise, test to see if the number is mobile. Only do this if certain that the patterns for - // mobile and fixed line aren't the same. - if (!$metadata->getSameMobileAndFixedLinePattern() && - $this->isNumberMatchingDesc($nationalNumber, $metadata->getMobile()) - ) { - return PhoneNumberType::MOBILE; - } - return PhoneNumberType::UNKNOWN; - } - - /** - * @param string $nationalNumber - * @param PhoneNumberDesc $numberDesc - * @return bool - */ - public function isNumberMatchingDesc($nationalNumber, PhoneNumberDesc $numberDesc) - { - // Check if any possible number lengths are present; if so, we use them to avoid checking the - // validation pattern if they don't match. If they are absent, this means they match the general - // description, which we have already checked before checking a specific number type. - $actualLength = mb_strlen($nationalNumber); - $possibleLengths = $numberDesc->getPossibleLength(); - if (count($possibleLengths) > 0 && !in_array($actualLength, $possibleLengths)) { - return false; + // Check if any possible number lengths are present; if so, we use them to avoid checking the + // validation pattern if they don't match. If they are absent, this means they match the general + // description, which we have already checked before checking a specific number type. + $actualLength = mb_strlen($nationalNumber); + $possibleLengths = $numberDesc->getPossibleLength(); + if (count($possibleLengths) > 0 && !in_array($actualLength, $possibleLengths)) { + return false; } return $this->matcherAPI->matchNationalNumber($nationalNumber, $numberDesc, false); } /** - * isNumberGeographical(PhoneNumber) + * isNumberGeographical(PhoneNumber). * * Tests whether a phone number has a geographical association. It checks if the number is * associated with a certain region in the country to which it belongs. Note that this doesn't @@ -993,8 +747,9 @@ public function isNumberMatchingDesc($nationalNumber, PhoneNumberDesc $numberDes * This version exists since calculating the phone number type is expensive; if we have already * done this, we don't want to do it again. * - * @param PhoneNumber|int $phoneNumberObjOrType A PhoneNumber object, or a PhoneNumberType integer + * @param int|PhoneNumber $phoneNumberObjOrType A PhoneNumber object, or a PhoneNumberType integer * @param int|null $countryCallingCode Used when passing a PhoneNumberType + * * @return bool */ public function isNumberGeographical($phoneNumberObjOrType, $countryCallingCode = null) @@ -1003,41 +758,34 @@ public function isNumberGeographical($phoneNumberObjOrType, $countryCallingCode return $this->isNumberGeographical($this->getNumberType($phoneNumberObjOrType), $phoneNumberObjOrType->getCountryCode()); } - return $phoneNumberObjOrType == PhoneNumberType::FIXED_LINE - || $phoneNumberObjOrType == PhoneNumberType::FIXED_LINE_OR_MOBILE + return PhoneNumberType::FIXED_LINE == $phoneNumberObjOrType + || PhoneNumberType::FIXED_LINE_OR_MOBILE == $phoneNumberObjOrType || (in_array($countryCallingCode, static::$GEO_MOBILE_COUNTRIES) - && $phoneNumberObjOrType == PhoneNumberType::MOBILE); + && PhoneNumberType::MOBILE == $phoneNumberObjOrType); } /** * Gets the type of a valid phone number. + * * @param PhoneNumber $number the number the phone number that we want to know the type + * * @return int PhoneNumberType the type of the phone number, or UNKNOWN if it is invalid */ public function getNumberType(PhoneNumber $number) { $regionCode = $this->getRegionCodeForNumber($number); $metadata = $this->getMetadataForRegionOrCallingCode($number->getCountryCode(), $regionCode); - if ($metadata === null) { + if (null === $metadata) { return PhoneNumberType::UNKNOWN; } $nationalSignificantNumber = $this->getNationalSignificantNumber($number); - return $this->getNumberTypeHelper($nationalSignificantNumber, $metadata); - } - /** - * @param int $countryCallingCode - * @param string $regionCode - * @return PhoneMetadata - */ - protected function getMetadataForRegionOrCallingCode($countryCallingCode, $regionCode) - { - return static::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCode ? - $this->getMetadataForNonGeographicalRegion($countryCallingCode) : $this->getMetadataForRegion($regionCode); + return $this->getNumberTypeHelper($nationalSignificantNumber, $metadata); } /** * @param int $countryCallingCode + * * @return PhoneMetadata */ public function getMetadataForNonGeographicalRegion($countryCallingCode) @@ -1045,6 +793,7 @@ public function getMetadataForNonGeographicalRegion($countryCallingCode) if (!isset($this->countryCallingCodeToRegionCodeMap[$countryCallingCode])) { return null; } + return $this->metadataSource->getMetadataForNonGeographicalRegion($countryCallingCode); } @@ -1079,7 +828,8 @@ public function getMetadataForNonGeographicalRegion($countryCallingCode) * Refer to the unit tests to see the difference between this function and * {@link #getLengthOfGeographicalAreaCode}. * - * @param PhoneNumber $number the PhoneNumber object for which clients want to know the length of the NDC. + * @param PhoneNumber $number the PhoneNumber object for which clients want to know the length of the NDC + * * @return int the length of NDC of the PhoneNumber object passed in, which could be zero */ public function getLengthOfNationalDestinationCode(PhoneNumber $number) @@ -1105,7 +855,7 @@ public function getLengthOfNationalDestinationCode(PhoneNumber $number) return 0; } - if ($this->getNumberType($number) == PhoneNumberType::MOBILE) { + if (PhoneNumberType::MOBILE == $this->getNumberType($number)) { // For example Argentinian mobile numbers, when formatted in the international format, are in // the form of +54 9 NDC XXXX.... As a result, we take the length of the third group (NDC) and // add the length of the second group (which is the mobile token), which also forms part of @@ -1113,10 +863,11 @@ public function getLengthOfNationalDestinationCode(PhoneNumber $number) // separately from the rest of the phone number. $mobileToken = static::getCountryMobileToken($number->getCountryCode()); - if ($mobileToken !== '') { + if ('' !== $mobileToken) { return mb_strlen($numberGroups[2]) + mb_strlen($numberGroups[3]); } } + return mb_strlen($numberGroups[2]); } @@ -1132,11 +883,12 @@ public function getLengthOfNationalDestinationCode(PhoneNumber $number) * * @param PhoneNumber $number the phone number to be formatted * @param int $numberFormat the PhoneNumberFormat the phone number should be formatted into + * * @return string the formatted phone number */ public function format(PhoneNumber $number, $numberFormat) { - if ($number->getNationalNumber() == 0 && $number->hasRawInput()) { + if (0 == $number->getNationalNumber() && $number->hasRawInput()) { // Unparseable numbers that kept their raw input just use that. // This is the only case where a number can be formatted as E164 without a // leading '+' symbol (but the original number wasn't parseable anyway). @@ -1152,16 +904,18 @@ public function format(PhoneNumber $number, $numberFormat) $countryCallingCode = $number->getCountryCode(); $nationalSignificantNumber = $this->getNationalSignificantNumber($number); - if ($numberFormat == PhoneNumberFormat::E164) { + if (PhoneNumberFormat::E164 == $numberFormat) { // Early exit for E164 case (even if the country calling code is invalid) since no formatting // of the national number needs to be applied. Extensions are not formatted. $formattedNumber .= $nationalSignificantNumber; $this->prefixNumberWithCountryCallingCode($countryCallingCode, PhoneNumberFormat::E164, $formattedNumber); + return $formattedNumber; } if (!$this->hasValidCountryCallingCode($countryCallingCode)) { $formattedNumber .= $nationalSignificantNumber; + return $formattedNumber; } @@ -1175,41 +929,8 @@ public function format(PhoneNumber $number, $numberFormat) $formattedNumber .= $this->formatNsn($nationalSignificantNumber, $metadata, $numberFormat); $this->maybeAppendFormattedExtension($number, $metadata, $numberFormat, $formattedNumber); $this->prefixNumberWithCountryCallingCode($countryCallingCode, $numberFormat, $formattedNumber); - return $formattedNumber; - } - - /** - * A helper function that is used by format and formatByPattern. - * @param int $countryCallingCode - * @param int $numberFormat PhoneNumberFormat - * @param string $formattedNumber - */ - protected function prefixNumberWithCountryCallingCode($countryCallingCode, $numberFormat, &$formattedNumber) - { - switch ($numberFormat) { - case PhoneNumberFormat::E164: - $formattedNumber = static::PLUS_SIGN . $countryCallingCode . $formattedNumber; - return; - case PhoneNumberFormat::INTERNATIONAL: - $formattedNumber = static::PLUS_SIGN . $countryCallingCode . ' ' . $formattedNumber; - return; - case PhoneNumberFormat::RFC3966: - $formattedNumber = static::RFC3966_PREFIX . static::PLUS_SIGN . $countryCallingCode . '-' . $formattedNumber; - return; - case PhoneNumberFormat::NATIONAL: - default: - return; - } - } - /** - * Helper function to check the country calling code is valid. - * @param int $countryCallingCode - * @return bool - */ - protected function hasValidCountryCallingCode($countryCallingCode) - { - return isset($this->countryCallingCodeToRegionCodeMap[$countryCallingCode]); + return $formattedNumber; } /** @@ -1221,42 +942,20 @@ protected function hasValidCountryCallingCode($countryCallingCode) * the value for World in the UN M.49 schema). * * @param int $countryCallingCode + * * @return string */ public function getRegionCodeForCountryCode($countryCallingCode) { $regionCodes = isset($this->countryCallingCodeToRegionCodeMap[$countryCallingCode]) ? $this->countryCallingCodeToRegionCodeMap[$countryCallingCode] : null; - return $regionCodes === null ? static::UNKNOWN_REGION : $regionCodes[0]; - } - /** - * Note in some regions, the national number can be written in two completely different ways - * depending on whether it forms part of the NATIONAL format or INTERNATIONAL format. The - * numberFormat parameter here is used to specify which format to use for those cases. If a - * carrierCode is specified, this will be inserted into the formatted string to replace $CC. - * @param string $number - * @param PhoneMetadata $metadata - * @param int $numberFormat PhoneNumberFormat - * @param null|string $carrierCode - * @return string - */ - protected function formatNsn($number, PhoneMetadata $metadata, $numberFormat, $carrierCode = null) - { - $intlNumberFormats = $metadata->intlNumberFormats(); - // When the intlNumberFormats exists, we use that to format national number for the - // INTERNATIONAL format instead of using the numberDesc.numberFormats. - $availableFormats = (count($intlNumberFormats) == 0 || $numberFormat == PhoneNumberFormat::NATIONAL) - ? $metadata->numberFormats() - : $metadata->intlNumberFormats(); - $formattingPattern = $this->chooseFormattingPatternForNumber($availableFormats, $number); - return ($formattingPattern === null) - ? $number - : $this->formatNsnUsingPattern($number, $formattingPattern, $numberFormat, $carrierCode); + return null === $regionCodes ? static::UNKNOWN_REGION : $regionCodes[0]; } /** * @param NumberFormat[] $availableFormats * @param string $nationalNumber + * * @return NumberFormat|null */ public function chooseFormattingPatternForNumber(array $availableFormats, $nationalNumber) @@ -1271,23 +970,25 @@ public function chooseFormattingPatternForNumber(array $availableFormats, $natio $nationalNumber ); } - if ($size == 0 || $leadingDigitsPatternMatcher->lookingAt()) { + if (0 == $size || $leadingDigitsPatternMatcher->lookingAt()) { $m = new Matcher($numFormat->getPattern(), $nationalNumber); if ($m->matches() > 0) { return $numFormat; } } } + return null; } /** * Note that carrierCode is optional - if null or an empty string, no carrier code replacement * will take place. + * * @param string $nationalNumber - * @param NumberFormat $formattingPattern * @param int $numberFormat PhoneNumberFormat - * @param null|string $carrierCode + * @param string|null $carrierCode + * * @return string */ public function formatNsnUsingPattern( @@ -1298,9 +999,9 @@ public function formatNsnUsingPattern( ) { $numberFormatRule = $formattingPattern->getFormat(); $m = new Matcher($formattingPattern->getPattern(), $nationalNumber); - if ($numberFormat === PhoneNumberFormat::NATIONAL && - $carrierCode !== null && mb_strlen($carrierCode) > 0 && - mb_strlen($formattingPattern->getDomesticCarrierCodeFormattingRule()) > 0 + if (PhoneNumberFormat::NATIONAL === $numberFormat + && null !== $carrierCode && mb_strlen($carrierCode) > 0 + && mb_strlen($formattingPattern->getDomesticCarrierCodeFormattingRule()) > 0 ) { // Replace the $CC in the formatting rule with the desired carrier code. $carrierCodeFormattingRule = $formattingPattern->getDomesticCarrierCodeFormattingRule(); @@ -1313,9 +1014,9 @@ public function formatNsnUsingPattern( } else { // Use the national prefix formatting rule instead. $nationalPrefixFormattingRule = $formattingPattern->getNationalPrefixFormattingRule(); - if ($numberFormat == PhoneNumberFormat::NATIONAL && - $nationalPrefixFormattingRule !== null && - mb_strlen($nationalPrefixFormattingRule) > 0 + if (PhoneNumberFormat::NATIONAL == $numberFormat + && null !== $nationalPrefixFormattingRule + && mb_strlen($nationalPrefixFormattingRule) > 0 ) { $firstGroupMatcher = new Matcher(static::FIRST_GROUP_PATTERN, $numberFormatRule); $formattedNationalNumber = $m->replaceAll( @@ -1325,7 +1026,7 @@ public function formatNsnUsingPattern( $formattedNationalNumber = $m->replaceAll($numberFormatRule); } } - if ($numberFormat == PhoneNumberFormat::RFC3966) { + if (PhoneNumberFormat::RFC3966 == $numberFormat) { // Strip any leading punctuation. $matcher = new Matcher(static::$SEPARATOR_PATTERN, $formattedNationalNumber); if ($matcher->lookingAt()) { @@ -1334,29 +1035,8 @@ public function formatNsnUsingPattern( // Replace the rest with a dash between each number group. $formattedNationalNumber = $matcher->reset($formattedNationalNumber)->replaceAll('-'); } - return $formattedNationalNumber; - } - /** - * Appends the formatted extension of a phone number to formattedNumber, if the phone number had - * an extension specified. - * - * @param PhoneNumber $number - * @param PhoneMetadata|null $metadata - * @param int $numberFormat PhoneNumberFormat - * @param string $formattedNumber - */ - protected function maybeAppendFormattedExtension(PhoneNumber $number, $metadata, $numberFormat, &$formattedNumber) - { - if ($number->hasExtension() && mb_strlen($number->getExtension()) > 0) { - if ($numberFormat === PhoneNumberFormat::RFC3966) { - $formattedNumber .= static::RFC3966_EXTN_PREFIX . $number->getExtension(); - } elseif (!empty($metadata) && $metadata->hasPreferredExtnPrefix()) { - $formattedNumber .= $metadata->getPreferredExtnPrefix() . $number->getExtension(); - } else { - $formattedNumber .= static::DEFAULT_EXTN_PREFIX . $number->getExtension(); - } - } + return $formattedNationalNumber; } /** @@ -1365,17 +1045,19 @@ protected function maybeAppendFormattedExtension(PhoneNumber $number, $metadata, * a mobile number from that country from abroad. * * @param int $countryCallingCode the country calling code for which we want the mobile token + * * @return string the mobile token, as a string, for the given country calling code */ public static function getCountryMobileToken($countryCallingCode) { - if (count(static::$MOBILE_TOKEN_MAPPINGS) === 0) { + if (0 === count(static::$MOBILE_TOKEN_MAPPINGS)) { static::initMobileTokenMappings(); } if (array_key_exists($countryCallingCode, static::$MOBILE_TOKEN_MAPPINGS)) { return static::$MOBILE_TOKEN_MAPPINGS[$countryCallingCode]; } + return ''; } @@ -1387,6 +1069,7 @@ public static function getCountryMobileToken($countryCallingCode) * {@link #isValidNumber} should be used. * * @param string $number the number that needs to be checked + * * @return bool true if the number is a valid vanity number */ public function isAlphaNumber($number) @@ -1396,7 +1079,8 @@ public function isAlphaNumber($number) return false; } $this->maybeStripExtension($number); - return (bool)preg_match('/' . static::VALID_ALPHA_PHONE_PATTERN . '/' . static::REGEX_FLAGS, $number); + + return (bool) preg_match('/' . static::VALID_ALPHA_PHONE_PATTERN . '/' . static::REGEX_FLAGS, $number); } /** @@ -1407,11 +1091,12 @@ public function isAlphaNumber($number) * leading non-number symbols have been removed, such as by the method extractPossibleNumber. * * @param string $number to be checked for viability as a phone number - * @return boolean true if the number could be a phone number of some sort, otherwise false + * + * @return bool true if the number could be a phone number of some sort, otherwise false */ public static function isViablePhoneNumber($number) { - if (static::$VALID_PHONE_NUMBER_PATTERN === null) { + if (null === static::$VALID_PHONE_NUMBER_PATTERN) { static::initValidPhoneNumberPatterns(); } @@ -1422,46 +1107,8 @@ public static function isViablePhoneNumber($number) $validPhoneNumberPattern = static::getValidPhoneNumberPattern(); $m = preg_match($validPhoneNumberPattern, $number); - return $m > 0; - } - - /** - * We append optionally the extension pattern to the end here, as a valid phone number may - * have an extension prefix appended, followed by 1 or more digits. - * @return string - */ - protected static function getValidPhoneNumberPattern() - { - return static::$VALID_PHONE_NUMBER_PATTERN; - } - /** - * Strips any extension (as in, the part of the number dialled after the call is connected, - * usually indicated with extn, ext, x or similar) from the end of the number, and returns it. - * - * @param string $number the non-normalized telephone number that we wish to strip the extension from - * @return string the phone extension - */ - protected function maybeStripExtension(&$number) - { - $matches = array(); - $find = preg_match(static::$EXTN_PATTERN, $number, $matches, PREG_OFFSET_CAPTURE); - // If we find a potential extension, and the number preceding this is a viable number, we assume - // it is an extension. - if ($find > 0 && static::isViablePhoneNumber(substr($number, 0, $matches[0][1]))) { - // The numbers are captured into groups in the regular expression. - - for ($i = 1, $length = count($matches); $i <= $length; $i++) { - if ($matches[$i][0] != '') { - // We go through the capturing groups until we find one that captured some digits. If none - // did, then we will return the empty string. - $extension = $matches[$i][0]; - $number = substr($number, 0, $matches[0][1]); - return $extension; - } - } - } - return ''; + return $m > 0; } /** @@ -1470,36 +1117,39 @@ protected function maybeStripExtension(&$number) * well as the country_code_source field. * * @param string $numberToParse number that we are attempting to parse. This can contain formatting - * such as +, ( and -, as well as a phone number extension. It can also - * be provided in RFC3966 format. + * such as +, ( and -, as well as a phone number extension. It can also + * be provided in RFC3966 format. * @param string $defaultRegion region that we are expecting the number to be from. This is only used - * if the number being parsed is not written in international format. - * The country calling code for the number in this case would be stored - * as that of the default region supplied. + * if the number being parsed is not written in international format. + * The country calling code for the number in this case would be stored + * as that of the default region supplied. * @param PhoneNumber $phoneNumber - * @return PhoneNumber a phone number proto buffer filled with the parsed number + * + * @return PhoneNumber a phone number proto buffer filled with the parsed number */ public function parseAndKeepRawInput($numberToParse, $defaultRegion, PhoneNumber $phoneNumber = null) { - if ($phoneNumber === null) { + if (null === $phoneNumber) { $phoneNumber = new PhoneNumber(); } $this->parseHelper($numberToParse, $defaultRegion, true, true, $phoneNumber); + return $phoneNumber; } /** - * Returns an iterable over all PhoneNumberMatches in $text + * Returns an iterable over all PhoneNumberMatches in $text. * * @param string $text * @param string $defaultRegion * @param AbstractLeniency $leniency Defaults to Leniency::VALID() * @param int $maxTries Defaults to PHP_INT_MAX + * * @return PhoneNumberMatcher */ public function findNumbers($text, $defaultRegion, AbstractLeniency $leniency = null, $maxTries = PHP_INT_MAX) { - if ($leniency === null) { + if (null === $leniency) { $leniency = Leniency::VALID(); } @@ -1509,7 +1159,8 @@ public function findNumbers($text, $defaultRegion, AbstractLeniency $leniency = /** * Gets an AsYouTypeFormatter for the specific region. * - * @param string $regionCode The region where the phone number is being entered. + * @param string $regionCode the region where the phone number is being entered + * * @return AsYouTypeFormatter */ public function getAsYouTypeFormatter($regionCode) @@ -1519,305 +1170,64 @@ public function getAsYouTypeFormatter($regionCode) /** * A helper function to set the values related to leading zeros in a PhoneNumber. + * * @param string $nationalNumber - * @param PhoneNumber $phoneNumber */ public static function setItalianLeadingZerosForPhoneNumber($nationalNumber, PhoneNumber $phoneNumber) { - if (strlen($nationalNumber) > 1 && substr($nationalNumber, 0, 1) == '0') { + if (strlen($nationalNumber) > 1 && '0' == substr($nationalNumber, 0, 1)) { $phoneNumber->setItalianLeadingZero(true); $numberOfLeadingZeros = 1; // Note that if the national number is all "0"s, the last "0" is not counted as a leading // zero. - while ($numberOfLeadingZeros < (strlen($nationalNumber) - 1) && - substr($nationalNumber, $numberOfLeadingZeros, 1) == '0') { - $numberOfLeadingZeros++; + while ($numberOfLeadingZeros < (strlen($nationalNumber) - 1) + && '0' == substr($nationalNumber, $numberOfLeadingZeros, 1)) { + ++$numberOfLeadingZeros; } - if ($numberOfLeadingZeros != 1) { + if (1 != $numberOfLeadingZeros) { $phoneNumber->setNumberOfLeadingZeros($numberOfLeadingZeros); } } } /** - * Parses a string and fills up the phoneNumber. This method is the same as the public - * parse() method, with the exception that it allows the default region to be null, for use by - * isNumberMatch(). checkRegion should be set to false if it is permitted for the default region - * to be null or unknown ("ZZ"). - * @param string $numberToParse - * @param string $defaultRegion - * @param bool $keepRawInput - * @param bool $checkRegion - * @param PhoneNumber $phoneNumber - * @throws NumberParseException + * Attempts to extract a possible number from the string passed in. This currently strips all + * leading characters that cannot be used to start a phone number. Characters that can be used to + * start a phone number are defined in the VALID_START_CHAR_PATTERN. If none of these characters + * are found in the number passed in, an empty string is returned. This function also attempts to + * strip off any alternative extensions or endings if two or more are present, such as in the case + * of: (530) 583-6985 x302/x2303. The second extension here makes this actually two phone numbers, + * (530) 583-6985 x302 and (530) 583-6985 x2303. We remove the second extension so that the first + * number is parsed correctly. + * + * @param int $number the string that might contain a phone number + * + * @return string the number, stripped of any non-phone-number prefix (such as "Tel:") or an empty + * string if no character used to start phone numbers (such as + or any digit) is + * found in the number */ - protected function parseHelper($numberToParse, $defaultRegion, $keepRawInput, $checkRegion, PhoneNumber $phoneNumber) + public static function extractPossibleNumber($number) { - if ($numberToParse === null) { - throw new NumberParseException(NumberParseException::NOT_A_NUMBER, 'The phone number supplied was null.'); + if (null === static::$VALID_START_CHAR_PATTERN) { + static::initValidStartCharPattern(); } - $numberToParse = trim($numberToParse); + $matches = []; + $match = preg_match('/' . static::$VALID_START_CHAR_PATTERN . '/ui', $number, $matches, PREG_OFFSET_CAPTURE); + if ($match > 0) { + $number = substr($number, $matches[0][1]); + // Remove trailing non-alpha non-numerical characters. + $trailingCharsMatcher = new Matcher(static::$UNWANTED_END_CHAR_PATTERN, $number); + if ($trailingCharsMatcher->find() && $trailingCharsMatcher->start() > 0) { + $number = substr($number, 0, $trailingCharsMatcher->start()); + } - if (mb_strlen($numberToParse) > static::MAX_INPUT_STRING_LENGTH) { - throw new NumberParseException( - NumberParseException::TOO_LONG, - 'The string supplied was too long to parse.' - ); - } - - $nationalNumber = ''; - $this->buildNationalNumberForParsing($numberToParse, $nationalNumber); - - if (!static::isViablePhoneNumber($nationalNumber)) { - throw new NumberParseException( - NumberParseException::NOT_A_NUMBER, - 'The string supplied did not seem to be a phone number.' - ); - } - - // Check the region supplied is valid, or that the extracted number starts with some sort of + - // sign so the number's region can be determined. - if ($checkRegion && !$this->checkRegionForParsing($nationalNumber, $defaultRegion)) { - throw new NumberParseException( - NumberParseException::INVALID_COUNTRY_CODE, - 'Missing or invalid default region.' - ); - } - - if ($keepRawInput) { - $phoneNumber->setRawInput($numberToParse); - } - // Attempt to parse extension first, since it doesn't require region-specific data and we want - // to have the non-normalised number here. - $extension = $this->maybeStripExtension($nationalNumber); - if (mb_strlen($extension) > 0) { - $phoneNumber->setExtension($extension); - } - - $regionMetadata = $this->getMetadataForRegion($defaultRegion); - // Check to see if the number is given in international format so we know whether this number is - // from the default region or not. - $normalizedNationalNumber = ''; - try { - // TODO: This method should really just take in the string buffer that has already - // been created, and just remove the prefix, rather than taking in a string and then - // outputting a string buffer. - $countryCode = $this->maybeExtractCountryCode( - $nationalNumber, - $regionMetadata, - $normalizedNationalNumber, - $keepRawInput, - $phoneNumber - ); - } catch (NumberParseException $e) { - $matcher = new Matcher(static::$PLUS_CHARS_PATTERN, $nationalNumber); - if ($e->getErrorType() == NumberParseException::INVALID_COUNTRY_CODE && $matcher->lookingAt()) { - // Strip the plus-char, and try again. - $countryCode = $this->maybeExtractCountryCode( - substr($nationalNumber, $matcher->end()), - $regionMetadata, - $normalizedNationalNumber, - $keepRawInput, - $phoneNumber - ); - if ($countryCode == 0) { - throw new NumberParseException( - NumberParseException::INVALID_COUNTRY_CODE, - 'Could not interpret numbers after plus-sign.' - ); - } - } else { - throw new NumberParseException($e->getErrorType(), $e->getMessage(), $e); - } - } - if ($countryCode !== 0) { - $phoneNumberRegion = $this->getRegionCodeForCountryCode($countryCode); - if ($phoneNumberRegion != $defaultRegion) { - // Metadata cannot be null because the country calling code is valid. - $regionMetadata = $this->getMetadataForRegionOrCallingCode($countryCode, $phoneNumberRegion); - } - } else { - // If no extracted country calling code, use the region supplied instead. The national number - // is just the normalized version of the number we were given to parse. - - $normalizedNationalNumber .= static::normalize($nationalNumber); - if ($defaultRegion !== null) { - $countryCode = $regionMetadata->getCountryCode(); - $phoneNumber->setCountryCode($countryCode); - } elseif ($keepRawInput) { - $phoneNumber->clearCountryCodeSource(); - } - } - if (mb_strlen($normalizedNationalNumber) < static::MIN_LENGTH_FOR_NSN) { - throw new NumberParseException( - NumberParseException::TOO_SHORT_NSN, - 'The string supplied is too short to be a phone number.' - ); - } - if ($regionMetadata !== null) { - $carrierCode = ''; - $potentialNationalNumber = $normalizedNationalNumber; - $this->maybeStripNationalPrefixAndCarrierCode($potentialNationalNumber, $regionMetadata, $carrierCode); - // We require that the NSN remaining after stripping the national prefix and carrier code be - // long enough to be a possible length for the region. Otherwise, we don't do the stripping, - // since the original number could be a valid short number. - $validationResult = $this->testNumberLength($potentialNationalNumber, $regionMetadata); - if ($validationResult !== ValidationResult::TOO_SHORT - && $validationResult !== ValidationResult::IS_POSSIBLE_LOCAL_ONLY - && $validationResult !== ValidationResult::INVALID_LENGTH) { - $normalizedNationalNumber = $potentialNationalNumber; - if ($keepRawInput && mb_strlen($carrierCode) > 0) { - $phoneNumber->setPreferredDomesticCarrierCode($carrierCode); - } - } - } - $lengthOfNationalNumber = mb_strlen($normalizedNationalNumber); - if ($lengthOfNationalNumber < static::MIN_LENGTH_FOR_NSN) { - throw new NumberParseException( - NumberParseException::TOO_SHORT_NSN, - 'The string supplied is too short to be a phone number.' - ); - } - if ($lengthOfNationalNumber > static::MAX_LENGTH_FOR_NSN) { - throw new NumberParseException( - NumberParseException::TOO_LONG, - 'The string supplied is too long to be a phone number.' - ); - } - static::setItalianLeadingZerosForPhoneNumber($normalizedNationalNumber, $phoneNumber); - - /* - * We have to store the National Number as a string instead of a "long" as Google do - * - * Since PHP doesn't always support 64 bit INTs, this was a float, but that had issues - * with long numbers. - * - * We have to remove the leading zeroes ourself though - */ - if ((int)$normalizedNationalNumber == 0) { - $normalizedNationalNumber = '0'; - } else { - $normalizedNationalNumber = ltrim($normalizedNationalNumber, '0'); - } - - $phoneNumber->setNationalNumber($normalizedNationalNumber); - } - - /** - * Returns a new phone number containing only the fields needed to uniquely identify a phone - * number, rather than any fields that capture the context in which the phone number was created. - * These fields correspond to those set in parse() rather than parseAndKeepRawInput() - * - * @param PhoneNumber $phoneNumberIn - * @return PhoneNumber - */ - protected static function copyCoreFieldsOnly(PhoneNumber $phoneNumberIn) - { - $phoneNumber = new PhoneNumber(); - $phoneNumber->setCountryCode($phoneNumberIn->getCountryCode()); - $phoneNumber->setNationalNumber($phoneNumberIn->getNationalNumber()); - if (mb_strlen($phoneNumberIn->getExtension()) > 0) { - $phoneNumber->setExtension($phoneNumberIn->getExtension()); - } - if ($phoneNumberIn->isItalianLeadingZero()) { - $phoneNumber->setItalianLeadingZero(true); - // This field is only relevant if there are leading zeros at all. - $phoneNumber->setNumberOfLeadingZeros($phoneNumberIn->getNumberOfLeadingZeros()); - } - return $phoneNumber; - } - - /** - * Converts numberToParse to a form that we can parse and write it to nationalNumber if it is - * written in RFC3966; otherwise extract a possible number out of it and write to nationalNumber. - * @param string $numberToParse - * @param string $nationalNumber - */ - protected function buildNationalNumberForParsing($numberToParse, &$nationalNumber) - { - $indexOfPhoneContext = strpos($numberToParse, static::RFC3966_PHONE_CONTEXT); - if ($indexOfPhoneContext !== false) { - $phoneContextStart = $indexOfPhoneContext + mb_strlen(static::RFC3966_PHONE_CONTEXT); - // If the phone context contains a phone number prefix, we need to capture it, whereas domains - // will be ignored. - if ($phoneContextStart < (strlen($numberToParse) - 1) - && substr($numberToParse, $phoneContextStart, 1) == static::PLUS_SIGN) { - // Additional parameters might follow the phone context. If so, we will remove them here - // because the parameters after phone context are not important for parsing the - // phone number. - $phoneContextEnd = strpos($numberToParse, ';', $phoneContextStart); - if ($phoneContextEnd > 0) { - $nationalNumber .= substr($numberToParse, $phoneContextStart, $phoneContextEnd - $phoneContextStart); - } else { - $nationalNumber .= substr($numberToParse, $phoneContextStart); - } - } - - // Now append everything between the "tel:" prefix and the phone-context. This should include - // the national number, an optional extension or isdn-subaddress component. Note we also - // handle the case when "tel:" is missing, as we have seen in some of the phone number inputs. - // In that case, we append everything from the beginning. - - $indexOfRfc3966Prefix = strpos($numberToParse, static::RFC3966_PREFIX); - $indexOfNationalNumber = ($indexOfRfc3966Prefix !== false) ? $indexOfRfc3966Prefix + strlen(static::RFC3966_PREFIX) : 0; - $nationalNumber .= substr($numberToParse, $indexOfNationalNumber, - $indexOfPhoneContext - $indexOfNationalNumber); - } else { - // Extract a possible number from the string passed in (this strips leading characters that - // could not be the start of a phone number.) - $nationalNumber .= static::extractPossibleNumber($numberToParse); - } - - // Delete the isdn-subaddress and everything after it if it is present. Note extension won't - // appear at the same time with isdn-subaddress according to paragraph 5.3 of the RFC3966 spec, - $indexOfIsdn = strpos($nationalNumber, static::RFC3966_ISDN_SUBADDRESS); - if ($indexOfIsdn > 0) { - $nationalNumber = substr($nationalNumber, 0, $indexOfIsdn); - } - // If both phone context and isdn-subaddress are absent but other parameters are present, the - // parameters are left in nationalNumber. This is because we are concerned about deleting - // content from a potential number string when there is no strong evidence that the number is - // actually written in RFC3966. - } - - /** - * Attempts to extract a possible number from the string passed in. This currently strips all - * leading characters that cannot be used to start a phone number. Characters that can be used to - * start a phone number are defined in the VALID_START_CHAR_PATTERN. If none of these characters - * are found in the number passed in, an empty string is returned. This function also attempts to - * strip off any alternative extensions or endings if two or more are present, such as in the case - * of: (530) 583-6985 x302/x2303. The second extension here makes this actually two phone numbers, - * (530) 583-6985 x302 and (530) 583-6985 x2303. We remove the second extension so that the first - * number is parsed correctly. - * - * @param int $number the string that might contain a phone number - * @return string the number, stripped of any non-phone-number prefix (such as "Tel:") or an empty - * string if no character used to start phone numbers (such as + or any digit) is - * found in the number - */ - public static function extractPossibleNumber($number) - { - if (static::$VALID_START_CHAR_PATTERN === null) { - static::initValidStartCharPattern(); - } - - $matches = array(); - $match = preg_match('/' . static::$VALID_START_CHAR_PATTERN . '/ui', $number, $matches, PREG_OFFSET_CAPTURE); - if ($match > 0) { - $number = substr($number, $matches[0][1]); - // Remove trailing non-alpha non-numerical characters. - $trailingCharsMatcher = new Matcher(static::$UNWANTED_END_CHAR_PATTERN, $number); - if ($trailingCharsMatcher->find() && $trailingCharsMatcher->start() > 0) { - $number = substr($number, 0, $trailingCharsMatcher->start()); - } - - // Check for extra numbers at the end. - $match = preg_match('%' . static::$SECOND_NUMBER_START_PATTERN . '%', $number, $matches, PREG_OFFSET_CAPTURE); - if ($match > 0) { - $number = substr($number, 0, $matches[0][1]); - } + // Check for extra numbers at the end. + $match = preg_match('%' . static::$SECOND_NUMBER_START_PATTERN . '%', $number, $matches, PREG_OFFSET_CAPTURE); + if ($match > 0) { + $number = substr($number, 0, $matches[0][1]); + } return $number; } @@ -1825,26 +1235,6 @@ public static function extractPossibleNumber($number) return ''; } - /** - * Checks to see that the region code used is valid, or if it is not valid, that the number to - * parse starts with a + symbol so that we can attempt to infer the region from the number. - * Returns false if it cannot use the region provided and the region cannot be inferred. - * @param string $numberToParse - * @param string $defaultRegion - * @return bool - */ - protected function checkRegionForParsing($numberToParse, $defaultRegion) - { - if (!$this->isValidRegionCode($defaultRegion)) { - // If the number is null or empty, we can't infer the region. - $plusCharsPatternMatcher = new Matcher(static::$PLUS_CHARS_PATTERN, $numberToParse); - if ($numberToParse === null || mb_strlen($numberToParse) == 0 || !$plusCharsPatternMatcher->lookingAt()) { - return false; - } - } - return true; - } - /** * Tries to extract a country calling code from a number. This method will return zero if no * country calling code is considered to be present. Country calling codes are extracted in the @@ -1864,18 +1254,20 @@ protected function checkRegionForParsing($numberToParse, $defaultRegion) * code supplied after this does not match that of any known region. * * @param string $number non-normalized telephone number that we wish to extract a country calling - * code from - may begin with '+' + * code from - may begin with '+' * @param PhoneMetadata $defaultRegionMetadata metadata about the region this number may be from * @param string $nationalNumber a string buffer to store the national significant number in, in the case - * that a country calling code was extracted. The number is appended to any existing contents. - * If no country calling code was extracted, this will be left unchanged. + * that a country calling code was extracted. The number is appended to any existing contents. + * If no country calling code was extracted, this will be left unchanged. * @param bool $keepRawInput true if the country_code_source and preferred_carrier_code fields of - * phoneNumber should be populated. + * phoneNumber should be populated * @param PhoneNumber $phoneNumber the PhoneNumber object where the country_code and country_code_source need - * to be populated. Note the country_code is always populated, whereas country_code_source is - * only populated when keepCountryCodeSource is true. - * @return int the country calling code extracted or 0 if none could be extracted + * to be populated. Note the country_code is always populated, whereas country_code_source is + * only populated when keepCountryCodeSource is true. + * * @throws NumberParseException + * + * @return int the country calling code extracted or 0 if none could be extracted */ public function maybeExtractCountryCode( $number, @@ -1884,13 +1276,13 @@ public function maybeExtractCountryCode( $keepRawInput, PhoneNumber $phoneNumber ) { - if (mb_strlen($number) == 0) { + if (0 == mb_strlen($number)) { return 0; } $fullNumber = $number; // Set the default prefix to be something that will never match. $possibleCountryIddPrefix = 'NonMatch'; - if ($defaultRegionMetadata !== null) { + if (null !== $defaultRegionMetadata) { $possibleCountryIddPrefix = $defaultRegionMetadata->getInternationalPrefix(); } $countryCodeSource = $this->maybeStripInternationalPrefixAndNormalize($fullNumber, $possibleCountryIddPrefix); @@ -1898,7 +1290,7 @@ public function maybeExtractCountryCode( if ($keepRawInput) { $phoneNumber->setCountryCodeSource($countryCodeSource); } - if ($countryCodeSource != CountryCodeSource::FROM_DEFAULT_COUNTRY) { + if (CountryCodeSource::FROM_DEFAULT_COUNTRY != $countryCodeSource) { if (mb_strlen($fullNumber) <= static::MIN_LENGTH_FOR_NSN) { throw new NumberParseException( NumberParseException::TOO_SHORT_AFTER_IDD, @@ -1907,8 +1299,9 @@ public function maybeExtractCountryCode( } $potentialCountryCode = $this->extractCountryCode($fullNumber, $nationalNumber); - if ($potentialCountryCode != 0) { + if (0 != $potentialCountryCode) { $phoneNumber->setCountryCode($potentialCountryCode); + return $potentialCountryCode; } @@ -1920,14 +1313,14 @@ public function maybeExtractCountryCode( ); } - if ($defaultRegionMetadata !== null) { + if (null !== $defaultRegionMetadata) { // Check to see if the number starts with the country calling code for the default region. If // so, we remove the country calling code, and do some checks on the validity of the number // before and after. $defaultCountryCode = $defaultRegionMetadata->getCountryCode(); - $defaultCountryCodeString = (string)$defaultCountryCode; + $defaultCountryCodeString = (string) $defaultCountryCode; $normalizedNumber = $fullNumber; - if (strpos($normalizedNumber, $defaultCountryCodeString) === 0) { + if (0 === strpos($normalizedNumber, $defaultCountryCodeString)) { $potentialNationalNumber = substr($normalizedNumber, mb_strlen($defaultCountryCodeString)); $generalDesc = $defaultRegionMetadata->getGeneralDesc(); // Don't need the carrier code. @@ -1942,19 +1335,21 @@ public function maybeExtractCountryCode( // keep that instead. if ((!$this->matcherAPI->matchNationalNumber($fullNumber, $generalDesc, false) && $this->matcherAPI->matchNationalNumber($potentialNationalNumber, $generalDesc, false)) - || $this->testNumberLength($fullNumber, $defaultRegionMetadata) === ValidationResult::TOO_LONG + || ValidationResult::TOO_LONG === $this->testNumberLength($fullNumber, $defaultRegionMetadata) ) { $nationalNumber .= $potentialNationalNumber; if ($keepRawInput) { $phoneNumber->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITHOUT_PLUS_SIGN); } $phoneNumber->setCountryCode($defaultCountryCode); + return $defaultCountryCode; } } } // No country calling code present. $phoneNumber->setCountryCode(0); + return 0; } @@ -1963,30 +1358,33 @@ public function maybeExtractCountryCode( * the resulting number, and indicates if an international prefix was present. * * @param string $number the non-normalized telephone number that we wish to strip any international - * dialing prefix from. + * dialing prefix from * @param string $possibleIddPrefix string the international direct dialing prefix from the region we - * think this number may be dialed in + * think this number may be dialed in + * * @return int the corresponding CountryCodeSource if an international dialing prefix could be - * removed from the number, otherwise CountryCodeSource.FROM_DEFAULT_COUNTRY if the number did - * not seem to be in international format. + * removed from the number, otherwise CountryCodeSource.FROM_DEFAULT_COUNTRY if the number did + * not seem to be in international format. */ public function maybeStripInternationalPrefixAndNormalize(&$number, $possibleIddPrefix) { - if (mb_strlen($number) == 0) { + if (0 == mb_strlen($number)) { return CountryCodeSource::FROM_DEFAULT_COUNTRY; } - $matches = array(); + $matches = []; // Check to see if the number begins with one or more plus signs. $match = preg_match('/^' . static::$PLUS_CHARS_PATTERN . '/' . static::REGEX_FLAGS, $number, $matches, PREG_OFFSET_CAPTURE); if ($match > 0) { $number = mb_substr($number, $matches[0][1] + mb_strlen($matches[0][0])); // Can now normalize the rest of the number since we've consumed the "+" sign at the start. $number = static::normalize($number); + return CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN; } // Attempt to parse the first digits as an international prefix. $iddPattern = $possibleIddPrefix; $number = static::normalize($number); + return $this->parsePrefixAsIdd($iddPattern, $number) ? CountryCodeSource::FROM_NUMBER_WITH_IDD : CountryCodeSource::FROM_DEFAULT_COUNTRY; @@ -2006,12 +1404,13 @@ public function maybeStripInternationalPrefixAndNormalize(&$number, $possibleIdd * - Arabic-Indic numerals are converted to European numerals. * - Spurious alpha characters are stripped. * - * @param string $number a string of characters representing a phone number. - * @return string the normalized string version of the phone number. + * @param string $number a string of characters representing a phone number + * + * @return string the normalized string version of the phone number */ public static function normalize(&$number) { - if (static::$ALPHA_PHONE_MAPPINGS === null) { + if (null === static::$ALPHA_PHONE_MAPPINGS) { static::initAlphaPhoneMappings(); } @@ -2028,6 +1427,7 @@ public static function normalize(&$number) * arabic-indic numerals to European numerals, and strips punctuation and alpha characters. * * @param $number string a string of characters representing a phone number + * * @return string the normalized string version of the phone number */ public static function normalizeDigitsOnly($number) @@ -2038,6 +1438,7 @@ public static function normalizeDigitsOnly($number) /** * @param string $number * @param bool $keepNonDigits + * * @return string */ public static function normalizeDigits($number, $keepNonDigits) @@ -2054,59 +1455,38 @@ public static function normalizeDigits($number, $keepNonDigits) $normalizedDigits .= $character; } } - return $normalizedDigits; - } - /** - * Strips the IDD from the start of the number if present. Helper function used by - * maybeStripInternationalPrefixAndNormalize. - * @param string $iddPattern - * @param string $number - * @return bool - */ - protected function parsePrefixAsIdd($iddPattern, &$number) - { - $m = new Matcher($iddPattern, $number); - if ($m->lookingAt()) { - $matchEnd = $m->end(); - // Only strip this if the first digit after the match is not a 0, since country calling codes - // cannot begin with 0. - $digitMatcher = new Matcher(static::$CAPTURING_DIGIT_PATTERN, substr($number, $matchEnd)); - if ($digitMatcher->find()) { - $normalizedGroup = static::normalizeDigitsOnly($digitMatcher->group(1)); - if ($normalizedGroup == '0') { - return false; - } - } - $number = substr($number, $matchEnd); - return true; - } - return false; + return $normalizedDigits; } /** * Extracts country calling code from fullNumber, returns it and places the remaining number in nationalNumber. * It assumes that the leading plus sign or IDD has already been removed. * Returns 0 if fullNumber doesn't start with a valid country calling code, and leaves nationalNumber unmodified. + * * @param string $fullNumber * @param string $nationalNumber + * * @return int + * * @internal */ public function extractCountryCode($fullNumber, &$nationalNumber) { - if ((mb_strlen($fullNumber) == 0) || ($fullNumber[0] == '0')) { + if ((0 == mb_strlen($fullNumber)) || ('0' == $fullNumber[0])) { // Country codes do not begin with a '0'. return 0; } $numberLength = mb_strlen($fullNumber); - for ($i = 1; $i <= static::MAX_LENGTH_COUNTRY_CODE && $i <= $numberLength; $i++) { - $potentialCountryCode = (int)substr($fullNumber, 0, $i); + for ($i = 1; $i <= static::MAX_LENGTH_COUNTRY_CODE && $i <= $numberLength; ++$i) { + $potentialCountryCode = (int) substr($fullNumber, 0, $i); if (isset($this->countryCallingCodeToRegionCodeMap[$potentialCountryCode])) { $nationalNumber .= substr($fullNumber, $i); + return $potentialCountryCode; } } + return 0; } @@ -2114,16 +1494,17 @@ public function extractCountryCode($fullNumber, &$nationalNumber) * Strips any national prefix (such as 0, 1) present in the number provided. * * @param string $number the normalized telephone number that we wish to strip any national - * dialing prefix from + * dialing prefix from * @param PhoneMetadata $metadata the metadata for the region that we think this number is from * @param string $carrierCode a place to insert the carrier code if one is extracted - * @return bool true if a national prefix or carrier code (or both) could be extracted. + * + * @return bool true if a national prefix or carrier code (or both) could be extracted */ public function maybeStripNationalPrefixAndCarrierCode(&$number, PhoneMetadata $metadata, &$carrierCode) { $numberLength = mb_strlen($number); $possibleNationalPrefix = $metadata->getNationalPrefixForParsing(); - if ($numberLength == 0 || $possibleNationalPrefix === null || mb_strlen($possibleNationalPrefix) == 0) { + if (0 == $numberLength || null === $possibleNationalPrefix || 0 == mb_strlen($possibleNationalPrefix)) { // Early return for numbers of zero length. return false; } @@ -2139,21 +1520,25 @@ public function maybeStripNationalPrefixAndCarrierCode(&$number, PhoneMetadata $ // remove the national prefix $numOfGroups = $prefixMatcher->groupCount(); $transformRule = $metadata->getNationalPrefixTransformRule(); - if ($transformRule === null - || mb_strlen($transformRule) == 0 - || $prefixMatcher->group($numOfGroups - 1) === null + if (null === $transformRule + || 0 == mb_strlen($transformRule) + || null === $prefixMatcher->group($numOfGroups - 1) ) { // If the original number was viable, and the resultant number is not, we return. - if ($isViableOriginalNumber && - !$this->matcherAPI->matchNationalNumber( - substr($number, $prefixMatcher->end()), $generalDesc, false)) { + if ($isViableOriginalNumber + && !$this->matcherAPI->matchNationalNumber( + substr($number, $prefixMatcher->end()), + $generalDesc, + false + )) { return false; } - if ($carrierCode !== null && $numOfGroups > 0 && $prefixMatcher->group($numOfGroups) !== null) { + if (null !== $carrierCode && $numOfGroups > 0 && null !== $prefixMatcher->group($numOfGroups)) { $carrierCode .= $prefixMatcher->group(1); } $number = substr($number, $prefixMatcher->end()); + return true; } @@ -2170,12 +1555,14 @@ public function maybeStripNationalPrefixAndCarrierCode(&$number, PhoneMetadata $ && !$this->matcherAPI->matchNationalNumber($transformedNumber, $generalDesc, false)) { return false; } - if ($carrierCode !== null && $numOfGroups > 1) { + if (null !== $carrierCode && $numOfGroups > 1) { $carrierCode .= $prefixMatcher->group(1); } $number = substr_replace($number, $transformedNumber, 0, mb_strlen($number)); + return true; } + return false; } @@ -2189,111 +1576,31 @@ public function maybeStripNationalPrefixAndCarrierCode(&$number, PhoneMetadata $ * * @param PhoneNumber $number The number that needs to be checked * @param int $type PhoneNumberType The type we are interested in + * * @return bool true if the number is possible for this particular type */ public function isPossibleNumberForType(PhoneNumber $number, $type) { $result = $this->isPossibleNumberForTypeWithReason($number, $type); - return $result === ValidationResult::IS_POSSIBLE - || $result === ValidationResult::IS_POSSIBLE_LOCAL_ONLY; - } - - /** - * Helper method to check a number against possible lengths for this number type, and determine - * whether it matches, or is too short or too long. - * - * @param string $number - * @param PhoneMetadata $metadata - * @param int $type PhoneNumberType - * @return int ValidationResult - */ - protected function testNumberLength($number, PhoneMetadata $metadata, $type = PhoneNumberType::UNKNOWN) - { - $descForType = $this->getNumberDescByType($metadata, $type); - // There should always be "possibleLengths" set for every element. This is declared in the XML - // schema which is verified by PhoneNumberMetadataSchemaTest. - // For size efficiency, where a sub-description (e.g. fixed-line) has the same possibleLengths - // as the parent, this is missing, so we fall back to the general desc (where no numbers of the - // type exist at all, there is one possible length (-1) which is guaranteed not to match the - // length of any real phone number). - $possibleLengths = (count($descForType->getPossibleLength()) === 0) - ? $metadata->getGeneralDesc()->getPossibleLength() : $descForType->getPossibleLength(); - - $localLengths = $descForType->getPossibleLengthLocalOnly(); - - if ($type === PhoneNumberType::FIXED_LINE_OR_MOBILE) { - if (!static::descHasPossibleNumberData($this->getNumberDescByType($metadata, PhoneNumberType::FIXED_LINE))) { - // The rate case has been encountered where no fixedLine data is available (true for some - // non-geographical entities), so we just check mobile. - return $this->testNumberLength($number, $metadata, PhoneNumberType::MOBILE); - } - - $mobileDesc = $this->getNumberDescByType($metadata, PhoneNumberType::MOBILE); - if (static::descHasPossibleNumberData($mobileDesc)) { - // Note that when adding the possible lengths from mobile, we have to again check they - // aren't empty since if they are this indicates they are the same as the general desc and - // should be obtained from there. - $possibleLengths = array_merge($possibleLengths, - (count($mobileDesc->getPossibleLength()) === 0) - ? $metadata->getGeneralDesc()->getPossibleLength() : $mobileDesc->getPossibleLength()); - - // The current list is sorted; we need to merge in the new list and re-sort (duplicates - // are okay). Sorting isn't so expensive because the lists are very small. - sort($possibleLengths); - - if (count($localLengths) === 0) { - $localLengths = $mobileDesc->getPossibleLengthLocalOnly(); - } else { - $localLengths = array_merge($localLengths, $mobileDesc->getPossibleLengthLocalOnly()); - sort($localLengths); - } - } - } - - // If the type is not supported at all (indicated by the possible lengths containing -1 at this - // point) we return invalid length. - - if ($possibleLengths[0] === -1) { - return ValidationResult::INVALID_LENGTH; - } - - $actualLength = mb_strlen($number); - - // This is safe because there is never an overlap between the possible lengths and the local-only - // lengths; this is checked at build time. - - if (in_array($actualLength, $localLengths)) { - return ValidationResult::IS_POSSIBLE_LOCAL_ONLY; - } - - $minimumLength = reset($possibleLengths); - if ($minimumLength == $actualLength) { - return ValidationResult::IS_POSSIBLE; - } - - if ($minimumLength > $actualLength) { - return ValidationResult::TOO_SHORT; - } elseif (isset($possibleLengths[count($possibleLengths) - 1]) && $possibleLengths[count($possibleLengths) - 1] < $actualLength) { - return ValidationResult::TOO_LONG; - } - - // We skip the first element; we've already checked it. - array_shift($possibleLengths); - return in_array($actualLength, $possibleLengths) ? ValidationResult::IS_POSSIBLE : ValidationResult::INVALID_LENGTH; + return ValidationResult::IS_POSSIBLE === $result + || ValidationResult::IS_POSSIBLE_LOCAL_ONLY === $result; } /** * Returns a list with the region codes that match the specific country calling code. For * non-geographical country calling codes, the region code 001 is returned. Also, in the case * of no region code being found, an empty list is returned. + * * @param int $countryCallingCode + * * @return array */ public function getRegionCodesForCountryCode($countryCallingCode) { $regionCodes = isset($this->countryCallingCodeToRegionCodeMap[$countryCallingCode]) ? $this->countryCallingCodeToRegionCodeMap[$countryCallingCode] : null; - return $regionCodes === null ? array() : $regionCodes; + + return null === $regionCodes ? [] : $regionCodes; } /** @@ -2301,6 +1608,7 @@ public function getRegionCodesForCountryCode($countryCallingCode) * United States, and 64 for New Zealand. Assumes the region is already valid. * * @param string $regionCode the region that we want to get the country calling code for + * * @return int the country calling code for the region denoted by regionCode */ public function getCountryCodeForRegion($regionCode) @@ -2308,24 +1616,8 @@ public function getCountryCodeForRegion($regionCode) if (!$this->isValidRegionCode($regionCode)) { return 0; } - return $this->getCountryCodeForValidRegion($regionCode); - } - /** - * Returns the country calling code for a specific region. For example, this would be 1 for the - * United States, and 64 for New Zealand. Assumes the region is already valid. - * - * @param string $regionCode the region that we want to get the country calling code for - * @return int the country calling code for the region denoted by regionCode - * @throws \InvalidArgumentException if the region is invalid - */ - protected function getCountryCodeForValidRegion($regionCode) - { - $metadata = $this->getMetadataForRegion($regionCode); - if ($metadata === null) { - throw new \InvalidArgumentException('Invalid region code: ' . $regionCode); - } - return $metadata->getCountryCode(); + return $this->getCountryCodeForValidRegion($regionCode); } /** @@ -2336,8 +1628,9 @@ protected function getCountryCodeForValidRegion($regionCode) * * @param PhoneNumber $number the phone number to be formatted * @param string $regionCallingFrom the region where the call is being placed - * @param boolean $withFormatting whether the number should be returned with formatting symbols, such as - * spaces and dashes. + * @param bool $withFormatting whether the number should be returned with formatting symbols, such as + * spaces and dashes + * * @return string the formatted phone number */ public function formatNumberForMobileDialing(PhoneNumber $number, $regionCallingFrom, $withFormatting) @@ -2353,16 +1646,16 @@ public function formatNumberForMobileDialing(PhoneNumber $number, $regionCalling $numberNoExt->mergeFrom($number)->clearExtension(); $regionCode = $this->getRegionCodeForCountryCode($countryCallingCode); $numberType = $this->getNumberType($numberNoExt); - $isValidNumber = ($numberType !== PhoneNumberType::UNKNOWN); + $isValidNumber = (PhoneNumberType::UNKNOWN !== $numberType); if ($regionCallingFrom == $regionCode) { - $isFixedLineOrMobile = ($numberType == PhoneNumberType::FIXED_LINE) || ($numberType == PhoneNumberType::MOBILE) || ($numberType == PhoneNumberType::FIXED_LINE_OR_MOBILE); + $isFixedLineOrMobile = (PhoneNumberType::FIXED_LINE == $numberType) || (PhoneNumberType::MOBILE == $numberType) || (PhoneNumberType::FIXED_LINE_OR_MOBILE == $numberType); // Carrier codes may be needed in some countries. We handle this here. - if ($regionCode == 'CO' && $numberType == PhoneNumberType::FIXED_LINE) { + if ('CO' == $regionCode && PhoneNumberType::FIXED_LINE == $numberType) { $formattedNumber = $this->formatNationalNumberWithCarrierCode( $numberNoExt, static::COLOMBIA_MOBILE_TO_FIXED_LINE_PREFIX ); - } elseif ($regionCode == 'BR' && $isFixedLineOrMobile) { + } elseif ('BR' == $regionCode && $isFixedLineOrMobile) { // Historically, we set this to an empty string when parsing with raw input if none was // found in the input string. However, this doesn't result in a number we can dial. For this // reason, we treat the empty string the same as if it isn't set at all. @@ -2372,29 +1665,30 @@ public function formatNumberForMobileDialing(PhoneNumber $number, $regionCalling // called within Brazil. Without that, most of the carriers won't connect the call. // Because of that, we return an empty string here. : ''; - } elseif ($isValidNumber && $regionCode == 'HU') { + } elseif ($isValidNumber && 'HU' == $regionCode) { // The national format for HU numbers doesn't contain the national prefix, because that is // how numbers are normally written down. However, the national prefix is obligatory when // dialing from a mobile phone, except for short numbers. As a result, we add it back here // if it is a valid regular length phone number. $formattedNumber = $this->getNddPrefixForRegion( - $regionCode, - true /* strip non-digits */ - ) . ' ' . $this->format($numberNoExt, PhoneNumberFormat::NATIONAL); + $regionCode, + true // strip non-digits + ) . ' ' . $this->format($numberNoExt, PhoneNumberFormat::NATIONAL); } elseif ($countryCallingCode === static::NANPA_COUNTRY_CODE) { // For NANPA countries, we output international format for numbers that can be dialed // internationally, since that always works, except for numbers which might potentially be // short numbers, which are always dialled in national format. $regionMetadata = $this->getMetadataForRegion($regionCallingFrom); if ($this->canBeInternationallyDialled($numberNoExt) - && $this->testNumberLength($this->getNationalSignificantNumber($numberNoExt), $regionMetadata) - !== ValidationResult::TOO_SHORT + && ValidationResult::TOO_SHORT + !== $this->testNumberLength($this->getNationalSignificantNumber($numberNoExt), $regionMetadata) ) { $formattedNumber = $this->format($numberNoExt, PhoneNumberFormat::INTERNATIONAL); } else { $formattedNumber = $this->format($numberNoExt, PhoneNumberFormat::NATIONAL); } - } elseif (($regionCode == static::REGION_CODE_FOR_NON_GEO_ENTITY || + } elseif (( + $regionCode == static::REGION_CODE_FOR_NON_GEO_ENTITY // MX fixed line and mobile numbers should always be formatted in international format, // even when dialed within MX. For national format to work, a carrier code needs to be // used, and the correct carrier code depends on if the caller and callee are from the @@ -2403,11 +1697,11 @@ public function formatNumberForMobileDialing(PhoneNumber $number, $regionCalling // CL fixed line numbers need the national prefix when dialing in the national format, // but don't have it when used for display. The reverse is true for mobile numbers. // As a result, we output them in the international format to make it work. - ( - ($regionCode === 'MX' || $regionCode === 'CL' || $regionCode === 'UZ') + || ( + ('MX' === $regionCode || 'CL' === $regionCode || 'UZ' === $regionCode) && $isFixedLineOrMobile ) - ) && $this->canBeInternationallyDialled($numberNoExt) + ) && $this->canBeInternationallyDialled($numberNoExt) ) { $formattedNumber = $this->format($numberNoExt, PhoneNumberFormat::INTERNATIONAL); } else { @@ -2421,6 +1715,7 @@ public function formatNumberForMobileDialing(PhoneNumber $number, $regionCalling $this->format($numberNoExt, PhoneNumberFormat::INTERNATIONAL) : $this->format($numberNoExt, PhoneNumberFormat::E164); } + return $withFormatting ? $formattedNumber : static::normalizeDiallableCharsOnly($formattedNumber); } @@ -2432,8 +1727,9 @@ public function formatNumberForMobileDialing(PhoneNumber $number, $regionCalling * * @param PhoneNumber $number the phone number to be formatted * @param string $carrierCode the carrier selection code to be used + * * @return string the formatted phone number in national format for dialing using the carrier as - * specified in the {@code carrierCode} + * specified in the {@code carrierCode} */ public function formatNationalNumberWithCarrierCode(PhoneNumber $number, $carrierCode) { @@ -2462,6 +1758,7 @@ public function formatNationalNumberWithCarrierCode(PhoneNumber $number, $carrie PhoneNumberFormat::NATIONAL, $formattedNumber ); + return $formattedNumber; } @@ -2477,10 +1774,11 @@ public function formatNationalNumberWithCarrierCode(PhoneNumber $number, $carrie * * @param PhoneNumber $number the phone number to be formatted * @param string $fallbackCarrierCode the carrier selection code to be used, if none is found in the - * phone number itself + * phone number itself + * * @return string the formatted phone number in national format for dialing using the number's - * {@code preferredDomesticCarrierCode}, or the {@code fallbackCarrierCode} passed in if - * none is found + * {@code preferredDomesticCarrierCode}, or the {@code fallbackCarrierCode} passed in if + * none is found */ public function formatNationalNumberWithPreferredCarrierCode(PhoneNumber $number, $fallbackCarrierCode) { @@ -2502,17 +1800,19 @@ public function formatNationalNumberWithPreferredCarrierCode(PhoneNumber $number * currently all presumed to not be diallable from outside their country). * * @param PhoneNumber $number the phone-number for which we want to know whether it is diallable from outside the region + * * @return bool */ public function canBeInternationallyDialled(PhoneNumber $number) { $metadata = $this->getMetadataForRegion($this->getRegionCodeForNumber($number)); - if ($metadata === null) { + if (null === $metadata) { // Note numbers belonging to non-geographical entities (e.g. +800 numbers) are always // internationally diallable, and will be caught here. return true; } $nationalSignificantNumber = $this->getNationalSignificantNumber($number); + return !$this->isNumberMatchingDesc($nationalSignificantNumber, $metadata->getNoInternationalDialling()); } @@ -2521,11 +1821,12 @@ public function canBeInternationallyDialled(PhoneNumber $number) * are not diallable on a mobile phone keypad (including all non-ASCII digits). * * @param string $number a string of characters representing a phone number + * * @return string the normalized string version of the phone number */ public static function normalizeDiallableCharsOnly($number) { - if (count(static::$DIALLABLE_CHAR_MAPPINGS) === 0) { + if (0 === count(static::$DIALLABLE_CHAR_MAPPINGS)) { static::initDiallableCharMappings(); } @@ -2553,15 +1854,16 @@ public static function normalizeDiallableCharsOnly($number) * * * @param PhoneNumber $number the phone number that needs to be formatted - * @param String $regionCallingFrom the region where the call is being placed - * @return String the formatted phone number + * @param string $regionCallingFrom the region where the call is being placed + * + * @return string the formatted phone number */ public function formatOutOfCountryKeepingAlphaChars(PhoneNumber $number, $regionCallingFrom) { $rawInput = $number->getRawInput(); // If there is no raw input, then we can't keep alpha characters because there aren't any. // In this case, we return formatOutOfCountryCallingNumber. - if (mb_strlen($rawInput) == 0) { + if (0 == mb_strlen($rawInput)) { return $this->formatOutOfCountryCallingNumber($number, $regionCallingFrom); } $countryCode = $number->getCountryCode(); @@ -2580,7 +1882,7 @@ public function formatOutOfCountryKeepingAlphaChars(PhoneNumber $number, $region $nationalNumber = $this->getNationalSignificantNumber($number); if (mb_strlen($nationalNumber) > 3) { $firstNationalNumberDigit = strpos($rawInput, substr($nationalNumber, 0, 3)); - if ($firstNationalNumberDigit !== false) { + if (false !== $firstNationalNumberDigit) { $rawInput = substr($rawInput, $firstNationalNumberDigit); } } @@ -2589,22 +1891,22 @@ public function formatOutOfCountryKeepingAlphaChars(PhoneNumber $number, $region if ($this->isNANPACountry($regionCallingFrom)) { return $countryCode . ' ' . $rawInput; } - } elseif ($metadataForRegionCallingFrom !== null && - $countryCode == $this->getCountryCodeForValidRegion($regionCallingFrom) + } elseif (null !== $metadataForRegionCallingFrom + && $countryCode == $this->getCountryCodeForValidRegion($regionCallingFrom) ) { $formattingPattern = $this->chooseFormattingPatternForNumber( $metadataForRegionCallingFrom->numberFormats(), $nationalNumber ); - if ($formattingPattern === null) { + if (null === $formattingPattern) { // If no pattern above is matched, we format the original input. return $rawInput; } $newFormat = new NumberFormat(); $newFormat->mergeFrom($formattingPattern); // The first group is the first group of digits that the user wrote together. - $newFormat->setPattern("(\\d+)(.*)"); + $newFormat->setPattern('(\\d+)(.*)'); // Here we just concatenate them back together after the national prefix has been fixed. $newFormat->setFormat('$1$2'); // Now we format using this pattern instead of the default pattern, but with the national @@ -2618,7 +1920,7 @@ public function formatOutOfCountryKeepingAlphaChars(PhoneNumber $number, $region // If an unsupported region-calling-from is entered, or a country with multiple international // prefixes, the international format of the number is returned, unless there is a preferred // international prefix. - if ($metadataForRegionCallingFrom !== null) { + if (null !== $metadataForRegionCallingFrom) { $internationalPrefix = $metadataForRegionCallingFrom->getInternationalPrefix(); $uniqueInternationalPrefixMatcher = new Matcher(static::SINGLE_INTERNATIONAL_PREFIX, $internationalPrefix); $internationalPrefixForFormatting = @@ -2647,6 +1949,7 @@ public function formatOutOfCountryKeepingAlphaChars(PhoneNumber $number, $region $formattedNumber ); } + return $formattedNumber; } @@ -2665,7 +1968,8 @@ public function formatOutOfCountryKeepingAlphaChars(PhoneNumber $number, $region * * @param PhoneNumber $number the phone number to be formatted * @param string $regionCallingFrom the region where the call is being placed - * @return string the formatted phone number + * + * @return string the formatted phone number */ public function formatOutOfCountryCallingNumber(PhoneNumber $number, $regionCallingFrom) { @@ -2732,13 +2036,16 @@ public function formatOutOfCountryCallingNumber(PhoneNumber $number, $regionCall $formattedNumber ); } + return $formattedNumber; } /** * Checks if this is a region under the North American Numbering Plan Administration (NANPA). + * * @param string $regionCode - * @return boolean true if regionCode is one of the regions under NANPA + * + * @return bool true if regionCode is one of the regions under NANPA */ public function isNANPACountry($regionCode) { @@ -2757,7 +2064,8 @@ public function isNANPACountry($regionCode) * * @param PhoneNumber $number the phone number that needs to be formatted in its original number format * @param string $regionCallingFrom the region whose IDD needs to be prefixed if the original number - * has one + * has one + * * @return string the formatted phone number in its original number format */ public function formatInOriginalFormat(PhoneNumber $number, $regionCallingFrom) @@ -2770,29 +2078,36 @@ public function formatInOriginalFormat(PhoneNumber $number, $regionCallingFrom) if (!$number->hasCountryCodeSource()) { return $this->format($number, PhoneNumberFormat::NATIONAL); } + switch ($number->getCountryCodeSource()) { case CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN: $formattedNumber = $this->format($number, PhoneNumberFormat::INTERNATIONAL); + break; + case CountryCodeSource::FROM_NUMBER_WITH_IDD: $formattedNumber = $this->formatOutOfCountryCallingNumber($number, $regionCallingFrom); + break; + case CountryCodeSource::FROM_NUMBER_WITHOUT_PLUS_SIGN: $formattedNumber = substr($this->format($number, PhoneNumberFormat::INTERNATIONAL), 1); + break; + case CountryCodeSource::FROM_DEFAULT_COUNTRY: // Fall-through to default case. default: - $regionCode = $this->getRegionCodeForCountryCode($number->getCountryCode()); // We strip non-digits from the NDD here, and from the raw input later, so that we can // compare them easily. $nationalPrefix = $this->getNddPrefixForRegion($regionCode, true /* strip non-digits */); $nationalFormat = $this->format($number, PhoneNumberFormat::NATIONAL); - if ($nationalPrefix === null || mb_strlen($nationalPrefix) == 0) { + if (null === $nationalPrefix || 0 == mb_strlen($nationalPrefix)) { // If the region doesn't have a national prefix at all, we can safely return the national // format without worrying about a national prefix being added. $formattedNumber = $nationalFormat; + break; } // Otherwise, we check if the original number was entered with a national prefix. @@ -2804,6 +2119,7 @@ public function formatInOriginalFormat(PhoneNumber $number, $regionCallingFrom) ) { // If so, we can safely return the national format. $formattedNumber = $nationalFormat; + break; } // Metadata cannot be null here because getNddPrefixForRegion() (above) returns null if @@ -2814,8 +2130,9 @@ public function formatInOriginalFormat(PhoneNumber $number, $regionCallingFrom) // The format rule could still be null here if the national number was 0 and there was no // raw input (this should not be possible for numbers generated by the phonenumber library // as they would also not have a country calling code and we would have exited earlier). - if ($formatRule === null) { + if (null === $formatRule) { $formattedNumber = $nationalFormat; + break; } // When the format we apply to this number doesn't contain national prefix, we can just @@ -2826,52 +2143,39 @@ public function formatInOriginalFormat(PhoneNumber $number, $regionCallingFrom) $indexOfFirstGroup = strpos($candidateNationalPrefixRule, '$1'); if ($indexOfFirstGroup <= 0) { $formattedNumber = $nationalFormat; + break; } $candidateNationalPrefixRule = substr($candidateNationalPrefixRule, 0, $indexOfFirstGroup); $candidateNationalPrefixRule = static::normalizeDigitsOnly($candidateNationalPrefixRule); - if (mb_strlen($candidateNationalPrefixRule) == 0) { + if (0 == mb_strlen($candidateNationalPrefixRule)) { // National prefix not used when formatting this number. $formattedNumber = $nationalFormat; + break; } // Otherwise, we need to remove the national prefix from our output. $numFormatCopy = new NumberFormat(); $numFormatCopy->mergeFrom($formatRule); $numFormatCopy->clearNationalPrefixFormattingRule(); - $numberFormats = array(); + $numberFormats = []; $numberFormats[] = $numFormatCopy; $formattedNumber = $this->formatByPattern($number, PhoneNumberFormat::NATIONAL, $numberFormats); + break; } $rawInput = $number->getRawInput(); // If no digit is inserted/removed/modified as a result of our formatting, we return the // formatted phone number; otherwise we return the raw input the user entered. - if ($formattedNumber !== null && mb_strlen($rawInput) > 0) { + if (null !== $formattedNumber && mb_strlen($rawInput) > 0) { $normalizedFormattedNumber = static::normalizeDiallableCharsOnly($formattedNumber); $normalizedRawInput = static::normalizeDiallableCharsOnly($rawInput); if ($normalizedFormattedNumber != $normalizedRawInput) { $formattedNumber = $rawInput; } } - return $formattedNumber; - } - /** - * @param PhoneNumber $number - * @return bool - */ - protected function hasFormattingPatternForNumber(PhoneNumber $number) - { - $countryCallingCode = $number->getCountryCode(); - $phoneNumberRegion = $this->getRegionCodeForCountryCode($countryCallingCode); - $metadata = $this->getMetadataForRegionOrCallingCode($countryCallingCode, $phoneNumberRegion); - if ($metadata === null) { - return false; - } - $nationalNumber = $this->getNationalSignificantNumber($number); - $formatRule = $this->chooseFormattingPatternForNumber($metadata->numberFormats(), $nationalNumber); - return $formatRule !== null; + return $formattedNumber; } /** @@ -2885,18 +2189,19 @@ protected function hasFormattingPatternForNumber(PhoneNumber $number) * formatting functions to prefix the national prefix when required. * * @param string $regionCode the region that we want to get the dialling prefix for - * @param boolean $stripNonDigits true to strip non-digits from the national dialling prefix + * @param bool $stripNonDigits true to strip non-digits from the national dialling prefix + * * @return string the dialling prefix for the region denoted by regionCode */ public function getNddPrefixForRegion($regionCode, $stripNonDigits) { $metadata = $this->getMetadataForRegion($regionCode); - if ($metadata === null) { + if (null === $metadata) { return null; } $nationalPrefix = $metadata->getNationalPrefix(); // If no national prefix was found, we return null. - if (mb_strlen($nationalPrefix) == 0) { + if (0 == mb_strlen($nationalPrefix)) { return null; } if ($stripNonDigits) { @@ -2904,34 +2209,8 @@ public function getNddPrefixForRegion($regionCode, $stripNonDigits) // to be removed here as well. $nationalPrefix = str_replace('~', '', $nationalPrefix); } - return $nationalPrefix; - } - /** - * Check if rawInput, which is assumed to be in the national format, has a national prefix. The - * national prefix is assumed to be in digits-only form. - * @param string $rawInput - * @param string $nationalPrefix - * @param string $regionCode - * @return bool - */ - protected function rawInputContainsNationalPrefix($rawInput, $nationalPrefix, $regionCode) - { - $normalizedNationalNumber = static::normalizeDigitsOnly($rawInput); - if (strpos($normalizedNationalNumber, $nationalPrefix) === 0) { - try { - // Some Japanese numbers (e.g. 00777123) might be mistaken to contain the national prefix - // when written without it (e.g. 0777123) if we just do prefix matching. To tackle that, we - // check the validity of the number if the assumed national prefix is removed (777123 won't - // be valid in Japan). - return $this->isValidNumber( - $this->parse(substr($normalizedNationalNumber, mb_strlen($nationalPrefix)), $regionCode) - ); - } catch (NumberParseException $e) { - return false; - } - } - return false; + return $nationalPrefix; } /** @@ -2943,11 +2222,13 @@ protected function rawInputContainsNationalPrefix($rawInput, $nationalPrefix, $r * significant number "789272696". This is valid, while the original string is not diallable. * * @param PhoneNumber $number the phone number that we want to validate - * @return boolean that indicates whether the number is of a valid pattern + * + * @return bool that indicates whether the number is of a valid pattern */ public function isValidNumber(PhoneNumber $number) { $regionCode = $this->getRegionCodeForNumber($number); + return $this->isValidNumberForRegion($number, $regionCode); } @@ -2965,15 +2246,16 @@ public function isValidNumber(PhoneNumber $number) * * @param PhoneNumber $number the phone number that we want to validate * @param string $regionCode the region that we want to validate the phone number for - * @return boolean that indicates whether the number is of a valid pattern + * + * @return bool that indicates whether the number is of a valid pattern */ public function isValidNumberForRegion(PhoneNumber $number, $regionCode) { $countryCode = $number->getCountryCode(); $metadata = $this->getMetadataForRegionOrCallingCode($countryCode, $regionCode); - if (($metadata === null) || - (static::REGION_CODE_FOR_NON_GEO_ENTITY !== $regionCode && - $countryCode !== $this->getCountryCodeForValidRegion($regionCode)) + if ((null === $metadata) + || (static::REGION_CODE_FOR_NON_GEO_ENTITY !== $regionCode + && $countryCode !== $this->getCountryCodeForValidRegion($regionCode)) ) { // Either the region code was invalid, or the country calling code for this number does not // match that of the region code. @@ -2981,7 +2263,7 @@ public function isValidNumberForRegion(PhoneNumber $number, $regionCode) } $nationalSignificantNumber = $this->getNationalSignificantNumber($number); - return $this->getNumberTypeHelper($nationalSignificantNumber, $metadata) != PhoneNumberType::UNKNOWN; + return PhoneNumberType::UNKNOWN != $this->getNumberTypeHelper($nationalSignificantNumber, $metadata); } /** @@ -3000,31 +2282,32 @@ public function isValidNumberForRegion(PhoneNumber $number, $regionCode) *

    Note this method canonicalizes the phone number such that different representations can be * easily compared, no matter what form it was originally entered in (e.g. national, * international). If you want to record context about the number being parsed, such as the raw - * input that was entered, how the country code was derived etc. then call {@link - * #parseAndKeepRawInput} instead. + * input that was entered, how the country code was derived etc. then call {@link * #parseAndKeepRawInput} instead. * * @param string $numberToParse number that we are attempting to parse. This can contain formatting - * such as +, ( and -, as well as a phone number extension. + * such as +, ( and -, as well as a phone number extension. * @param string|null $defaultRegion region that we are expecting the number to be from. This is only used - * if the number being parsed is not written in international format. - * The country_code for the number in this case would be stored as that - * of the default region supplied. If the number is guaranteed to - * start with a '+' followed by the country calling code, then - * "ZZ" or null can be supplied. - * @param PhoneNumber|null $phoneNumber + * if the number being parsed is not written in international format. + * The country_code for the number in this case would be stored as that + * of the default region supplied. If the number is guaranteed to + * start with a '+' followed by the country calling code, then + * "ZZ" or null can be supplied. * @param bool $keepRawInput + * + * @throws NumberParseException if the string is not considered to be a viable phone number (e.g. + * too few or too many digits) or if no default region was supplied + * and the number is not in international format (does not start + * with +) + * * @return PhoneNumber a phone number proto buffer filled with the parsed number - * @throws NumberParseException if the string is not considered to be a viable phone number (e.g. - * too few or too many digits) or if no default region was supplied - * and the number is not in international format (does not start - * with +) */ public function parse($numberToParse, $defaultRegion = null, PhoneNumber $phoneNumber = null, $keepRawInput = false) { - if ($phoneNumber === null) { + if (null === $phoneNumber) { $phoneNumber = new PhoneNumber(); } $this->parseHelper($numberToParse, $defaultRegion, $keepRawInput, true, $phoneNumber); + return $phoneNumber; } @@ -3037,7 +2320,8 @@ public function parse($numberToParse, $defaultRegion = null, PhoneNumber $phoneN * @param PhoneNumber $number the phone number to be formatted * @param int $numberFormat the format the phone number should be formatted into * @param array $userDefinedFormats formatting rules specified by clients - * @return String the formatted phone number + * + * @return string the formatted phone number */ public function formatByPattern(PhoneNumber $number, $numberFormat, array $userDefinedFormats) { @@ -3056,7 +2340,7 @@ public function formatByPattern(PhoneNumber $number, $numberFormat, array $userD $formattedNumber = ''; $formattingPattern = $this->chooseFormattingPatternForNumber($userDefinedFormats, $nationalSignificantNumber); - if ($formattingPattern === null) { + if (null === $formattingPattern) { // If no pattern above is matched, we format the number as a whole. $formattedNumber .= $nationalSignificantNumber; } else { @@ -3070,8 +2354,11 @@ public function formatByPattern(PhoneNumber $number, $numberFormat, array $userD $nationalPrefix = $metadata->getNationalPrefix(); if (mb_strlen($nationalPrefix) > 0) { // Replace $NP with national prefix and $FG with the first group ($1). - $nationalPrefixFormattingRule = str_replace(array(static::NP_STRING, static::FG_STRING), - array($nationalPrefix, '$1'), $nationalPrefixFormattingRule); + $nationalPrefixFormattingRule = str_replace( + [static::NP_STRING, static::FG_STRING], + [$nationalPrefix, '$1'], + $nationalPrefixFormattingRule + ); $numFormatCopy->setNationalPrefixFormattingRule($nationalPrefixFormattingRule); } else { // We don't want to have a rule for how to format the national prefix if there isn't one. @@ -3082,6 +2369,7 @@ public function formatByPattern(PhoneNumber $number, $numberFormat, array $userD } $this->maybeAppendFormattedExtension($number, $metadata, $numberFormat, $formattedNumber); $this->prefixNumberWithCountryCallingCode($countryCallingCode, $numberFormat, $formattedNumber); + return $formattedNumber; } @@ -3089,9 +2377,11 @@ public function formatByPattern(PhoneNumber $number, $numberFormat, array $userD * Gets a valid number for the specified region. * * @param string regionCode the region for which an example number is needed + * @param mixed $regionCode + * * @return PhoneNumber a valid fixed-line number for the specified region. Returns null when the metadata - * does not contain such information, or the region 001 is passed in. For 001 (representing - * non-geographical numbers), call {@link #getExampleNumberForNonGeoEntity} instead. + * does not contain such information, or the region 001 is passed in. For 001 (representing + * non-geographical numbers), call {@link #getExampleNumberForNonGeoEntity} instead. */ public function getExampleNumber($regionCode) { @@ -3106,8 +2396,9 @@ public function getExampleNumber($regionCode) * {@link ShortNumberInfo}. * * @param string $regionCode The region for which an example number is needed + * * @return PhoneNumber|null An invalid number for the specified region. Returns null when an unsupported region - * or the region 001 (Earth) is passed in. + * or the region 001 (Earth) is passed in. */ public function getInvalidExampleNumber($regionCode) { @@ -3122,7 +2413,7 @@ public function getInvalidExampleNumber($regionCode) $desc = $this->getNumberDescByType($this->getMetadataForRegion($regionCode), PhoneNumberType::FIXED_LINE); - if ($desc->getExampleNumber() == '') { + if ('' == $desc->getExampleNumber()) { // This shouldn't happen; we have a test for this. return null; } @@ -3140,8 +2431,9 @@ public function getInvalidExampleNumber($regionCode) // a mobile number. It would be faster to loop in a different order, but we prefer numbers that // look closer to real numbers (and it gives us a variety of different lengths for the resulting // phone numbers - otherwise they would all be MIN_LENGTH_FOR_NSN digits long.) - for ($phoneNumberLength = mb_strlen($exampleNumber) - 1; $phoneNumberLength >= static::MIN_LENGTH_FOR_NSN; $phoneNumberLength--) { + for ($phoneNumberLength = mb_strlen($exampleNumber) - 1; $phoneNumberLength >= static::MIN_LENGTH_FOR_NSN; --$phoneNumberLength) { $numberToTry = mb_substr($exampleNumber, 0, $phoneNumberLength); + try { $possiblyValidNumber = $this->parse($numberToTry, $regionCode); if (!$this->isValidNumber($possiblyValidNumber)) { @@ -3159,25 +2451,24 @@ public function getInvalidExampleNumber($regionCode) /** * Gets a valid number for the specified region and number type. * - * @param string|int $regionCodeOrType the region for which an example number is needed + * @param int|string $regionCodeOrType the region for which an example number is needed * @param int $type the PhoneNumberType of number that is needed + * * @return PhoneNumber a valid number for the specified region and type. Returns null when the metadata - * does not contain such information or if an invalid region or region 001 was entered. - * For 001 (representing non-geographical numbers), call - * {@link #getExampleNumberForNonGeoEntity} instead. + * does not contain such information or if an invalid region or region 001 was entered. + * For 001 (representing non-geographical numbers), call + * {@link #getExampleNumberForNonGeoEntity} instead. * * If $regionCodeOrType is the only parameter supplied, then a valid number for the specified number type * will be returned that may belong to any country. */ public function getExampleNumberForType($regionCodeOrType, $type = null) { - if ($regionCodeOrType !== null && $type === null) { - /* - * Gets a valid number for the specified number type (it may belong to any country). - */ + if (null !== $regionCodeOrType && null === $type) { + // Gets a valid number for the specified number type (it may belong to any country). foreach ($this->getSupportedRegions() as $regionCode) { $exampleNumber = $this->getExampleNumberForType($regionCode, $regionCodeOrType); - if ($exampleNumber !== null) { + if (null !== $exampleNumber) { return $exampleNumber; } } @@ -3185,416 +2476,1329 @@ public function getExampleNumberForType($regionCodeOrType, $type = null) // If there wasn't an example number for a region, try the non-geographical entities foreach ($this->getSupportedGlobalNetworkCallingCodes() as $countryCallingCode) { $desc = $this->getNumberDescByType($this->getMetadataForNonGeographicalRegion($countryCallingCode), $regionCodeOrType); + try { - if ($desc->getExampleNumber() != '') { + if ('' != $desc->getExampleNumber()) { return $this->parse('+' . $countryCallingCode . $desc->getExampleNumber(), static::UNKNOWN_REGION); } } catch (NumberParseException $e) { // noop } } - // There are no example numbers of this type for any country in the library. - return null; - } + // There are no example numbers of this type for any country in the library. + return null; + } + + // Check the region code is valid. + if (!$this->isValidRegionCode($regionCodeOrType)) { + return null; + } + $desc = $this->getNumberDescByType($this->getMetadataForRegion($regionCodeOrType), $type); + + try { + if ($desc->hasExampleNumber()) { + return $this->parse($desc->getExampleNumber(), $regionCodeOrType); + } + } catch (NumberParseException $e) { + // noop + } + + return null; + } + + /** + * Gets a valid number for the specified country calling code for a non-geographical entity. + * + * @param int $countryCallingCode the country calling code for a non-geographical entity + * + * @return PhoneNumber a valid number for the non-geographical entity. Returns null when the metadata + * does not contain such information, or the country calling code passed in does not belong + * to a non-geographical entity. + */ + public function getExampleNumberForNonGeoEntity($countryCallingCode) + { + $metadata = $this->getMetadataForNonGeographicalRegion($countryCallingCode); + if (null !== $metadata) { + // For geographical entities, fixed-line data is always present. However, for non-geographical + // entities, this is not the case, so we have to go through different types to find the + // example number. We don't check fixed-line or personal number since they aren't used by + // non-geographical entities (if this changes, a unit-test will catch this.) + /** @var PhoneNumberDesc[] $list */ + $list = [ + $metadata->getMobile(), + $metadata->getTollFree(), + $metadata->getSharedCost(), + $metadata->getVoip(), + $metadata->getVoicemail(), + $metadata->getUan(), + $metadata->getPremiumRate(), + ]; + foreach ($list as $desc) { + try { + if (null !== $desc && $desc->hasExampleNumber()) { + return $this->parse('+' . $countryCallingCode . $desc->getExampleNumber(), self::UNKNOWN_REGION); + } + } catch (NumberParseException $e) { + // noop + } + } + } + + return null; + } + + /** + * Takes two phone numbers and compares them for equality. + * + *

    Returns EXACT_MATCH if the country_code, NSN, presence of a leading zero + * for Italian numbers and any extension present are the same. Returns NSN_MATCH + * if either or both has no region specified, and the NSNs and extensions are + * the same. Returns SHORT_NSN_MATCH if either or both has no region specified, + * or the region specified is the same, and one NSN could be a shorter version + * of the other number. This includes the case where one has an extension + * specified, and the other does not. Returns NO_MATCH otherwise. For example, + * the numbers +1 345 657 1234 and 657 1234 are a SHORT_NSN_MATCH. The numbers + * +1 345 657 1234 and 345 657 are a NO_MATCH. + * + * @param $firstNumberIn PhoneNumber|string First number to compare. If it is a + * string it can contain formatting, and can have country calling code specified + * with + at the start. + * @param $secondNumberIn PhoneNumber|string Second number to compare. If it is a + * string it can contain formatting, and can have country calling code specified + * with + at the start. + * + * @throws \InvalidArgumentException + * + * @return int {MatchType} NOT_A_NUMBER, NO_MATCH, + */ + public function isNumberMatch($firstNumberIn, $secondNumberIn) + { + if (is_string($firstNumberIn) && is_string($secondNumberIn)) { + try { + $firstNumberAsProto = $this->parse($firstNumberIn, static::UNKNOWN_REGION); + + return $this->isNumberMatch($firstNumberAsProto, $secondNumberIn); + } catch (NumberParseException $e) { + if (NumberParseException::INVALID_COUNTRY_CODE === $e->getErrorType()) { + try { + $secondNumberAsProto = $this->parse($secondNumberIn, static::UNKNOWN_REGION); + + return $this->isNumberMatch($secondNumberAsProto, $firstNumberIn); + } catch (NumberParseException $e2) { + if (NumberParseException::INVALID_COUNTRY_CODE === $e2->getErrorType()) { + try { + $firstNumberProto = new PhoneNumber(); + $secondNumberProto = new PhoneNumber(); + $this->parseHelper($firstNumberIn, null, false, false, $firstNumberProto); + $this->parseHelper($secondNumberIn, null, false, false, $secondNumberProto); + + return $this->isNumberMatch($firstNumberProto, $secondNumberProto); + } catch (NumberParseException $e3) { + // Fall through and return MatchType::NOT_A_NUMBER + } + } + } + } + } + + return MatchType::NOT_A_NUMBER; + } + if ($firstNumberIn instanceof PhoneNumber && is_string($secondNumberIn)) { + // First see if the second number has an implicit country calling code, by attempting to parse + // it. + try { + $secondNumberAsProto = $this->parse($secondNumberIn, static::UNKNOWN_REGION); + + return $this->isNumberMatch($firstNumberIn, $secondNumberAsProto); + } catch (NumberParseException $e) { + if (NumberParseException::INVALID_COUNTRY_CODE === $e->getErrorType()) { + // The second number has no country calling code. EXACT_MATCH is no longer possible. + // We parse it as if the region was the same as that for the first number, and if + // EXACT_MATCH is returned, we replace this with NSN_MATCH. + $firstNumberRegion = $this->getRegionCodeForCountryCode($firstNumberIn->getCountryCode()); + + try { + if ($firstNumberRegion != static::UNKNOWN_REGION) { + $secondNumberWithFirstNumberRegion = $this->parse($secondNumberIn, $firstNumberRegion); + $match = $this->isNumberMatch($firstNumberIn, $secondNumberWithFirstNumberRegion); + if (MatchType::EXACT_MATCH === $match) { + return MatchType::NSN_MATCH; + } + + return $match; + } + + // If the first number didn't have a valid country calling code, then we parse the + // second number without one as well. + $secondNumberProto = new PhoneNumber(); + $this->parseHelper($secondNumberIn, null, false, false, $secondNumberProto); + + return $this->isNumberMatch($firstNumberIn, $secondNumberProto); + } catch (NumberParseException $e2) { + // Fall-through to return NOT_A_NUMBER. + } + } + } + } + if ($firstNumberIn instanceof PhoneNumber && $secondNumberIn instanceof PhoneNumber) { + // We only care about the fields that uniquely define a number, so we copy these across + // explicitly. + $firstNumber = self::copyCoreFieldsOnly($firstNumberIn); + $secondNumber = self::copyCoreFieldsOnly($secondNumberIn); + + // Early exit if both had extensions and these are different. + if ($firstNumber->hasExtension() && $secondNumber->hasExtension() + && $firstNumber->getExtension() != $secondNumber->getExtension() + ) { + return MatchType::NO_MATCH; + } + + $firstNumberCountryCode = $firstNumber->getCountryCode(); + $secondNumberCountryCode = $secondNumber->getCountryCode(); + // Both had country_code specified. + if (0 != $firstNumberCountryCode && 0 != $secondNumberCountryCode) { + if ($firstNumber->equals($secondNumber)) { + return MatchType::EXACT_MATCH; + } + + if ($firstNumberCountryCode == $secondNumberCountryCode + && $this->isNationalNumberSuffixOfTheOther($firstNumber, $secondNumber)) { + // A SHORT_NSN_MATCH occurs if there is a difference because of the presence or absence of + // an 'Italian leading zero', the presence or absence of an extension, or one NSN being a + // shorter variant of the other. + return MatchType::SHORT_NSN_MATCH; + } + // This is not a match. + return MatchType::NO_MATCH; + } + // Checks cases where one or both country_code fields were not specified. To make equality + // checks easier, we first set the country_code fields to be equal. + $firstNumber->setCountryCode($secondNumberCountryCode); + // If all else was the same, then this is an NSN_MATCH. + if ($firstNumber->equals($secondNumber)) { + return MatchType::NSN_MATCH; + } + if ($this->isNationalNumberSuffixOfTheOther($firstNumber, $secondNumber)) { + return MatchType::SHORT_NSN_MATCH; + } + + return MatchType::NO_MATCH; + } + + return MatchType::NOT_A_NUMBER; + } + + /** + * Returns true if the supplied region supports mobile number portability. Returns false for + * invalid, unknown or regions that don't support mobile number portability. + * + * @param string $regionCode the region for which we want to know whether it supports mobile number + * portability or not + * + * @return bool + */ + public function isMobileNumberPortableRegion($regionCode) + { + $metadata = $this->getMetadataForRegion($regionCode); + if (null === $metadata) { + return false; + } + + return $metadata->isMobileNumberPortableRegion(); + } + + /** + * Check whether a phone number is a possible number given a number in the form of a string, and + * the region where the number could be dialed from. It provides a more lenient check than + * {@link #isValidNumber}. See {@link #isPossibleNumber(PhoneNumber)} for details. + * + * Convenience wrapper around {@link #isPossibleNumberWithReason}. Instead of returning the reason + * for failure, this method returns a boolean value. + * for failure, this method returns true if the number is either a possible fully-qualified number + * (containing the area code and country code), or if the number could be a possible local number + * (with a country code, but missing an area code). Local numbers are considered possible if they + * could be possibly dialled in this format: if the area code is needed for a call to connect, the + * number is not considered possible without it. + * + * Note: There are two ways to call this method. + * + * isPossibleNumber(PhoneNumber $numberObject) + * isPossibleNumber(string '+441174960126', string 'GB') + * + * @param PhoneNumber|string $number the number that needs to be checked, in the form of a string + * @param string|null $regionDialingFrom the region that we are expecting the number to be dialed from. + * Note this is different from the region where the number belongs. For example, the number + * +1 650 253 0000 is a number that belongs to US. When written in this form, it can be + * dialed from any region. When it is written as 00 1 650 253 0000, it can be dialed from any + * region which uses an international dialling prefix of 00. When it is written as + * 650 253 0000, it can only be dialed from within the US, and when written as 253 0000, it + * can only be dialed from within a smaller area in the US (Mountain View, CA, to be more + * specific). + * + * @return bool true if the number is possible + */ + public function isPossibleNumber($number, $regionDialingFrom = null) + { + if (null !== $regionDialingFrom && is_string($number)) { + try { + return $this->isPossibleNumber($this->parse($number, $regionDialingFrom)); + } catch (NumberParseException $e) { + return false; + } + } else { + $result = $this->isPossibleNumberWithReason($number); + + return ValidationResult::IS_POSSIBLE === $result + || ValidationResult::IS_POSSIBLE_LOCAL_ONLY === $result; + } + } + + /** + * Check whether a phone number is a possible number. It provides a more lenient check than + * {@link #isValidNumber} in the following sense: + *

      + *
    1. It only checks the length of phone numbers. In particular, it doesn't check starting + * digits of the number. + *
    2. It doesn't attempt to figure out the type of the number, but uses general rules which + * applies to all types of phone numbers in a region. Therefore, it is much faster than + * isValidNumber. + *
    3. For some numbers (particularly fixed-line), many regions have the concept of area code, + * which together with subscriber number constitute the national significant number. It is + * sometimes okay to dial only the subscriber number when dialing in the same area. This + * function will return IS_POSSIBLE_LOCAL_ONLY if the subscriber-number-only version is + * passed in. On the other hand, because isValidNumber validates using information on both + * starting digits (for fixed line numbers, that would most likely be area codes) and + * length (obviously includes the length of area codes for fixed line numbers), it will + * return false for the subscriber-number-only version. + *
    . + * + * @param PhoneNumber $number the number that needs to be checked + * + * @return int a ValidationResult object which indicates whether the number is possible + */ + public function isPossibleNumberWithReason(PhoneNumber $number) + { + return $this->isPossibleNumberForTypeWithReason($number, PhoneNumberType::UNKNOWN); + } + + /** + * Check whether a phone number is a possible number of a particular type. For types that don't + * exist in a particular region, this will return a result that isn't so useful; it is recommended + * that you use {@link #getSupportedTypesForRegion} or {@link #getSupportedTypesForNonGeoEntity} + * respectively before calling this method to determine whether you should call it for this number + * at all. + * + * This provides a more lenient check than {@link #isValidNumber} in the following sense: + * + *
      + *
    1. It only checks the length of phone numbers. In particular, it doesn't check starting + * digits of the number. + *
    2. For some numbers (particularly fixed-line), many regions have the concept of area code, + * which together with subscriber number constitute the national significant number. It is + * sometimes okay to dial only the subscriber number when dialing in the same area. This + * function will return IS_POSSIBLE_LOCAL_ONLY if the subscriber-number-only version is + * passed in. On the other hand, because isValidNumber validates using information on both + * starting digits (for fixed line numbers, that would most likely be area codes) and + * length (obviously includes the length of area codes for fixed line numbers), it will + * return false for the subscriber-number-only version. + *
    + * + * @param PhoneNumber $number the number that needs to be checked + * @param int $type the PhoneNumberType we are interested in + * + * @return int a ValidationResult object which indicates whether the number is possible + */ + public function isPossibleNumberForTypeWithReason(PhoneNumber $number, $type) + { + $nationalNumber = $this->getNationalSignificantNumber($number); + $countryCode = $number->getCountryCode(); + + // Note: For regions that share a country calling code, like NANPA numbers, we just use the + // rules from the default region (US in this case) since the getRegionCodeForNumber will not + // work if the number is possible but not valid. There is in fact one country calling code (290) + // where the possible number pattern differs between various regions (Saint Helena and Tristan + // da Cuñha), but this is handled by putting all possible lengths for any country with this + // country calling code in the metadata for the default region in this case. + if (!$this->hasValidCountryCallingCode($countryCode)) { + return ValidationResult::INVALID_COUNTRY_CODE; + } + + $regionCode = $this->getRegionCodeForCountryCode($countryCode); + // Metadata cannot be null because the country calling code is valid. + $metadata = $this->getMetadataForRegionOrCallingCode($countryCode, $regionCode); + + return $this->testNumberLength($nationalNumber, $metadata, $type); + } + + /** + * Attempts to extract a valid number from a phone number that is too long to be valid, and resets + * the PhoneNumber object passed in to that valid version. If no valid number could be extracted, + * the PhoneNumber object passed in will not be modified. + * + * @param PhoneNumber $number a PhoneNumber object which contains a number that is too long to be valid + * + * @return bool true if a valid phone number can be successfully extracted + */ + public function truncateTooLongNumber(PhoneNumber $number) + { + if ($this->isValidNumber($number)) { + return true; + } + $numberCopy = new PhoneNumber(); + $numberCopy->mergeFrom($number); + $nationalNumber = $number->getNationalNumber(); + do { + $nationalNumber = floor($nationalNumber / 10); + $numberCopy->setNationalNumber($nationalNumber); + if (ValidationResult::TOO_SHORT == $this->isPossibleNumberWithReason($numberCopy) || 0 == $nationalNumber) { + return false; + } + } while (!$this->isValidNumber($numberCopy)); + $number->setNationalNumber($nationalNumber); + + return true; + } + + protected function init() + { + $supportedRegions = [[]]; + + foreach ($this->countryCallingCodeToRegionCodeMap as $countryCode => $regionCodes) { + // We can assume that if the country calling code maps to the non-geo entity region code then + // that's the only region code it maps to. + if (1 === count($regionCodes) && static::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCodes[0]) { + // This is the subset of all country codes that map to the non-geo entity region code. + $this->countryCodesForNonGeographicalRegion[] = $countryCode; + } else { + // The supported regions set does not include the "001" non-geo entity region code. + $supportedRegions[] = $regionCodes; + } + } + + $this->supportedRegions = call_user_func_array('array_merge', $supportedRegions); + + // If the non-geo entity still got added to the set of supported regions it must be because + // there are entries that list the non-geo entity alongside normal regions (which is wrong). + // If we discover this, remove the non-geo entity from the set of supported regions and log. + $idx_region_code_non_geo_entity = array_search(static::REGION_CODE_FOR_NON_GEO_ENTITY, $this->supportedRegions); + if (false !== $idx_region_code_non_geo_entity) { + unset($this->supportedRegions[$idx_region_code_non_geo_entity]); + } + $this->nanpaRegions = $this->countryCallingCodeToRegionCodeMap[static::NANPA_COUNTRY_CODE]; + } + + /** + * Helper initialiser method to create the regular-expression pattern to match extensions, + * allowing the one-char extension symbols provided by {@code singleExtnSymbols}. + * + * @param string $singleExtnSymbols + * + * @return string + */ + protected static function createExtnPattern($singleExtnSymbols) + { + // There are three regular expressions here. The first covers RFC 3966 format, where the + // extension is added using ";ext=". The second more generic one starts with optional white + // space and ends with an optional full stop (.), followed by zero or more spaces/tabs/commas + // and then the numbers themselves. The other one covers the special case of American numbers + // where the extension is written with a hash at the end, such as "- 503#" + // Note that the only capturing groups should be around the digits that you want to capture as + // part of the extension, or else parsing will fail! + // Canonical-equivalence doesn't seem to be an option with Android java, so we allow two options + // for representing the accented o - the character itself, and one in the unicode decomposed + // form with the combining acute accent. + return (static::RFC3966_EXTN_PREFIX . static::$CAPTURING_EXTN_DIGITS . '|' . "[ \xC2\xA0\\t,]*" . + "(?:e?xt(?:ensi(?:o\xCC\x81?|\xC3\xB3))?n?|(?:\xEF\xBD\x85)?\xEF\xBD\x98\xEF\xBD\x94(?:\xEF\xBD\x8E)?|" . + 'доб|' . '[' . $singleExtnSymbols . "]|int|\xEF\xBD\x89\xEF\xBD\x8E\xEF\xBD\x94|anexo)" . + "[:\\.\xEF\xBC\x8E]?[ \xC2\xA0\\t,-]*" . static::$CAPTURING_EXTN_DIGITS . '\\#?|' . + '[- ]+(' . static::DIGITS . '{1,5})\\#'); + } + + protected static function initExtnPattern() + { + static::$EXTN_PATTERN = '/(?:' . static::$EXTN_PATTERNS_FOR_PARSING . ')$/' . static::REGEX_FLAGS; + } + + protected static function initValidPhoneNumberPatterns() + { + static::initCapturingExtnDigits(); + static::initExtnPatterns(); + static::$MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' . static::DIGITS . ']{' . static::MIN_LENGTH_FOR_NSN . '}'; + static::$VALID_PHONE_NUMBER = '[' . static::PLUS_CHARS . ']*(?:[' . static::VALID_PUNCTUATION . static::STAR_SIGN . ']*[' . static::DIGITS . ']){3,}[' . static::VALID_PUNCTUATION . static::STAR_SIGN . static::VALID_ALPHA . static::DIGITS . ']*'; + static::$VALID_PHONE_NUMBER_PATTERN = '%^' . static::$MIN_LENGTH_PHONE_NUMBER_PATTERN . '$|^' . static::$VALID_PHONE_NUMBER . '(?:' . static::$EXTN_PATTERNS_FOR_PARSING . ')?$%' . static::REGEX_FLAGS; + } + + protected static function initAlphaPhoneMappings() + { + static::$ALPHA_PHONE_MAPPINGS = static::$ALPHA_MAPPINGS + static::$asciiDigitMappings; + } + + protected static function initValidStartCharPattern() + { + static::$VALID_START_CHAR_PATTERN = '[' . static::PLUS_CHARS . static::DIGITS . ']'; + } + + protected static function initMobileTokenMappings() + { + static::$MOBILE_TOKEN_MAPPINGS = []; + static::$MOBILE_TOKEN_MAPPINGS['52'] = '1'; + static::$MOBILE_TOKEN_MAPPINGS['54'] = '9'; + } + + protected static function initDiallableCharMappings() + { + static::$DIALLABLE_CHAR_MAPPINGS = static::$asciiDigitMappings; + static::$DIALLABLE_CHAR_MAPPINGS[static::PLUS_SIGN] = static::PLUS_SIGN; + static::$DIALLABLE_CHAR_MAPPINGS['*'] = '*'; + static::$DIALLABLE_CHAR_MAPPINGS['#'] = '#'; + } + + /** + * Normalizes a string of characters representing a phone number by replacing all characters found + * in the accompanying map with the values therein, and stripping all other characters if + * removeNonMatches is true. + * + * @param string $number a string of characters representing a phone number + * @param array $normalizationReplacements a mapping of characters to what they should be replaced by in + * the normalized version of the phone number + * @param bool $removeNonMatches indicates whether characters that are not able to be replaced + * should be stripped from the number. If this is false, they will be left unchanged in the number. + * + * @return string the normalized string version of the phone number + */ + protected static function normalizeHelper($number, array $normalizationReplacements, $removeNonMatches) + { + $normalizedNumber = ''; + $strLength = mb_strlen($number, 'UTF-8'); + for ($i = 0; $i < $strLength; ++$i) { + $character = mb_substr($number, $i, 1, 'UTF-8'); + if (isset($normalizationReplacements[mb_strtoupper($character, 'UTF-8')])) { + $normalizedNumber .= $normalizationReplacements[mb_strtoupper($character, 'UTF-8')]; + } elseif (!$removeNonMatches) { + $normalizedNumber .= $character; + } + // If neither of the above are true, we remove this character. + } + + return $normalizedNumber; + } + + /** + * Returns true if there is any possible number data set for a particular PhoneNumberDesc. + * + * @return bool + */ + protected static function descHasPossibleNumberData(PhoneNumberDesc $desc) + { + // If this is empty, it means numbers of this type inherit from the "general desc" -> the value + // '-1' means that no numbers exist for this type. + $possibleLength = $desc->getPossibleLength(); + + return 1 != count($possibleLength) || -1 != $possibleLength[0]; + } + + /** + * Returns true if there is any data set for a particular PhoneNumberDesc. + * + * @return bool + */ + protected static function descHasData(PhoneNumberDesc $desc) + { + // Checking most properties since we don't know what's present, since a custom build may have + // stripped just one of them (e.g. liteBuild strips exampleNumber). We don't bother checking the + // possibleLengthsLocalOnly, since if this is the only thing that's present we don't really + // support the type at all: no type-specific methods will work with only this data. + return $desc->hasExampleNumber() + || static::descHasPossibleNumberData($desc) + || $desc->hasNationalNumberPattern(); + } + + /** + * Helper function to check region code is not unknown or null. + * + * @param string $regionCode + * + * @return bool + */ + protected function isValidRegionCode($regionCode) + { + return null !== $regionCode && in_array($regionCode, $this->supportedRegions); + } + + /** + * @return string|null + */ + protected function getRegionCodeForNumberFromRegionList(PhoneNumber $number, array $regionCodes) + { + $nationalNumber = $this->getNationalSignificantNumber($number); + foreach ($regionCodes as $regionCode) { + // If leadingDigits is present, use this. Otherwise, do full validation. + // Metadata cannot be null because the region codes come from the country calling code map. + $metadata = $this->getMetadataForRegion($regionCode); + if ($metadata->hasLeadingDigits()) { + $nbMatches = preg_match( + '/' . $metadata->getLeadingDigits() . '/', + $nationalNumber, + $matches, + PREG_OFFSET_CAPTURE + ); + if ($nbMatches > 0 && 0 === $matches[0][1]) { + return $regionCode; + } + } elseif (PhoneNumberType::UNKNOWN != $this->getNumberTypeHelper($nationalNumber, $metadata)) { + return $regionCode; + } + } + + return null; + } + + /** + * @param string $nationalNumber + * + * @return int PhoneNumberType constant + */ + protected function getNumberTypeHelper($nationalNumber, PhoneMetadata $metadata) + { + if (!$this->isNumberMatchingDesc($nationalNumber, $metadata->getGeneralDesc())) { + return PhoneNumberType::UNKNOWN; + } + if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getPremiumRate())) { + return PhoneNumberType::PREMIUM_RATE; + } + if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getTollFree())) { + return PhoneNumberType::TOLL_FREE; + } + + if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getSharedCost())) { + return PhoneNumberType::SHARED_COST; + } + if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getVoip())) { + return PhoneNumberType::VOIP; + } + if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getPersonalNumber())) { + return PhoneNumberType::PERSONAL_NUMBER; + } + if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getPager())) { + return PhoneNumberType::PAGER; + } + if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getUan())) { + return PhoneNumberType::UAN; + } + if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getVoicemail())) { + return PhoneNumberType::VOICEMAIL; + } + $isFixedLine = $this->isNumberMatchingDesc($nationalNumber, $metadata->getFixedLine()); + if ($isFixedLine) { + if ($metadata->getSameMobileAndFixedLinePattern()) { + return PhoneNumberType::FIXED_LINE_OR_MOBILE; + } + + if ($this->isNumberMatchingDesc($nationalNumber, $metadata->getMobile())) { + return PhoneNumberType::FIXED_LINE_OR_MOBILE; + } + + return PhoneNumberType::FIXED_LINE; + } + // Otherwise, test to see if the number is mobile. Only do this if certain that the patterns for + // mobile and fixed line aren't the same. + if (!$metadata->getSameMobileAndFixedLinePattern() + && $this->isNumberMatchingDesc($nationalNumber, $metadata->getMobile()) + ) { + return PhoneNumberType::MOBILE; + } + + return PhoneNumberType::UNKNOWN; + } + + /** + * @param int $countryCallingCode + * @param string $regionCode + * + * @return PhoneMetadata + */ + protected function getMetadataForRegionOrCallingCode($countryCallingCode, $regionCode) + { + return static::REGION_CODE_FOR_NON_GEO_ENTITY === $regionCode ? + $this->getMetadataForNonGeographicalRegion($countryCallingCode) : $this->getMetadataForRegion($regionCode); + } + + /** + * A helper function that is used by format and formatByPattern. + * + * @param int $countryCallingCode + * @param int $numberFormat PhoneNumberFormat + * @param string $formattedNumber + */ + protected function prefixNumberWithCountryCallingCode($countryCallingCode, $numberFormat, &$formattedNumber) + { + switch ($numberFormat) { + case PhoneNumberFormat::E164: + $formattedNumber = static::PLUS_SIGN . $countryCallingCode . $formattedNumber; + + return; + + case PhoneNumberFormat::INTERNATIONAL: + $formattedNumber = static::PLUS_SIGN . $countryCallingCode . ' ' . $formattedNumber; + + return; + + case PhoneNumberFormat::RFC3966: + $formattedNumber = static::RFC3966_PREFIX . static::PLUS_SIGN . $countryCallingCode . '-' . $formattedNumber; + + return; + + case PhoneNumberFormat::NATIONAL: + default: + return; + } + } + + /** + * Helper function to check the country calling code is valid. + * + * @param int $countryCallingCode + * + * @return bool + */ + protected function hasValidCountryCallingCode($countryCallingCode) + { + return isset($this->countryCallingCodeToRegionCodeMap[$countryCallingCode]); + } + + /** + * Note in some regions, the national number can be written in two completely different ways + * depending on whether it forms part of the NATIONAL format or INTERNATIONAL format. The + * numberFormat parameter here is used to specify which format to use for those cases. If a + * carrierCode is specified, this will be inserted into the formatted string to replace $CC. + * + * @param string $number + * @param int $numberFormat PhoneNumberFormat + * @param string|null $carrierCode + * + * @return string + */ + protected function formatNsn($number, PhoneMetadata $metadata, $numberFormat, $carrierCode = null) + { + $intlNumberFormats = $metadata->intlNumberFormats(); + // When the intlNumberFormats exists, we use that to format national number for the + // INTERNATIONAL format instead of using the numberDesc.numberFormats. + $availableFormats = (0 == count($intlNumberFormats) || PhoneNumberFormat::NATIONAL == $numberFormat) + ? $metadata->numberFormats() + : $metadata->intlNumberFormats(); + $formattingPattern = $this->chooseFormattingPatternForNumber($availableFormats, $number); + + return (null === $formattingPattern) + ? $number + : $this->formatNsnUsingPattern($number, $formattingPattern, $numberFormat, $carrierCode); + } + + /** + * Appends the formatted extension of a phone number to formattedNumber, if the phone number had + * an extension specified. + * + * @param PhoneMetadata|null $metadata + * @param int $numberFormat PhoneNumberFormat + * @param string $formattedNumber + */ + protected function maybeAppendFormattedExtension(PhoneNumber $number, $metadata, $numberFormat, &$formattedNumber) + { + if ($number->hasExtension() && mb_strlen($number->getExtension()) > 0) { + if (PhoneNumberFormat::RFC3966 === $numberFormat) { + $formattedNumber .= static::RFC3966_EXTN_PREFIX . $number->getExtension(); + } elseif (!empty($metadata) && $metadata->hasPreferredExtnPrefix()) { + $formattedNumber .= $metadata->getPreferredExtnPrefix() . $number->getExtension(); + } else { + $formattedNumber .= static::DEFAULT_EXTN_PREFIX . $number->getExtension(); + } + } + } + + /** + * We append optionally the extension pattern to the end here, as a valid phone number may + * have an extension prefix appended, followed by 1 or more digits. + * + * @return string + */ + protected static function getValidPhoneNumberPattern() + { + return static::$VALID_PHONE_NUMBER_PATTERN; + } + + /** + * Strips any extension (as in, the part of the number dialled after the call is connected, + * usually indicated with extn, ext, x or similar) from the end of the number, and returns it. + * + * @param string $number the non-normalized telephone number that we wish to strip the extension from + * + * @return string the phone extension + */ + protected function maybeStripExtension(&$number) + { + $matches = []; + $find = preg_match(static::$EXTN_PATTERN, $number, $matches, PREG_OFFSET_CAPTURE); + // If we find a potential extension, and the number preceding this is a viable number, we assume + // it is an extension. + if ($find > 0 && static::isViablePhoneNumber(substr($number, 0, $matches[0][1]))) { + // The numbers are captured into groups in the regular expression. + + for ($i = 1, $length = count($matches); $i <= $length; ++$i) { + if ('' != $matches[$i][0]) { + // We go through the capturing groups until we find one that captured some digits. If none + // did, then we will return the empty string. + $extension = $matches[$i][0]; + $number = substr($number, 0, $matches[0][1]); + + return $extension; + } + } + } + + return ''; + } + + /** + * Parses a string and fills up the phoneNumber. This method is the same as the public + * parse() method, with the exception that it allows the default region to be null, for use by + * isNumberMatch(). checkRegion should be set to false if it is permitted for the default region + * to be null or unknown ("ZZ"). + * + * @param string $numberToParse + * @param string $defaultRegion + * @param bool $keepRawInput + * @param bool $checkRegion + * + * @throws NumberParseException + */ + protected function parseHelper($numberToParse, $defaultRegion, $keepRawInput, $checkRegion, PhoneNumber $phoneNumber) + { + if (null === $numberToParse) { + throw new NumberParseException(NumberParseException::NOT_A_NUMBER, 'The phone number supplied was null.'); + } + + $numberToParse = trim($numberToParse); + + if (mb_strlen($numberToParse) > static::MAX_INPUT_STRING_LENGTH) { + throw new NumberParseException( + NumberParseException::TOO_LONG, + 'The string supplied was too long to parse.' + ); + } + + $nationalNumber = ''; + $this->buildNationalNumberForParsing($numberToParse, $nationalNumber); + + if (!static::isViablePhoneNumber($nationalNumber)) { + throw new NumberParseException( + NumberParseException::NOT_A_NUMBER, + 'The string supplied did not seem to be a phone number.' + ); + } + + // Check the region supplied is valid, or that the extracted number starts with some sort of + + // sign so the number's region can be determined. + if ($checkRegion && !$this->checkRegionForParsing($nationalNumber, $defaultRegion)) { + throw new NumberParseException( + NumberParseException::INVALID_COUNTRY_CODE, + 'Missing or invalid default region.' + ); + } + + if ($keepRawInput) { + $phoneNumber->setRawInput($numberToParse); + } + // Attempt to parse extension first, since it doesn't require region-specific data and we want + // to have the non-normalised number here. + $extension = $this->maybeStripExtension($nationalNumber); + if (mb_strlen($extension) > 0) { + $phoneNumber->setExtension($extension); + } + + $regionMetadata = $this->getMetadataForRegion($defaultRegion); + // Check to see if the number is given in international format so we know whether this number is + // from the default region or not. + $normalizedNationalNumber = ''; + + try { + // TODO: This method should really just take in the string buffer that has already + // been created, and just remove the prefix, rather than taking in a string and then + // outputting a string buffer. + $countryCode = $this->maybeExtractCountryCode( + $nationalNumber, + $regionMetadata, + $normalizedNationalNumber, + $keepRawInput, + $phoneNumber + ); + } catch (NumberParseException $e) { + $matcher = new Matcher(static::$PLUS_CHARS_PATTERN, $nationalNumber); + if (NumberParseException::INVALID_COUNTRY_CODE == $e->getErrorType() && $matcher->lookingAt()) { + // Strip the plus-char, and try again. + $countryCode = $this->maybeExtractCountryCode( + substr($nationalNumber, $matcher->end()), + $regionMetadata, + $normalizedNationalNumber, + $keepRawInput, + $phoneNumber + ); + if (0 == $countryCode) { + throw new NumberParseException( + NumberParseException::INVALID_COUNTRY_CODE, + 'Could not interpret numbers after plus-sign.' + ); + } + } else { + throw new NumberParseException($e->getErrorType(), $e->getMessage(), $e); + } + } + if (0 !== $countryCode) { + $phoneNumberRegion = $this->getRegionCodeForCountryCode($countryCode); + if ($phoneNumberRegion != $defaultRegion) { + // Metadata cannot be null because the country calling code is valid. + $regionMetadata = $this->getMetadataForRegionOrCallingCode($countryCode, $phoneNumberRegion); + } + } else { + // If no extracted country calling code, use the region supplied instead. The national number + // is just the normalized version of the number we were given to parse. + + $normalizedNationalNumber .= static::normalize($nationalNumber); + if (null !== $defaultRegion) { + $countryCode = $regionMetadata->getCountryCode(); + $phoneNumber->setCountryCode($countryCode); + } elseif ($keepRawInput) { + $phoneNumber->clearCountryCodeSource(); + } + } + if (mb_strlen($normalizedNationalNumber) < static::MIN_LENGTH_FOR_NSN) { + throw new NumberParseException( + NumberParseException::TOO_SHORT_NSN, + 'The string supplied is too short to be a phone number.' + ); + } + if (null !== $regionMetadata) { + $carrierCode = ''; + $potentialNationalNumber = $normalizedNationalNumber; + $this->maybeStripNationalPrefixAndCarrierCode($potentialNationalNumber, $regionMetadata, $carrierCode); + // We require that the NSN remaining after stripping the national prefix and carrier code be + // long enough to be a possible length for the region. Otherwise, we don't do the stripping, + // since the original number could be a valid short number. + $validationResult = $this->testNumberLength($potentialNationalNumber, $regionMetadata); + if (ValidationResult::TOO_SHORT !== $validationResult + && ValidationResult::IS_POSSIBLE_LOCAL_ONLY !== $validationResult + && ValidationResult::INVALID_LENGTH !== $validationResult) { + $normalizedNationalNumber = $potentialNationalNumber; + if ($keepRawInput && mb_strlen($carrierCode) > 0) { + $phoneNumber->setPreferredDomesticCarrierCode($carrierCode); + } + } + } + $lengthOfNationalNumber = mb_strlen($normalizedNationalNumber); + if ($lengthOfNationalNumber < static::MIN_LENGTH_FOR_NSN) { + throw new NumberParseException( + NumberParseException::TOO_SHORT_NSN, + 'The string supplied is too short to be a phone number.' + ); + } + if ($lengthOfNationalNumber > static::MAX_LENGTH_FOR_NSN) { + throw new NumberParseException( + NumberParseException::TOO_LONG, + 'The string supplied is too long to be a phone number.' + ); + } + static::setItalianLeadingZerosForPhoneNumber($normalizedNationalNumber, $phoneNumber); + + /* + * We have to store the National Number as a string instead of a "long" as Google do + * + * Since PHP doesn't always support 64 bit INTs, this was a float, but that had issues + * with long numbers. + * + * We have to remove the leading zeroes ourself though + */ + if (0 == (int) $normalizedNationalNumber) { + $normalizedNationalNumber = '0'; + } else { + $normalizedNationalNumber = ltrim($normalizedNationalNumber, '0'); + } + + $phoneNumber->setNationalNumber($normalizedNationalNumber); + } + + /** + * Returns a new phone number containing only the fields needed to uniquely identify a phone + * number, rather than any fields that capture the context in which the phone number was created. + * These fields correspond to those set in parse() rather than parseAndKeepRawInput(). + * + * @return PhoneNumber + */ + protected static function copyCoreFieldsOnly(PhoneNumber $phoneNumberIn) + { + $phoneNumber = new PhoneNumber(); + $phoneNumber->setCountryCode($phoneNumberIn->getCountryCode()); + $phoneNumber->setNationalNumber($phoneNumberIn->getNationalNumber()); + if (mb_strlen($phoneNumberIn->getExtension()) > 0) { + $phoneNumber->setExtension($phoneNumberIn->getExtension()); + } + if ($phoneNumberIn->isItalianLeadingZero()) { + $phoneNumber->setItalianLeadingZero(true); + // This field is only relevant if there are leading zeros at all. + $phoneNumber->setNumberOfLeadingZeros($phoneNumberIn->getNumberOfLeadingZeros()); + } + + return $phoneNumber; + } + + /** + * Converts numberToParse to a form that we can parse and write it to nationalNumber if it is + * written in RFC3966; otherwise extract a possible number out of it and write to nationalNumber. + * + * @param string $numberToParse + * @param string $nationalNumber + */ + protected function buildNationalNumberForParsing($numberToParse, &$nationalNumber) + { + $indexOfPhoneContext = strpos($numberToParse, static::RFC3966_PHONE_CONTEXT); + if (false !== $indexOfPhoneContext) { + $phoneContextStart = $indexOfPhoneContext + mb_strlen(static::RFC3966_PHONE_CONTEXT); + // If the phone context contains a phone number prefix, we need to capture it, whereas domains + // will be ignored. + if ($phoneContextStart < (strlen($numberToParse) - 1) + && substr($numberToParse, $phoneContextStart, 1) == static::PLUS_SIGN) { + // Additional parameters might follow the phone context. If so, we will remove them here + // because the parameters after phone context are not important for parsing the + // phone number. + $phoneContextEnd = strpos($numberToParse, ';', $phoneContextStart); + if ($phoneContextEnd > 0) { + $nationalNumber .= substr($numberToParse, $phoneContextStart, $phoneContextEnd - $phoneContextStart); + } else { + $nationalNumber .= substr($numberToParse, $phoneContextStart); + } + } - // Check the region code is valid. - if (!$this->isValidRegionCode($regionCodeOrType)) { - return null; + // Now append everything between the "tel:" prefix and the phone-context. This should include + // the national number, an optional extension or isdn-subaddress component. Note we also + // handle the case when "tel:" is missing, as we have seen in some of the phone number inputs. + // In that case, we append everything from the beginning. + + $indexOfRfc3966Prefix = strpos($numberToParse, static::RFC3966_PREFIX); + $indexOfNationalNumber = (false !== $indexOfRfc3966Prefix) ? $indexOfRfc3966Prefix + strlen(static::RFC3966_PREFIX) : 0; + $nationalNumber .= substr( + $numberToParse, + $indexOfNationalNumber, + $indexOfPhoneContext - $indexOfNationalNumber + ); + } else { + // Extract a possible number from the string passed in (this strips leading characters that + // could not be the start of a phone number.) + $nationalNumber .= static::extractPossibleNumber($numberToParse); } - $desc = $this->getNumberDescByType($this->getMetadataForRegion($regionCodeOrType), $type); - try { - if ($desc->hasExampleNumber()) { - return $this->parse($desc->getExampleNumber(), $regionCodeOrType); - } - } catch (NumberParseException $e) { - // noop + + // Delete the isdn-subaddress and everything after it if it is present. Note extension won't + // appear at the same time with isdn-subaddress according to paragraph 5.3 of the RFC3966 spec, + $indexOfIsdn = strpos($nationalNumber, static::RFC3966_ISDN_SUBADDRESS); + if ($indexOfIsdn > 0) { + $nationalNumber = substr($nationalNumber, 0, $indexOfIsdn); } - return null; + // If both phone context and isdn-subaddress are absent but other parameters are present, the + // parameters are left in nationalNumber. This is because we are concerned about deleting + // content from a potential number string when there is no strong evidence that the number is + // actually written in RFC3966. } /** - * @param PhoneMetadata $metadata - * @param int $type PhoneNumberType - * @return PhoneNumberDesc + * Checks to see that the region code used is valid, or if it is not valid, that the number to + * parse starts with a + symbol so that we can attempt to infer the region from the number. + * Returns false if it cannot use the region provided and the region cannot be inferred. + * + * @param string $numberToParse + * @param string $defaultRegion + * + * @return bool */ - protected function getNumberDescByType(PhoneMetadata $metadata, $type) + protected function checkRegionForParsing($numberToParse, $defaultRegion) { - switch ($type) { - case PhoneNumberType::PREMIUM_RATE: - return $metadata->getPremiumRate(); - case PhoneNumberType::TOLL_FREE: - return $metadata->getTollFree(); - case PhoneNumberType::MOBILE: - return $metadata->getMobile(); - case PhoneNumberType::FIXED_LINE: - case PhoneNumberType::FIXED_LINE_OR_MOBILE: - return $metadata->getFixedLine(); - case PhoneNumberType::SHARED_COST: - return $metadata->getSharedCost(); - case PhoneNumberType::VOIP: - return $metadata->getVoip(); - case PhoneNumberType::PERSONAL_NUMBER: - return $metadata->getPersonalNumber(); - case PhoneNumberType::PAGER: - return $metadata->getPager(); - case PhoneNumberType::UAN: - return $metadata->getUan(); - case PhoneNumberType::VOICEMAIL: - return $metadata->getVoicemail(); - default: - return $metadata->getGeneralDesc(); + if (!$this->isValidRegionCode($defaultRegion)) { + // If the number is null or empty, we can't infer the region. + $plusCharsPatternMatcher = new Matcher(static::$PLUS_CHARS_PATTERN, $numberToParse); + if (null === $numberToParse || 0 == mb_strlen($numberToParse) || !$plusCharsPatternMatcher->lookingAt()) { + return false; + } } + + return true; } /** - * Gets a valid number for the specified country calling code for a non-geographical entity. + * Strips the IDD from the start of the number if present. Helper function used by + * maybeStripInternationalPrefixAndNormalize. * - * @param int $countryCallingCode the country calling code for a non-geographical entity - * @return PhoneNumber a valid number for the non-geographical entity. Returns null when the metadata - * does not contain such information, or the country calling code passed in does not belong - * to a non-geographical entity. + * @param string $iddPattern + * @param string $number + * + * @return bool */ - public function getExampleNumberForNonGeoEntity($countryCallingCode) + protected function parsePrefixAsIdd($iddPattern, &$number) { - $metadata = $this->getMetadataForNonGeographicalRegion($countryCallingCode); - if ($metadata !== null) { - // For geographical entities, fixed-line data is always present. However, for non-geographical - // entities, this is not the case, so we have to go through different types to find the - // example number. We don't check fixed-line or personal number since they aren't used by - // non-geographical entities (if this changes, a unit-test will catch this.) - /** @var PhoneNumberDesc[] $list */ - $list = array( - $metadata->getMobile(), - $metadata->getTollFree(), - $metadata->getSharedCost(), - $metadata->getVoip(), - $metadata->getVoicemail(), - $metadata->getUan(), - $metadata->getPremiumRate(), - ); - foreach ($list as $desc) { - try { - if ($desc !== null && $desc->hasExampleNumber()) { - return $this->parse('+' . $countryCallingCode . $desc->getExampleNumber(), self::UNKNOWN_REGION); - } - } catch (NumberParseException $e) { - // noop + $m = new Matcher($iddPattern, $number); + if ($m->lookingAt()) { + $matchEnd = $m->end(); + // Only strip this if the first digit after the match is not a 0, since country calling codes + // cannot begin with 0. + $digitMatcher = new Matcher(static::$CAPTURING_DIGIT_PATTERN, substr($number, $matchEnd)); + if ($digitMatcher->find()) { + $normalizedGroup = static::normalizeDigitsOnly($digitMatcher->group(1)); + if ('0' == $normalizedGroup) { + return false; } } + $number = substr($number, $matchEnd); + + return true; } - return null; - } + return false; + } /** - * Takes two phone numbers and compares them for equality. + * Helper method to check a number against possible lengths for this number type, and determine + * whether it matches, or is too short or too long. * - *

    Returns EXACT_MATCH if the country_code, NSN, presence of a leading zero - * for Italian numbers and any extension present are the same. Returns NSN_MATCH - * if either or both has no region specified, and the NSNs and extensions are - * the same. Returns SHORT_NSN_MATCH if either or both has no region specified, - * or the region specified is the same, and one NSN could be a shorter version - * of the other number. This includes the case where one has an extension - * specified, and the other does not. Returns NO_MATCH otherwise. For example, - * the numbers +1 345 657 1234 and 657 1234 are a SHORT_NSN_MATCH. The numbers - * +1 345 657 1234 and 345 657 are a NO_MATCH. + * @param string $number + * @param int $type PhoneNumberType * - * @param $firstNumberIn PhoneNumber|string First number to compare. If it is a - * string it can contain formatting, and can have country calling code specified - * with + at the start. - * @param $secondNumberIn PhoneNumber|string Second number to compare. If it is a - * string it can contain formatting, and can have country calling code specified - * with + at the start. - * @throws \InvalidArgumentException - * @return int {MatchType} NOT_A_NUMBER, NO_MATCH, + * @return int ValidationResult */ - public function isNumberMatch($firstNumberIn, $secondNumberIn) + protected function testNumberLength($number, PhoneMetadata $metadata, $type = PhoneNumberType::UNKNOWN) { - if (is_string($firstNumberIn) && is_string($secondNumberIn)) { - try { - $firstNumberAsProto = $this->parse($firstNumberIn, static::UNKNOWN_REGION); - return $this->isNumberMatch($firstNumberAsProto, $secondNumberIn); - } catch (NumberParseException $e) { - if ($e->getErrorType() === NumberParseException::INVALID_COUNTRY_CODE) { - try { - $secondNumberAsProto = $this->parse($secondNumberIn, static::UNKNOWN_REGION); - return $this->isNumberMatch($secondNumberAsProto, $firstNumberIn); - } catch (NumberParseException $e2) { - if ($e2->getErrorType() === NumberParseException::INVALID_COUNTRY_CODE) { - try { - $firstNumberProto = new PhoneNumber(); - $secondNumberProto = new PhoneNumber(); - $this->parseHelper($firstNumberIn, null, false, false, $firstNumberProto); - $this->parseHelper($secondNumberIn, null, false, false, $secondNumberProto); - return $this->isNumberMatch($firstNumberProto, $secondNumberProto); - } catch (NumberParseException $e3) { - // Fall through and return MatchType::NOT_A_NUMBER - } - } - } - } + $descForType = $this->getNumberDescByType($metadata, $type); + // There should always be "possibleLengths" set for every element. This is declared in the XML + // schema which is verified by PhoneNumberMetadataSchemaTest. + // For size efficiency, where a sub-description (e.g. fixed-line) has the same possibleLengths + // as the parent, this is missing, so we fall back to the general desc (where no numbers of the + // type exist at all, there is one possible length (-1) which is guaranteed not to match the + // length of any real phone number). + $possibleLengths = (0 === count($descForType->getPossibleLength())) + ? $metadata->getGeneralDesc()->getPossibleLength() : $descForType->getPossibleLength(); + + $localLengths = $descForType->getPossibleLengthLocalOnly(); + + if (PhoneNumberType::FIXED_LINE_OR_MOBILE === $type) { + if (!static::descHasPossibleNumberData($this->getNumberDescByType($metadata, PhoneNumberType::FIXED_LINE))) { + // The rate case has been encountered where no fixedLine data is available (true for some + // non-geographical entities), so we just check mobile. + return $this->testNumberLength($number, $metadata, PhoneNumberType::MOBILE); } - return MatchType::NOT_A_NUMBER; - } - if ($firstNumberIn instanceof PhoneNumber && is_string($secondNumberIn)) { - // First see if the second number has an implicit country calling code, by attempting to parse - // it. - try { - $secondNumberAsProto = $this->parse($secondNumberIn, static::UNKNOWN_REGION); - return $this->isNumberMatch($firstNumberIn, $secondNumberAsProto); - } catch (NumberParseException $e) { - if ($e->getErrorType() === NumberParseException::INVALID_COUNTRY_CODE) { - // The second number has no country calling code. EXACT_MATCH is no longer possible. - // We parse it as if the region was the same as that for the first number, and if - // EXACT_MATCH is returned, we replace this with NSN_MATCH. - $firstNumberRegion = $this->getRegionCodeForCountryCode($firstNumberIn->getCountryCode()); - try { - if ($firstNumberRegion != static::UNKNOWN_REGION) { - $secondNumberWithFirstNumberRegion = $this->parse($secondNumberIn, $firstNumberRegion); - $match = $this->isNumberMatch($firstNumberIn, $secondNumberWithFirstNumberRegion); - if ($match === MatchType::EXACT_MATCH) { - return MatchType::NSN_MATCH; - } - return $match; - } - // If the first number didn't have a valid country calling code, then we parse the - // second number without one as well. - $secondNumberProto = new PhoneNumber(); - $this->parseHelper($secondNumberIn, null, false, false, $secondNumberProto); - return $this->isNumberMatch($firstNumberIn, $secondNumberProto); - } catch (NumberParseException $e2) { - // Fall-through to return NOT_A_NUMBER. - } + $mobileDesc = $this->getNumberDescByType($metadata, PhoneNumberType::MOBILE); + if (static::descHasPossibleNumberData($mobileDesc)) { + // Note that when adding the possible lengths from mobile, we have to again check they + // aren't empty since if they are this indicates they are the same as the general desc and + // should be obtained from there. + $possibleLengths = array_merge( + $possibleLengths, + (0 === count($mobileDesc->getPossibleLength())) + ? $metadata->getGeneralDesc()->getPossibleLength() : $mobileDesc->getPossibleLength() + ); + + // The current list is sorted; we need to merge in the new list and re-sort (duplicates + // are okay). Sorting isn't so expensive because the lists are very small. + sort($possibleLengths); + + if (0 === count($localLengths)) { + $localLengths = $mobileDesc->getPossibleLengthLocalOnly(); + } else { + $localLengths = array_merge($localLengths, $mobileDesc->getPossibleLengthLocalOnly()); + sort($localLengths); } } } - if ($firstNumberIn instanceof PhoneNumber && $secondNumberIn instanceof PhoneNumber) { - // We only care about the fields that uniquely define a number, so we copy these across - // explicitly. - $firstNumber = self::copyCoreFieldsOnly($firstNumberIn); - $secondNumber = self::copyCoreFieldsOnly($secondNumberIn); - // Early exit if both had extensions and these are different. - if ($firstNumber->hasExtension() && $secondNumber->hasExtension() && - $firstNumber->getExtension() != $secondNumber->getExtension() - ) { - return MatchType::NO_MATCH; - } + // If the type is not supported at all (indicated by the possible lengths containing -1 at this + // point) we return invalid length. + + if (-1 === $possibleLengths[0]) { + return ValidationResult::INVALID_LENGTH; + } + + $actualLength = mb_strlen($number); + + // This is safe because there is never an overlap between the possible lengths and the local-only + // lengths; this is checked at build time. + + if (in_array($actualLength, $localLengths)) { + return ValidationResult::IS_POSSIBLE_LOCAL_ONLY; + } + + $minimumLength = reset($possibleLengths); + if ($minimumLength == $actualLength) { + return ValidationResult::IS_POSSIBLE; + } + + if ($minimumLength > $actualLength) { + return ValidationResult::TOO_SHORT; + } elseif (isset($possibleLengths[count($possibleLengths) - 1]) && $possibleLengths[count($possibleLengths) - 1] < $actualLength) { + return ValidationResult::TOO_LONG; + } - $firstNumberCountryCode = $firstNumber->getCountryCode(); - $secondNumberCountryCode = $secondNumber->getCountryCode(); - // Both had country_code specified. - if ($firstNumberCountryCode != 0 && $secondNumberCountryCode != 0) { - if ($firstNumber->equals($secondNumber)) { - return MatchType::EXACT_MATCH; - } + // We skip the first element; we've already checked it. + array_shift($possibleLengths); - if ($firstNumberCountryCode == $secondNumberCountryCode && - $this->isNationalNumberSuffixOfTheOther($firstNumber, $secondNumber)) { - // A SHORT_NSN_MATCH occurs if there is a difference because of the presence or absence of - // an 'Italian leading zero', the presence or absence of an extension, or one NSN being a - // shorter variant of the other. - return MatchType::SHORT_NSN_MATCH; - } - // This is not a match. - return MatchType::NO_MATCH; - } - // Checks cases where one or both country_code fields were not specified. To make equality - // checks easier, we first set the country_code fields to be equal. - $firstNumber->setCountryCode($secondNumberCountryCode); - // If all else was the same, then this is an NSN_MATCH. - if ($firstNumber->equals($secondNumber)) { - return MatchType::NSN_MATCH; - } - if ($this->isNationalNumberSuffixOfTheOther($firstNumber, $secondNumber)) { - return MatchType::SHORT_NSN_MATCH; - } - return MatchType::NO_MATCH; - } - return MatchType::NOT_A_NUMBER; + return in_array($actualLength, $possibleLengths) ? ValidationResult::IS_POSSIBLE : ValidationResult::INVALID_LENGTH; } /** - * Returns true when one national number is the suffix of the other or both are the same. - * @param PhoneNumber $firstNumber - * @param PhoneNumber $secondNumber - * @return bool + * Returns the country calling code for a specific region. For example, this would be 1 for the + * United States, and 64 for New Zealand. Assumes the region is already valid. + * + * @param string $regionCode the region that we want to get the country calling code for + * + * @throws \InvalidArgumentException if the region is invalid + * + * @return int the country calling code for the region denoted by regionCode */ - protected function isNationalNumberSuffixOfTheOther(PhoneNumber $firstNumber, PhoneNumber $secondNumber) + protected function getCountryCodeForValidRegion($regionCode) { - $firstNumberNationalNumber = trim((string)$firstNumber->getNationalNumber()); - $secondNumberNationalNumber = trim((string)$secondNumber->getNationalNumber()); - return $this->stringEndsWithString($firstNumberNationalNumber, $secondNumberNationalNumber) || - $this->stringEndsWithString($secondNumberNationalNumber, $firstNumberNationalNumber); - } + $metadata = $this->getMetadataForRegion($regionCode); + if (null === $metadata) { + throw new \InvalidArgumentException('Invalid region code: ' . $regionCode); + } - protected function stringEndsWithString($hayStack, $needle) - { - $revNeedle = strrev($needle); - $revHayStack = strrev($hayStack); - return strpos($revHayStack, $revNeedle) === 0; + return $metadata->getCountryCode(); } /** - * Returns true if the supplied region supports mobile number portability. Returns false for - * invalid, unknown or regions that don't support mobile number portability. - * - * @param string $regionCode the region for which we want to know whether it supports mobile number - * portability or not. * @return bool */ - public function isMobileNumberPortableRegion($regionCode) + protected function hasFormattingPatternForNumber(PhoneNumber $number) { - $metadata = $this->getMetadataForRegion($regionCode); - if ($metadata === null) { + $countryCallingCode = $number->getCountryCode(); + $phoneNumberRegion = $this->getRegionCodeForCountryCode($countryCallingCode); + $metadata = $this->getMetadataForRegionOrCallingCode($countryCallingCode, $phoneNumberRegion); + if (null === $metadata) { return false; } + $nationalNumber = $this->getNationalSignificantNumber($number); + $formatRule = $this->chooseFormattingPatternForNumber($metadata->numberFormats(), $nationalNumber); - return $metadata->isMobileNumberPortableRegion(); + return null !== $formatRule; } /** - * Check whether a phone number is a possible number given a number in the form of a string, and - * the region where the number could be dialed from. It provides a more lenient check than - * {@link #isValidNumber}. See {@link #isPossibleNumber(PhoneNumber)} for details. - * - * Convenience wrapper around {@link #isPossibleNumberWithReason}. Instead of returning the reason - * for failure, this method returns a boolean value. - * for failure, this method returns true if the number is either a possible fully-qualified number - * (containing the area code and country code), or if the number could be a possible local number - * (with a country code, but missing an area code). Local numbers are considered possible if they - * could be possibly dialled in this format: if the area code is needed for a call to connect, the - * number is not considered possible without it. - * - * Note: There are two ways to call this method. + * Check if rawInput, which is assumed to be in the national format, has a national prefix. The + * national prefix is assumed to be in digits-only form. * - * isPossibleNumber(PhoneNumber $numberObject) - * isPossibleNumber(string '+441174960126', string 'GB') + * @param string $rawInput + * @param string $nationalPrefix + * @param string $regionCode * - * @param PhoneNumber|string $number the number that needs to be checked, in the form of a string - * @param string|null $regionDialingFrom the region that we are expecting the number to be dialed from. - * Note this is different from the region where the number belongs. For example, the number - * +1 650 253 0000 is a number that belongs to US. When written in this form, it can be - * dialed from any region. When it is written as 00 1 650 253 0000, it can be dialed from any - * region which uses an international dialling prefix of 00. When it is written as - * 650 253 0000, it can only be dialed from within the US, and when written as 253 0000, it - * can only be dialed from within a smaller area in the US (Mountain View, CA, to be more - * specific). - * @return boolean true if the number is possible + * @return bool */ - public function isPossibleNumber($number, $regionDialingFrom = null) + protected function rawInputContainsNationalPrefix($rawInput, $nationalPrefix, $regionCode) { - if ($regionDialingFrom !== null && is_string($number)) { + $normalizedNationalNumber = static::normalizeDigitsOnly($rawInput); + if (0 === strpos($normalizedNationalNumber, $nationalPrefix)) { try { - return $this->isPossibleNumber($this->parse($number, $regionDialingFrom)); + // Some Japanese numbers (e.g. 00777123) might be mistaken to contain the national prefix + // when written without it (e.g. 0777123) if we just do prefix matching. To tackle that, we + // check the validity of the number if the assumed national prefix is removed (777123 won't + // be valid in Japan). + return $this->isValidNumber( + $this->parse(substr($normalizedNationalNumber, mb_strlen($nationalPrefix)), $regionCode) + ); } catch (NumberParseException $e) { return false; } - } else { - $result = $this->isPossibleNumberWithReason($number); - return $result === ValidationResult::IS_POSSIBLE - || $result === ValidationResult::IS_POSSIBLE_LOCAL_ONLY; } - } + return false; + } /** - * Check whether a phone number is a possible number. It provides a more lenient check than - * {@link #isValidNumber} in the following sense: - *

      - *
    1. It only checks the length of phone numbers. In particular, it doesn't check starting - * digits of the number. - *
    2. It doesn't attempt to figure out the type of the number, but uses general rules which - * applies to all types of phone numbers in a region. Therefore, it is much faster than - * isValidNumber. - *
    3. For some numbers (particularly fixed-line), many regions have the concept of area code, - * which together with subscriber number constitute the national significant number. It is - * sometimes okay to dial only the subscriber number when dialing in the same area. This - * function will return IS_POSSIBLE_LOCAL_ONLY if the subscriber-number-only version is - * passed in. On the other hand, because isValidNumber validates using information on both - * starting digits (for fixed line numbers, that would most likely be area codes) and - * length (obviously includes the length of area codes for fixed line numbers), it will - * return false for the subscriber-number-only version. - *
    - * @param PhoneNumber $number the number that needs to be checked - * @return int a ValidationResult object which indicates whether the number is possible + * @param int $type PhoneNumberType + * + * @return PhoneNumberDesc */ - public function isPossibleNumberWithReason(PhoneNumber $number) + protected function getNumberDescByType(PhoneMetadata $metadata, $type) { - return $this->isPossibleNumberForTypeWithReason($number, PhoneNumberType::UNKNOWN); + switch ($type) { + case PhoneNumberType::PREMIUM_RATE: + return $metadata->getPremiumRate(); + + case PhoneNumberType::TOLL_FREE: + return $metadata->getTollFree(); + + case PhoneNumberType::MOBILE: + return $metadata->getMobile(); + + case PhoneNumberType::FIXED_LINE: + case PhoneNumberType::FIXED_LINE_OR_MOBILE: + return $metadata->getFixedLine(); + + case PhoneNumberType::SHARED_COST: + return $metadata->getSharedCost(); + + case PhoneNumberType::VOIP: + return $metadata->getVoip(); + + case PhoneNumberType::PERSONAL_NUMBER: + return $metadata->getPersonalNumber(); + + case PhoneNumberType::PAGER: + return $metadata->getPager(); + + case PhoneNumberType::UAN: + return $metadata->getUan(); + + case PhoneNumberType::VOICEMAIL: + return $metadata->getVoicemail(); + + default: + return $metadata->getGeneralDesc(); + } } /** - * Check whether a phone number is a possible number of a particular type. For types that don't - * exist in a particular region, this will return a result that isn't so useful; it is recommended - * that you use {@link #getSupportedTypesForRegion} or {@link #getSupportedTypesForNonGeoEntity} - * respectively before calling this method to determine whether you should call it for this number - * at all. - * - * This provides a more lenient check than {@link #isValidNumber} in the following sense: - * - *
      - *
    1. It only checks the length of phone numbers. In particular, it doesn't check starting - * digits of the number. - *
    2. For some numbers (particularly fixed-line), many regions have the concept of area code, - * which together with subscriber number constitute the national significant number. It is - * sometimes okay to dial only the subscriber number when dialing in the same area. This - * function will return IS_POSSIBLE_LOCAL_ONLY if the subscriber-number-only version is - * passed in. On the other hand, because isValidNumber validates using information on both - * starting digits (for fixed line numbers, that would most likely be area codes) and - * length (obviously includes the length of area codes for fixed line numbers), it will - * return false for the subscriber-number-only version. - *
    + * Returns true when one national number is the suffix of the other or both are the same. * - * @param PhoneNumber $number the number that needs to be checked - * @param int $type the PhoneNumberType we are interested in - * @return int a ValidationResult object which indicates whether the number is possible + * @return bool */ - public function isPossibleNumberForTypeWithReason(PhoneNumber $number, $type) + protected function isNationalNumberSuffixOfTheOther(PhoneNumber $firstNumber, PhoneNumber $secondNumber) { - $nationalNumber = $this->getNationalSignificantNumber($number); - $countryCode = $number->getCountryCode(); + $firstNumberNationalNumber = trim((string) $firstNumber->getNationalNumber()); + $secondNumberNationalNumber = trim((string) $secondNumber->getNationalNumber()); - // Note: For regions that share a country calling code, like NANPA numbers, we just use the - // rules from the default region (US in this case) since the getRegionCodeForNumber will not - // work if the number is possible but not valid. There is in fact one country calling code (290) - // where the possible number pattern differs between various regions (Saint Helena and Tristan - // da Cuñha), but this is handled by putting all possible lengths for any country with this - // country calling code in the metadata for the default region in this case. - if (!$this->hasValidCountryCallingCode($countryCode)) { - return ValidationResult::INVALID_COUNTRY_CODE; - } + return $this->stringEndsWithString($firstNumberNationalNumber, $secondNumberNationalNumber) + || $this->stringEndsWithString($secondNumberNationalNumber, $firstNumberNationalNumber); + } - $regionCode = $this->getRegionCodeForCountryCode($countryCode); - // Metadata cannot be null because the country calling code is valid. - $metadata = $this->getMetadataForRegionOrCallingCode($countryCode, $regionCode); - return $this->testNumberLength($nationalNumber, $metadata, $type); + protected function stringEndsWithString($hayStack, $needle) + { + $revNeedle = strrev($needle); + $revHayStack = strrev($hayStack); + + return 0 === strpos($revHayStack, $revNeedle); } /** - * Attempts to extract a valid number from a phone number that is too long to be valid, and resets - * the PhoneNumber object passed in to that valid version. If no valid number could be extracted, - * the PhoneNumber object passed in will not be modified. - * @param PhoneNumber $number a PhoneNumber object which contains a number that is too long to be valid. - * @return boolean true if a valid phone number can be successfully extracted. + * Returns the types we have metadata for based on the PhoneMetadata object passed in. + * + * @return array */ - public function truncateTooLongNumber(PhoneNumber $number) + private function getSupportedTypesForMetadata(PhoneMetadata $metadata) { - if ($this->isValidNumber($number)) { - return true; - } - $numberCopy = new PhoneNumber(); - $numberCopy->mergeFrom($number); - $nationalNumber = $number->getNationalNumber(); - do { - $nationalNumber = floor($nationalNumber / 10); - $numberCopy->setNationalNumber($nationalNumber); - if ($this->isPossibleNumberWithReason($numberCopy) == ValidationResult::TOO_SHORT || $nationalNumber == 0) { - return false; + $types = []; + foreach (array_keys(PhoneNumberType::values()) as $type) { + if (PhoneNumberType::FIXED_LINE_OR_MOBILE === $type || PhoneNumberType::UNKNOWN === $type) { + // Never return FIXED_LINE_OR_MOBILE (it is a convenience type, and represents that a + // particular number type can't be determined) or UNKNOWN (the non-type). + continue; } - } while (!$this->isValidNumber($numberCopy)); - $number->setNationalNumber($nationalNumber); - return true; + + if (self::descHasData($this->getNumberDescByType($metadata, $type))) { + $types[] = $type; + } + } + + return $types; } } diff --git a/lib/libphonenumber/RegexBasedMatcher.php b/lib/libphonenumber/RegexBasedMatcher.php index d6bdbc66..398fca4e 100755 --- a/lib/libphonenumber/RegexBasedMatcher.php +++ b/lib/libphonenumber/RegexBasedMatcher.php @@ -3,8 +3,8 @@ namespace libphonenumber; /** - * Class RegexBasedMatcher - * @package libphonenumber + * Class RegexBasedMatcher. + * * @internal */ class RegexBasedMatcher implements MatcherAPIInterface @@ -19,9 +19,9 @@ public static function create() * the national number pattern defined in the given {@code PhoneNumberDesc} message. * * @param string $number - * @param PhoneNumberDesc $numberDesc - * @param boolean $allowPrefixMatch - * @return boolean + * @param bool $allowPrefixMatch + * + * @return bool */ public function matchNationalNumber($number, PhoneNumberDesc $numberDesc, $allowPrefixMatch) { @@ -30,7 +30,7 @@ public function matchNationalNumber($number, PhoneNumberDesc $numberDesc, $allow // We don't want to consider it a prefix match when matching non-empty input against an empty // pattern - if (strlen($nationalNumberPattern) === 0) { + if (0 === strlen($nationalNumberPattern)) { return false; } @@ -41,6 +41,7 @@ public function matchNationalNumber($number, PhoneNumberDesc $numberDesc, $allow * @param string $number * @param string $pattern * @param $allowPrefixMatch + * * @return bool */ private function match($number, $pattern, $allowPrefixMatch) diff --git a/lib/libphonenumber/ValidationResult.php b/lib/libphonenumber/ValidationResult.php index b5ef72e9..2deae7fb 100755 --- a/lib/libphonenumber/ValidationResult.php +++ b/lib/libphonenumber/ValidationResult.php @@ -8,7 +8,7 @@ class ValidationResult { /** - * The number length matches that of valid numbers for this region + * The number length matches that of valid numbers for this region. */ const IS_POSSIBLE = 0; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_255.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_255.php index f1da64d7..a1283dca 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_255.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_255.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 255, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[67]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[67]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 255, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[67]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[67]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_27.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_27.php index cba664d5..20190e71 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_27.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_27.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 27, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '86[1-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 27, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '86[1-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_30.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_30.php index 61b8316a..89082168 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_30.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_30.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 30, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '21', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 30, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '21', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_31.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_31.php index 666d9567..0b51472b 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_31.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_31.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 31, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7|8[4578]|91', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[16-8]|2[259]|3[124]|4[17-9]|5[124679]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 31, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7|8[4578]|91', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1[16-8]|2[259]|3[124]|4[17-9]|5[124679]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_34.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_34.php index 2cb2cd10..c41751cf 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_34.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_34.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 34, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[5-7]|80[367]|90[12]|[89][1-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '9(?:0[12]|[1-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 34, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[5-7]|80[367]|90[12]|[89][1-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '9(?:0[12]|[1-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_350.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_350.php index 0c946c9e..0a7f657f 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_350.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_350.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 350, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 350, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_351.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_351.php index dc990816..2757bbff 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_351.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_351.php @@ -10,55 +10,46 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 351, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[12]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2[12]|9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 351, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[12]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2[12]|9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_352.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_352.php index 84006495..d2e068ae 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_352.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_352.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 352, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:[0367]|4[3-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 352, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:[0367]|4[3-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_358.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_358.php index 600f340f..6a8b3e64 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_358.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_358.php @@ -10,55 +10,46 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 358, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2568][1-8]|3(?:0[1-9]|[1-9])|9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]0[1-9]|4|1[3-9]|29|50|7[15]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2568][1-8]|3(?:0[1-9]|[1-9])|9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 358, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2568][1-8]|3(?:0[1-9]|[1-9])|9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[12]0[1-9]|4|1[3-9]|29|50|7[15]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2568][1-8]|3(?:0[1-9]|[1-9])|9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_359.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_359.php index ca8339b3..91193c84 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_359.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_359.php @@ -10,55 +10,46 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 359, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8|98', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8|98', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 359, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8|98', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8|98', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_36.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_36.php index 2614240d..22eb1c87 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_36.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_36.php @@ -10,42 +10,35 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 36, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 36, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_372.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_372.php index 6b379f79..45cf6782 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_372.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_372.php @@ -10,55 +10,46 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 372, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[4-79]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[4-79]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 372, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[4-79]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[4-79]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_373.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_373.php index 1eca828b..ba7b815b 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_373.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_373.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 373, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '22|[367]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[67]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 373, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '22|[367]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[67]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_380.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_380.php index 7b2d8a22..182c34a7 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_380.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_380.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 380, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 380, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_381.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_381.php index 4150ef42..0a370158 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_381.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_381.php @@ -10,55 +10,46 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 381, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[16]|2[0-24-7]|3[0-8]|(?:2[389]|39)[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1|2[0-24-7]|3[0-8]|(?:2[389]|39)[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 381, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[16]|2[0-24-7]|3[0-8]|(?:2[389]|39)[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1|2[0-24-7]|3[0-8]|(?:2[389]|39)[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_385.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_385.php index c3585a2f..428b074c 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_385.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_385.php @@ -10,67 +10,56 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 385, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-69]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 385, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-69]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_39.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_39.php index 8aa7a8a5..50ce5145 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_39.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_39.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 39, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '0(?:[13-579][2-46-8]|8[236-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0(?:[13-579][2-46-8]|8[236-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 39, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '0(?:[13-579][2-46-8]|8[236-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0(?:[13-579][2-46-8]|8[236-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_43.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_43.php index 2acfb7f5..6f186371 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_43.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_43.php @@ -10,175 +10,146 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 43, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{4,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{7,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{6,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d)(\\d{9,12})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2,4})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{2})(\\d{5})(\\d{4,6})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 11 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 12 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2|3(?:1[1-578]|[3-68])|4[2378]|5[2-6]|6(?:[124]|5[468])|7(?:2[1-8]|35|[4-79])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 43, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{4,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '5[079]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{7,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '5[079]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '5[079]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{6,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '5[079]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d)(\\d{9,12})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '5[079]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '5[079]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2,4})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '5[079]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{2})(\\d{5})(\\d{4,6})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '5[079]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 10 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 11 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 12 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2|3(?:1[1-578]|[3-68])|4[2378]|5[2-6]|6(?:[124]|5[468])|7(?:2[1-8]|35|[4-79])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_44.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_44.php index b6637e33..411355e5 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_44.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_44.php @@ -10,79 +10,66 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 44, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '20', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:1|[2-69]1)|20|[389]|7(?:[1-57-9]|624)', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '20', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:[2-69][02-9]|[78])|3|7(?:[1-57-9]|624)', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 44, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '20', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:1|[2-69]1)|20|[389]|7(?:[1-57-9]|624)', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '20', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:[2-69][02-9]|[78])|3|7(?:[1-57-9]|624)', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_49.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_49.php index 9ae09a0b..e89782f6 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_49.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_49.php @@ -10,511 +10,426 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 49, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[34]0|[68]9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:0|3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|4[01]|50|6[09]|7(?:0|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6]|9)|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[34]0|[68]9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{1,2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[34]0|[68]9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '3[02]|40|[68]9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d)(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5 $6', - 'leadingDigitsPatterns' => - array ( - 0 => '3[02]|40|[68]9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{1,2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 11 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})(\\d)', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 12 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 13 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{1,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 14 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|66[2-9]|7(?:1[2-9]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|[5-8]0|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 15 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d)(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|66[2-9]|7(?:1[2-9]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|[5-8]0|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 16 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d)(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5 $6', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 17 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5 $6', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|7(?:8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|[5-7]0|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 18 => - array ( - 'pattern' => '(\\d{4})(\\d{4})(\\d{1,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 19 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|4[19]|7(?:8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|[5-7]0|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 20 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '15[1279]|2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 21 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 22 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 23 => - array ( - 'pattern' => '(\\d{5})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:3(?:0[589]|2[03]|3[369]|4[357]|6[0357]|7[0346]|8[347]|9[236-8])|4(?:4[2469]|6[03579]|9[0257])|5(?:0[235]|2[046]|[49][357]|6[09]|7[2579]|8[2479])|6(?:2[05]|3[37]|6[02459]|7[03468]|8[47]|9[246])|7(?:2[09]|4[236]|60|75)|8(?:2[0239]|3[023579]|7[23589]|8[2457])|9(?:0[03568]|3[24689]|4[0258]|60|7[2457]|8[23568]|9[23579]))|3[68]4[2568]|3(?:47|60)[2478]|3[49]2[02469]|3[457]3[2468]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 24 => - array ( - 'pattern' => '(\\d{5})(\\d{4})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:3(?:0[589]|2[03]|3[369]|4[357]|6[0357]|7[0346]|8[347]|9[236-8])|4(?:4[2469]|6[03579]|9[0257])|5(?:0[235]|2[046]|[49][357]|6[09]|7[2579]|8[2479])|6(?:2[05]|3[37]|6[02459]|7[03468]|8[47]|9[246])|7(?:2[09]|4[236]|60|75)|8(?:2[0239]|3[023579]|7[23589]|8[2457])|9(?:0[03568]|3[24689]|4[0258]|60|7[2457]|8[23568]|9[23579]))|3[68]4[2568]|3(?:47|60)[2478]|3[49]2[02469]|3[457]3[2468]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 25 => - array ( - 'pattern' => '(\\d{5})(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:3(?:0[589]|2[03]|3[369]|4[357]|6[0357]|7[0346]|8[347]|9[236-8])|4(?:4[2469]|6[03579]|9[0257])|5(?:0[235]|2[046]|[49][357]|6[09]|7[2579]|8[2479])|6(?:2[05]|3[37]|6[02459]|7[03468]|8[47]|9[246])|7(?:2[09]|4[236]|60|75)|8(?:2[0239]|3[023579]|7[23589]|8[2457])|9(?:0[03568]|3[24689]|4[0258]|60|7[2457]|8[23568]|9[23579]))|3[68]4[2568]|3(?:47|60)[2478]|3[49]2[02469]|3[457]3[2468]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 26 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '15[1279]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 27 => - array ( - 'pattern' => '(\\d{4})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '15[1279]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 28 => - array ( - 'pattern' => '(\\d{3})(\\d{8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '15[1279]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 29 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '15[1279]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 30 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d)', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[67]|800', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 31 => - array ( - 'pattern' => '(\\d{3})(\\d{2,3})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[67]|800', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 32 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 33 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 34 => - array ( - 'pattern' => '(\\d{3})(\\d{6})(\\d{2})(\\d{1,4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 35 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '900', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 36 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{4})(\\d{3,4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '900', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 37 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '180', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 38 => - array ( - 'pattern' => '(\\d{4})(\\d{4,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '180', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 39 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '180', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 40 => - array ( - 'pattern' => '(\\d{4})(\\d{4,10})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '900', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 49, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[34]0|[68]9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:0|3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|4[01]|50|6[09]|7(?:0|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6]|9)|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[34]0|[68]9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{1,2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[34]0|[68]9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '3[02]|40|[68]9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d)(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5 $6', + 'leadingDigitsPatterns' => [ + 0 => '3[02]|40|[68]9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{1,2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 10 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 11 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})(\\d)', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 12 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 13 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{1,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 14 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|66[2-9]|7(?:1[2-9]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|[5-8]0|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 15 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d)(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|66[2-9]|7(?:1[2-9]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|[5-8]0|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 16 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d)(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5 $6', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 17 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5 $6', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|7(?:8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|[5-7]0|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 18 => [ + 'pattern' => '(\\d{4})(\\d{4})(\\d{1,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 19 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|4[19]|7(?:8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|[5-7]0|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 20 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '15[1279]|2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 21 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 22 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[4-6]|1(?:[035-9]|29)|3[0235-9]|7[2-7])|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]))|41|[56]0|7(?:0[2-8]|8[02-5]|9[03-7])|8(?:3[02-46-9]|5[03-9]|6[2-8]|8[024-6])|9(?:0[7-9]|7[02-467])|(?:45|84)[02-6]|3(?:83|99)[1468]|3[68]4[1347]|3(?:47|60)[1356]|(?:66|71|80)[2-9]|3(?:3[46]|46|5[49])[1246]|(?:22|47|81)[02-79]|3[4579]3[1357]|(?:28|49|5[79]|7[27]|9[589])[02-7]|(?:2[569]|4[2-48]|5[124-6]|6[1-358]|73|82|9[1-4])[02-9]|(?:24|[49]6|5[38]|6[47]|7[4-6]|87)[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 23 => [ + 'pattern' => '(\\d{5})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3(?:3(?:0[589]|2[03]|3[369]|4[357]|6[0357]|7[0346]|8[347]|9[236-8])|4(?:4[2469]|6[03579]|9[0257])|5(?:0[235]|2[046]|[49][357]|6[09]|7[2579]|8[2479])|6(?:2[05]|3[37]|6[02459]|7[03468]|8[47]|9[246])|7(?:2[09]|4[236]|60|75)|8(?:2[0239]|3[023579]|7[23589]|8[2457])|9(?:0[03568]|3[24689]|4[0258]|60|7[2457]|8[23568]|9[23579]))|3[68]4[2568]|3(?:47|60)[2478]|3[49]2[02469]|3[457]3[2468]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 24 => [ + 'pattern' => '(\\d{5})(\\d{4})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3(?:3(?:0[589]|2[03]|3[369]|4[357]|6[0357]|7[0346]|8[347]|9[236-8])|4(?:4[2469]|6[03579]|9[0257])|5(?:0[235]|2[046]|[49][357]|6[09]|7[2579]|8[2479])|6(?:2[05]|3[37]|6[02459]|7[03468]|8[47]|9[246])|7(?:2[09]|4[236]|60|75)|8(?:2[0239]|3[023579]|7[23589]|8[2457])|9(?:0[03568]|3[24689]|4[0258]|60|7[2457]|8[23568]|9[23579]))|3[68]4[2568]|3(?:47|60)[2478]|3[49]2[02469]|3[457]3[2468]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 25 => [ + 'pattern' => '(\\d{5})(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '3(?:3(?:0[589]|2[03]|3[369]|4[357]|6[0357]|7[0346]|8[347]|9[236-8])|4(?:4[2469]|6[03579]|9[0257])|5(?:0[235]|2[046]|[49][357]|6[09]|7[2579]|8[2479])|6(?:2[05]|3[37]|6[02459]|7[03468]|8[47]|9[246])|7(?:2[09]|4[236]|60|75)|8(?:2[0239]|3[023579]|7[23589]|8[2457])|9(?:0[03568]|3[24689]|4[0258]|60|7[2457]|8[23568]|9[23579]))|3[68]4[2568]|3(?:47|60)[2478]|3[49]2[02469]|3[457]3[2468]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 26 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '15[1279]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 27 => [ + 'pattern' => '(\\d{4})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '15[1279]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 28 => [ + 'pattern' => '(\\d{3})(\\d{8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '15[1279]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 29 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '15[1279]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 30 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d)', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1[67]|800', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 31 => [ + 'pattern' => '(\\d{3})(\\d{2,3})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1[67]|800', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 32 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '800', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 33 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '800', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 34 => [ + 'pattern' => '(\\d{3})(\\d{6})(\\d{2})(\\d{1,4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '800', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 35 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '900', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 36 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{4})(\\d{3,4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '900', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 37 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '180', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 38 => [ + 'pattern' => '(\\d{4})(\\d{4,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '180', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 39 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '180', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 40 => [ + 'pattern' => '(\\d{4})(\\d{4,10})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '900', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_505.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_505.php index ce3f5360..19271198 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_505.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_505.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 505, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 505, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_506.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_506.php index 3462fb4e..e2407b54 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_506.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_506.php @@ -10,30 +10,25 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 506, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 506, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_52.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_52.php index b33490b4..98a0cd3e 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_52.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_52.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 52, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '33|5[56]|81', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[24679]|3[0-2457-9]|5[089]|8[02-46-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 52, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '33|5[56]|81', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[24679]|3[0-2457-9]|5[089]|8[02-46-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_54.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_54.php index a83474f4..e4d8effa 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_54.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_54.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 54, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04-79]|3[5-8]|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)', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '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]))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 54, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04-79]|3[5-8]|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)', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '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]))', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_55.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_55.php index 92d2fba7..40c92d91 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_55.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_55.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 55, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[12467]|3[1-578]|5[13-5]|[89][1-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 55, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[12467]|3[1-578]|5[13-5]|[89][1-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_58.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_58.php index 9d8a8918..3400f871 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_58.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_58.php @@ -10,30 +10,25 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 58, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 58, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_595.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_595.php index b1ba4a3d..ebf94dde 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_595.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_595.php @@ -10,55 +10,46 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 595, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{6,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2[279]|3[13-5]|4[359]|5[1-5]|6[347]|7[46-8]|85', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 595, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{6,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2[279]|3[13-5]|4[359]|5[1-5]|6[347]|7[46-8]|85', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_61.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_61.php index ebeca067..8d2f8657 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_61.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_61.php @@ -10,64 +10,53 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 61, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2378]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 61, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2378]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_62.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_62.php index ec10b33c..2099cd40 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_62.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_62.php @@ -10,91 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 62, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[124]|[36]1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[124]|[36]1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2[124]|[36]1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8[1-35-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{5,6})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 62, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[124]|[36]1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{5})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[124]|[36]1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2[124]|[36]1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8[1-35-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{5,6})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_63.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_63.php index 0d711402..e8232344 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_63.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_63.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 63, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 63, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_64.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_64.php index 98f74191..271aeb91 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_64.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_64.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 64, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3467]|9[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 64, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3467]|9[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_66.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_66.php index 8fa5a1c1..96b24a1b 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_66.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_66.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 66, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 66, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_675.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_675.php index 9b12a6d0..262bf5ad 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_675.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_675.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 675, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 675, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_676.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_676.php index 017ec2ae..5b34817b 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_676.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_676.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 676, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[78]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 676, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[78]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_679.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_679.php index 4cfd162e..697db87c 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_679.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_679.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 679, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 679, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_7.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_7.php index 86ef6953..a3573b63 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_7.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_7.php @@ -10,91 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 7, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3489]|7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{5})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[3489]|7(?:1(?:[06][3-6]|[13-5][3-5]|2[35]|8[34])|2(?:[1-38][3-5]|[49][35]|5[3-6]|6|7[457]))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '7(?:1|2(?:[1-689]|7[2457]))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[3489]|7(?:[04-8]|1(?:04|[236]3|4[3-5]|5[34])|2(?:13|34|7[39]))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '[3489]|7(?:[04-8]|1(?:04|[236]3|4[3-5]|5[34])|2(?:13|34|7[39]))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[3489]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 7, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3489]|7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{5})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[3489]|7(?:1(?:[06][3-6]|[13-5][3-5]|2[35]|8[34])|2(?:[1-38][3-5]|[49][35]|5[3-6]|6|7[457]))', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '7(?:1|2(?:[1-689]|7[2457]))', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[3489]|7(?:[04-8]|1(?:04|[236]3|4[3-5]|5[34])|2(?:13|34|7[39]))', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '[3489]|7(?:[04-8]|1(?:04|[236]3|4[3-5]|5[34])|2(?:13|34|7[39]))', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[3489]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_81.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_81.php index 8ed7a085..77ce2b44 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_81.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_81.php @@ -10,55 +10,46 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 81, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:12|57|99)0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:12|57|99)0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:12|57|99)0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 81, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '(?:12|57|99)0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '(?:12|57|99)0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '(?:12|57|99)0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_84.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_84.php index 955e7a66..dae9f39b 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_84.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_84.php @@ -10,55 +10,46 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 84, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[69]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2[48]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 84, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[69]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2[48]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_855.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_855.php index 6fae9ece..d3c3b95b 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_855.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_855.php @@ -10,30 +10,25 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 855, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 855, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_856.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_856.php index b9492799..aca1d1f8 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_856.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_856.php @@ -10,52 +10,43 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 856, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 856, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_90.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_90.php index 0133a128..04f9b0ca 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_90.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_90.php @@ -10,43 +10,36 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 90, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-4]|5(?:[02-69]|1[06])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '512|[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 90, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-4]|5(?:[02-69]|1[06])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '512|[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_91.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_91.php index 29991e78..d7b498f4 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_91.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_91.php @@ -10,79 +10,66 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 91, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{6})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6(?:[09]|127|2(?:[036]|8[0-379]|9[0-4679])|3(?:[06-9]|5[0-46-9]))|7(?:[07]|19[0-5]|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|8(?:[0-79]|8[0189])|9(?:[089]|31|7[02-9]))|8(?:0(?:[01589]|6[67]|7[02-9])|1[0-57-9]|2[235-9]|3[03-57-9]|[45]|6[02457-9]|7[1-69]|8(?:[0-25-9]|4[047-9])|9(?:[02-9]|1[027-9]))|9|7(?:2[14]|3[134]|4[47]|5[15])[017-9]|8(?:16|2[014]|3[126]|6[136]|7[078]|83)[07-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '6(?:[09]|127|2(?:[036]|8[0-379]|9[0-4679])|3(?:[06-9]|5[0-46-9]))|7(?:[07]|19[0-5]|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|8(?:[0-79]|8[0189])|9(?:[089]|31|7[02-9]))|8(?:0(?:[01589]|6[67]|7[02-9])|1[0-57-9]|2[235-9]|3[03-57-9]|[45]|6[02457-9]|7[1-69]|8(?:[0-25-9]|4[047-9])|9(?:[02-9]|1[027-9]))|9|7(?:2[14]|3[134]|4[47]|5[15])[017-9]|8(?:16|2[014]|3[126]|6[136]|7[078]|83)[07-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '79(?:[089]|31|7[02-9])|80(?:[01589]|6[67]|7[02-9])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7(?:19[0-5]|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|7|8(?:[0-79]|8[0189]))|8(?:1[0-57-9]|2[235-9]|3[03-57-9]|[45]|6[02457-9]|7[1-69]|8(?:[0-25-9]|4[047-9])|9(?:[02-9]|1[027-9]))|7(?:2[14]|3[134]|4[47]|5[15])[017-9]|8(?:16|2[014]|3[126]|6[136]|7[078]|83)[07-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7(?:19[0-5]|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|7)|80(?:[01589]|6[67]|7[02-9])|7(?:2[14]|3[134]|4[47]|5[15])[017-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 91, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{6})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '6(?:[09]|127|2(?:[036]|8[0-379]|9[0-4679])|3(?:[06-9]|5[0-46-9]))|7(?:[07]|19[0-5]|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|8(?:[0-79]|8[0189])|9(?:[089]|31|7[02-9]))|8(?:0(?:[01589]|6[67]|7[02-9])|1[0-57-9]|2[235-9]|3[03-57-9]|[45]|6[02457-9]|7[1-69]|8(?:[0-25-9]|4[047-9])|9(?:[02-9]|1[027-9]))|9|7(?:2[14]|3[134]|4[47]|5[15])[017-9]|8(?:16|2[014]|3[126]|6[136]|7[078]|83)[07-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '6(?:[09]|127|2(?:[036]|8[0-379]|9[0-4679])|3(?:[06-9]|5[0-46-9]))|7(?:[07]|19[0-5]|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|8(?:[0-79]|8[0189])|9(?:[089]|31|7[02-9]))|8(?:0(?:[01589]|6[67]|7[02-9])|1[0-57-9]|2[235-9]|3[03-57-9]|[45]|6[02457-9]|7[1-69]|8(?:[0-25-9]|4[047-9])|9(?:[02-9]|1[027-9]))|9|7(?:2[14]|3[134]|4[47]|5[15])[017-9]|8(?:16|2[014]|3[126]|6[136]|7[078]|83)[07-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '79(?:[089]|31|7[02-9])|80(?:[01589]|6[67]|7[02-9])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7(?:19[0-5]|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|7|8(?:[0-79]|8[0189]))|8(?:1[0-57-9]|2[235-9]|3[03-57-9]|[45]|6[02457-9]|7[1-69]|8(?:[0-25-9]|4[047-9])|9(?:[02-9]|1[027-9]))|7(?:2[14]|3[134]|4[47]|5[15])[017-9]|8(?:16|2[014]|3[126]|6[136]|7[078]|83)[07-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7(?:19[0-5]|2[0235-9]|3[025-9]|4[0-35689]|5[02-46-9]|6(?:[02-9]|1[0-257-9])|7)|80(?:[01589]|6[67]|7[02-9])|7(?:2[14]|3[134]|4[47]|5[15])[017-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_94.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_94.php index e48c9bf1..ab98e445 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_94.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_94.php @@ -10,55 +10,46 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 94, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d)(\\d{6})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-689]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-689]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 94, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d)(\\d{6})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-689]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[1-689]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_95.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_95.php index 6cd1f14b..3d9ea3c4 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_95.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_95.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 95, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '92', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 95, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{5})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '92', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_971.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_971.php index 7b4bc9ed..863bd18b 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_971.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_971.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 971, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 971, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '5', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_972.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_972.php index c61e6701..f7c7017b 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_972.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_972.php @@ -10,31 +10,26 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 972, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-489]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 972, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[2-489]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberAlternateFormats_995.php b/lib/libphonenumber/data/PhoneNumberAlternateFormats_995.php index d99c4f57..35773996 100755 --- a/lib/libphonenumber/data/PhoneNumberAlternateFormats_995.php +++ b/lib/libphonenumber/data/PhoneNumberAlternateFormats_995.php @@ -10,91 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'id' => '', - 'countryCode' => 995, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '32', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d)(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '32', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[348]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[348]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '32', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{5})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '32', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'id' => '', + 'countryCode' => 995, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '32', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d)(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '32', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[348]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[348]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '32', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{5})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '32', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_800.php b/lib/libphonenumber/data/PhoneNumberMetadata_800.php index 1e3b5a44..15b9106f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_800.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_800.php @@ -10,152 +10,111 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '\\d{8}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '\\d{8}', - 'ExampleNumber' => '12345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => '001', - 'countryCode' => 800, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '\\d{8}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '\\d{8}', + 'ExampleNumber' => '12345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => '001', + 'countryCode' => 800, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_808.php b/lib/libphonenumber/data/PhoneNumberMetadata_808.php index f3d0469c..497a0980 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_808.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_808.php @@ -10,152 +10,111 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '\\d{8}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '\\d{8}', - 'ExampleNumber' => '12345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => '001', - 'countryCode' => 808, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '\\d{8}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '\\d{8}', + 'ExampleNumber' => '12345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => '001', + 'countryCode' => 808, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_870.php b/lib/libphonenumber/data/PhoneNumberMetadata_870.php index bd21063b..4928b111 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_870.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_870.php @@ -10,153 +10,112 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[35-7]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:[356]\\d|7[6-8])\\d{7}', - 'ExampleNumber' => '301234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => '001', - 'countryCode' => 870, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[35-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[35-7]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:[356]\\d|7[6-8])\\d{7}', + 'ExampleNumber' => '301234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_878.php b/lib/libphonenumber/data/PhoneNumberMetadata_878.php index 9d855395..588a3b73 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_878.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_878.php @@ -10,153 +10,112 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '10\\d{10}', - 'PossibleLength' => - array ( - 0 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '10\\d{10}', - 'ExampleNumber' => '101234567890', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => '001', - 'countryCode' => 878, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{5})(\\d{5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '10\\d{10}', + 'PossibleLength' => [ + 0 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '10\\d{10}', + 'ExampleNumber' => '101234567890', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_881.php b/lib/libphonenumber/data/PhoneNumberMetadata_881.php index e6c5f21b..a2abd498 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_881.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_881.php @@ -10,153 +10,112 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[67]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[67]\\d{8}', - 'ExampleNumber' => '612345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => '001', - 'countryCode' => 881, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[67]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[67]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[67]\\d{8}', + 'ExampleNumber' => '612345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => '001', + 'countryCode' => 881, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{5})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[67]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_882.php b/lib/libphonenumber/data/PhoneNumberMetadata_882.php index 9a1d6b26..b8f0ec72 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_882.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_882.php @@ -10,237 +10,184 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{6,11}|3\\d{6}(?:\\d{2,5})?', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - 5 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '3(?:37\\d\\d|42)\\d{4}|3(?:2|47|7\\d{3})\\d{7}', - 'ExampleNumber' => '3421234', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - 2 => 10, - 3 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - '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})|3(?:45|9\\d{3})\\d{7}', - 'ExampleNumber' => '390123456789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '348[57]\\d{7}', - 'ExampleNumber' => '34851234567', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => '001', - 'countryCode' => 882, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '16|342', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3[23]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '34[57]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '34', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{4,5})(\\d{5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[13]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{6,11}|3\\d{6}(?:\\d{2,5})?', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + 5 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '3(?:37\\d\\d|42)\\d{4}|3(?:2|47|7\\d{3})\\d{7}', + 'ExampleNumber' => '3421234', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + 2 => 10, + 3 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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})|3(?:45|9\\d{3})\\d{7}', + 'ExampleNumber' => '390123456789', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '348[57]\\d{7}', + 'ExampleNumber' => '34851234567', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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{2})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3[23]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '34[57]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '34', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{4,5})(\\d{5})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[13]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_883.php b/lib/libphonenumber/data/PhoneNumberMetadata_883.php index fff5d532..d5c50f70 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_883.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_883.php @@ -10,178 +10,133 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '51\\d{7}(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '51[013]0\\d{8}|5100\\d{5}', - 'ExampleNumber' => '510012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => '001', - 'countryCode' => 883, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '510', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '510', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '51\\d{7}(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 9, + 1 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '51[013]0\\d{8}|5100\\d{5}', + 'ExampleNumber' => '510012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => '001', + 'countryCode' => 883, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '510', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '510', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '5', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_888.php b/lib/libphonenumber/data/PhoneNumberMetadata_888.php index a3c8a8cf..0d597f9d 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_888.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_888.php @@ -10,152 +10,111 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '\\d{11}', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '\\d{11}', - 'ExampleNumber' => '12345678901', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => '001', - 'countryCode' => 888, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '\\d{11}', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '\\d{11}', + 'ExampleNumber' => '12345678901', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_979.php b/lib/libphonenumber/data/PhoneNumberMetadata_979.php index 44179b37..dbf98535 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_979.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_979.php @@ -10,152 +10,111 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '\\d{9}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '\\d{9}', - 'ExampleNumber' => '123456789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => '001', - 'countryCode' => 979, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '\\d{9}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '\\d{9}', + 'ExampleNumber' => '123456789', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => '001', + 'countryCode' => 979, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AC.php b/lib/libphonenumber/data/PhoneNumberMetadata_AC.php index ed084b39..dfcad3a8 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AC.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AC.php @@ -10,147 +10,108 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[01589]\\d|[46])\\d{4}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '6[2-467]\\d{3}', - 'ExampleNumber' => '62889', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '4\\d{4}', - 'ExampleNumber' => '40123', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:0[1-9]|[1589]\\d)\\d{4}', - 'ExampleNumber' => '542011', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AC', - 'countryCode' => 247, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[01589]\\d|[46])\\d{4}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '6[2-467]\\d{3}', + 'ExampleNumber' => '62889', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '4\\d{4}', + 'ExampleNumber' => '40123', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:0[1-9]|[1589]\\d)\\d{4}', + 'ExampleNumber' => '542011', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AC', + 'countryCode' => 247, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AD.php b/lib/libphonenumber/data/PhoneNumberMetadata_AD.php index b33bac32..2c8e51ea 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AD.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AD.php @@ -10,188 +10,143 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1|6\\d)\\d{7}|[136-9]\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[78]\\d{5}', - 'ExampleNumber' => '712345', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '690\\d{6}|[36]\\d{5}', - 'ExampleNumber' => '312345', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '180[02]\\d{4}', - 'ExampleNumber' => '18001234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '[19]\\d{5}', - 'ExampleNumber' => '912345', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '1800\\d{4}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AD', - 'countryCode' => 376, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[136-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1|6\\d)\\d{7}|[136-9]\\d{5}', + 'PossibleLength' => [ + 0 => 6, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[78]\\d{5}', + 'ExampleNumber' => '712345', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '690\\d{6}|[36]\\d{5}', + 'ExampleNumber' => '312345', + 'PossibleLength' => [ + 0 => 6, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '180[02]\\d{4}', + 'ExampleNumber' => '18001234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '[19]\\d{5}', + 'ExampleNumber' => '912345', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '1800\\d{4}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AD', + 'countryCode' => 376, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[136-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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AE.php b/lib/libphonenumber/data/PhoneNumberMetadata_AE.php index 18bdbcd4..5b7c3f9c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AE.php @@ -10,209 +10,162 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - 5 => 10, - 6 => 11, - 7 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[2-4679][2-8]\\d{6}', - 'ExampleNumber' => '22345678', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '5[024-68]\\d{7}', - 'ExampleNumber' => '501234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '400\\d{6}|800\\d{2,9}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[02]\\d{5}', - 'ExampleNumber' => '900234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '700[05]\\d{5}', - 'ExampleNumber' => '700012345', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '600[25]\\d{5}', - 'ExampleNumber' => '600212345', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AE', - 'countryCode' => 971, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2,9})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '60|8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[236]|[479][2-8]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[479]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '400\\d{6}|800\\d{2,9}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[02]\\d{5}', + 'ExampleNumber' => '900234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '700[05]\\d{5}', + 'ExampleNumber' => '700012345', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '600[25]\\d{5}', + 'ExampleNumber' => '600212345', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AF.php b/lib/libphonenumber/data/PhoneNumberMetadata_AF.php index 5031fbaa..142ec4b5 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AF.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AF.php @@ -10,182 +10,137 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-7]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}', - 'ExampleNumber' => '234567890', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7(?:[014-9]\\d|2[89]|3[01])\\d{6}', - 'ExampleNumber' => '701234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AF', - 'countryCode' => 93, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +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', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7(?:[014-9]\\d|2[89]|3[01])\\d{6}', + 'ExampleNumber' => '701234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AF', + 'countryCode' => 93, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-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, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AG.php b/lib/libphonenumber/data/PhoneNumberMetadata_AG.php index 443b818a..8e4e07df 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AG.php @@ -10,156 +10,117 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:268|[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}', - 'ExampleNumber' => '2684601234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '268(?:464|7(?:1[3-9]|2\\d|3[246]|64|[78][0-689]))\\d{4}', - 'ExampleNumber' => '2684641234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '26848[01]\\d{4}', - 'ExampleNumber' => '2684801234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '26840[69]\\d{4}', - 'ExampleNumber' => '2684061234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AG', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([457]\\d{6})$', - 'nationalPrefixTransformRule' => '268$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '268', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +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', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '268(?:464|7(?:1[3-9]|2\\d|3[246]|64|[78][0-689]))\\d{4}', + 'ExampleNumber' => '2684641234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '26848[01]\\d{4}', + 'ExampleNumber' => '2684801234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '26840[69]\\d{4}', + 'ExampleNumber' => '2684061234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AG', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([457]\\d{6})$', + 'nationalPrefixTransformRule' => '268$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '268', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AI.php b/lib/libphonenumber/data/PhoneNumberMetadata_AI.php index 423c6220..9c5cf771 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AI.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:264|[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2644(?:6[12]|9[78])\\d{4}', - 'ExampleNumber' => '2644612345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}', - 'ExampleNumber' => '2642351234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AI', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2457]\\d{6})$', - 'nationalPrefixTransformRule' => '264$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '264', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:264|[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2644(?:6[12]|9[78])\\d{4}', + 'ExampleNumber' => '2644612345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '264(?:235|476|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}', + 'ExampleNumber' => '2642351234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AI', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2457]\\d{6})$', + 'nationalPrefixTransformRule' => '264$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '264', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AL.php b/lib/libphonenumber/data/PhoneNumberMetadata_AL.php index 25fb9649..a186f0ba 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AL.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AL.php @@ -10,221 +10,172 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[2358](?:[16-9]\\d[2-9]|[2-5][2-9]\\d)|4(?:[2-57-9][2-9]|6\\d)\\d)\\d{4}', - 'ExampleNumber' => '22345678', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6(?:[689][2-9]|7[2-6])\\d{6}', - 'ExampleNumber' => '662123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{4}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[1-9]\\d\\d', - 'ExampleNumber' => '900123', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '808[1-9]\\d\\d', - 'ExampleNumber' => '808123', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '700[2-9]\\d{4}', - 'ExampleNumber' => '70021234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AL', - 'countryCode' => 355, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3,4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '80|9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '4[2-6]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2358][2-5]|4', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[23578]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +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' => '(?:[2358](?:[16-9]\\d[2-9]|[2-5][2-9]\\d)|4(?:[2-57-9][2-9]|6\\d)\\d)\\d{4}', + 'ExampleNumber' => '22345678', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + 2 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6(?:[689][2-9]|7[2-6])\\d{6}', + 'ExampleNumber' => '662123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{4}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[1-9]\\d\\d', + 'ExampleNumber' => '900123', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '808[1-9]\\d\\d', + 'ExampleNumber' => '808123', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '700[2-9]\\d{4}', + 'ExampleNumber' => '70021234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AM.php b/lib/libphonenumber/data/PhoneNumberMetadata_AM.php index dcd4e192..70e2b062 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AM.php @@ -10,200 +10,153 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[1-489]\\d|55|60|77)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:(?:1[0-2]|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', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:4[1349]|55|77|88|9[13-9])\\d{6}', - 'ExampleNumber' => '77123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[016]\\d{5}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '80[1-4]\\d{5}', - 'ExampleNumber' => '80112345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|90)\\d{4}', - 'ExampleNumber' => '60271234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AM', - 'countryCode' => 374, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]0', - ), - 'nationalPrefixFormattingRule' => '0 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1|47', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[23]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[4-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[1-489]\\d|55|60|77)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:(?:1[0-2]|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', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:4[1349]|55|77|88|9[13-9])\\d{6}', + 'ExampleNumber' => '77123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[016]\\d{5}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '80[1-4]\\d{5}', + 'ExampleNumber' => '80112345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|90)\\d{4}', + 'ExampleNumber' => '60271234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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{2})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1|47', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[23]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[4-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AO.php b/lib/libphonenumber/data/PhoneNumberMetadata_AO.php index f7e2d87e..104b47bc 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AO.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[29]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}', - 'ExampleNumber' => '222123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9[1-49]\\d{7}', - 'ExampleNumber' => '923123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AO', - 'countryCode' => 244, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[29]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[29]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}', + 'ExampleNumber' => '222123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9[1-49]\\d{7}', + 'ExampleNumber' => '923123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AR.php b/lib/libphonenumber/data/PhoneNumberMetadata_AR.php index 3eed178f..ad505f31 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AR.php @@ -10,384 +10,309 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '11\\d{8}|(?:[2368]|9\\d)\\d{9}', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:646[0-46-9]|9(?:45[02-69]|54[2-8]))|3(?:4(?:3(?:5[0-7]|6[1-69])|5(?:4[0-4679]|[56][024-6]))|585[013-7]|7(?:(?:1[15]|81)[46]|77[2-8])|8(?:(?:21|4[16]|9[12])[46]|35[124-6]|5(?:5[0-46-9]|6[0-246-9])|6(?:5[2-8]|9[46])|86[0-68])))\\d{5}|(?:2(?:284|657|9(?:20|66))|3(?:4(?:8[27]|92)|755|878))[2-7]\\d{5}|(?:2(?:2(?:2[59]|44|52)|3(?:26|4[24])|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|(?:2(?:(?:26|62)2|3(?:02|2[03])|477|9(?:42|83))|3(?:4(?:[47]6|62|89)|5(?:41|64)|873))[2-6]\\d{5}|(?:(?:11[2-7]|670)\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-7]|[346][45])|80[45]|9(?:[17][4-6]|44|8[45]|9[3-6]))|3(?:364|4(?:1[2-7]|2[4-6]|[38]4)|5(?:1[2-8]|3[4-6]|8[46])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-6]|34|5[34]|7[24-6]|8[3-5])))\\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(?:329|4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])|888))[3-6]\\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|[24]5|5[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' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9(?:2(?:646[0-46-9]|9(?:45[02-69]|54[2-8]))|3(?:4(?:3(?:5[0-7]|6[1-69])|5(?:4[0-4679]|[56][024-6]))|585[013-7]|7(?:(?:1[15]|81)[46]|77[2-8])|8(?:(?:21|4[16]|9[12])[46]|35[124-6]|5(?:5[0-46-9]|6[0-246-9])|6(?:5[2-8]|9[46])|86[0-68])))\\d{5}|9(?:2(?:284|657|9(?:20|66))|3(?:4(?:8[27]|92)|755|878))[2-7]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|4[24])|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:(?:26|62)2|3(?:02|2[03])|477|9(?:42|83))|3(?:4(?:[47]6|62|89)|5(?:41|64)|873))[2-6]\\d{5}|(?:675\\d|9(?:11[2-7]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-7]|[346][45])|80[45]|9(?:[17][4-6]|44|8[45]|9[3-6]))|3(?:364|4(?:1[2-7]|2[4-6]|[38]4)|5(?:1[2-8]|3[4-6]|8[46])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-6]|34|5[34]|7[24-6]|8[3-5]))))\\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(?:329|4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])|888))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|[24]5|5[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', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '60[04579]\\d{7}', - 'ExampleNumber' => '6001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '810\\d{7}', - 'ExampleNumber' => '8101234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '810\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - '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' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '[09]|1(?:[02]|1[02-5])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]|8[0-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]|8[013-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '2[0-8]|[3-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 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(?:[24-6]|3[2-5]))|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 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[23]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[68]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{2})(\\d{4})', - 'format' => '$2 15-$3-$4', - 'leadingDigitsPatterns' => - array ( - 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(?:[24-6]|3[2-5]))|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 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$2 15-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '91', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$2 15-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 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(?:[24-6]|3[2-5]))|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 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[23]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[68]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3-$4', - 'leadingDigitsPatterns' => - array ( - 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(?:[24-6]|3[2-5]))|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 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '91', - ), - ), - 6 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '11\\d{8}|(?:[2368]|9\\d)\\d{9}', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + 2 => 8, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:646[0-46-9]|9(?:45[02-69]|54[2-8]))|3(?:4(?:3(?:5[0-7]|6[1-69])|5(?:4[0-4679]|[56][024-6]))|585[013-7]|7(?:(?:1[15]|81)[46]|77[2-8])|8(?:(?:21|4[16]|9[12])[46]|35[124-6]|5(?:5[0-46-9]|6[0-246-9])|6(?:5[2-8]|9[46])|86[0-68])))\\d{5}|(?:2(?:284|657|9(?:20|66))|3(?:4(?:8[27]|92)|755|878))[2-7]\\d{5}|(?:2(?:2(?:2[59]|44|52)|3(?:26|4[24])|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|(?:2(?:(?:26|62)2|3(?:02|2[03])|477|9(?:42|83))|3(?:4(?:[47]6|62|89)|5(?:41|64)|873))[2-6]\\d{5}|(?:(?:11[2-7]|670)\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-7]|[346][45])|80[45]|9(?:[17][4-6]|44|8[45]|9[3-6]))|3(?:364|4(?:1[2-7]|2[4-6]|[38]4)|5(?:1[2-8]|3[4-6]|8[46])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-6]|34|5[34]|7[24-6]|8[3-5])))\\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(?:329|4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])|888))[3-6]\\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|[24]5|5[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' => '9(?:2(?:646[0-46-9]|9(?:45[02-69]|54[2-8]))|3(?:4(?:3(?:5[0-7]|6[1-69])|5(?:4[0-4679]|[56][024-6]))|585[013-7]|7(?:(?:1[15]|81)[46]|77[2-8])|8(?:(?:21|4[16]|9[12])[46]|35[124-6]|5(?:5[0-46-9]|6[0-246-9])|6(?:5[2-8]|9[46])|86[0-68])))\\d{5}|9(?:2(?:284|657|9(?:20|66))|3(?:4(?:8[27]|92)|755|878))[2-7]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|4[24])|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:(?:26|62)2|3(?:02|2[03])|477|9(?:42|83))|3(?:4(?:[47]6|62|89)|5(?:41|64)|873))[2-6]\\d{5}|(?:675\\d|9(?:11[2-7]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-7]|[346][45])|80[45]|9(?:[17][4-6]|44|8[45]|9[3-6]))|3(?:364|4(?:1[2-7]|2[4-6]|[38]4)|5(?:1[2-8]|3[4-6]|8[46])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-6]|34|5[34]|7[24-6]|8[3-5]))))\\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(?:329|4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])|888))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|[24]5|5[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', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + 2 => 8, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '60[04579]\\d{7}', + 'ExampleNumber' => '6001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '810\\d{7}', + 'ExampleNumber' => '8101234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '810\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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 => '[09]|1(?:[02]|1[02-5])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[2-7]|8[0-7]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[2-7]|8[013-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '2[0-8]|[3-7]', + ], + '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(?:[24-6]|3[2-5]))|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 => '[23]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[68]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 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(?:[24-6]|3[2-5]))|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)(\\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(?:[24-6]|3[2-5]))|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 => '[23]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[68]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 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(?:[24-6]|3[2-5]))|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)(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3-$4', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AS.php b/lib/libphonenumber/data/PhoneNumberMetadata_AS.php index 527f9a24..f984b4ca 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AS.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AS.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|684|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '6846(?:22|33|44|55|77|88|9[19])\\d{4}', - 'ExampleNumber' => '6846221234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '684(?:2(?:5[2468]|72)|7(?:3[13]|70))\\d{4}', - 'ExampleNumber' => '6847331234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AS', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([267]\\d{6})$', - 'nationalPrefixTransformRule' => '684$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '684', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +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', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '684(?:2(?:5[2468]|72)|7(?:3[13]|70))\\d{4}', + 'ExampleNumber' => '6847331234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AS', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([267]\\d{6})$', + 'nationalPrefixTransformRule' => '684$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '684', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AT.php b/lib/libphonenumber/data/PhoneNumberMetadata_AT.php index 491abbd0..923b8b14 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AT.php @@ -10,371 +10,302 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - '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' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - 4 => 8, - 5 => 9, - 6 => 10, - 7 => 11, - 8 => 12, - 9 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 3, - ), - ), - 'fixedLine' => - array ( - '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', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 3, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}', - 'ExampleNumber' => '664123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - 5 => 12, - 6 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6,10}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - 2 => 11, - 3 => 12, - 4 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9(?:0[01]|3[019])\\d{6,10}', - 'ExampleNumber' => '900123456', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - 2 => 11, - 3 => 12, - 4 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '8(?:10|2[018])\\d{6,10}|828\\d{5}', - 'ExampleNumber' => '810123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - 3 => 11, - 4 => 12, - 5 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '5(?:0[1-9]|17|[79]\\d)\\d{2,10}|7[28]0\\d{6,10}', - 'ExampleNumber' => '780123456', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - 5 => 10, - 6 => 11, - 7 => 12, - 8 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AT', - 'countryCode' => 43, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3,12})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:11|[2-9])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '517', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3,10})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{4})(\\d{3,9})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-467]|5[2-6]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4,7})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3,12})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:11|[2-9])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '517', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '5[079]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3,10})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{4})(\\d{3,9})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-467]|5[2-6]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4,7})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +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', + 'PossibleLength' => [ + ], + '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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6,10}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + 2 => 11, + 3 => 12, + 4 => 13, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9(?:0[01]|3[019])\\d{6,10}', + 'ExampleNumber' => '900123456', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + 2 => 11, + 3 => 12, + 4 => 13, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AT', + 'countryCode' => 43, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 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{6})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + '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, + ], + 5 => [ + 'pattern' => '(\\d{4})(\\d{3,9})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-467]|5[2-6]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '5', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + '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, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AU.php b/lib/libphonenumber/data/PhoneNumberMetadata_AU.php index 5d8f1f6b..25889fc7 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AU.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AU.php @@ -10,343 +10,276 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1(?:[0-79]\\d{7,8}|8[0-24-9]\\d{7})|(?:[2-478]\\d\\d|550)\\d{6}|1\\d{4,7}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - 5 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[237]\\d{5}|8(?:51(?:0(?:0[03-9]|[1247]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-6])|1(?:1[69]|[23]\\d|4[0-4]))|(?:[6-8]\\d{3}|9(?:[02-9]\\d\\d|1(?:[0-57-9]\\d|6[0135-9])))\\d))\\d{3}', - 'ExampleNumber' => '212345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-2457-9]|9[017-9])\\d{6}', - 'ExampleNumber' => '412345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '180(?:0\\d{3}|2)\\d{3}', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '190[0-26]\\d{6}', - 'ExampleNumber' => '1900123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}', - 'ExampleNumber' => '1300123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 8, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '(?:14(?:5(?:1[0458]|[23][458])|71\\d)|550\\d\\d)\\d{4}', - 'ExampleNumber' => '550123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '16\\d{3,7}', - 'ExampleNumber' => '1612345', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '1[38]00\\d{6}|1(?:345[0-4]|802)\\d{3}|13\\d{4}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - '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' => '0|(183[12])', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '16', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '13', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '19', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '180', - 1 => '1802', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{4})(\\d{3,4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '19', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '16', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '14|[45]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2378]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '$CC ($1)', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:30|[89])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '16', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '16', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '14|[45]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2378]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '$CC ($1)', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:30|[89])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => true, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1(?:[0-79]\\d{7,8}|8[0-24-9]\\d{7})|(?:[2-478]\\d\\d|550)\\d{6}|1\\d{4,7}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + 5 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:[237]\\d{5}|8(?:51(?:0(?:0[03-9]|[1247]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-6])|1(?:1[69]|[23]\\d|4[0-4]))|(?:[6-8]\\d{3}|9(?:[02-9]\\d\\d|1(?:[0-57-9]\\d|6[0135-9])))\\d))\\d{3}', + 'ExampleNumber' => '212345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 8, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-2457-9]|9[017-9])\\d{6}', + 'ExampleNumber' => '412345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '180(?:0\\d{3}|2)\\d{3}', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '190[0-26]\\d{6}', + 'ExampleNumber' => '1900123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}', + 'ExampleNumber' => '1300123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 8, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '(?:14(?:5(?:1[0458]|[23][458])|71\\d)|550\\d\\d)\\d{4}', + 'ExampleNumber' => '550123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '16\\d{3,7}', + 'ExampleNumber' => '1612345', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '1[38]00\\d{6}|1(?:345[0-4]|802)\\d{3}|13\\d{4}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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' => '0|(183[12])', + '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|[45]', + ], + '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, + ], + ], + '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|[45]', + ], + '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, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AW.php b/lib/libphonenumber/data/PhoneNumberMetadata_AW.php index f14bbb51..f0a6052a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AW.php @@ -10,157 +10,116 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[25-79]\\d\\d|800)\\d{4}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '5(?:2\\d|8[1-9])\\d{4}', - 'ExampleNumber' => '5212345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - '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', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{4}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{4}', - 'ExampleNumber' => '9001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '(?:28\\d|501)\\d{4}', - 'ExampleNumber' => '5011234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AW', - 'countryCode' => 297, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[25-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[25-79]\\d\\d|800)\\d{4}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '5(?:2\\d|8[1-9])\\d{4}', + 'ExampleNumber' => '5212345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{4}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{4}', + 'ExampleNumber' => '9001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '(?:28\\d|501)\\d{4}', + 'ExampleNumber' => '5011234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AX.php b/lib/libphonenumber/data/PhoneNumberMetadata_AX.php index e92c56f9..c4d4f6b5 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AX.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AX.php @@ -10,168 +10,129 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|(?:[147]\\d|3[0-46-9]|50)\\d{4,8}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - 5 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '18[1-8]\\d{3,6}', - 'ExampleNumber' => '181234567', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:4[0-8]|50)\\d{4,8}', - 'ExampleNumber' => '412345678', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{4,6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '[67]00\\d{5,6}', - 'ExampleNumber' => '600123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:10|[23][09])\\d{4,8}|60(?:[12]\\d{5,6}|6\\d{7})|7(?:(?:1|3\\d)\\d{7}|5[03-9]\\d{3,7})|20[2-59]\\d\\d', - 'ExampleNumber' => '10112345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - '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' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '18', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|(?:[147]\\d|3[0-46-9]|50)\\d{4,8}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + 5 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '18[1-8]\\d{3,6}', + 'ExampleNumber' => '181234567', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:4[0-8]|50)\\d{4,8}', + 'ExampleNumber' => '412345678', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{4,6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '[67]00\\d{5,6}', + 'ExampleNumber' => '600123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:10|[23][09])\\d{4,8}|60(?:[12]\\d{5,6}|6\\d{7})|7(?:(?:1|3\\d)\\d{7}|5[03-9]\\d{3,7})|20[2-59]\\d\\d', + 'ExampleNumber' => '10112345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '18', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_AZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_AZ.php index 3702964b..339ed867 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_AZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_AZ.php @@ -10,236 +10,183 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:365\\d{3}|900200)\\d{3}|(?:[12457]\\d|60|88)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '365(?:[0-46-9]\\d|5[0-35-9])\\d{4}|(?:1[28]\\d|2(?:[045]2|1[24]|2[2-4]|33|6[23]))\\d{6}', - 'ExampleNumber' => '123123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '36554\\d{4}|(?:4[04]|5[015]|60|7[07])\\d{7}', - 'ExampleNumber' => '401234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '88\\d{7}', - 'ExampleNumber' => '881234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900200\\d{3}', - 'ExampleNumber' => '900200123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AZ', - 'countryCode' => 994, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]|365', - 1 => '[12]|365', - 2 => '[12]|365(?:[0-46-9]|5[0-35-9])', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-8]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]|365', - 1 => '[12]|365', - 2 => '[12]|365(?:[0-46-9]|5[0-35-9])', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-8]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:365\\d{3}|900200)\\d{3}|(?:[12457]\\d|60|88)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '365(?:[0-46-9]\\d|5[0-35-9])\\d{4}|(?:1[28]\\d|2(?:[045]2|1[24]|2[2-4]|33|6[23]))\\d{6}', + 'ExampleNumber' => '123123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '36554\\d{4}|(?:4[04]|5[015]|60|7[07])\\d{7}', + 'ExampleNumber' => '401234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '88\\d{7}', + 'ExampleNumber' => '881234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900200\\d{3}', + 'ExampleNumber' => '900200123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[12]|365', + 1 => '[12]|365', + 2 => '[12]|365(?:[0-46-9]|5[0-35-9])', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[3-8]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[12]|365', + 1 => '[12]|365', + 2 => '[12]|365(?:[0-46-9]|5[0-35-9])', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[3-8]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BA.php b/lib/libphonenumber/data/PhoneNumberMetadata_BA.php index cb270592..e71f31fc 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BA.php @@ -10,240 +10,187 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '6\\d{8}|(?:[35689]\\d|49|70)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - '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' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6(?:0(?:3\\d|40)|[1-356]\\d|44[0-6]|71[137])\\d{5}', - 'ExampleNumber' => '61123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8[08]\\d{6}', - 'ExampleNumber' => '80123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9[0246]\\d{6}', - 'ExampleNumber' => '90123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '8[12]\\d{6}', - 'ExampleNumber' => '82123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '70(?:3[0146]|[56]0)\\d{4}', - 'ExampleNumber' => '70341234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BA', - 'countryCode' => 387, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6[1-356]|[7-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-5]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6[1-356]|[7-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-5]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +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' => '6(?:0(?:3\\d|40)|[1-356]\\d|44[0-6]|71[137])\\d{5}', + 'ExampleNumber' => '61123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8[08]\\d{6}', + 'ExampleNumber' => '80123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9[0246]\\d{6}', + 'ExampleNumber' => '90123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '8[12]\\d{6}', + 'ExampleNumber' => '82123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '70(?:3[0146]|[56]0)\\d{4}', + 'ExampleNumber' => '70341234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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-356]|[7-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[3-5]', + ], + '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-356]|[7-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[3-5]', + ], + '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, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BB.php b/lib/libphonenumber/data/PhoneNumberMetadata_BB.php index 8bdaca7e..fea30c31 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BB.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BB.php @@ -10,157 +10,118 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:246|[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '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', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '246(?:2(?:[356]\\d|4[0-57-9]|8[0-79])|45\\d|69[5-7]|8(?:[2-5]\\d|83))\\d{4}', - 'ExampleNumber' => '2462501234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:246976|900[2-9]\\d\\d)\\d{4}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '24631\\d{5}', - 'ExampleNumber' => '2463101234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '246(?:292|367|4(?:1[7-9]|3[01]|44|67)|7(?:36|53))\\d{4}', - 'ExampleNumber' => '2464301234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BB', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', - 'nationalPrefixTransformRule' => '246$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '246', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:246|[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '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', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '246(?:2(?:[356]\\d|4[0-57-9]|8[0-79])|45\\d|69[5-7]|8(?:[2-5]\\d|83))\\d{4}', + 'ExampleNumber' => '2462501234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:246976|900[2-9]\\d\\d)\\d{4}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '24631\\d{5}', + 'ExampleNumber' => '2463101234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '246(?:292|367|4(?:1[7-9]|3[01]|44|67)|7(?:36|53))\\d{4}', + 'ExampleNumber' => '2464301234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BB', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', + 'nationalPrefixTransformRule' => '246$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '246', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BD.php b/lib/libphonenumber/data/PhoneNumberMetadata_BD.php index a68ab4ea..d6ed43f3 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BD.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BD.php @@ -10,201 +10,154 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[13469]\\d{9}|8[0-79]\\d{7,8}|[2-7]\\d{8}|[2-9]\\d{7}|[3-689]\\d{6}|[57-9]\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3(?:03[56]|224)|4(?:22[25]|653))\\d{3,4}|(?:4(?:31\\d\\d|[46]23)|5(?:222|32[37]))\\d{3}(?:\\d{2})?|(?:3(?:42[47]|529|823)|4(?:027|525|658)|(?:56|73)2|6257|9[35]1)\\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[01367]|7[15]|8[014-9]))|3(?:0(?:2[025-79]|3[2-4])|22[12]|32[2356]|824)|4(?:02[09]|22[348]|32[045]|523|6(?:27|54))|666(?:22|53)|8(?:4[12]|[5-7]2)|9(?:[024]2|81))\\d{4}|(?:2[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(?:25|56|62)|8(?:23|54)|92[2-5])|5(?:02[03489]|22[457]|32[569]|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(?:0|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', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}', - 'ExampleNumber' => '1812345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[03]\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '96(?:0[469]|1[0-47]|3[389]|6[69]|7[78])\\d{6}', - 'ExampleNumber' => '9604123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BD', - 'countryCode' => 880, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{4,6})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '31[5-7]|[459]1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3,7})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|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 => - array ( - 'pattern' => '(\\d{4})(\\d{3,6})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[13-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{7,8})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[13469]\\d{9}|8[0-79]\\d{7,8}|[2-7]\\d{8}|[2-9]\\d{7}|[3-689]\\d{6}|[57-9]\\d{5}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3(?:03[56]|224)|4(?:22[25]|653))\\d{3,4}|(?:4(?:31\\d\\d|[46]23)|5(?:222|32[37]))\\d{3}(?:\\d{2})?|(?:3(?:42[47]|529|823)|4(?:027|525|658)|(?:56|73)2|6257|9[35]1)\\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[01367]|7[15]|8[014-9]))|3(?:0(?:2[025-79]|3[2-4])|22[12]|32[2356]|824)|4(?:02[09]|22[348]|32[045]|523|6(?:27|54))|666(?:22|53)|8(?:4[12]|[5-7]2)|9(?:[024]2|81))\\d{4}|(?:2[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(?:25|56|62)|8(?:23|54)|92[2-5])|5(?:02[03489]|22[457]|32[569]|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(?:0|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', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}', + 'ExampleNumber' => '1812345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[03]\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '96(?:0[469]|1[0-47]|3[389]|6[69]|7[78])\\d{6}', + 'ExampleNumber' => '9604123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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-7]|[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(?:28|4[14]|5)|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]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{7,8})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BE.php b/lib/libphonenumber/data/PhoneNumberMetadata_BE.php index e00e94b5..44c097fd 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BE.php @@ -10,203 +10,156 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '4\\d{8}|[1-9]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - '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' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '4(?:5[56]|6[0135-8]|[79]\\d|8[3-9])\\d{6}', - 'ExampleNumber' => '470123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800[1-9]\\d{4}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:70(?:2[0-57]|3[0457]|44|69|7[0579])|90(?:0[0-35-8]|1[36]|2[0-3568]|3[0135689]|4[2-68]|5[1-68]|6[0-378]|7[23568]|9[34679]))\\d{4}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '7879\\d{4}', - 'ExampleNumber' => '78791234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '78(?:0[57]|1[0458]|2[25]|3[5-8]|48|[56]0|7[078])\\d{4}', - 'ExampleNumber' => '78102345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BE', - 'countryCode' => 32, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:80|9)0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[239]|4[23]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[15-8]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '4', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '4\\d{8}|[1-9]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '4(?:5[56]|6[0135-8]|[79]\\d|8[3-9])\\d{6}', + 'ExampleNumber' => '470123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800[1-9]\\d{4}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:70(?:2[0-57]|3[0457]|44|69|7[0579])|90(?:0[0-35-8]|1[36]|2[0-3568]|3[0135689]|4[2-68]|5[1-68]|6[0-378]|7[23568]|9[34679]))\\d{4}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '7879\\d{4}', + 'ExampleNumber' => '78791234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '78(?:0[57]|1[0458]|2[25]|3[5-8]|48|[56]0|7[078])\\d{4}', + 'ExampleNumber' => '78102345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BF.php b/lib/libphonenumber/data/PhoneNumberMetadata_BF.php index fd6fc058..acaee38a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BF.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BF.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[025-7]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:0(?:49|5[23]|6[56]|9[016-9])|4(?:4[569]|5[4-6]|6[56]|7[0179])|5(?:[34]\\d|50|6[5-7]))\\d{4}', - 'ExampleNumber' => '20491234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:0[17]|5[124-8]|[67]\\d)\\d{6}', - 'ExampleNumber' => '70123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BF', - 'countryCode' => 226, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[025-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[025-7]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:0(?:49|5[23]|6[56]|9[016-9])|4(?:4[569]|5[4-6]|6[56]|7[0179])|5(?:[34]\\d|50|6[5-7]))\\d{4}', + 'ExampleNumber' => '20491234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:0[17]|5[124-8]|[67]\\d)\\d{6}', + 'ExampleNumber' => '70123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BG.php b/lib/libphonenumber/data/PhoneNumberMetadata_BG.php index a9ef3f88..ed6ede2a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BG.php @@ -10,366 +10,293 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - ), - ), - 'fixedLine' => - array ( - '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' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '43[07-9]\\d{5}|(?:48|8[7-9]\\d|9(?:8\\d|9[69]))\\d{6}', - 'ExampleNumber' => '48123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90\\d{6}', - 'ExampleNumber' => '90123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '700\\d{5}', - 'ExampleNumber' => '70012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BG', - 'countryCode' => 359, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d)(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '43[1-6]|70[1-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2,3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:70|8)0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '43[1-7]|7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[48]|9[08]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d)(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '43[1-6]|70[1-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2,3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:70|8)0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '43[1-7]|7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[48]|9[08]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + ], + '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]\\d{5}|(?:48|8[7-9]\\d|9(?:8\\d|9[69]))\\d{6}', + 'ExampleNumber' => '48123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90\\d{6}', + 'ExampleNumber' => '90123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '700\\d{5}', + 'ExampleNumber' => '70012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BH.php b/lib/libphonenumber/data/PhoneNumberMetadata_BH.php index 1f45a642..527aafe9 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BH.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BH.php @@ -10,157 +10,116 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[136-9]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|7[7-9]|88)|9[69][69])|7(?:1(?:11|78)|7\\d\\d))\\d{4}', - 'ExampleNumber' => '17001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:3(?:[1-4679]\\d|5[013-69]|8[0-47-9])\\d|6(?:3(?:00|33|6[16])|6(?:3[03-9]|[69]\\d|7[0-6])))\\d{4}', - 'ExampleNumber' => '36001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{6}', - 'ExampleNumber' => '80123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:87|9[014578])\\d{6}', - 'ExampleNumber' => '90123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '84\\d{6}', - 'ExampleNumber' => '84123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BH', - 'countryCode' => 973, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[13679]|8[047]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[136-9]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|7[7-9]|88)|9[69][69])|7(?:1(?:11|78)|7\\d\\d))\\d{4}', + 'ExampleNumber' => '17001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:3(?:[1-4679]\\d|5[013-69]|8[0-47-9])\\d|6(?:3(?:00|33|6[16])|6(?:3[03-9]|[69]\\d|7[0-6])))\\d{4}', + 'ExampleNumber' => '36001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{6}', + 'ExampleNumber' => '80123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:87|9[014578])\\d{6}', + 'ExampleNumber' => '90123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '84\\d{6}', + 'ExampleNumber' => '84123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BH', + 'countryCode' => 973, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[13679]|8[047]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BI.php b/lib/libphonenumber/data/PhoneNumberMetadata_BI.php index 68faea78..a99af8c4 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BI.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[267]\\d|31)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '22\\d{6}', - 'ExampleNumber' => '22201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:29|31|6[189]|7[125-9])\\d{6}', - 'ExampleNumber' => '79561234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BI', - 'countryCode' => 257, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[2367]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[267]\\d|31)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '22\\d{6}', + 'ExampleNumber' => '22201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:29|31|6[189]|7[125-9])\\d{6}', + 'ExampleNumber' => '79561234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BJ.php b/lib/libphonenumber/data/PhoneNumberMetadata_BJ.php index ef0bb4c9..abe178ee 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BJ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BJ.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2689]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:02|1[037]|2[45]|3[68])\\d{5}', - 'ExampleNumber' => '20211234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:6\\d|9[013-9])\\d{6}', - 'ExampleNumber' => '90011234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '857[58]\\d{4}', - 'ExampleNumber' => '85751234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '81\\d{6}', - 'ExampleNumber' => '81123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BJ', - 'countryCode' => 229, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[2689]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2689]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:02|1[037]|2[45]|3[68])\\d{5}', + 'ExampleNumber' => '20211234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:6\\d|9[013-9])\\d{6}', + 'ExampleNumber' => '90011234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '857[58]\\d{4}', + 'ExampleNumber' => '85751234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '81\\d{6}', + 'ExampleNumber' => '81123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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 => '[2689]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BL.php b/lib/libphonenumber/data/PhoneNumberMetadata_BL.php index 381bc05f..6cbfcd05 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BL.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BL.php @@ -10,144 +10,105 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:590|69\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '590(?:2[7-9]|5[12]|87)\\d{4}', - 'ExampleNumber' => '590271234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '69(?:0\\d\\d|1(?:2[29]|3[0-5]))\\d{4}', - 'ExampleNumber' => '690001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BL', - 'countryCode' => 590, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:590|69\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '590(?:2[7-9]|5[12]|87)\\d{4}', + 'ExampleNumber' => '590271234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '69(?:0\\d\\d|1(?:2[29]|3[0-5]))\\d{4}', + 'ExampleNumber' => '690001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BL', + 'countryCode' => 590, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BM.php b/lib/libphonenumber/data/PhoneNumberMetadata_BM.php index ea0c4881..4c00e57f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BM.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:441|[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '441(?:2(?:02|23|[3479]\\d|61)|[46]\\d\\d|5(?:4\\d|60|89)|824)\\d{4}', - 'ExampleNumber' => '4412345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '441(?:[37]\\d|5[0-39])\\d{5}', - 'ExampleNumber' => '4413701234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BM', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-8]\\d{6})$', - 'nationalPrefixTransformRule' => '441$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '441', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:441|[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '441(?:2(?:02|23|[3479]\\d|61)|[46]\\d\\d|5(?:4\\d|60|89)|824)\\d{4}', + 'ExampleNumber' => '4412345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '441(?:[37]\\d|5[0-39])\\d{5}', + 'ExampleNumber' => '4413701234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BM', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-8]\\d{6})$', + 'nationalPrefixTransformRule' => '441$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '441', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BN.php b/lib/libphonenumber/data/PhoneNumberMetadata_BN.php index fffaba98..4e0dbf67 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BN.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-578]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '22[0-7]\\d{4}|(?:2[013-9]|[3-5]\\d)\\d{5}', - 'ExampleNumber' => '2345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:22[89]|[78]\\d\\d)\\d{4}', - 'ExampleNumber' => '7123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BN', - 'countryCode' => 673, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-578]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-578]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '22[0-7]\\d{4}|(?:2[013-9]|[3-5]\\d)\\d{5}', + 'ExampleNumber' => '2345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:22[89]|[78]\\d\\d)\\d{4}', + 'ExampleNumber' => '7123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BO.php b/lib/libphonenumber/data/PhoneNumberMetadata_BO.php index eda13255..21116ccb 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BO.php @@ -10,187 +10,142 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2-467]\\d{3}|80017)\\d{4}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - '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' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[67]\\d{7}', - 'ExampleNumber' => '71234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80017\\d{4}', - 'ExampleNumber' => '800171234', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BO', - 'countryCode' => 591, - 'internationalPrefix' => '00(?:1\\d)?', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0(1\\d)?', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[23]|4[46]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '0$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{8})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '[67]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '0$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '0$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2-467]\\d{3}|80017)\\d{4}', + '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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80017\\d{4}', + 'ExampleNumber' => '800171234', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BQ.php b/lib/libphonenumber/data/PhoneNumberMetadata_BQ.php index 45bb7d54..e40129e7 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BQ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BQ.php @@ -10,143 +10,104 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[34]1|7\\d)\\d{5}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:318[023]|41(?:6[023]|70)|7(?:1[578]|50)\\d)\\d{3}', - 'ExampleNumber' => '7151234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}', - 'ExampleNumber' => '3181234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BQ', - 'countryCode' => 599, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '[347]', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[34]1|7\\d)\\d{5}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:318[023]|41(?:6[023]|70)|7(?:1[578]|50)\\d)\\d{3}', + 'ExampleNumber' => '7151234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BQ', + 'countryCode' => 599, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '[347]', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BR.php b/lib/libphonenumber/data/PhoneNumberMetadata_BR.php index 5865bb44..9e572718 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BR.php @@ -10,299 +10,238 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-24679]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - 3 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}', - 'ExampleNumber' => '1123456789', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}', - 'ExampleNumber' => '11961234567', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 8, - 1 => 9, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6,7}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '300\\d{6}|[59]00\\d{6,7}', - 'ExampleNumber' => '300123456', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '300\\d{7}|[34]00\\d{5}|4(?:02|37)0\\d{4}', - 'ExampleNumber' => '40041234', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '4020\\d{4}|[34]00\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BR', - 'countryCode' => 55, - 'internationalPrefix' => '00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?', - 'nationalPrefixTransformRule' => '$2', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3,6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:1[25-8]|2[357-9]|3[02-68]|4[12568]|5|6[0-8]|8[015]|9[0-47-9])|610', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '300|4(?:0[02]|37)', - 1 => '4(?:02|37)0|[34]00', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-57]', - 1 => '[2357]|4(?:[0-24-9]|3(?:[0-689]|7[1-9]))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{2,3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:[358]|90)0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{5})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 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 => - array ( - 'pattern' => '(\\d{2})(\\d{5})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[16][1-9]|[2-57-9]', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '0 $CC ($1)', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '300|4(?:0[02]|37)', - 1 => '4(?:02|37)0|[34]00', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2,3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:[358]|90)0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 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 => - array ( - 'pattern' => '(\\d{2})(\\d{5})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[16][1-9]|[2-57-9]', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '0 $CC ($1)', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-24679]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + 3 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '300\\d{6}|[59]00\\d{6,7}', + 'ExampleNumber' => '300123456', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '300\\d{7}|[34]00\\d{5}|4(?:02|37)0\\d{4}', + 'ExampleNumber' => '40041234', + 'PossibleLength' => [ + 0 => 8, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '4020\\d{4}|[34]00\\d{5}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BR', + 'countryCode' => 55, + 'internationalPrefix' => '00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0(?:(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])|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, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BS.php b/lib/libphonenumber/data/PhoneNumberMetadata_BS.php index fc8e696f..5c93a4d8 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BS.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BS.php @@ -10,154 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:242|[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-4]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}', - 'ExampleNumber' => '2423456789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - '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|[89]9))\\d{4}', - 'ExampleNumber' => '2423591234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '242300\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '242225[0-46-9]\\d{3}', - 'ExampleNumber' => '2422250123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BS', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([3-8]\\d{6})$', - 'nationalPrefixTransformRule' => '242$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '242', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +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-4]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}', + 'ExampleNumber' => '2423456789', + 'PossibleLength' => [ + ], + '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|[89]9))\\d{4}', + 'ExampleNumber' => '2423591234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '242300\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '242225[0-46-9]\\d{3}', + 'ExampleNumber' => '2422250123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BS', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([3-8]\\d{6})$', + 'nationalPrefixTransformRule' => '242$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '242', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BT.php b/lib/libphonenumber/data/PhoneNumberMetadata_BT.php index ae2422ad..57332827 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BT.php @@ -10,207 +10,158 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[17]\\d{7}|[2-8]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}', - 'ExampleNumber' => '2345678', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:1[67]|77)\\d{6}', - 'ExampleNumber' => '17123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BT', - 'countryCode' => 975, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-68]|7[246]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[67]|7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-68]|7[246]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[67]|7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BW.php b/lib/libphonenumber/data/PhoneNumberMetadata_BW.php index 67a2f555..49792601 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BW.php @@ -10,185 +10,140 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '90\\d{5}|(?:[2-6]|7\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013])|4(?:6[03]|7[1267]|9[0-5])|5(?:3[0389]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\d{4}', - 'ExampleNumber' => '2401234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '77200\\d{3}|7(?:[1-6]\\d|7[014-8])\\d{5}', - 'ExampleNumber' => '71123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90\\d{5}', - 'ExampleNumber' => '9012345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '79(?:1(?:[01]\\d|20)|2[0-2]\\d)\\d{3}', - 'ExampleNumber' => '79101234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BW', - 'countryCode' => 267, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '90', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-6]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '90\\d{5}|(?:[2-6]|7\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013])|4(?:6[03]|7[1267]|9[0-5])|5(?:3[0389]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\d{4}', + 'ExampleNumber' => '2401234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '77200\\d{3}|7(?:[1-6]\\d|7[014-8])\\d{5}', + 'ExampleNumber' => '71123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90\\d{5}', + 'ExampleNumber' => '9012345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '79(?:1(?:[01]\\d|20)|2[0-2]\\d)\\d{3}', + 'ExampleNumber' => '79101234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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 => '[2-6]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BY.php b/lib/libphonenumber/data/PhoneNumberMetadata_BY.php index e3087fa8..a06b4467 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BY.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BY.php @@ -10,234 +10,183 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - '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' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - 5 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - ), - ), - 'fixedLine' => - array ( - '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' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}', - 'ExampleNumber' => '294911911', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{3,7}|8(?:0[13]|20\\d)\\d{7}', - 'ExampleNumber' => '8011234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:810|902)\\d{7}', - 'ExampleNumber' => '9021234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '249\\d{6}', - 'ExampleNumber' => '249123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '800\\d{3,7}|(?:8(?:0[13]|10|20\\d)|902)\\d{7}', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BY', - 'countryCode' => 375, - 'internationalPrefix' => '810', - 'preferredInternationalPrefix' => '8~10', - 'nationalPrefix' => '8', - 'nationalPrefixForParsing' => '0|80?', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '8 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '8 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{3})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 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 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:[56]|7[467])|2[1-3]', - ), - 'nationalPrefixFormattingRule' => '8 0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-4]', - ), - 'nationalPrefixFormattingRule' => '8 0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '8 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +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, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{3,7}|8(?:0[13]|20\\d)\\d{7}', + 'ExampleNumber' => '8011234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:810|902)\\d{7}', + 'ExampleNumber' => '9021234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '249\\d{6}', + 'ExampleNumber' => '249123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '800\\d{3,7}|(?:8(?:0[13]|10|20\\d)|902)\\d{7}', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_BZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_BZ.php index 412c9471..5f607ed8 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_BZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_BZ.php @@ -10,171 +10,128 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:0800\\d|[2-8])\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:236|732)\\d{4}|[2-578][02]\\d{5}', - 'ExampleNumber' => '2221234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6[0-35-7]\\d{5}', - 'ExampleNumber' => '6221234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0800\\d{7}', - 'ExampleNumber' => '08001234123', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BZ', - 'countryCode' => 501, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})(\\d{3})', - 'format' => '$1-$2-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:0800\\d|[2-8])\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:236|732)\\d{4}|[2-578][02]\\d{5}', + 'ExampleNumber' => '2221234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6[0-35-7]\\d{5}', + 'ExampleNumber' => '6221234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0800\\d{7}', + 'ExampleNumber' => '08001234123', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + '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, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CA.php b/lib/libphonenumber/data/PhoneNumberMetadata_CA.php index 3ca13e3c..4569a6b2 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CA.php @@ -10,151 +10,112 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2-8]\\d|90)\\d{8}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}', - 'ExampleNumber' => '5062345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}', - 'ExampleNumber' => '5062345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '600[2-9]\\d{6}', - 'ExampleNumber' => '6002012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CA', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2-8]\\d|90)\\d{8}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}', + 'ExampleNumber' => '5062345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|65)|4(?:03|1[68]|3[178]|50)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}', + 'ExampleNumber' => '5062345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '600[2-9]\\d{6}', + 'ExampleNumber' => '6002012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CA', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CC.php b/lib/libphonenumber/data/PhoneNumberMetadata_CC.php index 849fc290..8980aaf0 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CC.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CC.php @@ -10,164 +10,125 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1(?:[0-79]\\d|8[0-24-9])\\d{7}|(?:[148]\\d\\d|550)\\d{6}|1\\d{5,7}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '8(?:51(?:0(?:02|31|60)|118)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}', - 'ExampleNumber' => '891621234', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-2457-9]|9[017-9])\\d{6}', - 'ExampleNumber' => '412345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '180(?:0\\d{3}|2)\\d{3}', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '190[0-26]\\d{6}', - 'ExampleNumber' => '1900123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}', - 'ExampleNumber' => '1300123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 8, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '(?:14(?:5(?:1[0458]|[23][458])|71\\d)|550\\d\\d)\\d{4}', - 'ExampleNumber' => '550123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CC', - 'countryCode' => 61, - 'internationalPrefix' => '001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011', - 'preferredInternationalPrefix' => '0011', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0|([59]\\d{7})$', - 'nationalPrefixTransformRule' => '8$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1(?:[0-79]\\d|8[0-24-9])\\d{7}|(?:[148]\\d\\d|550)\\d{6}|1\\d{5,7}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '8(?:51(?:0(?:02|31|60)|118)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}', + 'ExampleNumber' => '891621234', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 8, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-2457-9]|9[017-9])\\d{6}', + 'ExampleNumber' => '412345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '180(?:0\\d{3}|2)\\d{3}', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '190[0-26]\\d{6}', + 'ExampleNumber' => '1900123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}', + 'ExampleNumber' => '1300123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 8, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '(?:14(?:5(?:1[0458]|[23][458])|71\\d)|550\\d\\d)\\d{4}', + 'ExampleNumber' => '550123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CC', + 'countryCode' => 61, + 'internationalPrefix' => '001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011', + 'preferredInternationalPrefix' => '0011', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0|([59]\\d{7})$', + 'nationalPrefixTransformRule' => '8$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CD.php b/lib/libphonenumber/data/PhoneNumberMetadata_CD.php index 98f1029f..cd76f052 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CD.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CD.php @@ -10,193 +10,146 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[189]\\d{8}|[1-68]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '12\\d{7}|[1-6]\\d{6}', - 'ExampleNumber' => '1234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '88\\d{5}|(?:8[0-2459]|9[017-9])\\d{7}', - 'ExampleNumber' => '991234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CD', - 'countryCode' => 243, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '88', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-6]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[189]\\d{8}|[1-68]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '12\\d{7}|[1-6]\\d{6}', + 'ExampleNumber' => '1234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '88\\d{5}|(?:8[0-2459]|9[017-9])\\d{7}', + 'ExampleNumber' => '991234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CD', + 'countryCode' => 243, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '88', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[1-6]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CF.php b/lib/libphonenumber/data/PhoneNumberMetadata_CF.php index dfce4149..2f29b934 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CF.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CF.php @@ -10,155 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[27]\\d{3}|8776)\\d{4}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2[12]\\d{6}', - 'ExampleNumber' => '21612345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[0257]\\d{6}', - 'ExampleNumber' => '70012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '8776\\d{4}', - 'ExampleNumber' => '87761234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CF', - 'countryCode' => 236, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[278]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[27]\\d{3}|8776)\\d{4}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2[12]\\d{6}', + 'ExampleNumber' => '21612345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[0257]\\d{6}', + 'ExampleNumber' => '70012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '8776\\d{4}', + 'ExampleNumber' => '87761234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CF', + 'countryCode' => 236, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[278]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CG.php b/lib/libphonenumber/data/PhoneNumberMetadata_CG.php index 8c2d7da0..f385dfa5 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CG.php @@ -10,179 +10,134 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '222\\d{6}|(?:0\\d|80)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '222[1-589]\\d{5}', - 'ExampleNumber' => '222123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '0[14-6]\\d{7}', - 'ExampleNumber' => '061234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '80(?:0\\d\\d|11[0-4])\\d{4}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CG', - 'countryCode' => 242, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '801', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[02]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '222\\d{6}|(?:0\\d|80)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '222[1-589]\\d{5}', + 'ExampleNumber' => '222123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '0[14-6]\\d{7}', + 'ExampleNumber' => '061234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '80(?:0\\d\\d|11[0-4])\\d{4}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CG', + 'countryCode' => 242, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '801', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[02]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CH.php b/lib/libphonenumber/data/PhoneNumberMetadata_CH.php index e8ceee59..f7501fd9 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CH.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CH.php @@ -10,197 +10,152 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '8\\d{11}|[2-9]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}', - 'ExampleNumber' => '212345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[35-9]\\d{7}', - 'ExampleNumber' => '781234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[016]\\d{6}', - 'ExampleNumber' => '900123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '84[0248]\\d{6}', - 'ExampleNumber' => '840123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '878\\d{6}', - 'ExampleNumber' => '878123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '74[0248]\\d{6}', - 'ExampleNumber' => '740123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '5[18]\\d{7}', - 'ExampleNumber' => '581234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '860\\d{9}', - 'ExampleNumber' => '860123456789', - 'PossibleLength' => - array ( - 0 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CH', - 'countryCode' => 41, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8[047]|90', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-79]|81', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '8\\d{11}|[2-9]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + 1 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}', + 'ExampleNumber' => '212345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[35-9]\\d{7}', + 'ExampleNumber' => '781234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[016]\\d{6}', + 'ExampleNumber' => '900123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '84[0248]\\d{6}', + 'ExampleNumber' => '840123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '878\\d{6}', + 'ExampleNumber' => '878123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '74[0248]\\d{6}', + 'ExampleNumber' => '740123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '5[18]\\d{7}', + 'ExampleNumber' => '581234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '860\\d{9}', + 'ExampleNumber' => '860123456789', + 'PossibleLength' => [ + 0 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CH', + 'countryCode' => 41, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8[047]|90', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[2-79]|81', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CI.php b/lib/libphonenumber/data/PhoneNumberMetadata_CI.php index 3653df4d..4b7bd462 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CI.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[02-8]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:0[023]|1[02357]|[23][045]|4[03-5])|3(?:0[06]|1[069]|[2-4][07]|5[09]|6[08]))\\d{5}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:0[1-9]|[457]\\d|6[014-9]|8[4-9])\\d{6}', - 'ExampleNumber' => '01234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CI', - 'countryCode' => 225, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[02-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[02-8]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:0[023]|1[02357]|[23][045]|4[03-5])|3(?:0[06]|1[069]|[2-4][07]|5[09]|6[08]))\\d{5}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:0[1-9]|[457]\\d|6[014-9]|8[4-9])\\d{6}', + 'ExampleNumber' => '01234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CI', + 'countryCode' => 225, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[02-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CK.php b/lib/libphonenumber/data/PhoneNumberMetadata_CK.php index 5fca7ed0..881df00b 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CK.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-8]\\d{4}', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2\\d|3[13-7]|4[1-5])\\d{3}', - 'ExampleNumber' => '21234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[5-8]\\d{4}', - 'ExampleNumber' => '71234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CK', - 'countryCode' => 682, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-8]\\d{4}', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2\\d|3[13-7]|4[1-5])\\d{3}', + 'ExampleNumber' => '21234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[5-8]\\d{4}', + 'ExampleNumber' => '71234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CK', + 'countryCode' => 682, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CL.php b/lib/libphonenumber/data/PhoneNumberMetadata_CL.php index e1c966da..8053ec38 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CL.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CL.php @@ -10,360 +10,287 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - 2 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '21962\\d{4}|(?:232[0-8]|80[1-9]\\d)\\d{5}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2-9])\\d{7}', - 'ExampleNumber' => '221234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '21962\\d{4}|(?:232[0-8]|80[1-9]\\d)\\d{5}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2-9])\\d{7}', - 'ExampleNumber' => '221234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '(?:123|8)00\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '600\\d{7,8}', - 'ExampleNumber' => '6001234567', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '44\\d{7}', - 'ExampleNumber' => '441234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '600\\d{7,8}', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CL', - 'countryCode' => 56, - 'internationalPrefix' => '(?:0|1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))0', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:[03-589]|21)|[29]0|78', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{5})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '21', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '44', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[23]', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '60|8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '60', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{5})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '21', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '44', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[23]', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '60|8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '60', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + 2 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '21962\\d{4}|(?:232[0-8]|80[1-9]\\d)\\d{5}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2-9])\\d{7}', + 'ExampleNumber' => '221234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '21962\\d{4}|(?:232[0-8]|80[1-9]\\d)\\d{5}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2-9])\\d{7}', + 'ExampleNumber' => '221234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '(?:123|8)00\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '600\\d{7,8}', + 'ExampleNumber' => '6001234567', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '44\\d{7}', + 'ExampleNumber' => '441234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '600\\d{7,8}', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CL', + 'countryCode' => 56, + 'internationalPrefix' => '(?:0|1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))0', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '1(?:[03-589]|21)|[29]0|78', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{5})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '21', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '44', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[23]', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '60|8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '60', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{5})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '21', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '44', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[23]', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '60|8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '60', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CM.php b/lib/libphonenumber/data/PhoneNumberMetadata_CM.php index cc76f9b0..44b414ba 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CM.php @@ -10,171 +10,128 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[26]\\d\\d|88)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:22|33|4[23])\\d{6}', - 'ExampleNumber' => '222123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6[5-9]\\d{7}', - 'ExampleNumber' => '671234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '88\\d{6}', - 'ExampleNumber' => '88012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CM', - 'countryCode' => 237, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '88', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '[26]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[26]\\d\\d|88)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:22|33|4[23])\\d{6}', + 'ExampleNumber' => '222123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6[5-9]\\d{7}', + 'ExampleNumber' => '671234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '88\\d{6}', + 'ExampleNumber' => '88012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CM', + 'countryCode' => 237, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '88', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '[26]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CN.php b/lib/libphonenumber/data/PhoneNumberMetadata_CN.php index a1d874f5..da820a0d 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CN.php @@ -10,483 +10,396 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1[1279]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-68]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - 5 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:10(?:[02-79]\\d\\d|[18](?:0[1-9]|[1-9]\\d))|21(?:[18](?:0[1-9]|[1-9]\\d)|[2-79]\\d\\d))\\d{5}|(?:43[35]|754)\\d{7,8}|8(?:078\\d{7}|51\\d{7,8})|(?:10|(?:2|85)1|43[35]|754)(?:100\\d\\d|95\\d{3,4})|(?:2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:[39]1|5[57]|6[09])|8(?:71|98))(?:[02-8]\\d{7}|1(?:0(?:0\\d\\d(?:\\d{3})?|[1-9]\\d{5})|[1-9]\\d{6})|9(?:[0-46-9]\\d{6}|5\\d{3}(?:\\d(?:\\d{2})?)?))|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[46-9]|5[2-9]|6[47-9]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|3\\d|5[2-9]|7[02-9]|8[36-8]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:[02-8]\\d{6}|1(?:0(?:0\\d\\d(?:\\d{2})?|[1-9]\\d{4})|[1-9]\\d{5})|9(?:[0-46-9]\\d{5}|5\\d{3,5}))', - 'ExampleNumber' => '1012345678', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '1740[0-5]\\d{6}|1(?:[38]\\d|4[57]|5[0-35-9]|6[25-7]|7[0-35-8]|9[189])\\d{8}', - 'ExampleNumber' => '13123456789', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '(?:(?:10|21)8|8)00\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '16[08]\\d{5}', - 'ExampleNumber' => '16812345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '400\\d{7}|950\\d{7,8}|(?:10|2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}', - 'ExampleNumber' => '4001234567', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '(?:(?:10|21)8|[48])00\\d{7}|950\\d{7,8}', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - 2 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CN', - 'countryCode' => 86, - 'internationalPrefix' => '00|1(?:[12]\\d|79|9[0235-7])\\d\\d00', - 'preferredInternationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0|(1(?:[12]\\d|79|9[0235-7])\\d\\d)', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{5,6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '96', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{5,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:10|2[0-57-9])[19]', - 1 => '(?:10|2[0-57-9])(?:10|9[56])', - 2 => '(?:10|2[0-57-9])(?:100|9[56])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-9]', - 1 => '1[1-9]|26|[3-9]|(?:10|2[0-57-9])(?:[0-8]|9[0-47-9])', - 2 => '1[1-9]|26|[3-9]|(?:10|2[0-57-9])(?:[02-8]|1(?:0[1-9]|[1-9])|9[0-47-9])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '16[08]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{5,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]', - 1 => '(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]', - 2 => '85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])', - 3 => '85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-9]', - 1 => '1[1-9]|26|[3-9]|(?:10|2[0-57-9])(?:[0-8]|9[0-47-9])', - 2 => '26|3(?:[0268]|9[079])|4(?:[049]|2[02-68]|[35]0|6[0-356]|8[014-9])|5(?:0|2[0-24-689]|4[0-2457-9]|6[057-9]|90)|6(?:[0-24578]|6[14-79]|9[03-9])|7(?:0[02-9]|2[0135-79]|3[23]|4[0-27-9]|6[1457]|8)|8(?:[046]|1[01459]|2[0-489]|50|8[0-2459]|9[09])|9(?:0[0457]|1[08]|[268]|4[024-9])|(?:34|85[23])[0-8]|(?:1|58)[1-9]|(?:63|95)[06-9]|(?:33|85[23]9)[0-46-9]|(?:10|2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:[0-8]|9[0-47-9])', - 3 => '26|3(?:[0268]|3[0-46-9]|4[0-8]|9[079])|4(?:[049]|2[02-68]|[35]0|6[0-356]|8[014-9])|5(?:0|2[0-24-689]|4[0-2457-9]|6[057-9]|90)|6(?:[0-24578]|3[06-9]|6[14-79]|9[03-9])|7(?:0[02-9]|2[0135-79]|3[23]|4[0-27-9]|6[1457]|8)|8(?:[046]|1[01459]|2[0-489]|5(?:0|[23](?:[02-8]|1[1-9]|9[0-46-9]))|8[0-2459]|9[09])|9(?:0[0457]|1[08]|[268]|4[024-9]|5[06-9])|(?:1|58|85[23]10)[1-9]|(?:10|2[0-57-9])(?:[0-8]|9[0-47-9])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:[02-8]|1(?:0[1-9]|[1-9])|9[0-47-9])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:4|80)0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '10|2(?:[02-57-9]|1[1-9])', - 1 => '10|2(?:[02-57-9]|1[1-9])', - 2 => '10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 8 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 9 => - array ( - 'pattern' => '(\\d{3})(\\d{7,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 11 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-578]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 12 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[3-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 13 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{5,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:10|2[0-57-9])[19]', - 1 => '(?:10|2[0-57-9])(?:10|9[56])', - 2 => '(?:10|2[0-57-9])(?:100|9[56])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{5,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]', - 1 => '(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]', - 2 => '85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])', - 3 => '85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:4|80)0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '10|2(?:[02-57-9]|1[1-9])', - 1 => '10|2(?:[02-57-9]|1[1-9])', - 2 => '10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{7,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-578]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 8 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[3-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1[1279]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-68]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + 5 => 12, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:10(?:[02-79]\\d\\d|[18](?:0[1-9]|[1-9]\\d))|21(?:[18](?:0[1-9]|[1-9]\\d)|[2-79]\\d\\d))\\d{5}|(?:43[35]|754)\\d{7,8}|8(?:078\\d{7}|51\\d{7,8})|(?:10|(?:2|85)1|43[35]|754)(?:100\\d\\d|95\\d{3,4})|(?:2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:[39]1|5[57]|6[09])|8(?:71|98))(?:[02-8]\\d{7}|1(?:0(?:0\\d\\d(?:\\d{3})?|[1-9]\\d{5})|[1-9]\\d{6})|9(?:[0-46-9]\\d{6}|5\\d{3}(?:\\d(?:\\d{2})?)?))|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[46-9]|5[2-9]|6[47-9]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|3\\d|5[2-9]|7[02-9]|8[36-8]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:[02-8]\\d{6}|1(?:0(?:0\\d\\d(?:\\d{2})?|[1-9]\\d{4})|[1-9]\\d{5})|9(?:[0-46-9]\\d{5}|5\\d{3,5}))', + 'ExampleNumber' => '1012345678', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '1740[0-5]\\d{6}|1(?:[38]\\d|4[57]|5[0-35-9]|6[25-7]|7[0-35-8]|9[189])\\d{8}', + 'ExampleNumber' => '13123456789', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '(?:(?:10|21)8|8)00\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 10, + 1 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '16[08]\\d{5}', + 'ExampleNumber' => '16812345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '400\\d{7}|950\\d{7,8}|(?:10|2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}', + 'ExampleNumber' => '4001234567', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '(?:(?:10|21)8|[48])00\\d{7}|950\\d{7,8}', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + 2 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CN', + 'countryCode' => 86, + 'internationalPrefix' => '00|1(?:[12]\\d|79|9[0235-7])\\d\\d00', + 'preferredInternationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0|(1(?:[12]\\d|79|9[0235-7])\\d\\d)', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{5,6})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '96', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{5,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '(?:10|2[0-57-9])[19]', + 1 => '(?:10|2[0-57-9])(?:10|9[56])', + 2 => '(?:10|2[0-57-9])(?:100|9[56])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[1-9]', + 1 => '1[1-9]|26|[3-9]|(?:10|2[0-57-9])(?:[0-8]|9[0-47-9])', + 2 => '1[1-9]|26|[3-9]|(?:10|2[0-57-9])(?:[02-8]|1(?:0[1-9]|[1-9])|9[0-47-9])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '16[08]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{5,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]', + 1 => '(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]', + 2 => '85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])', + 3 => '85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[1-9]', + 1 => '1[1-9]|26|[3-9]|(?:10|2[0-57-9])(?:[0-8]|9[0-47-9])', + 2 => '26|3(?:[0268]|9[079])|4(?:[049]|2[02-68]|[35]0|6[0-356]|8[014-9])|5(?:0|2[0-24-689]|4[0-2457-9]|6[057-9]|90)|6(?:[0-24578]|6[14-79]|9[03-9])|7(?:0[02-9]|2[0135-79]|3[23]|4[0-27-9]|6[1457]|8)|8(?:[046]|1[01459]|2[0-489]|50|8[0-2459]|9[09])|9(?:0[0457]|1[08]|[268]|4[024-9])|(?:34|85[23])[0-8]|(?:1|58)[1-9]|(?:63|95)[06-9]|(?:33|85[23]9)[0-46-9]|(?:10|2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:[0-8]|9[0-47-9])', + 3 => '26|3(?:[0268]|3[0-46-9]|4[0-8]|9[079])|4(?:[049]|2[02-68]|[35]0|6[0-356]|8[014-9])|5(?:0|2[0-24-689]|4[0-2457-9]|6[057-9]|90)|6(?:[0-24578]|3[06-9]|6[14-79]|9[03-9])|7(?:0[02-9]|2[0135-79]|3[23]|4[0-27-9]|6[1457]|8)|8(?:[046]|1[01459]|2[0-489]|5(?:0|[23](?:[02-8]|1[1-9]|9[0-46-9]))|8[0-2459]|9[09])|9(?:0[0457]|1[08]|[268]|4[024-9]|5[06-9])|(?:1|58|85[23]10)[1-9]|(?:10|2[0-57-9])(?:[0-8]|9[0-47-9])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:[02-8]|1(?:0[1-9]|[1-9])|9[0-47-9])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '(?:4|80)0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '10|2(?:[02-57-9]|1[1-9])', + 1 => '10|2(?:[02-57-9]|1[1-9])', + 2 => '10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 8 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 9 => [ + 'pattern' => '(\\d{3})(\\d{7,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 10 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 11 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3-578]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 12 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[3-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 13 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[12]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{5,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '(?:10|2[0-57-9])[19]', + 1 => '(?:10|2[0-57-9])(?:10|9[56])', + 2 => '(?:10|2[0-57-9])(?:100|9[56])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{5,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]', + 1 => '(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]', + 2 => '85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])', + 3 => '85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '(?:4|80)0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '10|2(?:[02-57-9]|1[1-9])', + 1 => '10|2(?:[02-57-9]|1[1-9])', + 2 => '10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{7,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3-578]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 8 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[3-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[12]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CO.php b/lib/libphonenumber/data/PhoneNumberMetadata_CO.php index ce0b690b..442b08f8 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CO.php @@ -10,225 +10,174 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1\\d|3)\\d{9}|[124-8]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 10, - 2 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[124-8][2-9]\\d{6}', - 'ExampleNumber' => '12345678', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '3(?:0[0-5]|1\\d|2[0-3]|5[01])\\d{7}', - 'ExampleNumber' => '3211234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1800\\d{7}', - 'ExampleNumber' => '18001234567', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '19(?:0[01]|4[78])\\d{7}', - 'ExampleNumber' => '19001234567', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CO', - 'countryCode' => 57, - 'internationalPrefix' => '00(?:4(?:[14]4|56)|[579])', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0([3579]|4(?:[14]4|56))?', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1[2-79]|[25-8]|(?:18|4)[2-9]', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '0$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '0$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{7})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:80|9)', - 1 => '1(?:800|9)', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1[2-79]|[25-8]|(?:18|4)[2-9]', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '0$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '0$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{7})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:80|9)', - 1 => '1(?:800|9)', - ), - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1\\d|3)\\d{9}|[124-8]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 10, + 2 => 11, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[124-8][2-9]\\d{6}', + 'ExampleNumber' => '12345678', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '3(?:0[0-5]|1\\d|2[0-3]|5[01])\\d{7}', + 'ExampleNumber' => '3211234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1800\\d{7}', + 'ExampleNumber' => '18001234567', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '19(?:0[01]|4[78])\\d{7}', + 'ExampleNumber' => '19001234567', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CO', + 'countryCode' => 57, + 'internationalPrefix' => '00(?:4(?:[14]4|56)|[579])', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0([3579]|4(?:[14]4|56))?', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1[2-79]|[25-8]|(?:18|4)[2-9]', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '0$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '0$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{7})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:80|9)', + 1 => '1(?:800|9)', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1[2-79]|[25-8]|(?:18|4)[2-9]', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '0$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '0$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{7})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:80|9)', + 1 => '1(?:800|9)', + ], + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CR.php b/lib/libphonenumber/data/PhoneNumberMetadata_CR.php index 461f42a5..f001b306 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CR.php @@ -10,176 +10,133 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:8\\d|90)\\d{8}|[24-8]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '210[7-9]\\d{4}|2(?:[024-7]\\d|1[1-9])\\d{5}', - 'ExampleNumber' => '22123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6500[01]\\d{3}|5(?:0[01]|7[0-3])\\d{5}|(?:6[0-4]|7[0-3]|8[3-9])\\d{6}', - 'ExampleNumber' => '83123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[059]\\d{7}', - 'ExampleNumber' => '9001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '(?:210[0-6]|4\\d{3}|5100)\\d{4}', - 'ExampleNumber' => '40001234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CR', - 'countryCode' => 506, - 'internationalPrefix' => '00', - 'nationalPrefixForParsing' => '(19(?:0[0-2468]|1[09]|20|66|77|99))', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[24-7]|8[3-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:8\\d|90)\\d{8}|[24-8]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '210[7-9]\\d{4}|2(?:[024-7]\\d|1[1-9])\\d{5}', + 'ExampleNumber' => '22123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6500[01]\\d{3}|5(?:0[01]|7[0-3])\\d{5}|(?:6[0-4]|7[0-3]|8[3-9])\\d{6}', + 'ExampleNumber' => '83123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[059]\\d{7}', + 'ExampleNumber' => '9001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '(?:210[0-6]|4\\d{3}|5100)\\d{4}', + 'ExampleNumber' => '40001234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CR', + 'countryCode' => 506, + 'internationalPrefix' => '00', + 'nationalPrefixForParsing' => '(19(?:0[0-2468]|1[09]|20|66|77|99))', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[24-7]|8[3-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CU.php b/lib/libphonenumber/data/PhoneNumberMetadata_CU.php index b45c50d1..1675f224 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CU.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CU.php @@ -10,187 +10,142 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[27]\\d{6,7}|[34]\\d{5,7}|5\\d{7}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3[23]|48)\\d{4,6}|(?:31|4[36])\\d{6}|(?:2[1-4]|4[1257]|7\\d)\\d{5,6}', - 'ExampleNumber' => '71234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '5\\d{7}', - 'ExampleNumber' => '51234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CU', - 'countryCode' => 53, - 'internationalPrefix' => '119', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{4,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2[1-4]|[34]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{6,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[27]\\d{6,7}|[34]\\d{5,7}|5\\d{7}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3[23]|48)\\d{4,6}|(?:31|4[36])\\d{6}|(?:2[1-4]|4[1257]|7\\d)\\d{5,6}', + 'ExampleNumber' => '71234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '5\\d{7}', + 'ExampleNumber' => '51234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CU', + 'countryCode' => 53, + 'internationalPrefix' => '119', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{4,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2[1-4]|[34]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{6,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '5', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CV.php b/lib/libphonenumber/data/PhoneNumberMetadata_CV.php index 63494275..482f5a2a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CV.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CV.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-59]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}', - 'ExampleNumber' => '2211234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:[34][36]|5[1-389]|9\\d)\\d{5}', - 'ExampleNumber' => '9911234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CV', - 'countryCode' => 238, - 'internationalPrefix' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-59]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-59]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}', + 'ExampleNumber' => '2211234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:[34][36]|5[1-389]|9\\d)\\d{5}', + 'ExampleNumber' => '9911234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CV', + 'countryCode' => 238, + 'internationalPrefix' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-59]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CW.php b/lib/libphonenumber/data/PhoneNumberMetadata_CW.php index 88ff2a4f..c25c745b 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CW.php @@ -10,172 +10,129 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '9(?:4(?:3[0-5]|4[14]|6\\d)|50\\d|7(?:2[014]|3[02-9]|4[4-9]|6[357]|77|8[7-9])|8(?:3[39]|[46]\\d|7[01]|8[57-9]))\\d{4}', - 'ExampleNumber' => '94351234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}', - 'ExampleNumber' => '95181234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '60[0-2]\\d{4}', - 'ExampleNumber' => '6001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '955\\d{5}', - 'ExampleNumber' => '95581234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CW', - 'countryCode' => 599, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[3467]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9[4-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => true, - 'leadingDigits' => '[69]', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '9(?:4(?:3[0-5]|4[14]|6\\d)|50\\d|7(?:2[014]|3[02-9]|4[4-9]|6[357]|77|8[7-9])|8(?:3[39]|[46]\\d|7[01]|8[57-9]))\\d{4}', + 'ExampleNumber' => '94351234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}', + 'ExampleNumber' => '95181234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '60[0-2]\\d{4}', + 'ExampleNumber' => '6001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '955\\d{5}', + 'ExampleNumber' => '95581234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CW', + 'countryCode' => 599, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[3467]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9[4-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => true, + 'leadingDigits' => '[69]', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CX.php b/lib/libphonenumber/data/PhoneNumberMetadata_CX.php index 202276f2..07bf99de 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CX.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CX.php @@ -10,164 +10,125 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1(?:[0-79]\\d|8[0-24-9])\\d{7}|(?:[148]\\d\\d|550)\\d{6}|1\\d{5,7}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '8(?:51(?:0(?:01|30|59)|117)|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}', - 'ExampleNumber' => '891641234', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-2457-9]|9[017-9])\\d{6}', - 'ExampleNumber' => '412345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '180(?:0\\d{3}|2)\\d{3}', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '190[0-26]\\d{6}', - 'ExampleNumber' => '1900123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}', - 'ExampleNumber' => '1300123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 8, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '(?:14(?:5(?:1[0458]|[23][458])|71\\d)|550\\d\\d)\\d{4}', - 'ExampleNumber' => '550123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CX', - 'countryCode' => 61, - 'internationalPrefix' => '001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011', - 'preferredInternationalPrefix' => '0011', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0|([59]\\d{7})$', - 'nationalPrefixTransformRule' => '8$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1(?:[0-79]\\d|8[0-24-9])\\d{7}|(?:[148]\\d\\d|550)\\d{6}|1\\d{5,7}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '8(?:51(?:0(?:01|30|59)|117)|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}', + 'ExampleNumber' => '891641234', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 8, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-2457-9]|9[017-9])\\d{6}', + 'ExampleNumber' => '412345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '180(?:0\\d{3}|2)\\d{3}', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '190[0-26]\\d{6}', + 'ExampleNumber' => '1900123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '13(?:00\\d{3}|45[0-4])\\d{3}|13\\d{4}', + 'ExampleNumber' => '1300123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 8, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '(?:14(?:5(?:1[0458]|[23][458])|71\\d)|550\\d\\d)\\d{4}', + 'ExampleNumber' => '550123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CX', + 'countryCode' => 61, + 'internationalPrefix' => '001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011', + 'preferredInternationalPrefix' => '0011', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0|([59]\\d{7})$', + 'nationalPrefixTransformRule' => '8$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CY.php b/lib/libphonenumber/data/PhoneNumberMetadata_CY.php index b8cc1a47..b3e8d06f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CY.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CY.php @@ -10,159 +10,118 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[279]\\d|[58]0)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2[2-6]\\d{6}', - 'ExampleNumber' => '22345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9[4-79]\\d{6}', - 'ExampleNumber' => '96123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[09]\\d{5}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '80[1-9]\\d{5}', - 'ExampleNumber' => '80112345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '700\\d{5}', - 'ExampleNumber' => '70012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:50|77)\\d{6}', - 'ExampleNumber' => '77123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CY', - 'countryCode' => 357, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[257-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[279]\\d|[58]0)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2[2-6]\\d{6}', + 'ExampleNumber' => '22345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9[4-79]\\d{6}', + 'ExampleNumber' => '96123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[09]\\d{5}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '80[1-9]\\d{5}', + 'ExampleNumber' => '80112345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '700\\d{5}', + 'ExampleNumber' => '70012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:50|77)\\d{6}', + 'ExampleNumber' => '77123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CY', + 'countryCode' => 357, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[257-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_CZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_CZ.php index ee4fcc6e..f487b063 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_CZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_CZ.php @@ -10,196 +10,151 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - 2 => 11, - 3 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2\\d|3[1257-9]|4[16-9]|5[13-9])\\d{7}', - 'ExampleNumber' => '212345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}', - 'ExampleNumber' => '601123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9(?:0[05689]|76)\\d{6}', - 'ExampleNumber' => '900123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '8[134]\\d{7}', - 'ExampleNumber' => '811234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70[01]\\d{6}', - 'ExampleNumber' => '700123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '9[17]0\\d{6}', - 'ExampleNumber' => '910123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '9(?:5\\d|7[2-4])\\d{6}', - 'ExampleNumber' => '972123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '9(?:3\\d{9}|6\\d{7,10})', - 'ExampleNumber' => '93123456789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CZ', - 'countryCode' => 420, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-8]|9[015-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + 2 => 11, + 3 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2\\d|3[1257-9]|4[16-9]|5[13-9])\\d{7}', + 'ExampleNumber' => '212345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}', + 'ExampleNumber' => '601123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9(?:0[05689]|76)\\d{6}', + 'ExampleNumber' => '900123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '8[134]\\d{7}', + 'ExampleNumber' => '811234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70[01]\\d{6}', + 'ExampleNumber' => '700123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '9[17]0\\d{6}', + 'ExampleNumber' => '910123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '9(?:5\\d|7[2-4])\\d{6}', + 'ExampleNumber' => '972123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '9(?:3\\d{9}|6\\d{7,10})', + 'ExampleNumber' => '93123456789', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CZ', + 'countryCode' => 420, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-8]|9[015-7]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_DE.php b/lib/libphonenumber/data/PhoneNumberMetadata_DE.php index 6b1ab67d..e80ebc03 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_DE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_DE.php @@ -10,437 +10,362 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2579]\\d{5,14}|49(?:[05]\\d{10}|[46][1-8]\\d{4,9})|49(?:[0-25]\\d|3[1-689]|7[1-7])\\d{4,8}|49(?:[0-2579]\\d|[34][1-9]|6[0-8])\\d{3}|49\\d{3,4}|(?:1|[368]\\d|4[0-8])\\d{3,13}', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - 4 => 8, - 5 => 9, - 6 => 10, - 7 => 11, - 8 => 12, - 9 => 13, - 10 => 14, - 11 => 15, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 2, - 1 => 3, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:32|49[4-6]\\d)\\d{9}|49[0-7]\\d{3,9}|(?:[34]0|[68]9)\\d{3,13}|(?:2(?:0[1-689]|[1-3569]\\d|4[0-8]|7[1-7]|8[0-7])|3(?:[3569]\\d|4[0-79]|7[1-7]|8[1-8])|4(?:1[02-9]|[2-48]\\d|5[0-6]|6[0-8]|7[0-79])|5(?:0[2-8]|[124-6]\\d|[38][0-8]|[79][0-7])|6(?:0[02-9]|[1-358]\\d|[47][0-8]|6[1-9])|7(?:0[2-8]|1[1-9]|[27][0-7]|3\\d|[4-6][0-8]|8[0-5]|9[013-7])|8(?:0[2-9]|1[0-79]|2\\d|3[0-46-9]|4[0-6]|5[013-9]|6[1-8]|7[0-8]|8[0-24-6])|9(?:0[6-9]|[1-4]\\d|[589][0-7]|6[0-8]|7[0-467]))\\d{3,12}', - 'ExampleNumber' => '30123456', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - 5 => 10, - 6 => 11, - 7 => 12, - 8 => 13, - 9 => 14, - 10 => 15, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '15[0-25-9]\\d{8}|1(?:6[023]|7\\d)\\d{7,8}', - 'ExampleNumber' => '15123456789', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7,12}', - 'ExampleNumber' => '8001234567890', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - 2 => 12, - 3 => 13, - 4 => 14, - 5 => 15, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:137[7-9]|900(?:[135]|9\\d))\\d{6}', - 'ExampleNumber' => '9001234567', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}', - 'ExampleNumber' => '18012345', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - 5 => 12, - 6 => 13, - 7 => 14, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '700\\d{8}', - 'ExampleNumber' => '70012345678', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '16(?:4\\d{1,10}|[89]\\d{1,11})', - 'ExampleNumber' => '16412345', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - 4 => 8, - 5 => 9, - 6 => 10, - 7 => 11, - 8 => 12, - 9 => 13, - 10 => 14, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '18(?:1\\d{5,11}|[2-9]\\d{8})', - 'ExampleNumber' => '18500123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - 3 => 11, - 4 => 12, - 5 => 13, - 6 => 14, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '1(?:6(?:013|255|399)|7(?:(?:[015]1|[69]3)3|[2-4]55|[78]99))\\d{7,8}|15(?:(?:[03-68]00|113)\\d|2\\d55|7\\d99|9\\d33)\\d{7}', - 'ExampleNumber' => '177991234567', - 'PossibleLength' => - array ( - 0 => 12, - 1 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DE', - 'countryCode' => 49, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3,13})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3[02]|40|[68]9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3,12})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', - 1 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{2,11})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]', - 1 => '[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '138', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{5})(\\d{2,10})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{5,11})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '181', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{4,10})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:3|80)|9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{7,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1[67]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{3})(\\d{7,12})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{5})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '185', - 1 => '1850', - 2 => '18500', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 11 => - array ( - 'pattern' => '(\\d{4})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '18[68]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 12 => - array ( - 'pattern' => '(\\d{5})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '15[0568]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 13 => - array ( - 'pattern' => '(\\d{4})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '15[1279]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 14 => - array ( - 'pattern' => '(\\d{3})(\\d{8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '18', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 15 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{7,8})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:6[023]|7)', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 16 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{7})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '15[279]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 17 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{8})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '15', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2579]\\d{5,14}|49(?:[05]\\d{10}|[46][1-8]\\d{4,9})|49(?:[0-25]\\d|3[1-689]|7[1-7])\\d{4,8}|49(?:[0-2579]\\d|[34][1-9]|6[0-8])\\d{3}|49\\d{3,4}|(?:1|[368]\\d|4[0-8])\\d{3,13}', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 7, + 4 => 8, + 5 => 9, + 6 => 10, + 7 => 11, + 8 => 12, + 9 => 13, + 10 => 14, + 11 => 15, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 2, + 1 => 3, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:32|49[4-6]\\d)\\d{9}|49[0-7]\\d{3,9}|(?:[34]0|[68]9)\\d{3,13}|(?:2(?:0[1-689]|[1-3569]\\d|4[0-8]|7[1-7]|8[0-7])|3(?:[3569]\\d|4[0-79]|7[1-7]|8[1-8])|4(?:1[02-9]|[2-48]\\d|5[0-6]|6[0-8]|7[0-79])|5(?:0[2-8]|[124-6]\\d|[38][0-8]|[79][0-7])|6(?:0[02-9]|[1-358]\\d|[47][0-8]|6[1-9])|7(?:0[2-8]|1[1-9]|[27][0-7]|3\\d|[4-6][0-8]|8[0-5]|9[013-7])|8(?:0[2-9]|1[0-79]|2\\d|3[0-46-9]|4[0-6]|5[013-9]|6[1-8]|7[0-8]|8[0-24-6])|9(?:0[6-9]|[1-4]\\d|[589][0-7]|6[0-8]|7[0-467]))\\d{3,12}', + 'ExampleNumber' => '30123456', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + 5 => 10, + 6 => 11, + 7 => 12, + 8 => 13, + 9 => 14, + 10 => 15, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 2, + 1 => 3, + 2 => 4, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '15[0-25-9]\\d{8}|1(?:6[023]|7\\d)\\d{7,8}', + 'ExampleNumber' => '15123456789', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7,12}', + 'ExampleNumber' => '8001234567890', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + 2 => 12, + 3 => 13, + 4 => 14, + 5 => 15, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:137[7-9]|900(?:[135]|9\\d))\\d{6}', + 'ExampleNumber' => '9001234567', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}', + 'ExampleNumber' => '18012345', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + 5 => 12, + 6 => 13, + 7 => 14, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '700\\d{8}', + 'ExampleNumber' => '70012345678', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '16(?:4\\d{1,10}|[89]\\d{1,11})', + 'ExampleNumber' => '16412345', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 7, + 4 => 8, + 5 => 9, + 6 => 10, + 7 => 11, + 8 => 12, + 9 => 13, + 10 => 14, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '18(?:1\\d{5,11}|[2-9]\\d{8})', + 'ExampleNumber' => '18500123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + 3 => 11, + 4 => 12, + 5 => 13, + 6 => 14, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '1(?:6(?:013|255|399)|7(?:(?:[015]1|[69]3)3|[2-4]55|[78]99))\\d{7,8}|15(?:(?:[03-68]00|113)\\d|2\\d55|7\\d99|9\\d33)\\d{7}', + 'ExampleNumber' => '177991234567', + 'PossibleLength' => [ + 0 => 12, + 1 => 13, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DE', + 'countryCode' => 49, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3,13})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3[02]|40|[68]9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3,12})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', + 1 => '2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{2,11})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]', + 1 => '[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '138', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{5})(\\d{2,10})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{5,11})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '181', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{4,10})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:3|80)|9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{7,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1[67]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{3})(\\d{7,12})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{5})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '185', + 1 => '1850', + 2 => '18500', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 10 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 11 => [ + 'pattern' => '(\\d{4})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '18[68]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 12 => [ + 'pattern' => '(\\d{5})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '15[0568]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 13 => [ + 'pattern' => '(\\d{4})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '15[1279]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 14 => [ + 'pattern' => '(\\d{3})(\\d{8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '18', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 15 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{7,8})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:6[023]|7)', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 16 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{7})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '15[279]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 17 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{8})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '15', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_DJ.php b/lib/libphonenumber/data/PhoneNumberMetadata_DJ.php index 7098993c..e5b3e8c1 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_DJ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_DJ.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:2\\d|77)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:1[2-5]|7[45])\\d{5}', - 'ExampleNumber' => '21360003', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '77\\d{6}', - 'ExampleNumber' => '77831001', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DJ', - 'countryCode' => 253, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[27]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:2\\d|77)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:1[2-5]|7[45])\\d{5}', + 'ExampleNumber' => '21360003', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '77\\d{6}', + 'ExampleNumber' => '77831001', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DJ', + 'countryCode' => 253, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[27]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_DK.php b/lib/libphonenumber/data/PhoneNumberMetadata_DK.php index 04b90d4a..f14a0393 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_DK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_DK.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-9]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}', - 'ExampleNumber' => '32123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}', - 'ExampleNumber' => '32123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{6}', - 'ExampleNumber' => '80123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90\\d{6}', - 'ExampleNumber' => '90123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DK', - 'countryCode' => 45, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-9]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}', + 'ExampleNumber' => '32123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:[2-7]\\d|8[126-9]|9[1-36-9])\\d{6}', + 'ExampleNumber' => '32123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{6}', + 'ExampleNumber' => '80123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90\\d{6}', + 'ExampleNumber' => '90123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DK', + 'countryCode' => 45, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_DM.php b/lib/libphonenumber/data/PhoneNumberMetadata_DM.php index 48540221..2c0c05a0 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_DM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_DM.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|767|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4]|70[1-3])\\d{4}', - 'ExampleNumber' => '7674201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-7])\\d{4}', - 'ExampleNumber' => '7672251234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DM', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-7]\\d{6})$', - 'nationalPrefixTransformRule' => '767$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '767', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[58]\\d\\d|767|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4]|70[1-3])\\d{4}', + 'ExampleNumber' => '7674201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-7])\\d{4}', + 'ExampleNumber' => '7672251234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DM', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-7]\\d{6})$', + 'nationalPrefixTransformRule' => '767$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '767', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_DO.php b/lib/libphonenumber/data/PhoneNumberMetadata_DO.php index 5e268c72..649d0ab4 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_DO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_DO.php @@ -10,151 +10,112 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}', - 'ExampleNumber' => '8092345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '8[024]9[2-9]\\d{6}', - 'ExampleNumber' => '8092345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DO', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '8[024]9', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}', + 'ExampleNumber' => '8092345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '8[024]9[2-9]\\d{6}', + 'ExampleNumber' => '8092345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DO', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '8[024]9', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_DZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_DZ.php index 2dd08de9..9f20c08e 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_DZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_DZ.php @@ -10,190 +10,145 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[1-4]|[5-79]\\d|80)\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '9619\\d{5}|(?:1\\d|2[013-79]|3[0-8]|4[0135689])\\d{6}', - 'ExampleNumber' => '12345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '67[0-6]\\d{6}|(?:5[4-6]|6[569]|7[7-9])\\d{7}', - 'ExampleNumber' => '551234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '80[3-689]1\\d{5}', - 'ExampleNumber' => '808123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '80[12]1\\d{5}', - 'ExampleNumber' => '801123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '98[23]\\d{6}', - 'ExampleNumber' => '983123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DZ', - 'countryCode' => 213, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-4]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[5-8]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[1-4]|[5-79]\\d|80)\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '9619\\d{5}|(?:1\\d|2[013-79]|3[0-8]|4[0135689])\\d{6}', + 'ExampleNumber' => '12345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '67[0-6]\\d{6}|(?:5[4-6]|6[569]|7[7-9])\\d{7}', + 'ExampleNumber' => '551234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '80[3-689]1\\d{5}', + 'ExampleNumber' => '808123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '80[12]1\\d{5}', + 'ExampleNumber' => '801123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '98[23]\\d{6}', + 'ExampleNumber' => '983123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DZ', + 'countryCode' => 213, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[1-4]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[5-8]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_EC.php b/lib/libphonenumber/data/PhoneNumberMetadata_EC.php index d3ae45e8..1474e0e4 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_EC.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_EC.php @@ -10,237 +10,184 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1800\\d{6,7}|(?:[2-7]|9\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - 3 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[2-7][2-7]\\d{6}', - 'ExampleNumber' => '22123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '964[0-2]\\d{5}|9(?:39|[57][89]|6[0-37-9]|[89]\\d)\\d{6}', - 'ExampleNumber' => '991234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1800\\d{6,7}', - 'ExampleNumber' => '18001234567', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '[2-7]890\\d{4}', - 'ExampleNumber' => '28901234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'EC', - 'countryCode' => 593, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]', - ), - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1800\\d{6,7}|(?:[2-7]|9\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + 3 => 11, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[2-7][2-7]\\d{6}', + 'ExampleNumber' => '22123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '964[0-2]\\d{5}|9(?:39|[57][89]|6[0-37-9]|[89]\\d)\\d{6}', + 'ExampleNumber' => '991234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1800\\d{6,7}', + 'ExampleNumber' => '18001234567', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '[2-7]890\\d{4}', + 'ExampleNumber' => '28901234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'EC', + 'countryCode' => 593, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[2-7]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[2-7]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[2-7]', + ], + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_EE.php b/lib/libphonenumber/data/PhoneNumberMetadata_EE.php index 40c419e0..5338b37a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_EE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_EE.php @@ -10,204 +10,157 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d\\d|900)\\d{4}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}', - 'ExampleNumber' => '3212345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:5\\d|8[1-4])\\d{6}|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}', - 'ExampleNumber' => '51234567', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800(?:(?:0\\d\\d|1)\\d|[2-9])\\d{3}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:40\\d\\d|900)\\d{4}', - 'ExampleNumber' => '9001234', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70[0-2]\\d{5}', - 'ExampleNumber' => '70012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '800[2-9]\\d{3}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'EE', - 'countryCode' => 372, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]', - 1 => '[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{3,4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[45]|8(?:00|[1-4])', - 1 => '[45]|8(?:00[1-9]|[1-4])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '80', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d\\d|900)\\d{4}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}', + 'ExampleNumber' => '3212345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:5\\d|8[1-4])\\d{6}|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}', + 'ExampleNumber' => '51234567', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800(?:(?:0\\d\\d|1)\\d|[2-9])\\d{3}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:40\\d\\d|900)\\d{4}', + 'ExampleNumber' => '9001234', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70[0-2]\\d{5}', + 'ExampleNumber' => '70012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '800[2-9]\\d{3}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'EE', + 'countryCode' => 372, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]', + 1 => '[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{3,4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[45]|8(?:00|[1-4])', + 1 => '[45]|8(?:00[1-9]|[1-4])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '80', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_EG.php b/lib/libphonenumber/data/PhoneNumberMetadata_EG.php index dafccc62..02d6d391 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_EG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_EG.php @@ -10,193 +10,148 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:15\\d|57[23])\\d{5,6}|(?:13[23]|(?:2[2-4]|3)\\d|4(?:0[2-5]|[578][23]|64)|5(?:0[2-7]|5\\d)|6[24-689]3|8(?:2[2-57]|4[26]|6[237]|8[2-4])|9(?:2[27]|3[24]|52|6[2356]|7[2-4]))\\d{6}', - 'ExampleNumber' => '234567890', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '1[0-25]\\d{8}', - 'ExampleNumber' => '1001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{7}', - 'ExampleNumber' => '9001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'EG', - 'countryCode' => 20, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{7,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[23]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{6,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1[35]|[4-6]|8[2468]|9[235-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[189]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:15\\d|57[23])\\d{5,6}|(?:13[23]|(?:2[2-4]|3)\\d|4(?:0[2-5]|[578][23]|64)|5(?:0[2-7]|5\\d)|6[24-689]3|8(?:2[2-57]|4[26]|6[237]|8[2-4])|9(?:2[27]|3[24]|52|6[2356]|7[2-4]))\\d{6}', + 'ExampleNumber' => '234567890', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '1[0-25]\\d{8}', + 'ExampleNumber' => '1001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{7}', + 'ExampleNumber' => '9001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'EG', + 'countryCode' => 20, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{7,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[23]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{6,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1[35]|[4-6]|8[2468]|9[235-7]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[189]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_EH.php b/lib/libphonenumber/data/PhoneNumberMetadata_EH.php index f55fbd97..e84c31ca 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_EH.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_EH.php @@ -10,148 +10,109 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[5-8]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '528[89]\\d{5}', - 'ExampleNumber' => '528812345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:6(?:[0-79]\\d|8[0-247-9])|7(?:0[06-8]|6[1267]|7[0-27]))\\d{6}', - 'ExampleNumber' => '650123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{7}', - 'ExampleNumber' => '801234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '89\\d{7}', - 'ExampleNumber' => '891234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '5924[01]\\d{4}', - 'ExampleNumber' => '592401234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'EH', - 'countryCode' => 212, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '528[89]', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[5-8]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '528[89]\\d{5}', + 'ExampleNumber' => '528812345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:6(?:[0-79]\\d|8[0-247-9])|7(?:0[06-8]|6[1267]|7[0-27]))\\d{6}', + 'ExampleNumber' => '650123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{7}', + 'ExampleNumber' => '801234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '89\\d{7}', + 'ExampleNumber' => '891234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '5924[01]\\d{4}', + 'ExampleNumber' => '592401234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'EH', + 'countryCode' => 212, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '528[89]', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ER.php b/lib/libphonenumber/data/PhoneNumberMetadata_ER.php index fb0ca4a7..e60529a5 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ER.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ER.php @@ -10,158 +10,117 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[178]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:1[12568]|[24]0|55|6[146])|8\\d\\d)\\d{4}', - 'ExampleNumber' => '8370362', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:17[1-3]|7\\d\\d)\\d{4}', - 'ExampleNumber' => '7123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ER', - 'countryCode' => 291, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[178]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[178]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:1[12568]|[24]0|55|6[146])|8\\d\\d)\\d{4}', + 'ExampleNumber' => '8370362', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:17[1-3]|7\\d\\d)\\d{4}', + 'ExampleNumber' => '7123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ER', + 'countryCode' => 291, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[178]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ES.php b/lib/libphonenumber/data/PhoneNumberMetadata_ES.php index fa304375..867879a2 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ES.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ES.php @@ -10,219 +10,168 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:51|[6-9]\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '96906(?:0[0-8]|1[1-9]|[2-9]\\d)\\d\\d|9(?:69(?:0[0-57-9]|[1-9]\\d)|73(?:[0-8]\\d|9[1-9]))\\d{4}|(?:8(?:[1356]\\d|[28][0-8]|[47][1-9])|9(?:[135]\\d|[268][0-8]|4[1-9]|7[124-9]))\\d{6}', - 'ExampleNumber' => '810123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9(?:6906(?:09|10)|7390\\d\\d)\\d\\d|(?:6\\d|7[1-48])\\d{7}', - 'ExampleNumber' => '612345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '[89]00\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '80[367]\\d{6}', - 'ExampleNumber' => '803123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '90[12]\\d{6}', - 'ExampleNumber' => '901123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70\\d{7}', - 'ExampleNumber' => '701234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '51\\d{7}', - 'ExampleNumber' => '511234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ES', - 'countryCode' => 34, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '905', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '[79]9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]00', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[5-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]00', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[5-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:51|[6-9]\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '96906(?:0[0-8]|1[1-9]|[2-9]\\d)\\d\\d|9(?:69(?:0[0-57-9]|[1-9]\\d)|73(?:[0-8]\\d|9[1-9]))\\d{4}|(?:8(?:[1356]\\d|[28][0-8]|[47][1-9])|9(?:[135]\\d|[268][0-8]|4[1-9]|7[124-9]))\\d{6}', + 'ExampleNumber' => '810123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9(?:6906(?:09|10)|7390\\d\\d)\\d\\d|(?:6\\d|7[1-48])\\d{7}', + 'ExampleNumber' => '612345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '[89]00\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '80[367]\\d{6}', + 'ExampleNumber' => '803123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '90[12]\\d{6}', + 'ExampleNumber' => '901123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70\\d{7}', + 'ExampleNumber' => '701234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '51\\d{7}', + 'ExampleNumber' => '511234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ES', + 'countryCode' => 34, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '905', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{6})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '[79]9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]00', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[5-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]00', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[5-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ET.php b/lib/libphonenumber/data/PhoneNumberMetadata_ET.php index 104a345f..988dbe2c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ET.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ET.php @@ -10,158 +10,117 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:11|[2-59]\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8])|5(?:1[578]|44|5[0-4])|6(?:1[78]|2[69]|39|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|(?:22|55)[0-6]|33[0134689]|44[04]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:(?:11|22)[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}', - 'ExampleNumber' => '111112345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9\\d{8}', - 'ExampleNumber' => '911234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ET', - 'countryCode' => 251, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-59]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:11|[2-59]\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:11(?:1(?:1[124]|2[2-57]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8])|5(?:1[578]|44|5[0-4])|6(?:1[78]|2[69]|39|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|(?:22|55)[0-6]|33[0134689]|44[04]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:(?:11|22)[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}', + 'ExampleNumber' => '111112345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9\\d{8}', + 'ExampleNumber' => '911234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ET', + 'countryCode' => 251, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-59]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_FI.php b/lib/libphonenumber/data/PhoneNumberMetadata_FI.php index 9cf8eb70..5af3934c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_FI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_FI.php @@ -10,265 +10,210 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}|[1-35689]\\d{4}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - 5 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1[3-79][1-8]|[235689][1-8]\\d)\\d{2,6}', - 'ExampleNumber' => '131234567', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:4[0-8]|50)\\d{4,8}', - 'ExampleNumber' => '412345678', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{4,6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '[67]00\\d{5,6}', - 'ExampleNumber' => '600123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:10|[23][09])\\d{4,8}|60(?:[12]\\d{5,6}|6\\d{7})|7(?:(?:1|3\\d)\\d{7}|5[03-9]\\d{3,7})|20[2-59]\\d\\d', - 'ExampleNumber' => '10112345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '20(?:2[023]|9[89])\\d{1,6}|60[12]\\d{5,6}|(?:606|7(?:1|3\\d))\\d{7}|(?:[1-3]00|75[03-9])\\d{3,7}', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FI', - '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' => - array ( - 0 => - array ( - 'pattern' => '(\\d{5})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '75[12]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{4,9})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2568][1-8]|3(?:0[1-9]|[1-9])|9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '11', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:[12]0|7)0|[368]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{4,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[12457]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{4,9})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2568][1-8]|3(?:0[1-9]|[1-9])|9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:[12]0|7)0|[368]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{4,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[12457]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => true, - 'leadingDigits' => '1[03-79]|[2-9]', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}|[1-35689]\\d{4}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + 5 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1[3-79][1-8]|[235689][1-8]\\d)\\d{2,6}', + 'ExampleNumber' => '131234567', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:4[0-8]|50)\\d{4,8}', + 'ExampleNumber' => '412345678', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{4,6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '[67]00\\d{5,6}', + 'ExampleNumber' => '600123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:10|[23][09])\\d{4,8}|60(?:[12]\\d{5,6}|6\\d{7})|7(?:(?:1|3\\d)\\d{7}|5[03-9]\\d{3,7})|20[2-59]\\d\\d', + 'ExampleNumber' => '10112345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '20(?:2[023]|9[89])\\d{1,6}|60[12]\\d{5,6}|(?:606|7(?:1|3\\d))\\d{7}|(?:[1-3]00|75[03-9])\\d{3,7}', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FI', + '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' => [ + 0 => [ + 'pattern' => '(\\d{5})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '75[12]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{4,9})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2568][1-8]|3(?:0[1-9]|[1-9])|9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{6})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '11', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '(?:[12]0|7)0|[368]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{4,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[12457]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{4,9})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2568][1-8]|3(?:0[1-9]|[1-9])|9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '(?:[12]0|7)0|[368]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{4,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[12457]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => true, + 'leadingDigits' => '1[03-79]|[2-9]', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_FJ.php b/lib/libphonenumber/data/PhoneNumberMetadata_FJ.php index 597bd322..7f18b21d 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_FJ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_FJ.php @@ -10,172 +10,129 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '45\\d{5}|(?:0800\\d|[235-9])\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '603\\d{4}|(?:3[0-5]|6[25-7]|8[58])\\d{5}', - 'ExampleNumber' => '3212345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:[279]\\d|45|5[01568]|8[034679])\\d{5}', - 'ExampleNumber' => '7012345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0800\\d{7}', - 'ExampleNumber' => '08001234567', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FJ', - 'countryCode' => 679, - 'internationalPrefix' => '0(?:0|52)', - 'preferredInternationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[235-9]|45', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '45\\d{5}|(?:0800\\d|[235-9])\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '603\\d{4}|(?:3[0-5]|6[25-7]|8[58])\\d{5}', + 'ExampleNumber' => '3212345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:[279]\\d|45|5[01568]|8[034679])\\d{5}', + 'ExampleNumber' => '7012345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0800\\d{7}', + 'ExampleNumber' => '08001234567', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FJ', + 'countryCode' => 679, + 'internationalPrefix' => '0(?:0|52)', + 'preferredInternationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[235-9]|45', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_FK.php b/lib/libphonenumber/data/PhoneNumberMetadata_FK.php index c0bcf425..3983a32f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_FK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_FK.php @@ -10,142 +10,103 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-7]\\d{4}', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[2-47]\\d{4}', - 'ExampleNumber' => '31234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[56]\\d{4}', - 'ExampleNumber' => '51234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FK', - 'countryCode' => 500, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-7]\\d{4}', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[2-47]\\d{4}', + 'ExampleNumber' => '31234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[56]\\d{4}', + 'ExampleNumber' => '51234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FK', + 'countryCode' => 500, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_FM.php b/lib/libphonenumber/data/PhoneNumberMetadata_FM.php index a6918eb5..ecbe8c76 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_FM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_FM.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[39]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3[2357]0[1-9]|9[2-6]\\d\\d)\\d{3}', - 'ExampleNumber' => '3201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:3[2357]0[1-9]|9[2-7]\\d\\d)\\d{3}', - 'ExampleNumber' => '3501234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FM', - 'countryCode' => 691, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[39]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[39]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3[2357]0[1-9]|9[2-6]\\d\\d)\\d{3}', + 'ExampleNumber' => '3201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:3[2357]0[1-9]|9[2-7]\\d\\d)\\d{3}', + 'ExampleNumber' => '3501234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FM', + 'countryCode' => 691, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[39]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_FO.php b/lib/libphonenumber/data/PhoneNumberMetadata_FO.php index 65d2914f..4134d60d 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_FO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_FO.php @@ -10,158 +10,117 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2-8]\\d|90)\\d{4}', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:20|[34]\\d|8[19])\\d{4}', - 'ExampleNumber' => '201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:[27][1-9]|5\\d)\\d{4}', - 'ExampleNumber' => '211234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[257-9]\\d{3}', - 'ExampleNumber' => '802123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90(?:[13-5][15-7]|2[125-7]|99)\\d\\d', - 'ExampleNumber' => '901123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '(?:6[0-36]|88)\\d{4}', - 'ExampleNumber' => '601234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FO', - 'countryCode' => 298, - 'internationalPrefix' => '00', - 'nationalPrefixForParsing' => '(10(?:01|[12]0|88))', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2-8]\\d|90)\\d{4}', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:20|[34]\\d|8[19])\\d{4}', + 'ExampleNumber' => '201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:[27][1-9]|5\\d)\\d{4}', + 'ExampleNumber' => '211234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[257-9]\\d{3}', + 'ExampleNumber' => '802123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90(?:[13-5][15-7]|2[125-7]|99)\\d\\d', + 'ExampleNumber' => '901123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '(?:6[0-36]|88)\\d{4}', + 'ExampleNumber' => '601234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FO', + 'countryCode' => 298, + 'internationalPrefix' => '00', + 'nationalPrefixForParsing' => '(10(?:01|[12]0|88))', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{6})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_FR.php b/lib/libphonenumber/data/PhoneNumberMetadata_FR.php index 8b9dee04..cf8b6639 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_FR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_FR.php @@ -10,221 +10,170 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[1-5]\\d{8}', - 'ExampleNumber' => '123456789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '700\\d{6}|(?:6\\d|7[3-9])\\d{7}', - 'ExampleNumber' => '612345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[0-5]\\d{6}', - 'ExampleNumber' => '801234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '8[129]\\d{7}', - 'ExampleNumber' => '891123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '884\\d{6}', - 'ExampleNumber' => '884012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '9\\d{8}', - 'ExampleNumber' => '912345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '80[6-9]\\d{6}', - 'ExampleNumber' => '806123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FR', - 'countryCode' => 33, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '10', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-79]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-79]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[1-5]\\d{8}', + 'ExampleNumber' => '123456789', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '700\\d{6}|(?:6\\d|7[3-9])\\d{7}', + 'ExampleNumber' => '612345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[0-5]\\d{6}', + 'ExampleNumber' => '801234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '8[129]\\d{7}', + 'ExampleNumber' => '891123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '884\\d{6}', + 'ExampleNumber' => '884012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '9\\d{8}', + 'ExampleNumber' => '912345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '80[6-9]\\d{6}', + 'ExampleNumber' => '806123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FR', + 'countryCode' => 33, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '10', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '[1-79]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '[1-79]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GA.php b/lib/libphonenumber/data/PhoneNumberMetadata_GA.php index 0f3d083c..41af3468 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GA.php @@ -10,168 +10,125 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:0\\d|[2-7])\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '01\\d{6}', - 'ExampleNumber' => '01441234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:0[2-7]|[2-7])\\d{6}', - 'ExampleNumber' => '06031234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GA', - 'countryCode' => 241, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:0\\d|[2-7])\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '01\\d{6}', + 'ExampleNumber' => '01441234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:0[2-7]|[2-7])\\d{6}', + 'ExampleNumber' => '06031234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GA', + 'countryCode' => 241, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[2-7]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GB.php b/lib/libphonenumber/data/PhoneNumberMetadata_GB.php index 58c4607f..bd1a47ac 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GB.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GB.php @@ -10,277 +10,222 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 8, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:1(?:3[0-58]|4[0-5]|5[0-26-9]|6[0-4]|[78][0-49])|2(?:0[024-9]|1[0-7]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)|3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))|2(?:0[01378]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d)\\d{6}|1(?:(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d|7(?:(?:26(?:6[13-9]|7[0-7])|442\\d|50(?:2[0-3]|[3-68]2|76))\\d|6888[2-46-8]))\\d\\d', - 'ExampleNumber' => '1212345678', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - 4 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}', - 'ExampleNumber' => '7400123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[08]\\d{7}|800\\d{6}|8001111', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d', - 'ExampleNumber' => '9012345678', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70\\d{8}', - 'ExampleNumber' => '7012345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '56\\d{8}', - 'ExampleNumber' => '5612345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '76(?:0[0-2]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}', - 'ExampleNumber' => '7640123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:3[0347]|55)\\d{8}', - 'ExampleNumber' => '5512345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GB', - 'countryCode' => 44, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'preferredExtnPrefix' => ' x', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - 1 => '8001', - 2 => '80011', - 3 => '800111', - 4 => '8001111', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '845', - 1 => '8454', - 2 => '84546', - 3 => '845464', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{5})(\\d{4,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:38|5[23]|69|76|94)', - 1 => '1(?:(?:38|69)7|5(?:24|39)|768|946)', - 2 => '1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{4})(\\d{5,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:[2-69][02-9]|[78])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[25]|7(?:0|6[024-9])', - 1 => '[25]|7(?:0|6(?:[04-9]|2[356]))', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{4})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1389]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => true, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 8, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:1(?:3[0-58]|4[0-5]|5[0-26-9]|6[0-4]|[78][0-49])|2(?:0[024-9]|1[0-7]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)|3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))|2(?:0[01378]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d)\\d{6}|1(?:(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d|7(?:(?:26(?:6[13-9]|7[0-7])|442\\d|50(?:2[0-3]|[3-68]2|76))\\d|6888[2-46-8]))\\d\\d', + 'ExampleNumber' => '1212345678', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 7, + 4 => 8, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}', + 'ExampleNumber' => '7400123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[08]\\d{7}|800\\d{6}|8001111', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d', + 'ExampleNumber' => '9012345678', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70\\d{8}', + 'ExampleNumber' => '7012345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '56\\d{8}', + 'ExampleNumber' => '5612345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '76(?:0[0-2]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}', + 'ExampleNumber' => '7640123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:3[0347]|55)\\d{8}', + 'ExampleNumber' => '5512345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GB', + 'countryCode' => 44, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'preferredExtnPrefix' => ' x', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '800', + 1 => '8001', + 2 => '80011', + 3 => '800111', + 4 => '8001111', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '845', + 1 => '8454', + 2 => '84546', + 3 => '845464', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '800', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{5})(\\d{4,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1(?:38|5[23]|69|76|94)', + 1 => '1(?:(?:38|69)7|5(?:24|39)|768|946)', + 2 => '1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{4})(\\d{5,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1(?:[2-69][02-9]|[78])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[25]|7(?:0|6[024-9])', + 1 => '[25]|7(?:0|6(?:[04-9]|2[356]))', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{4})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1389]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => true, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GD.php b/lib/libphonenumber/data/PhoneNumberMetadata_GD.php index 40f1a246..be9b564b 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GD.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GD.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:473|[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}', - 'ExampleNumber' => '4732691234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '473(?:4(?:0[2-79]|1[04-9]|2[0-5]|58)|5(?:2[01]|3[3-8])|901)\\d{4}', - 'ExampleNumber' => '4734031234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GD', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', - 'nationalPrefixTransformRule' => '473$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '473', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:473|[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}', + 'ExampleNumber' => '4732691234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '473(?:4(?:0[2-79]|1[04-9]|2[0-5]|58)|5(?:2[01]|3[3-8])|901)\\d{4}', + 'ExampleNumber' => '4734031234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GD', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', + 'nationalPrefixTransformRule' => '473$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '473', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GE.php b/lib/libphonenumber/data/PhoneNumberMetadata_GE.php index d7fa24fa..6e81f06c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GE.php @@ -10,198 +10,151 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[3-57]\\d\\d|800)\\d{6}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}', - 'ExampleNumber' => '322123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:5(?:[14]4|5[0157-9]|68|7[0147-9]|9[1-35-9])|790)\\d{6}', - 'ExampleNumber' => '555123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '706\\d{6}', - 'ExampleNumber' => '706123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '706\\d{6}', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GE', - 'countryCode' => 995, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '70', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '32', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[57]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[348]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[3-57]\\d\\d|800)\\d{6}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}', + 'ExampleNumber' => '322123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:5(?:[14]4|5[0157-9]|68|7[0147-9]|9[1-35-9])|790)\\d{6}', + 'ExampleNumber' => '555123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '706\\d{6}', + 'ExampleNumber' => '706123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '706\\d{6}', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GE', + 'countryCode' => 995, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '70', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '32', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[57]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[348]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GF.php b/lib/libphonenumber/data/PhoneNumberMetadata_GF.php index 07ebbc7d..8bbc7742 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GF.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GF.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[56]94\\d{6}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '594(?:[023]\\d|1[01]|4[03-9]|5[6-9]|6[0-3]|80|9[014])\\d{4}', - 'ExampleNumber' => '594101234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '694(?:[0-249]\\d|3[0-48])\\d{4}', - 'ExampleNumber' => '694201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GF', - 'countryCode' => 594, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[56]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[56]94\\d{6}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '594(?:[023]\\d|1[01]|4[03-9]|5[6-9]|6[0-3]|80|9[014])\\d{4}', + 'ExampleNumber' => '594101234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '694(?:[0-249]\\d|3[0-48])\\d{4}', + 'ExampleNumber' => '694201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GF', + 'countryCode' => 594, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[56]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GG.php b/lib/libphonenumber/data/PhoneNumberMetadata_GG.php index 5cd49dee..05c32129 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GG.php @@ -10,163 +10,124 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '1481[25-9]\\d{5}', - 'ExampleNumber' => '1481256789', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7(?:(?:781|839)\\d|911[17])\\d{5}', - 'ExampleNumber' => '7781123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[08]\\d{7}|800\\d{6}|8001111', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d', - 'ExampleNumber' => '9012345678', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70\\d{8}', - 'ExampleNumber' => '7012345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '56\\d{8}', - 'ExampleNumber' => '5612345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '76(?:0[0-2]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}', - 'ExampleNumber' => '7640123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:3[0347]|55)\\d{8}', - 'ExampleNumber' => '5512345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GG', - 'countryCode' => 44, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0|([25-9]\\d{5})$', - 'nationalPrefixTransformRule' => '1481$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '1481[25-9]\\d{5}', + 'ExampleNumber' => '1481256789', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7(?:(?:781|839)\\d|911[17])\\d{5}', + 'ExampleNumber' => '7781123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[08]\\d{7}|800\\d{6}|8001111', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d', + 'ExampleNumber' => '9012345678', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70\\d{8}', + 'ExampleNumber' => '7012345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '56\\d{8}', + 'ExampleNumber' => '5612345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '76(?:0[0-2]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}', + 'ExampleNumber' => '7640123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:3[0347]|55)\\d{8}', + 'ExampleNumber' => '5512345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GG', + 'countryCode' => 44, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0|([25-9]\\d{5})$', + 'nationalPrefixTransformRule' => '1481$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GH.php b/lib/libphonenumber/data/PhoneNumberMetadata_GH.php index c06d7cd1..99f0bb1d 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GH.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GH.php @@ -10,212 +10,163 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[235]\\d{3}|800)\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '3(?:[167]2[0-6]|22[0-5]|32[0-3]|4(?:2[013-9]|3[01])|52[0-7]|82[0-2])\\d{5}|3(?:[0-8]8|9[28])0\\d{5}|3(?:0[237]|[1-9]7)\\d{6}', - 'ExampleNumber' => '302345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '56[01]\\d{6}|(?:2[0346-8]|5[0457])\\d{7}', - 'ExampleNumber' => '231234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GH', - 'countryCode' => 233, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[237]|80', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[235]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[235]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[235]\\d{3}|800)\\d{5}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '3(?:[167]2[0-6]|22[0-5]|32[0-3]|4(?:2[013-9]|3[01])|52[0-7]|82[0-2])\\d{5}|3(?:[0-8]8|9[28])0\\d{5}|3(?:0[237]|[1-9]7)\\d{6}', + 'ExampleNumber' => '302345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '56[01]\\d{6}|(?:2[0346-8]|5[0457])\\d{7}', + 'ExampleNumber' => '231234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GH', + 'countryCode' => 233, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[237]|80', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[235]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[235]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GI.php b/lib/libphonenumber/data/PhoneNumberMetadata_GI.php index 4315afda..1a686171 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GI.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[25]\\d\\d|629)\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2190[0-2]\\d{3}|2(?:00\\d|16[24-7]|2(?:2[2457]|50))\\d{4}', - 'ExampleNumber' => '20012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:5[46-8]\\d|629)\\d{5}', - 'ExampleNumber' => '57123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GI', - 'countryCode' => 350, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[25]\\d\\d|629)\\d{5}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2190[0-2]\\d{3}|2(?:00\\d|16[24-7]|2(?:2[2457]|50))\\d{4}', + 'ExampleNumber' => '20012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:5[46-8]\\d|629)\\d{5}', + 'ExampleNumber' => '57123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GI', + 'countryCode' => 350, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GL.php b/lib/libphonenumber/data/PhoneNumberMetadata_GL.php index 0b1da17c..88a8b52b 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GL.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GL.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:19|[2-689]\\d)\\d{4}', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:19|3[1-7]|6[14689]|8[14-79]|9\\d)\\d{4}', - 'ExampleNumber' => '321000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:[25][1-9]|4[2-9])\\d{4}', - 'ExampleNumber' => '221234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{4}', - 'ExampleNumber' => '801234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '3[89]\\d{4}', - 'ExampleNumber' => '381234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GL', - 'countryCode' => 299, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '19|[2-689]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:19|[2-689]\\d)\\d{4}', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:19|3[1-7]|6[14689]|8[14-79]|9\\d)\\d{4}', + 'ExampleNumber' => '321000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:[25][1-9]|4[2-9])\\d{4}', + 'ExampleNumber' => '221234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{4}', + 'ExampleNumber' => '801234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '3[89]\\d{4}', + 'ExampleNumber' => '381234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GL', + 'countryCode' => 299, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '19|[2-689]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GM.php b/lib/libphonenumber/data/PhoneNumberMetadata_GM.php index 331073ff..4c94dfd8 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GM.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-9]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:4(?:[23]\\d\\d|4(?:1[024679]|[6-9]\\d))|5(?:54[0-7]|6[67]\\d|7(?:1[04]|2[035]|3[58]|48))|8\\d{3})\\d{3}', - 'ExampleNumber' => '5661234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:[23679]\\d|5[01])\\d{5}', - 'ExampleNumber' => '3012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GM', - 'countryCode' => 220, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-9]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:4(?:[23]\\d\\d|4(?:1[024679]|[6-9]\\d))|5(?:54[0-7]|6[67]\\d|7(?:1[04]|2[035]|3[58]|48))|8\\d{3})\\d{3}', + 'ExampleNumber' => '5661234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:[23679]\\d|5[01])\\d{5}', + 'ExampleNumber' => '3012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GM', + 'countryCode' => 220, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GN.php b/lib/libphonenumber/data/PhoneNumberMetadata_GN.php index beafa445..7fc6407e 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GN.php @@ -10,171 +10,128 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:30|6\\d\\d|722)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '30(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])\\d{4}', - 'ExampleNumber' => '30241234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6[02356]\\d{7}', - 'ExampleNumber' => '601123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '722\\d{6}', - 'ExampleNumber' => '722123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GN', - 'countryCode' => 224, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[67]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:30|6\\d\\d|722)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '30(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])\\d{4}', + 'ExampleNumber' => '30241234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6[02356]\\d{7}', + 'ExampleNumber' => '601123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '722\\d{6}', + 'ExampleNumber' => '722123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GN', + 'countryCode' => 224, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[67]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GP.php b/lib/libphonenumber/data/PhoneNumberMetadata_GP.php index 8223082b..00811c8b 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GP.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GP.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:590|69\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '590(?:0[1-68]|1[0-2]|2[0-68]|3[1289]|4[0-24-9]|5[3-579]|6[0189]|7[08]|8[0-689]|9\\d)\\d{4}', - 'ExampleNumber' => '590201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '69(?:0\\d\\d|1(?:2[29]|3[0-5]))\\d{4}', - 'ExampleNumber' => '690001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GP', - 'countryCode' => 590, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[56]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => true, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:590|69\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '590(?:0[1-68]|1[0-2]|2[0-68]|3[1289]|4[0-24-9]|5[3-579]|6[0189]|7[08]|8[0-689]|9\\d)\\d{4}', + 'ExampleNumber' => '590201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '69(?:0\\d\\d|1(?:2[29]|3[0-5]))\\d{4}', + 'ExampleNumber' => '690001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GP', + 'countryCode' => 590, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[56]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => true, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GQ.php b/lib/libphonenumber/data/PhoneNumberMetadata_GQ.php index 8e037f12..88416a23 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GQ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GQ.php @@ -10,168 +10,125 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '222\\d{6}|(?:3\\d|55|[89]0)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '33[0-24-9]\\d[46]\\d{4}|3(?:33|5\\d)\\d[7-9]\\d{4}', - 'ExampleNumber' => '333091234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:222|55[015])\\d{6}', - 'ExampleNumber' => '222123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d[1-9]\\d{5}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90\\d[1-9]\\d{5}', - 'ExampleNumber' => '900123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GQ', - 'countryCode' => 240, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[235]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '222\\d{6}|(?:3\\d|55|[89]0)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '33[0-24-9]\\d[46]\\d{4}|3(?:33|5\\d)\\d[7-9]\\d{4}', + 'ExampleNumber' => '333091234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:222|55[015])\\d{6}', + 'ExampleNumber' => '222123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d[1-9]\\d{5}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90\\d[1-9]\\d{5}', + 'ExampleNumber' => '900123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GQ', + 'countryCode' => 240, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[235]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GR.php b/lib/libphonenumber/data/PhoneNumberMetadata_GR.php index 725bb427..a2cc4b6f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GR.php @@ -10,182 +10,137 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[268]\\d|[79]0)\\d{8}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:1\\d\\d|2(?:2[1-46-9]|[36][1-8]|4[1-7]|5[1-4]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|[269][1-6]|3[1245]|4[1-7]|5[13-9]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}', - 'ExampleNumber' => '2123456789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6(?:8[57-9]|9\\d)\\d{7}', - 'ExampleNumber' => '6912345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[19]\\d{7}', - 'ExampleNumber' => '9091234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '8(?:0[16]|12|25)\\d{7}', - 'ExampleNumber' => '8011234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70\\d{8}', - 'ExampleNumber' => '7012345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GR', - 'countryCode' => 30, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '21|7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2689]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[268]\\d|[79]0)\\d{8}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:1\\d\\d|2(?:2[1-46-9]|[36][1-8]|4[1-7]|5[1-4]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|[269][1-6]|3[1245]|4[1-7]|5[13-9]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}', + 'ExampleNumber' => '2123456789', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6(?:8[57-9]|9\\d)\\d{7}', + 'ExampleNumber' => '6912345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[19]\\d{7}', + 'ExampleNumber' => '9091234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '8(?:0[16]|12|25)\\d{7}', + 'ExampleNumber' => '8011234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70\\d{8}', + 'ExampleNumber' => '7012345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GR', + 'countryCode' => 30, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '21|7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2689]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GT.php b/lib/libphonenumber/data/PhoneNumberMetadata_GT.php index 6b9aaa84..aab24304 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GT.php @@ -10,173 +10,130 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1\\d{3}|[2-7])\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[267][2-9]\\d{6}', - 'ExampleNumber' => '22456789', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[3-5]\\d{7}', - 'ExampleNumber' => '51234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '18[01]\\d{8}', - 'ExampleNumber' => '18001112222', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '19\\d{9}', - 'ExampleNumber' => '19001112222', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GT', - 'countryCode' => 502, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1\\d{3}|[2-7])\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[267][2-9]\\d{6}', + 'ExampleNumber' => '22456789', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[3-5]\\d{7}', + 'ExampleNumber' => '51234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '18[01]\\d{8}', + 'ExampleNumber' => '18001112222', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '19\\d{9}', + 'ExampleNumber' => '19001112222', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GT', + 'countryCode' => 502, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-7]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GU.php b/lib/libphonenumber/data/PhoneNumberMetadata_GU.php index 9617e2d9..10f8e270 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GU.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GU.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|671|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}', - 'ExampleNumber' => '6713001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}', - 'ExampleNumber' => '6713001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GU', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([3-9]\\d{6})$', - 'nationalPrefixTransformRule' => '671$1', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '671', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[58]\\d\\d|671|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}', + 'ExampleNumber' => '6713001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}', + 'ExampleNumber' => '6713001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GU', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([3-9]\\d{6})$', + 'nationalPrefixTransformRule' => '671$1', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '671', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GW.php b/lib/libphonenumber/data/PhoneNumberMetadata_GW.php index f9ad8e32..5840d16c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GW.php @@ -10,171 +10,128 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[49]\\d{8}|4\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '443\\d{6}', - 'ExampleNumber' => '443201234', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9(?:5\\d|6[569]|77)\\d{6}', - 'ExampleNumber' => '955012345', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '40\\d{5}', - 'ExampleNumber' => '4012345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GW', - 'countryCode' => 245, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '40', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[49]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[49]\\d{8}|4\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '443\\d{6}', + 'ExampleNumber' => '443201234', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9(?:5\\d|6[569]|77)\\d{6}', + 'ExampleNumber' => '955012345', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '40\\d{5}', + 'ExampleNumber' => '4012345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GW', + 'countryCode' => 245, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '40', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[49]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_GY.php b/lib/libphonenumber/data/PhoneNumberMetadata_GY.php index c299e0f5..ce69b697 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_GY.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_GY.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:862\\d|9008)\\d{3}|(?:[2-46]\\d|77)\\d{5}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-24-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56])|77[1-57])\\d{4}', - 'ExampleNumber' => '2201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6\\d{6}', - 'ExampleNumber' => '6091234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '(?:289|862)\\d{4}', - 'ExampleNumber' => '2891234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9008\\d{3}', - 'ExampleNumber' => '9008123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GY', - 'countryCode' => 592, - 'internationalPrefix' => '001', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-46-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:862\\d|9008)\\d{3}|(?:[2-46]\\d|77)\\d{5}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-24-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56])|77[1-57])\\d{4}', + 'ExampleNumber' => '2201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6\\d{6}', + 'ExampleNumber' => '6091234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '(?:289|862)\\d{4}', + 'ExampleNumber' => '2891234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9008\\d{3}', + 'ExampleNumber' => '9008123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GY', + 'countryCode' => 592, + 'internationalPrefix' => '001', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-46-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_HK.php b/lib/libphonenumber/data/PhoneNumberMetadata_HK.php index e36069dd..26329b8c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_HK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_HK.php @@ -10,213 +10,166 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '8[0-46-9]\\d{6,7}|9\\d{4}(?:\\d(?:\\d(?:\\d{4})?)?)?|(?:[235-79]\\d|46)\\d{6}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - 5 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:384[0-24]|58(?:0[1-8]|1[2-9]))\\d{4}|(?:2(?:[13-8]\\d|2[013-9]|9[0-24-9])|3(?:[1569][0-24-9]|4[0-246-9]|7[0-24-69]|89))\\d{5}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:46(?:0[0-6]|1[0-2]|4[0-57-9])|5730|(?:626|848)[01]|707[1-5]|929[03-9])\\d{4}|(?:5(?:[1-59][0-46-9]|6[0-4689]|7[0-2469])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}', - 'ExampleNumber' => '51234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900(?:[0-24-9]\\d{7}|3\\d{1,4})', - 'ExampleNumber' => '90012345678', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '8(?:1[0-4679]\\d|2(?:[0-36]\\d|7[0-4])|3(?:[034]\\d|2[09]|70))\\d{4}', - 'ExampleNumber' => '81123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '7(?:1(?:0[0-38]|1[0-3679]|3[013]|69|9[136])|2(?:[02389]\\d|1[18]|7[27-9])|3(?:[0-38]\\d|7[0-369]|9[2357-9])|47\\d|5(?:[178]\\d|5[0-5])|6(?:0[0-7]|2[236-9]|[35]\\d)|7(?:[27]\\d|8[7-9])|8(?:[23689]\\d|7[1-9])|9(?:[025]\\d|6[0-246-8]|7[0-36-9]|8[238]))\\d{4}', - 'ExampleNumber' => '71123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '30(?:0[1-9]|[15-7]\\d|2[047]|89)\\d{4}', - 'ExampleNumber' => '30161234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HK', - 'countryCode' => 852, - 'internationalPrefix' => '00(?:30|5[09]|[126-9]?)', - 'preferredInternationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '900', - 1 => '9003', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-7]|8[1-4]|9(?:0[1-9]|[1-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '8[0-46-9]\\d{6,7}|9\\d{4}(?:\\d(?:\\d(?:\\d{4})?)?)?|(?:[235-79]\\d|46)\\d{6}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + 5 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:384[0-24]|58(?:0[1-8]|1[2-9]))\\d{4}|(?:2(?:[13-8]\\d|2[013-9]|9[0-24-9])|3(?:[1569][0-24-9]|4[0-246-9]|7[0-24-69]|89))\\d{5}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:46(?:0[0-6]|1[0-2]|4[0-57-9])|5730|(?:626|848)[01]|707[1-5]|929[03-9])\\d{4}|(?:5(?:[1-59][0-46-9]|6[0-4689]|7[0-2469])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}', + 'ExampleNumber' => '51234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900(?:[0-24-9]\\d{7}|3\\d{1,4})', + 'ExampleNumber' => '90012345678', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '8(?:1[0-4679]\\d|2(?:[0-36]\\d|7[0-4])|3(?:[034]\\d|2[09]|70))\\d{4}', + 'ExampleNumber' => '81123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '7(?:1(?:0[0-38]|1[0-3679]|3[013]|69|9[136])|2(?:[02389]\\d|1[18]|7[27-9])|3(?:[0-38]\\d|7[0-369]|9[2357-9])|47\\d|5(?:[178]\\d|5[0-5])|6(?:0[0-7]|2[236-9]|[35]\\d)|7(?:[27]\\d|8[7-9])|8(?:[23689]\\d|7[1-9])|9(?:[025]\\d|6[0-246-8]|7[0-36-9]|8[238]))\\d{4}', + 'ExampleNumber' => '71123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '30(?:0[1-9]|[15-7]\\d|2[047]|89)\\d{4}', + 'ExampleNumber' => '30161234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HK', + 'countryCode' => 852, + 'internationalPrefix' => '00(?:30|5[09]|[126-9]?)', + 'preferredInternationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '900', + 1 => '9003', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-7]|8[1-4]|9(?:0[1-9]|[1-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_HN.php b/lib/libphonenumber/data/PhoneNumberMetadata_HN.php index 8b2dd57e..9954727a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_HN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_HN.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[237-9]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:2(?:0[019]|1[1-36]|[23]\\d|4[04-6]|5[57]|6[24]|7[0135689]|8[01346-9]|9[0-2])|4(?:07|2[3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:08|16|4[03-5]|5\\d|6[4-6]|74|80)|6(?:[056]\\d|17|20|3[04]|4[0-378]|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[034])|8(?:79|8[0-357-9]|9[1-57-9]))\\d{4}', - 'ExampleNumber' => '22123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[37-9]\\d{7}', - 'ExampleNumber' => '91234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HN', - 'countryCode' => 504, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[237-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[237-9]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:2(?:0[019]|1[1-36]|[23]\\d|4[04-6]|5[57]|6[24]|7[0135689]|8[01346-9]|9[0-2])|4(?:07|2[3-59]|3[13-689]|4[0-68]|5[1-35])|5(?:08|16|4[03-5]|5\\d|6[4-6]|74|80)|6(?:[056]\\d|17|20|3[04]|4[0-378]|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[034])|8(?:79|8[0-357-9]|9[1-57-9]))\\d{4}', + 'ExampleNumber' => '22123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[37-9]\\d{7}', + 'ExampleNumber' => '91234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HN', + 'countryCode' => 504, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[237-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_HR.php b/lib/libphonenumber/data/PhoneNumberMetadata_HR.php index 7777c606..982a9b25 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_HR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_HR.php @@ -10,250 +10,197 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}', - 'ExampleNumber' => '12345678', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9(?:751\\d{5}|8\\d{6,7})|9(?:01|[1259]\\d|7[0679])\\d{6}', - 'ExampleNumber' => '921234567', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[01]\\d{4,6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '6[01459]\\d{6}|6[01]\\d{4,5}', - 'ExampleNumber' => '611234', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '7[45]\\d{6}', - 'ExampleNumber' => '74123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '62\\d{6,7}|72\\d{6}', - 'ExampleNumber' => '62123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HR', - 'countryCode' => 385, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6[01]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[67]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-5]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}', + 'ExampleNumber' => '12345678', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9(?:751\\d{5}|8\\d{6,7})|9(?:01|[1259]\\d|7[0679])\\d{6}', + 'ExampleNumber' => '921234567', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[01]\\d{4,6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '6[01459]\\d{6}|6[01]\\d{4,5}', + 'ExampleNumber' => '611234', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '7[45]\\d{6}', + 'ExampleNumber' => '74123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '62\\d{6,7}|72\\d{6}', + 'ExampleNumber' => '62123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HR', + 'countryCode' => 385, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '6[01]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[67]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-5]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_HT.php b/lib/libphonenumber/data/PhoneNumberMetadata_HT.php index 32179c6c..8cfff4cb 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_HT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_HT.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-489]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:2\\d|5[1-5]|81|9[149])\\d{5}', - 'ExampleNumber' => '22453300', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[34]\\d{7}', - 'ExampleNumber' => '34101234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8\\d{7}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '9(?:[67][0-4]|8[0-3589]|9\\d)\\d{5}', - 'ExampleNumber' => '98901234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HT', - 'countryCode' => 509, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-489]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-489]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:2\\d|5[1-5]|81|9[149])\\d{5}', + 'ExampleNumber' => '22453300', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[34]\\d{7}', + 'ExampleNumber' => '34101234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8\\d{7}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '9(?:[67][0-4]|8[0-3589]|9\\d)\\d{5}', + 'ExampleNumber' => '98901234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HT', + 'countryCode' => 509, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-489]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_HU.php b/lib/libphonenumber/data/PhoneNumberMetadata_HU.php index 8d510e79..b9d256ca 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_HU.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_HU.php @@ -10,184 +10,141 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2357]\\d{8}|[1-9]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1\\d|[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6[23689]|8[2-57-9]|9[2-69])\\d{6}', - 'ExampleNumber' => '12345678', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:[257]0|3[01])\\d{7}', - 'ExampleNumber' => '201234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '[48]0\\d{6}', - 'ExampleNumber' => '80123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9[01]\\d{6}', - 'ExampleNumber' => '90123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '21\\d{7}', - 'ExampleNumber' => '211234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '38\\d{7}', - 'ExampleNumber' => '381234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '[48]0\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HU', - 'countryCode' => 36, - 'internationalPrefix' => '00', - 'nationalPrefix' => '06', - 'nationalPrefixForParsing' => '06', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2357]\\d{8}|[1-9]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1\\d|[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6[23689]|8[2-57-9]|9[2-69])\\d{6}', + 'ExampleNumber' => '12345678', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:[257]0|3[01])\\d{7}', + 'ExampleNumber' => '201234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '[48]0\\d{6}', + 'ExampleNumber' => '80123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9[01]\\d{6}', + 'ExampleNumber' => '90123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '21\\d{7}', + 'ExampleNumber' => '211234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '38\\d{7}', + 'ExampleNumber' => '381234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '[48]0\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HU', + 'countryCode' => 36, + 'internationalPrefix' => '00', + 'nationalPrefix' => '06', + 'nationalPrefixForParsing' => '06', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ID.php b/lib/libphonenumber/data/PhoneNumberMetadata_ID.php index ce0db2a1..8906420e 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ID.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ID.php @@ -10,406 +10,329 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:(?:007803|8\\d{4})\\d|[1-36])\\d{6}|[1-9]\\d{8,10}|[2-9]\\d{7}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - 5 => 12, - 6 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2[124]\\d{7,8}|619\\d{8}|2(?:1(?:14|500)|2\\d{3})\\d{3}|61\\d{5,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}', - 'ExampleNumber' => '218350123', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '8[1-35-9]\\d{7,10}', - 'ExampleNumber' => '812345678', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - 2 => 11, - 3 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '007803\\d{7}|(?:177\\d|800)\\d{5,7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - 3 => 11, - 4 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '809\\d{7}', - 'ExampleNumber' => '8091234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '804\\d{7}', - 'ExampleNumber' => '8041234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:1500|8071\\d{3})\\d{3}', - 'ExampleNumber' => '8071123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '(?:007803\\d|8071)\\d{6}', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ID', - 'countryCode' => 62, - 'internationalPrefix' => '00[189]', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '15', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{5,9})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2[124]|[36]1', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{5,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{5,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-79]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3,4})(\\d{3})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '8[1-35-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{6,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '804', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4,5})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '15', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{5,9})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2[124]|[36]1', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{5,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{5,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-79]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3,4})(\\d{3})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '8[1-35-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{6,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '804', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4,5})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:(?:007803|8\\d{4})\\d|[1-36])\\d{6}|[1-9]\\d{8,10}|[2-9]\\d{7}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + 5 => 12, + 6 => 13, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2[124]\\d{7,8}|619\\d{8}|2(?:1(?:14|500)|2\\d{3})\\d{3}|61\\d{5,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}', + 'ExampleNumber' => '218350123', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '8[1-35-9]\\d{7,10}', + 'ExampleNumber' => '812345678', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + 2 => 11, + 3 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '007803\\d{7}|(?:177\\d|800)\\d{5,7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + 3 => 11, + 4 => 13, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '809\\d{7}', + 'ExampleNumber' => '8091234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '804\\d{7}', + 'ExampleNumber' => '8041234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:1500|8071\\d{3})\\d{3}', + 'ExampleNumber' => '8071123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '(?:007803\\d|8071)\\d{6}', + 'PossibleLength' => [ + 0 => 10, + 1 => 13, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ID', + 'countryCode' => 62, + 'internationalPrefix' => '00[189]', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '15', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{5,9})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2[124]|[36]1', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{5,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '800', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{5,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-79]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3,4})(\\d{3})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '8[1-35-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{6,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '804', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4,5})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '15', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{5,9})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2[124]|[36]1', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{5,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '800', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{5,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-79]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3,4})(\\d{3})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '8[1-35-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{6,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '804', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4,5})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_IE.php b/lib/libphonenumber/data/PhoneNumberMetadata_IE.php index 844691d5..c28ebdd4 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_IE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_IE.php @@ -10,287 +10,228 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1\\d|21)\\d{6,7}|(?:2[24-9]|4(?:0[24]|5\\d|7)|5(?:0[45]|1\\d|8)|6(?:1\\d|[237-9])|9(?:1\\d|[35-9]))\\d{5}|(?:23|4(?:[1-469]|8[0-46-9])|5[23679]|6[4-6]|7[14]|9[04])\\d{7}', - 'ExampleNumber' => '2212345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '8(?:22|[35-9]\\d)\\d{6}', - 'ExampleNumber' => '850123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1800\\d{6}', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '15(?:1[2-8]|[2-8]0|9[089])\\d{6}', - 'ExampleNumber' => '1520123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '18[59]0\\d{6}', - 'ExampleNumber' => '1850123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '700\\d{6}', - 'ExampleNumber' => '700123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '76\\d{7}', - 'ExampleNumber' => '761234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '818\\d{6}', - 'ExampleNumber' => '818123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '8[35-9]5\\d{7}', - 'ExampleNumber' => '8551234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '18[59]0\\d{6}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IE', - 'countryCode' => 353, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2[24-9]|47|58|6[237-9]|9[35-9]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[45]0', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2569]|4[1-69]|7[14]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '70', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '81', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[78]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{2})(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '4', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1\\d|21)\\d{6,7}|(?:2[24-9]|4(?:0[24]|5\\d|7)|5(?:0[45]|1\\d|8)|6(?:1\\d|[237-9])|9(?:1\\d|[35-9]))\\d{5}|(?:23|4(?:[1-469]|8[0-46-9])|5[23679]|6[4-6]|7[14]|9[04])\\d{7}', + 'ExampleNumber' => '2212345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '8(?:22|[35-9]\\d)\\d{6}', + 'ExampleNumber' => '850123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1800\\d{6}', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '15(?:1[2-8]|[2-8]0|9[089])\\d{6}', + 'ExampleNumber' => '1520123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '18[59]0\\d{6}', + 'ExampleNumber' => '1850123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '700\\d{6}', + 'ExampleNumber' => '700123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '76\\d{7}', + 'ExampleNumber' => '761234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '818\\d{6}', + 'ExampleNumber' => '818123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '8[35-9]5\\d{7}', + 'ExampleNumber' => '8551234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '18[59]0\\d{6}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IE', + 'countryCode' => 353, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2[24-9]|47|58|6[237-9]|9[35-9]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[45]0', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2569]|4[1-69]|7[14]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '70', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '81', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[78]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{2})(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '4', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_IL.php b/lib/libphonenumber/data/PhoneNumberMetadata_IL.php index e567e4ff..f2088b35 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_IL.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_IL.php @@ -10,266 +10,211 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - 5 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '153\\d{8,9}|[2-489]\\d{7}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 11, - 2 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '5(?:(?:[0-489][2-9]|6\\d)\\d|5(?:01|2[2-5]|3[23]|4[45]|5[05689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}', - 'ExampleNumber' => '502345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:255|80[019]\\d{3})\\d{3}', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1212\\d{4}|1(?:200|9(?:0[01]|19))\\d{6}', - 'ExampleNumber' => '1919123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '1700\\d{6}', - 'ExampleNumber' => '1700123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '78(?:33|55|77|81)\\d{5}|7(?:18|2[23]|3[237]|47|6[58]|7\\d|82|9[2357-9])\\d{6}', - 'ExampleNumber' => '771234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '1599\\d{6}', - 'ExampleNumber' => '1599123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '151\\d{8,9}', - 'ExampleNumber' => '15112340000', - 'PossibleLength' => - array ( - 0 => 11, - 1 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '1700\\d{6}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IL', - 'countryCode' => 972, - 'internationalPrefix' => '0(?:0|1[2-9])', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{3})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '125', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{2})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '121', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-489]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[57]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '12', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{4})(\\d{6})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '159', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1-$2-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[7-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})', - 'format' => '$1-$2 $3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '15', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + 5 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '153\\d{8,9}|[2-489]\\d{7}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + 0 => 8, + 1 => 11, + 2 => 12, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '5(?:(?:[0-489][2-9]|6\\d)\\d|5(?:01|2[2-5]|3[23]|4[45]|5[05689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}', + 'ExampleNumber' => '502345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:255|80[019]\\d{3})\\d{3}', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1212\\d{4}|1(?:200|9(?:0[01]|19))\\d{6}', + 'ExampleNumber' => '1919123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '1700\\d{6}', + 'ExampleNumber' => '1700123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '78(?:33|55|77|81)\\d{5}|7(?:18|2[23]|3[237]|47|6[58]|7\\d|82|9[2357-9])\\d{6}', + 'ExampleNumber' => '771234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '1599\\d{6}', + 'ExampleNumber' => '1599123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '151\\d{8,9}', + 'ExampleNumber' => '15112340000', + 'PossibleLength' => [ + 0 => 11, + 1 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '1700\\d{6}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IL', + 'countryCode' => 972, + 'internationalPrefix' => '0(?:0|1[2-9])', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{3})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '125', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{2})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '121', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[2-489]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[57]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '12', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{4})(\\d{6})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '159', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1-$2-$3-$4', + 'leadingDigitsPatterns' => [ + 0 => '1[7-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})', + 'format' => '$1-$2 $3-$4', + 'leadingDigitsPatterns' => [ + 0 => '15', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_IM.php b/lib/libphonenumber/data/PhoneNumberMetadata_IM.php index 09b009ed..312fc9b8 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_IM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_IM.php @@ -10,153 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1624\\d{6}|(?:[3578]\\d|90)\\d{8}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '1624[5-8]\\d{5}', - 'ExampleNumber' => '1624756789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}', - 'ExampleNumber' => '7924123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '808162\\d{4}', - 'ExampleNumber' => '8081624567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '8(?:440[49]06|72299\\d)\\d{3}|(?:8(?:45|70)|90[0167])624\\d{4}', - 'ExampleNumber' => '9016247890', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70\\d{8}', - 'ExampleNumber' => '7012345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '56\\d{8}', - 'ExampleNumber' => '5612345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '3440[49]06\\d{3}|(?:3(?:08162|3\\d{4}|45624|7(?:0624|2299))|55\\d{4})\\d{4}', - 'ExampleNumber' => '5512345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IM', - 'countryCode' => 44, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0|([5-8]\\d{5})$', - 'nationalPrefixTransformRule' => '1624$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '74576|(?:16|7[56])24', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1624\\d{6}|(?:[3578]\\d|90)\\d{8}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '1624[5-8]\\d{5}', + 'ExampleNumber' => '1624756789', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}', + 'ExampleNumber' => '7924123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '808162\\d{4}', + 'ExampleNumber' => '8081624567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '8(?:440[49]06|72299\\d)\\d{3}|(?:8(?:45|70)|90[0167])624\\d{4}', + 'ExampleNumber' => '9016247890', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70\\d{8}', + 'ExampleNumber' => '7012345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '56\\d{8}', + 'ExampleNumber' => '5612345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '3440[49]06\\d{3}|(?:3(?:08162|3\\d{4}|45624|7(?:0624|2299))|55\\d{4})\\d{4}', + 'ExampleNumber' => '5512345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IM', + 'countryCode' => 44, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0|([5-8]\\d{5})$', + 'nationalPrefixTransformRule' => '1624$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '74576|(?:16|7[56])24', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_IN.php b/lib/libphonenumber/data/PhoneNumberMetadata_IN.php index 6462c087..270108e7 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_IN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_IN.php @@ -10,423 +10,344 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:00800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - 3 => 11, - 4 => 12, - 5 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '782[0-6][2-7]\\d{5}|(?:170[24]|2(?:80[13468]|90\\d)|380\\d|4(?:20[24]|72[2-8])|552[1-7])\\d{6}|(?:342|674|788)(?:[0189][2-7]|[2-7]\\d)\\d{5}|(?:11|2[02]|33|4[04]|79|80)[2-7]\\d{7}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[13]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[014-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[13-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1-5]|4[5-8]|5[125689]|6[235-7]|7[157-9]|8[2-46-8])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|8[013-7]|9[0189])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d[2-7]\\d{5}', - 'ExampleNumber' => '7410410123', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:6(?:1279|350[0-6])|7(?:3(?:1(?:11|7[02-8])|411)|4[47](?:11|7[02-8])|5111|700[02-9]|88(?:11|7[02-9])|9(?:313|79[07-9]))|8(?:079[04-9]|(?:16|2[014]|3[126]|6[136]|7[78]|8[34]|91)7[02-8]))\\d{5}|7(?:28[6-8]|3(?:2[0-49]|9[2-5])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7])[089]\\d{5}|(?:6(?:0(?:0[0-3569]|26|33)|2(?:[06]\\d|3[02589]|8[0-479]|9[0-79])|3(?:0[0-79]|5[1-9]|6[0-4679]|7[0-24-9]|[89]\\d)|9(?:0[019]|13))|7(?:0\\d\\d|19[0-5]|2(?:[0235-79]\\d|[14][017-9]|8[0-59])|3(?:[05-8]\\d|1[089]|2[5-8]|3[017-9]|4[07-9]|9[016-9])|4(?:0\\d|1[015-9]|[29][89]|39|[47][089]|8[389])|5(?:[0346-8]\\d|1[07-9]|2[04-9]|5[017-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9]\\d)|7(?:0[289]|[1-9]\\d)|8(?:[0-79]\\d|8[089])|9(?:[089]\\d|7[02-8]))|8(?:0(?:[01589]\\d|6[67]|7[02-8])|1(?:[0-57-9]\\d|6[089])|2(?:[014][089]|[235-9]\\d)|3(?:[03-57-9]\\d|[126][089])|[45]\\d\\d|6(?:[02457-9]\\d|[136][089])|7(?:0[07-9]|[1-69]\\d|[78][089])|8(?:[0-25-9]\\d|3[089]|4[0489])|9(?:[02-9]\\d|1[0289]))|9\\d{3})\\d{6}', - 'ExampleNumber' => '8123456789', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '00800\\d{7}|1(?:600\\d{6}|80(?:0\\d{4,9}|3\\d{9}))', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '186[12]\\d{9}', - 'ExampleNumber' => '1861123456789', - 'PossibleLength' => - array ( - 0 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '1860\\d{7}', - 'ExampleNumber' => '18603451234', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '140\\d{7}', - 'ExampleNumber' => '1409305260', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '1(?:600\\d{6}|800\\d{4,9})|(?:00800|18(?:03\\d\\d|6(?:0|[12]\\d\\d)))\\d{7}', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IN', - 'countryCode' => 91, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{7})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '575', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{8})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '5(?:0|2[23]|3[03]|[67]1|88)', - 1 => '5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)', - 2 => '5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{4,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '180', - 1 => '1800', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '140', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '11|2[02]|33|4[04]|79[1-7]|80[2-46]', - 1 => '11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])', - 2 => '11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]', - 1 => '1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|(?:55|61)2|7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]', - 2 => '1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:1(?:29|60|8[06])|261|552|788[01])[2-7]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 6 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|[4-8])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807', - 1 => '1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|[4-8])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]', - 2 => '1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|[4-8])|7(?:1(?:[013-8]|9[6-9])|3179)|807(?:1|9[1-3])|(?:1552|7(?:28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 7 => - array ( - 'pattern' => '(\\d{5})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[6-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 8 => - array ( - 'pattern' => '(\\d{4})(\\d{2,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:6|8[06])', - 1 => '1(?:6|8[06]0)', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 9 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '18', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{8})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '5(?:0|2[23]|3[03]|[67]1|88)', - 1 => '5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)', - 2 => '5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '180', - 1 => '1800', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '140', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '11|2[02]|33|4[04]|79[1-7]|80[2-46]', - 1 => '11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])', - 2 => '11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]', - 1 => '1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|(?:55|61)2|7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]', - 2 => '1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:1(?:29|60|8[06])|261|552|788[01])[2-7]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 5 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|[4-8])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807', - 1 => '1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|[4-8])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]', - 2 => '1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|[4-8])|7(?:1(?:[013-8]|9[6-9])|3179)|807(?:1|9[1-3])|(?:1552|7(?:28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 6 => - array ( - 'pattern' => '(\\d{5})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[6-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 7 => - array ( - 'pattern' => '(\\d{4})(\\d{2,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:6|8[06])', - 1 => '1(?:6|8[06]0)', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 8 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '18', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:00800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + 3 => 11, + 4 => 12, + 5 => 13, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '782[0-6][2-7]\\d{5}|(?:170[24]|2(?:80[13468]|90\\d)|380\\d|4(?:20[24]|72[2-8])|552[1-7])\\d{6}|(?:342|674|788)(?:[0189][2-7]|[2-7]\\d)\\d{5}|(?:11|2[02]|33|4[04]|79|80)[2-7]\\d{7}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[13]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[014-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[13-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1-5]|4[5-8]|5[125689]|6[235-7]|7[157-9]|8[2-46-8])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|8[013-7]|9[0189])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d[2-7]\\d{5}', + 'ExampleNumber' => '7410410123', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + 2 => 8, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:6(?:1279|350[0-6])|7(?:3(?:1(?:11|7[02-8])|411)|4[47](?:11|7[02-8])|5111|700[02-9]|88(?:11|7[02-9])|9(?:313|79[07-9]))|8(?:079[04-9]|(?:16|2[014]|3[126]|6[136]|7[78]|8[34]|91)7[02-8]))\\d{5}|7(?:28[6-8]|3(?:2[0-49]|9[2-5])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7])[089]\\d{5}|(?:6(?:0(?:0[0-3569]|26|33)|2(?:[06]\\d|3[02589]|8[0-479]|9[0-79])|3(?:0[0-79]|5[1-9]|6[0-4679]|7[0-24-9]|[89]\\d)|9(?:0[019]|13))|7(?:0\\d\\d|19[0-5]|2(?:[0235-79]\\d|[14][017-9]|8[0-59])|3(?:[05-8]\\d|1[089]|2[5-8]|3[017-9]|4[07-9]|9[016-9])|4(?:0\\d|1[015-9]|[29][89]|39|[47][089]|8[389])|5(?:[0346-8]\\d|1[07-9]|2[04-9]|5[017-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589]|[6-9]\\d)|7(?:0[289]|[1-9]\\d)|8(?:[0-79]\\d|8[089])|9(?:[089]\\d|7[02-8]))|8(?:0(?:[01589]\\d|6[67]|7[02-8])|1(?:[0-57-9]\\d|6[089])|2(?:[014][089]|[235-9]\\d)|3(?:[03-57-9]\\d|[126][089])|[45]\\d\\d|6(?:[02457-9]\\d|[136][089])|7(?:0[07-9]|[1-69]\\d|[78][089])|8(?:[0-25-9]\\d|3[089]|4[0489])|9(?:[02-9]\\d|1[0289]))|9\\d{3})\\d{6}', + 'ExampleNumber' => '8123456789', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '00800\\d{7}|1(?:600\\d{6}|80(?:0\\d{4,9}|3\\d{9}))', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '186[12]\\d{9}', + 'ExampleNumber' => '1861123456789', + 'PossibleLength' => [ + 0 => 13, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '1860\\d{7}', + 'ExampleNumber' => '18603451234', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '140\\d{7}', + 'ExampleNumber' => '1409305260', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '1(?:600\\d{6}|800\\d{4,9})|(?:00800|18(?:03\\d\\d|6(?:0|[12]\\d\\d)))\\d{7}', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IN', + 'countryCode' => 91, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{7})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '575', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{8})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '5(?:0|2[23]|3[03]|[67]1|88)', + 1 => '5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)', + 2 => '5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{4,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '180', + 1 => '1800', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '140', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '11|2[02]|33|4[04]|79[1-7]|80[2-46]', + 1 => '11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])', + 2 => '11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]', + 1 => '1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|(?:55|61)2|7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]', + 2 => '1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:1(?:29|60|8[06])|261|552|788[01])[2-7]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 6 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|[4-8])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807', + 1 => '1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|[4-8])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]', + 2 => '1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|[4-8])|7(?:1(?:[013-8]|9[6-9])|3179)|807(?:1|9[1-3])|(?:1552|7(?:28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 7 => [ + 'pattern' => '(\\d{5})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[6-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 8 => [ + 'pattern' => '(\\d{4})(\\d{2,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:6|8[06])', + 1 => '1(?:6|8[06]0)', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 9 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 10 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '18', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{8})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '5(?:0|2[23]|3[03]|[67]1|88)', + 1 => '5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)', + 2 => '5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '180', + 1 => '1800', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '140', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '11|2[02]|33|4[04]|79[1-7]|80[2-46]', + 1 => '11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])', + 2 => '11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]', + 1 => '1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|(?:55|61)2|7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]', + 2 => '1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|[2-4]1|5[17]|6[13]|7[14]|80)|7(?:12|(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:1(?:29|60|8[06])|261|552|788[01])[2-7]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 5 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|[4-8])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807', + 1 => '1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|[4-8])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]', + 2 => '1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|[4-8])|7(?:1(?:[013-8]|9[6-9])|3179)|807(?:1|9[1-3])|(?:1552|7(?:28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 6 => [ + 'pattern' => '(\\d{5})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[6-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 7 => [ + 'pattern' => '(\\d{4})(\\d{2,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:6|8[06])', + 1 => '1(?:6|8[06]0)', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 8 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '18', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_IO.php b/lib/libphonenumber/data/PhoneNumberMetadata_IO.php index 6012ee00..503ae0fd 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_IO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_IO.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '3\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '37\\d{5}', - 'ExampleNumber' => '3709100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '38\\d{5}', - 'ExampleNumber' => '3801234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IO', - 'countryCode' => 246, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '3\\d{6}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '37\\d{5}', + 'ExampleNumber' => '3709100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '38\\d{5}', + 'ExampleNumber' => '3801234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IO', + 'countryCode' => 246, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_IQ.php b/lib/libphonenumber/data/PhoneNumberMetadata_IQ.php index 8ef31e83..f74f0498 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_IQ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_IQ.php @@ -10,189 +10,144 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}', - 'ExampleNumber' => '12345678', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[3-9]\\d{8}', - 'ExampleNumber' => '7912345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IQ', - 'countryCode' => 964, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-6]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}', + 'ExampleNumber' => '12345678', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[3-9]\\d{8}', + 'ExampleNumber' => '7912345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IQ', + 'countryCode' => 964, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-6]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_IR.php b/lib/libphonenumber/data/PhoneNumberMetadata_IR.php index ea2a0cff..1e7e2120 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_IR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_IR.php @@ -10,212 +10,165 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - 4 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 8, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '944111\\d{4}|94(?:(?:00|44)0|(?:11|2\\d)\\d|30[01])\\d{5}|(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])(?:[03-57]\\d{7}|[16]\\d{3}(?:\\d{4})?|[289]\\d{3}(?:\\d(?:\\d{3})?)?)', - 'ExampleNumber' => '2123456789', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - 2 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9(?:(?:0(?:[1-35]\\d|44)|(?:[13]\\d|2[0-2])\\d)\\d|9(?:(?:[0-2]\\d|44)\\d|510|8(?:1\\d|88)|9(?:0[013]|1[0134]|21|77|9[6-9])))\\d{5}', - 'ExampleNumber' => '9123456789', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '993\\d{7}', - 'ExampleNumber' => '9932123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '96(?:0[12]|2[16-8]|3(?:08|[14]5|[23]|66)|4(?:0|80)|5[01]|6[89]|86|9[19])', - 'ExampleNumber' => '9601', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '96(?:0[12]|2[16-8]|3(?:08|[14]5|[23]|66)|4(?:0|80)|5[01]|6[89]|86|9[19])|94(?:11[1-7]|440)\\d{5}', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IR', - 'countryCode' => 98, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4,5})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '96', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{4,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-8]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 7, + 4 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 8, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '944111\\d{4}|94(?:(?:00|44)0|(?:11|2\\d)\\d|30[01])\\d{5}|(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])(?:[03-57]\\d{7}|[16]\\d{3}(?:\\d{4})?|[289]\\d{3}(?:\\d(?:\\d{3})?)?)', + 'ExampleNumber' => '2123456789', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + 2 => 8, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9(?:(?:0(?:[1-35]\\d|44)|(?:[13]\\d|2[0-2])\\d)\\d|9(?:(?:[0-2]\\d|44)\\d|510|8(?:1\\d|88)|9(?:0[013]|1[0134]|21|77|9[6-9])))\\d{5}', + 'ExampleNumber' => '9123456789', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '993\\d{7}', + 'ExampleNumber' => '9932123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '96(?:0[12]|2[16-8]|3(?:08|[14]5|[23]|66)|4(?:0|80)|5[01]|6[89]|86|9[19])', + 'ExampleNumber' => '9601', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '96(?:0[12]|2[16-8]|3(?:08|[14]5|[23]|66)|4(?:0|80)|5[01]|6[89]|86|9[19])|94(?:11[1-7]|440)\\d{5}', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IR', + 'countryCode' => 98, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4,5})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '96', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{4,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-8]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_IS.php b/lib/libphonenumber/data/PhoneNumberMetadata_IS.php index d034c439..f02f366b 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_IS.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_IS.php @@ -10,179 +10,136 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:38\\d|[4-9])\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:4(?:1[0-24-69]|2[0-7]|[37][0-8]|4[0-245]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[0-579]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|87[23])\\d{4}', - 'ExampleNumber' => '4101234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[027-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-8]\\d|9[0-3])|8(?:2[0-59]|[3469]\\d|5[1-9]|8[28]))\\d{4}', - 'ExampleNumber' => '6111234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{4}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90\\d{5}', - 'ExampleNumber' => '9011234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '49\\d{5}', - 'ExampleNumber' => '4921234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '809\\d{4}', - 'ExampleNumber' => '8091234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '(?:689|8(?:7[0189]|80)|95[48])\\d{4}', - 'ExampleNumber' => '6891234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IS', - 'countryCode' => 354, - 'internationalPrefix' => '00|1(?:0(?:01|[12]0)|100)', - 'preferredInternationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[4-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:38\\d|[4-9])\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:4(?:1[0-24-69]|2[0-7]|[37][0-8]|4[0-245]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[0-579]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|87[23])\\d{4}', + 'ExampleNumber' => '4101234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[027-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-8]\\d|9[0-3])|8(?:2[0-59]|[3469]\\d|5[1-9]|8[28]))\\d{4}', + 'ExampleNumber' => '6111234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{4}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90\\d{5}', + 'ExampleNumber' => '9011234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '49\\d{5}', + 'ExampleNumber' => '4921234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '809\\d{4}', + 'ExampleNumber' => '8091234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '(?:689|8(?:7[0189]|80)|95[48])\\d{4}', + 'ExampleNumber' => '6891234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IS', + 'countryCode' => 354, + 'internationalPrefix' => '00|1(?:0(?:01|[12]0)|100)', + 'preferredInternationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[4-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_IT.php b/lib/libphonenumber/data/PhoneNumberMetadata_IT.php index 95b15556..89e301f4 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_IT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_IT.php @@ -10,434 +10,351 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '0\\d{6,10}|55\\d{8}|[08]\\d{5}|(?:3[0-8]|8)\\d{7,9}|(?:1\\d|39)\\d{7,8}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - 5 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}', - 'ExampleNumber' => '0212345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '33\\d{9}|3[1-9]\\d{8}|3[2-9]\\d{7}', - 'ExampleNumber' => '3123456789', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - 2 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80(?:0\\d{3}|3)\\d{3}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:0878\\d\\d|89(?:2|4[5-9]\\d))\\d{3}|89[45][0-4]\\d\\d|(?:1(?:44|6[346])|89(?:5[5-9]|9))\\d{6}', - 'ExampleNumber' => '899123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '84(?:[08]\\d{3}|[17])\\d{3}', - 'ExampleNumber' => '848123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '1(?:78\\d|99)\\d{6}', - 'ExampleNumber' => '1781234567', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '55\\d{8}', - 'ExampleNumber' => '5512345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '848\\d{6}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IT', - 'countryCode' => 39, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4,5})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:0|9[246])', - 1 => '1(?:0|9(?:2[2-9]|[46]))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:1|92)', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{4,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '0[26]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '0[13-57-9][0159]|8(?:03|4[17]|9[245])', - 1 => '0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{4})(\\d{2,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '0(?:[13-579][2-46-8]|8[236-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '894', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0[26]|5', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[4679]|[38]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{3})(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0[13-57-9][0159]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0[26]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 11 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{4,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '0[26]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '0[13-57-9][0159]|8(?:03|4[17]|9[245])', - 1 => '0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{2,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '0(?:[13-579][2-46-8]|8[236-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '894', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0[26]|5', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[4679]|[38]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0[13-57-9][0159]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0[26]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => true, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '0\\d{6,10}|55\\d{8}|[08]\\d{5}|(?:3[0-8]|8)\\d{7,9}|(?:1\\d|39)\\d{7,8}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + 5 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}', + 'ExampleNumber' => '0212345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '33\\d{9}|3[1-9]\\d{8}|3[2-9]\\d{7}', + 'ExampleNumber' => '3123456789', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + 2 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80(?:0\\d{3}|3)\\d{3}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:0878\\d\\d|89(?:2|4[5-9]\\d))\\d{3}|89[45][0-4]\\d\\d|(?:1(?:44|6[346])|89(?:5[5-9]|9))\\d{6}', + 'ExampleNumber' => '899123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '84(?:[08]\\d{3}|[17])\\d{3}', + 'ExampleNumber' => '848123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '1(?:78\\d|99)\\d{6}', + 'ExampleNumber' => '1781234567', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '55\\d{8}', + 'ExampleNumber' => '5512345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '848\\d{6}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IT', + 'countryCode' => 39, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4,5})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '1(?:0|9[246])', + 1 => '1(?:0|9(?:2[2-9]|[46]))', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{6})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '1(?:1|92)', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{4,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '0[26]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '0[13-57-9][0159]|8(?:03|4[17]|9[245])', + 1 => '0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{4})(\\d{2,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '0(?:[13-579][2-46-8]|8[236-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '894', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0[26]|5', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[4679]|[38]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{3})(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0[13-57-9][0159]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 10 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{5})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0[26]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 11 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{4,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '0[26]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '0[13-57-9][0159]|8(?:03|4[17]|9[245])', + 1 => '0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{2,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '0(?:[13-579][2-46-8]|8[236-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '894', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0[26]|5', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[4679]|[38]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0[13-57-9][0159]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{5})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0[26]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => true, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_JE.php b/lib/libphonenumber/data/PhoneNumberMetadata_JE.php index 8f509bc8..4f69154e 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_JE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_JE.php @@ -10,153 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1534\\d{6}|(?:[3578]\\d|90)\\d{8}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '1534[0-24-8]\\d{5}', - 'ExampleNumber' => '1534456789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}', - 'ExampleNumber' => '7797712345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80(?:07(?:35|81)|8901)\\d{4}', - 'ExampleNumber' => '8007354567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}', - 'ExampleNumber' => '9018105678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '701511\\d{4}', - 'ExampleNumber' => '7015115678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '56\\d{8}', - 'ExampleNumber' => '5612345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '76(?:0[0-2]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}', - 'ExampleNumber' => '7640123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}', - 'ExampleNumber' => '5512345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'JE', - 'countryCode' => 44, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0|([0-24-8]\\d{5})$', - 'nationalPrefixTransformRule' => '1534$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1534\\d{6}|(?:[3578]\\d|90)\\d{8}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '1534[0-24-8]\\d{5}', + 'ExampleNumber' => '1534456789', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}', + 'ExampleNumber' => '7797712345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80(?:07(?:35|81)|8901)\\d{4}', + 'ExampleNumber' => '8007354567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}', + 'ExampleNumber' => '9018105678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '701511\\d{4}', + 'ExampleNumber' => '7015115678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '56\\d{8}', + 'ExampleNumber' => '5612345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '76(?:0[0-2]|2[356]|4[0134]|5[49]|6[0-369]|77|81|9[39])\\d{6}', + 'ExampleNumber' => '7640123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}', + 'ExampleNumber' => '5512345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'JE', + 'countryCode' => 44, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0|([0-24-8]\\d{5})$', + 'nationalPrefixTransformRule' => '1534$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_JM.php b/lib/libphonenumber/data/PhoneNumberMetadata_JM.php index a69edba2..b808d574 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_JM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_JM.php @@ -10,151 +10,112 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|658|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:658(?:2(?:[0-8]\\d|9[0-46-9])|[3-9]\\d\\d)|876(?:5(?:02|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[0237-9]|[23]\\d|40|5[06]|6[2-589]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}', - 'ExampleNumber' => '8765230123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:658295|876(?:(?:2[14-9]|[348]\\d)\\d|5(?:0[13-9]|17|[2-57-9]\\d|6[0-24-9])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}', - 'ExampleNumber' => '8762101234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'JM', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '658|876', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[58]\\d\\d|658|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:658(?:2(?:[0-8]\\d|9[0-46-9])|[3-9]\\d\\d)|876(?:5(?:02|1[0-468]|2[35]|63)|6(?:0[1-3579]|1[0237-9]|[23]\\d|40|5[06]|6[2-589]|7[05]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}', + 'ExampleNumber' => '8765230123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:658295|876(?:(?:2[14-9]|[348]\\d)\\d|5(?:0[13-9]|17|[2-57-9]\\d|6[0-24-9])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}', + 'ExampleNumber' => '8762101234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'JM', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '658|876', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_JO.php b/lib/libphonenumber/data/PhoneNumberMetadata_JO.php index b7de9f06..fd6e1391 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_JO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_JO.php @@ -10,207 +10,160 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '900\\d{5}|(?:(?:[268]|7\\d)\\d|32|53)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:6(?:2[0-35-9]|3[0-578]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[57][023]|6[03])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2(?:[05]0|22)|3(?:00|33)|4(?:0[0-25]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[178]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[0239]))|87(?:[029]0|7[08]))\\d{4}', - 'ExampleNumber' => '62001234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7(?:55[0-49]|(?:7[025-9]|[89][0-25-9])\\d)\\d{5}', - 'ExampleNumber' => '790123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{6}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{5}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '85\\d{6}', - 'ExampleNumber' => '85012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70\\d{7}', - 'ExampleNumber' => '700123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '74(?:66|77)\\d{5}', - 'ExampleNumber' => '746612345', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '8(?:10|8\\d)\\d{5}', - 'ExampleNumber' => '88101234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'JO', - 'countryCode' => 962, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2356]|87', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{5,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '70', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '900\\d{5}|(?:(?:[268]|7\\d)\\d|32|53)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:6(?:2[0-35-9]|3[0-578]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[57][023]|6[03])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2(?:[05]0|22)|3(?:00|33)|4(?:0[0-25]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[178]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[0239]))|87(?:[029]0|7[08]))\\d{4}', + 'ExampleNumber' => '62001234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7(?:55[0-49]|(?:7[025-9]|[89][0-25-9])\\d)\\d{5}', + 'ExampleNumber' => '790123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{6}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{5}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '85\\d{6}', + 'ExampleNumber' => '85012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70\\d{7}', + 'ExampleNumber' => '700123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '74(?:66|77)\\d{5}', + 'ExampleNumber' => '746612345', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '8(?:10|8\\d)\\d{5}', + 'ExampleNumber' => '88101234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'JO', + 'countryCode' => 962, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2356]|87', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{5,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '70', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_JP.php b/lib/libphonenumber/data/PhoneNumberMetadata_JP.php index 5957f647..a2a68d44 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_JP.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_JP.php @@ -10,459 +10,374 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - 3 => 11, - 4 => 12, - 5 => 13, - 6 => 14, - 7 => 15, - 8 => 16, - 9 => 17, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|(?:2[2-9]|[36][1-9])\\d|4(?:[2-578]\\d|6[02-8]|9[2-59])|5(?:[2-589]\\d|6[1-9]|7[2-8])|7(?:[25-9]\\d|3[4-9]|4[02-9])|8(?:[2679]\\d|3[2-9]|4[5-9]|5[1-9]|8[03-9])|9(?:[2-58]\\d|[679][1-9]))\\d{6}', - 'ExampleNumber' => '312345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[7-9]0[1-9]\\d{7}', - 'ExampleNumber' => '9012345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '00(?:(?:37|66)\\d{6,13}|(?:777(?:[01]|(?:5|8\\d)\\d)|882[1245]\\d\\d)\\d\\d)|(?:120|800\\d)\\d{6}', - 'ExampleNumber' => '120123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '990\\d{6}', - 'ExampleNumber' => '990123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '60\\d{7}', - 'ExampleNumber' => '601234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '50[1-9]\\d{7}', - 'ExampleNumber' => '5012345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '20\\d{8}', - 'ExampleNumber' => '2012345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '570\\d{6}', - 'ExampleNumber' => '570123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '00(?:777(?:[01]|(?:5|8\\d)\\d)|882[1245]\\d\\d)\\d\\d|00(?:37|66)\\d{6,13}', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'JP', - 'countryCode' => 81, - 'internationalPrefix' => '010', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '007', - 1 => '0077', - 2 => '00777', - 3 => '00777[01]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:12|57|99)0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d)(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])', - 1 => '1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[78]|96)|477|51[24]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]', - 2 => '1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[78]|96[2457-9])|477|51[24]|636[2-57-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '60', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[36]|4(?:2[09]|7[01])', - 1 => '[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[279]|49|6[0-24-689]|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])', - 1 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|6(?:[0-24]|5[0-3589]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:47[59]|59[89]|8(?:6[68]|9))[019]', - 2 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|6(?:[0-24]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]', - 3 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|6(?:[0-24]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[14]|[29][2-9]|5[3-9]|7[2-4679]|8(?:[246-9]|3[3-8]|5[2-9])', - 1 => '[14]|[29][2-9]|5[3-9]|7[2-4679]|8(?:[246-9]|3(?:[3-6][2-9]|7|8[2-5])|5[2-9])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{3,4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '007', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '008', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2579]|80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 11 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3,4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 12 => - array ( - 'pattern' => '(\\d{4})(\\d{4})(\\d{4,5})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 13 => - array ( - 'pattern' => '(\\d{4})(\\d{5})(\\d{5,6})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 14 => - array ( - 'pattern' => '(\\d{4})(\\d{6})(\\d{6,7})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:12|57|99)0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d)(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])', - 1 => '1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[78]|96)|477|51[24]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]', - 2 => '1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[78]|96[2457-9])|477|51[24]|636[2-57-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '60', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[36]|4(?:2[09]|7[01])', - 1 => '[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[279]|49|6[0-24-689]|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])', - 1 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|6(?:[0-24]|5[0-3589]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:47[59]|59[89]|8(?:6[68]|9))[019]', - 2 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|6(?:[0-24]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]', - 3 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|6(?:[0-24]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[14]|[29][2-9]|5[3-9]|7[2-4679]|8(?:[246-9]|3[3-8]|5[2-9])', - 1 => '[14]|[29][2-9]|5[3-9]|7[2-4679]|8(?:[246-9]|3(?:[3-6][2-9]|7|8[2-5])|5[2-9])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '800', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2579]|80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + 3 => 11, + 4 => 12, + 5 => 13, + 6 => 14, + 7 => 15, + 8 => 16, + 9 => 17, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|(?:2[2-9]|[36][1-9])\\d|4(?:[2-578]\\d|6[02-8]|9[2-59])|5(?:[2-589]\\d|6[1-9]|7[2-8])|7(?:[25-9]\\d|3[4-9]|4[02-9])|8(?:[2679]\\d|3[2-9]|4[5-9]|5[1-9]|8[03-9])|9(?:[2-58]\\d|[679][1-9]))\\d{6}', + 'ExampleNumber' => '312345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[7-9]0[1-9]\\d{7}', + 'ExampleNumber' => '9012345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '00(?:(?:37|66)\\d{6,13}|(?:777(?:[01]|(?:5|8\\d)\\d)|882[1245]\\d\\d)\\d\\d)|(?:120|800\\d)\\d{6}', + 'ExampleNumber' => '120123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '990\\d{6}', + 'ExampleNumber' => '990123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '60\\d{7}', + 'ExampleNumber' => '601234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '50[1-9]\\d{7}', + 'ExampleNumber' => '5012345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '20\\d{8}', + 'ExampleNumber' => '2012345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '570\\d{6}', + 'ExampleNumber' => '570123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '00(?:777(?:[01]|(?:5|8\\d)\\d)|882[1245]\\d\\d)\\d\\d|00(?:37|66)\\d{6,13}', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'JP', + 'countryCode' => 81, + 'internationalPrefix' => '010', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '007', + 1 => '0077', + 2 => '00777', + 3 => '00777[01]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '(?:12|57|99)0', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d)(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])', + 1 => '1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[78]|96)|477|51[24]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]', + 2 => '1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[78]|96[2457-9])|477|51[24]|636[2-57-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '60', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[36]|4(?:2[09]|7[01])', + 1 => '[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[279]|49|6[0-24-689]|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])', + 1 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|6(?:[0-24]|5[0-3589]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:47[59]|59[89]|8(?:6[68]|9))[019]', + 2 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|6(?:[0-24]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]', + 3 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|6(?:[0-24]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[14]|[29][2-9]|5[3-9]|7[2-4679]|8(?:[246-9]|3[3-8]|5[2-9])', + 1 => '[14]|[29][2-9]|5[3-9]|7[2-4679]|8(?:[246-9]|3(?:[3-6][2-9]|7|8[2-5])|5[2-9])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{3,4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '007', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '008', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '800', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 10 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[2579]|80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 11 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3,4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 12 => [ + 'pattern' => '(\\d{4})(\\d{4})(\\d{4,5})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 13 => [ + 'pattern' => '(\\d{4})(\\d{5})(\\d{5,6})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 14 => [ + 'pattern' => '(\\d{4})(\\d{6})(\\d{6,7})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '(?:12|57|99)0', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d)(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])', + 1 => '1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[78]|96)|477|51[24]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]', + 2 => '1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[78]|96[2457-9])|477|51[24]|636[2-57-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '60', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[36]|4(?:2[09]|7[01])', + 1 => '[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[279]|49|6[0-24-689]|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])', + 1 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|6(?:[0-24]|5[0-3589]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:47[59]|59[89]|8(?:6[68]|9))[019]', + 2 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|6(?:[0-24]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]', + 3 => '1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[0468][01]|[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|2[01]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|6(?:[0-24]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[14]|[29][2-9]|5[3-9]|7[2-4679]|8(?:[246-9]|3[3-8]|5[2-9])', + 1 => '[14]|[29][2-9]|5[3-9]|7[2-4679]|8(?:[246-9]|3(?:[3-6][2-9]|7|8[2-5])|5[2-9])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '800', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[2579]|80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KE.php b/lib/libphonenumber/data/PhoneNumberMetadata_KE.php index a530c347..6152d1f1 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KE.php @@ -10,192 +10,147 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:4[245]|5[2-79]|6[01457-9])\\d{5,7}|(?:4[136]|5[08]|62)\\d{7}|(?:[24]0|51|66)\\d{6,7}', - 'ExampleNumber' => '202012345', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:1(?:0[0-2]|1[01])|7\\d\\d)\\d{6}', - 'ExampleNumber' => '712123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800[24-8]\\d{5,6}', - 'ExampleNumber' => '800223456', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[02-9]\\d{5}', - 'ExampleNumber' => '900223456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KE', - 'countryCode' => 254, - 'internationalPrefix' => '000', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{5,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[24-6]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[17]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:4[245]|5[2-79]|6[01457-9])\\d{5,7}|(?:4[136]|5[08]|62)\\d{7}|(?:[24]0|51|66)\\d{6,7}', + 'ExampleNumber' => '202012345', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:1(?:0[0-2]|1[01])|7\\d\\d)\\d{6}', + 'ExampleNumber' => '712123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800[24-8]\\d{5,6}', + 'ExampleNumber' => '800223456', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[02-9]\\d{5}', + 'ExampleNumber' => '900223456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KE', + 'countryCode' => 254, + 'internationalPrefix' => '000', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{5,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[24-6]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[17]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KG.php b/lib/libphonenumber/data/PhoneNumberMetadata_KG.php index 2bd138d9..c7618359 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KG.php @@ -10,188 +10,143 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[235-7]\\d|99)\\d{7}|800\\d{6,7}', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3(?:1(?:[256]\\d|3[1-9]|47)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}', - 'ExampleNumber' => '312123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:2(?:0[0-35]|2\\d)|5(?:0[0-57-9]|[124-7]\\d)|7(?:[07]\\d|55)|99[69])\\d{6}', - 'ExampleNumber' => '700123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6,7}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KG', - 'countryCode' => 996, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:1[346]|[24-79])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[235-79]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d)(\\d{2,3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[235-7]\\d|99)\\d{7}|800\\d{6,7}', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3(?:1(?:[256]\\d|3[1-9]|47)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}', + 'ExampleNumber' => '312123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:2(?:0[0-35]|2\\d)|5(?:0[0-57-9]|[124-7]\\d)|7(?:[07]\\d|55)|99[69])\\d{6}', + 'ExampleNumber' => '700123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6,7}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KG', + 'countryCode' => 996, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3(?:1[346]|[24-79])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[235-79]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d)(\\d{2,3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KH.php b/lib/libphonenumber/data/PhoneNumberMetadata_KH.php index d69cc52f..07f2c7a6 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KH.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KH.php @@ -10,182 +10,139 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{9}|[1-9]\\d{7,8}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '23(?:4(?:[2-4]|[56]\\d)|[568]\\d\\d)\\d{4}|23[236-9]\\d{5}|(?:2[4-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:(?:[237-9]|4[56]|5\\d)\\d{5}|6\\d{5,6})', - 'ExampleNumber' => '23756789', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}', - 'ExampleNumber' => '91234567', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1800(?:1\\d|2[019])\\d{4}', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1900(?:1\\d|2[09])\\d{4}', - 'ExampleNumber' => '1900123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KH', - 'countryCode' => 855, - 'internationalPrefix' => '00[14-9]', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{9}|[1-9]\\d{7,8}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '23(?:4(?:[2-4]|[56]\\d)|[568]\\d\\d)\\d{4}|23[236-9]\\d{5}|(?:2[4-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:(?:[237-9]|4[56]|5\\d)\\d{5}|6\\d{5,6})', + 'ExampleNumber' => '23756789', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}', + 'ExampleNumber' => '91234567', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1800(?:1\\d|2[019])\\d{4}', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1900(?:1\\d|2[09])\\d{4}', + 'ExampleNumber' => '1900123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KH', + 'countryCode' => 855, + 'internationalPrefix' => '00[14-9]', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KI.php b/lib/libphonenumber/data/PhoneNumberMetadata_KI.php index c9f085b2..1a377f8a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KI.php @@ -10,148 +10,109 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[24]\\d|3[1-9]|50|65(?:02[12]|12[56]|22[89]|[3-5]00)|7(?:27\\d\\d|3100|5(?:02[12]|12[56]|22[89]|[34](?:00|81)|500))|8[0-5])\\d{3}', - 'ExampleNumber' => '31234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '73140\\d{3}|(?:630[01]|730[0-5])\\d{4}|[67]200[01]\\d{3}', - 'ExampleNumber' => '72001234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '30(?:0[01]\\d\\d|12(?:11|20))\\d\\d', - 'ExampleNumber' => '30010000', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KI', - 'countryCode' => 686, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}', + 'PossibleLength' => [ + 0 => 5, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:[24]\\d|3[1-9]|50|65(?:02[12]|12[56]|22[89]|[3-5]00)|7(?:27\\d\\d|3100|5(?:02[12]|12[56]|22[89]|[34](?:00|81)|500))|8[0-5])\\d{3}', + 'ExampleNumber' => '31234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '73140\\d{3}|(?:630[01]|730[0-5])\\d{4}|[67]200[01]\\d{3}', + 'ExampleNumber' => '72001234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '30(?:0[01]\\d\\d|12(?:11|20))\\d\\d', + 'ExampleNumber' => '30010000', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KI', + 'countryCode' => 686, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KM.php b/lib/libphonenumber/data/PhoneNumberMetadata_KM.php index 26ff00c2..ddbea774 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KM.php @@ -10,155 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[3478]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '7[4-7]\\d{5}', - 'ExampleNumber' => '7712345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[34]\\d{6}', - 'ExampleNumber' => '3212345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '8\\d{6}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KM', - 'countryCode' => 269, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3478]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[3478]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '7[4-7]\\d{5}', + 'ExampleNumber' => '7712345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[34]\\d{6}', + 'ExampleNumber' => '3212345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '8\\d{6}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KM', + 'countryCode' => 269, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3478]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KN.php b/lib/libphonenumber/data/PhoneNumberMetadata_KN.php index 443cbb26..40a338bc 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KN.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '869(?:2(?:29|36)|302|4(?:6[015-9]|70))\\d{4}', - 'ExampleNumber' => '8692361234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '869(?:5(?:5[6-8]|6[5-7])|66\\d|76[02-7])\\d{4}', - 'ExampleNumber' => '8697652917', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KN', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-7]\\d{6})$', - 'nationalPrefixTransformRule' => '869$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '869', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '869(?:2(?:29|36)|302|4(?:6[015-9]|70))\\d{4}', + 'ExampleNumber' => '8692361234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '869(?:5(?:5[6-8]|6[5-7])|66\\d|76[02-7])\\d{4}', + 'ExampleNumber' => '8697652917', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KN', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-7]\\d{6})$', + 'nationalPrefixTransformRule' => '869$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '869', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KP.php b/lib/libphonenumber/data/PhoneNumberMetadata_KP.php index 524db964..5e7328d6 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KP.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KP.php @@ -10,188 +10,143 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '85\\d{6}|(?:19\\d|2)\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2\\d|85)\\d{6}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '19[1-3]\\d{7}', - 'ExampleNumber' => '1921234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '238[02-9]\\d{4}|2(?:[0-24-9]\\d|3[0-79])\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KP', - 'countryCode' => 850, - 'internationalPrefix' => '00|99', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '85\\d{6}|(?:19\\d|2)\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2\\d|85)\\d{6}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '19[1-3]\\d{7}', + 'ExampleNumber' => '1921234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '238[02-9]\\d{4}|2(?:[0-24-9]\\d|3[0-79])\\d{5}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KP', + 'countryCode' => 850, + 'internationalPrefix' => '00|99', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KR.php b/lib/libphonenumber/data/PhoneNumberMetadata_KR.php index b606cedf..bd2d7f4e 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KR.php @@ -10,406 +10,331 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 8, - 3 => 9, - 4 => 10, - 5 => 11, - 6 => 12, - 7 => 13, - 8 => 14, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 3, - 1 => 4, - 2 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2|3[1-3]|[46][1-4]|5[1-5])[1-9]\\d{6,7}|(?:3[1-3]|[46][1-4]|5[1-5])1\\d{2,3}', - 'ExampleNumber' => '22123456', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 8, - 3 => 9, - 4 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 3, - 1 => 4, - 2 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '1[0-26-9]\\d{7,8}', - 'ExampleNumber' => '1000000000', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '00(?:308\\d{6,7}|798\\d{7,9})|(?:00368|80)\\d{7}', - 'ExampleNumber' => '801234567', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 11, - 2 => 12, - 3 => 13, - 4 => 14, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '60[2-9]\\d{6}', - 'ExampleNumber' => '602345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '50\\d{8,9}', - 'ExampleNumber' => '5012345678', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '70\\d{8}', - 'ExampleNumber' => '7012345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '15\\d{7,8}', - 'ExampleNumber' => '1523456789', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '1(?:5(?:22|44|66|77|88|99)|6(?:[07]0|44|6[16]|88)|8(?:00|33|55|77|99))\\d{4}', - 'ExampleNumber' => '15441234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '00(?:3(?:08\\d{6,7}|68\\d{7})|798\\d{7,9})', - 'PossibleLength' => - array ( - 0 => 11, - 1 => 12, - 2 => 13, - 3 => 14, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KR', - 'countryCode' => 82, - 'internationalPrefix' => '00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0(8(?:[1-46-8]|5\\d\\d))?', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{5})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1[016-9]1', - 1 => '1[016-9]11', - 2 => '1[016-9]114', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:3[1-3]|[46][1-4]|5[1-5])1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{3,4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '60|8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1346]|5[1-5]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[57]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{5})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '003', - 1 => '0030', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{2})(\\d{5})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{5})(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d{5})(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:3[1-3]|[46][1-4]|5[1-5])1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{3,4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '60|8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1346]|5[1-5]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[57]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{5})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '0$CC-$1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 8, + 3 => 9, + 4 => 10, + 5 => 11, + 6 => 12, + 7 => 13, + 8 => 14, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 3, + 1 => 4, + 2 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2|3[1-3]|[46][1-4]|5[1-5])[1-9]\\d{6,7}|(?:3[1-3]|[46][1-4]|5[1-5])1\\d{2,3}', + 'ExampleNumber' => '22123456', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 8, + 3 => 9, + 4 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 3, + 1 => 4, + 2 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '1[0-26-9]\\d{7,8}', + 'ExampleNumber' => '1000000000', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '00(?:308\\d{6,7}|798\\d{7,9})|(?:00368|80)\\d{7}', + 'ExampleNumber' => '801234567', + 'PossibleLength' => [ + 0 => 9, + 1 => 11, + 2 => 12, + 3 => 13, + 4 => 14, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '60[2-9]\\d{6}', + 'ExampleNumber' => '602345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '50\\d{8,9}', + 'ExampleNumber' => '5012345678', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '70\\d{8}', + 'ExampleNumber' => '7012345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '15\\d{7,8}', + 'ExampleNumber' => '1523456789', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '1(?:5(?:22|44|66|77|88|99)|6(?:[07]0|44|6[16]|88)|8(?:00|33|55|77|99))\\d{4}', + 'ExampleNumber' => '15441234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '00(?:3(?:08\\d{6,7}|68\\d{7})|798\\d{7,9})', + 'PossibleLength' => [ + 0 => 11, + 1 => 12, + 2 => 13, + 3 => 14, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KR', + 'countryCode' => 82, + 'internationalPrefix' => '00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0(8(?:[1-46-8]|5\\d\\d))?', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{5})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '1[016-9]1', + 1 => '1[016-9]11', + 2 => '1[016-9]114', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3,4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '(?:3[1-3]|[46][1-4]|5[1-5])1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{3,4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '60|8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[1346]|5[1-5]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[57]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{5})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '003', + 1 => '0030', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{2})(\\d{5})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '5', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{5})(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 10 => [ + 'pattern' => '(\\d{5})(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3,4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '(?:3[1-3]|[46][1-4]|5[1-5])1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{3,4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '60|8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[1346]|5[1-5]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[57]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{5})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '5', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '0$CC-$1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KW.php b/lib/libphonenumber/data/PhoneNumberMetadata_KW.php index 04e9182b..68822975 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KW.php @@ -10,171 +10,128 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:18|[2569]\\d\\d)\\d{5}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:[23]\\d\\d|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7]))\\d{4}', - 'ExampleNumber' => '22345678', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:52(?:22|5[25])|6(?:222|70[013-9]|93[039])|9(?:11[01]|702))\\d{4}|(?:5(?:[05]\\d|1[0-7]|6[56])|6(?:0[034679]|5[015-9]|6\\d|7[67]|9[069])|9(?:0[09]|22|4[01479]|55|6[0679]|7[1-9]|8[057-9]|9\\d))\\d{5}', - 'ExampleNumber' => '50012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '18\\d{5}', - 'ExampleNumber' => '1801234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KW', - 'countryCode' => 965, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{3,4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[169]|2(?:[235]|4[1-35-9])|52', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[25]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:18|[2569]\\d\\d)\\d{5}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:[23]\\d\\d|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7]))\\d{4}', + 'ExampleNumber' => '22345678', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:52(?:22|5[25])|6(?:222|70[013-9]|93[039])|9(?:11[01]|702))\\d{4}|(?:5(?:[05]\\d|1[0-7]|6[56])|6(?:0[034679]|5[015-9]|6\\d|7[67]|9[069])|9(?:0[09]|22|4[01479]|55|6[0679]|7[1-9]|8[057-9]|9\\d))\\d{5}', + 'ExampleNumber' => '50012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '18\\d{5}', + 'ExampleNumber' => '1801234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KW', + 'countryCode' => 965, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{3,4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[169]|2(?:[235]|4[1-35-9])|52', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[25]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KY.php b/lib/libphonenumber/data/PhoneNumberMetadata_KY.php index d40ee116..539ba29b 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KY.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KY.php @@ -10,153 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:345|[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}', - 'ExampleNumber' => '3452221234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '345(?:32[1-9]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|9(?:1[67]|2[2-9]|3[689]))\\d{4}', - 'ExampleNumber' => '3453231234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:345976|900[2-9]\\d\\d)\\d{4}', - 'ExampleNumber' => '9002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '345849\\d{4}', - 'ExampleNumber' => '3458491234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KY', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', - 'nationalPrefixTransformRule' => '345$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '345', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:345|[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '345(?:2(?:22|44)|444|6(?:23|38|40)|7(?:4[35-79]|6[6-9]|77)|8(?:00|1[45]|25|[48]8)|9(?:14|4[035-9]))\\d{4}', + 'ExampleNumber' => '3452221234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '345(?:32[1-9]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|9(?:1[67]|2[2-9]|3[689]))\\d{4}', + 'ExampleNumber' => '3453231234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:345976|900[2-9]\\d\\d)\\d{4}', + 'ExampleNumber' => '9002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '345849\\d{4}', + 'ExampleNumber' => '3458491234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KY', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', + 'nationalPrefixTransformRule' => '345$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '345', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_KZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_KZ.php index c2ed77d9..b88ed934 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_KZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_KZ.php @@ -10,154 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '33622\\d{5}|(?:7\\d|80)\\d{8}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:33622|7(?:1(?:0(?:[23]\\d|4[0-3]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[0-79]|4[0-35-9]|59)|4(?:[24]\\d|3[013-9]|5[1-9])|5(?:2\\d|3[1-9]|4[0-7]|59)|6(?:[2-4]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[2-4]\\d|5[139])|4(?:2\\d|3[1-35-9]|59)|5(?:[23]\\d|4[0-246-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[2379]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59))))\\d{5}', - 'ExampleNumber' => '7123456789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7(?:0[0-25-8]|47|6[02-4]|7[15-8]|85)\\d{7}', - 'ExampleNumber' => '7710009998', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '809\\d{7}', - 'ExampleNumber' => '8091234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '808\\d{7}', - 'ExampleNumber' => '8081234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '751\\d{7}', - 'ExampleNumber' => '7511234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '751\\d{7}', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KZ', - 'countryCode' => 7, - 'internationalPrefix' => '810', - 'preferredInternationalPrefix' => '8~10', - 'nationalPrefix' => '8', - 'nationalPrefixForParsing' => '8', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '33|7', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '33622\\d{5}|(?:7\\d|80)\\d{8}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:33622|7(?:1(?:0(?:[23]\\d|4[0-3]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[0-79]|4[0-35-9]|59)|4(?:[24]\\d|3[013-9]|5[1-9])|5(?:2\\d|3[1-9]|4[0-7]|59)|6(?:[2-4]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[2-4]\\d|5[139])|4(?:2\\d|3[1-35-9]|59)|5(?:[23]\\d|4[0-246-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[2379]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59))))\\d{5}', + 'ExampleNumber' => '7123456789', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7(?:0[0-25-8]|47|6[02-4]|7[15-8]|85)\\d{7}', + 'ExampleNumber' => '7710009998', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '809\\d{7}', + 'ExampleNumber' => '8091234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '808\\d{7}', + 'ExampleNumber' => '8081234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '751\\d{7}', + 'ExampleNumber' => '7511234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '751\\d{7}', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KZ', + 'countryCode' => 7, + 'internationalPrefix' => '810', + 'preferredInternationalPrefix' => '8~10', + 'nationalPrefix' => '8', + 'nationalPrefixForParsing' => '8', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '33|7', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LA.php b/lib/libphonenumber/data/PhoneNumberMetadata_LA.php index a2134c63..8454ab08 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LA.php @@ -10,188 +10,143 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:2\\d|3)\\d{8}|(?:[235-8]\\d|41)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[13]|[35-7][14]|41|8[1468])\\d{6}', - 'ExampleNumber' => '21212862', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '20(?:[29]\\d|5[24-689]|7[6-8])\\d{6}', - 'ExampleNumber' => '2023123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '30\\d{7}', - 'ExampleNumber' => '301234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LA', - 'countryCode' => 856, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[13]|3[14]|[4-8]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:2\\d|3)\\d{8}|(?:[235-8]\\d|41)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2[13]|[35-7][14]|41|8[1468])\\d{6}', + 'ExampleNumber' => '21212862', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '20(?:[29]\\d|5[24-689]|7[6-8])\\d{6}', + 'ExampleNumber' => '2023123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '30\\d{7}', + 'ExampleNumber' => '301234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LA', + 'countryCode' => 856, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[13]|3[14]|[4-8]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LB.php b/lib/libphonenumber/data/PhoneNumberMetadata_LB.php index ebfec2e8..c01417c8 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LB.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LB.php @@ -10,174 +10,131 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[7-9]\\d{7}|[13-9]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:(?:[14-69]\\d|8[02-9])\\d|7(?:[2-57]\\d|62|8[0-7]|9[04-9]))\\d{4}', - 'ExampleNumber' => '1123456', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[89]|9[1-3]))\\d{5}', - 'ExampleNumber' => '71123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9[01]\\d{6}', - 'ExampleNumber' => '90123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '80\\d{6}', - 'ExampleNumber' => '80123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LB', - 'countryCode' => 961, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[7-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[7-9]\\d{7}|[13-9]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:(?:[14-69]\\d|8[02-9])\\d|7(?:[2-57]\\d|62|8[0-7]|9[04-9]))\\d{4}', + 'ExampleNumber' => '1123456', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[89]|9[1-3]))\\d{5}', + 'ExampleNumber' => '71123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9[01]\\d{6}', + 'ExampleNumber' => '90123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '80\\d{6}', + 'ExampleNumber' => '80123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LB', + 'countryCode' => 961, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[7-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LC.php b/lib/libphonenumber/data/PhoneNumberMetadata_LC.php index 9bfa2b37..64828940 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LC.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LC.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|758|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '758(?:4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|638)\\d{4}', - 'ExampleNumber' => '7584305678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[01]))\\d{4}', - 'ExampleNumber' => '7582845678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LC', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-7]\\d{6})$', - 'nationalPrefixTransformRule' => '758$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '758', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[58]\\d\\d|758|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '758(?:4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|638)\\d{4}', + 'ExampleNumber' => '7584305678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[01]))\\d{4}', + 'ExampleNumber' => '7582845678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LC', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-7]\\d{6})$', + 'nationalPrefixTransformRule' => '758$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '758', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LI.php b/lib/libphonenumber/data/PhoneNumberMetadata_LI.php index eae695d0..de8db3fa 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LI.php @@ -10,190 +10,145 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '90\\d{5}|(?:[2378]|6\\d\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:01|1[27]|22|3\\d|6[02-578]|96)|3(?:33|40|7[0135-7]|8[048]|9[0269]))\\d{4}', - 'ExampleNumber' => '2345678', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '756\\d{4}|(?:6(?:499|5[0-3]\\d|6(?:0[0-7]|10|2[06-9]|39))|7[37-9])\\d{5}', - 'ExampleNumber' => '660234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80(?:02[28]|9\\d\\d)\\d\\d', - 'ExampleNumber' => '8002222', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d', - 'ExampleNumber' => '9002222', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '870(?:28|87)\\d\\d', - 'ExampleNumber' => '8702812', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '697(?:56|[78]\\d)\\d{4}', - 'ExampleNumber' => '697861234', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LI', - 'countryCode' => 423, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0|(10(?:01|20|66))', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[237-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '69', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '90\\d{5}|(?:[2378]|6\\d\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:01|1[27]|22|3\\d|6[02-578]|96)|3(?:33|40|7[0135-7]|8[048]|9[0269]))\\d{4}', + 'ExampleNumber' => '2345678', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '756\\d{4}|(?:6(?:499|5[0-3]\\d|6(?:0[0-7]|10|2[06-9]|39))|7[37-9])\\d{5}', + 'ExampleNumber' => '660234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80(?:02[28]|9\\d\\d)\\d\\d', + 'ExampleNumber' => '8002222', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d', + 'ExampleNumber' => '9002222', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '870(?:28|87)\\d\\d', + 'ExampleNumber' => '8702812', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '697(?:56|[78]\\d)\\d{4}', + 'ExampleNumber' => '697861234', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LI', + 'countryCode' => 423, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0|(10(?:01|20|66))', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[237-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '69', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LK.php b/lib/libphonenumber/data/PhoneNumberMetadata_LK.php index 7e44d891..9eb820af 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LK.php @@ -10,171 +10,128 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[1-7]\\d|[89]1)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[189]1|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}', - 'ExampleNumber' => '112345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[0-25-8]\\d{7}', - 'ExampleNumber' => '712345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '1973\\d{5}', - 'ExampleNumber' => '197312345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LK', - 'countryCode' => 94, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-689]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[1-7]\\d|[89]1)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:[189]1|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}', + 'ExampleNumber' => '112345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[0-25-8]\\d{7}', + 'ExampleNumber' => '712345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '1973\\d{5}', + 'ExampleNumber' => '197312345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LK', + 'countryCode' => 94, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-689]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LR.php b/lib/libphonenumber/data/PhoneNumberMetadata_LR.php index c1011835..4ba77aee 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LR.php @@ -10,188 +10,143 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:2|33|5\\d|77|88)\\d{7}|[45]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2\\d{3}|33333)\\d{4}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:(?:330|555|(?:77|88)\\d)\\d|4[67])\\d{5}|5\\d{6}', - 'ExampleNumber' => '770123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '332(?:02|[34]\\d)\\d{4}', - 'ExampleNumber' => '332021234', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LR', - 'countryCode' => 231, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[45]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3578]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:2|33|5\\d|77|88)\\d{7}|[45]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2\\d{3}|33333)\\d{4}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:(?:330|555|(?:77|88)\\d)\\d|4[67])\\d{5}|5\\d{6}', + 'ExampleNumber' => '770123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '332(?:02|[34]\\d)\\d{4}', + 'ExampleNumber' => '332021234', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LR', + 'countryCode' => 231, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[45]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3578]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LS.php b/lib/libphonenumber/data/PhoneNumberMetadata_LS.php index 88b6f1fe..07e9ea13 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LS.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LS.php @@ -10,155 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[256]\\d\\d|800)\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2\\d{7}', - 'ExampleNumber' => '22123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[56]\\d{7}', - 'ExampleNumber' => '50123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800[256]\\d{4}', - 'ExampleNumber' => '80021234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LS', - 'countryCode' => 266, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2568]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[256]\\d\\d|800)\\d{5}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2\\d{7}', + 'ExampleNumber' => '22123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[56]\\d{7}', + 'ExampleNumber' => '50123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800[256]\\d{4}', + 'ExampleNumber' => '80021234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LS', + 'countryCode' => 266, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2568]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LT.php b/lib/libphonenumber/data/PhoneNumberMetadata_LT.php index e7d95f7f..e9221cbd 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LT.php @@ -10,197 +10,150 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[3469]\\d|52|[78]0)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3[1478]|4[124-6]|52)\\d{6}', - 'ExampleNumber' => '31234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6\\d{7}', - 'ExampleNumber' => '61234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9(?:0[0239]|10)\\d{5}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '808\\d{5}', - 'ExampleNumber' => '80812345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '700\\d{5}', - 'ExampleNumber' => '70012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '70[67]\\d{5}', - 'ExampleNumber' => '70712345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LT', - 'countryCode' => 370, - 'internationalPrefix' => '00', - 'nationalPrefix' => '8', - 'nationalPrefixForParsing' => '[08]', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '52[0-79]', - ), - 'nationalPrefixFormattingRule' => '(8-$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[7-9]', - ), - 'nationalPrefixFormattingRule' => '8 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '37|4(?:[15]|6[1-8])', - ), - 'nationalPrefixFormattingRule' => '(8-$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-6]', - ), - 'nationalPrefixFormattingRule' => '(8-$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[3469]\\d|52|[78]0)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3[1478]|4[124-6]|52)\\d{6}', + 'ExampleNumber' => '31234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6\\d{7}', + 'ExampleNumber' => '61234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9(?:0[0239]|10)\\d{5}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '808\\d{5}', + 'ExampleNumber' => '80812345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '700\\d{5}', + 'ExampleNumber' => '70012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '70[67]\\d{5}', + 'ExampleNumber' => '70712345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LT', + 'countryCode' => 370, + 'internationalPrefix' => '00', + 'nationalPrefix' => '8', + 'nationalPrefixForParsing' => '[08]', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '52[0-79]', + ], + 'nationalPrefixFormattingRule' => '(8-$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[7-9]', + ], + 'nationalPrefixFormattingRule' => '8 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '37|4(?:[15]|6[1-8])', + ], + 'nationalPrefixFormattingRule' => '(8-$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[3-6]', + ], + 'nationalPrefixFormattingRule' => '(8-$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LU.php b/lib/libphonenumber/data/PhoneNumberMetadata_LU.php index 92cd8f2e..cbd45861 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LU.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LU.php @@ -10,273 +10,216 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - 4 => 8, - 5 => 9, - 6 => 10, - 7 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:35[013-9]|80[2-9]|90[89])\\d{1,8}|(?:2[2-9]|3[0-46-9]|[457]\\d|8[13-9]|9[2-579])\\d{2,9}', - 'ExampleNumber' => '27123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6(?:[269][18]|5[158]|7[189]|81)\\d{6}', - 'ExampleNumber' => '628123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[015]\\d{5}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '801\\d{5}', - 'ExampleNumber' => '80112345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '20(?:1\\d{5}|[2-689]\\d{1,7})', - 'ExampleNumber' => '20201234', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - 4 => 8, - 5 => 9, - 6 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LU', - 'countryCode' => 352, - 'internationalPrefix' => '00', - 'nationalPrefixForParsing' => '(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '20[2-689]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:[0367]|4[3-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '80[01]|90[015]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '20', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:[0367]|4[3-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 7, + 4 => 8, + 5 => 9, + 6 => 10, + 7 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:35[013-9]|80[2-9]|90[89])\\d{1,8}|(?:2[2-9]|3[0-46-9]|[457]\\d|8[13-9]|9[2-579])\\d{2,9}', + 'ExampleNumber' => '27123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6(?:[269][18]|5[158]|7[189]|81)\\d{6}', + 'ExampleNumber' => '628123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[015]\\d{5}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '801\\d{5}', + 'ExampleNumber' => '80112345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '20(?:1\\d{5}|[2-689]\\d{1,7})', + 'ExampleNumber' => '20201234', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 7, + 4 => 8, + 5 => 9, + 6 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LU', + 'countryCode' => 352, + 'internationalPrefix' => '00', + 'nationalPrefixForParsing' => '(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '20[2-689]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2(?:[0367]|4[3-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '80[01]|90[015]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '20', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '2(?:[0367]|4[3-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LV.php b/lib/libphonenumber/data/PhoneNumberMetadata_LV.php index 6a845127..9c046880 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LV.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LV.php @@ -10,157 +10,116 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[268]\\d|90)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '6\\d{7}', - 'ExampleNumber' => '63123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '2\\d{7}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{6}', - 'ExampleNumber' => '80123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90\\d{6}', - 'ExampleNumber' => '90123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '81\\d{6}', - 'ExampleNumber' => '81123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LV', - 'countryCode' => 371, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[269]|8[01]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[268]\\d|90)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '6\\d{7}', + 'ExampleNumber' => '63123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '2\\d{7}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{6}', + 'ExampleNumber' => '80123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90\\d{6}', + 'ExampleNumber' => '90123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '81\\d{6}', + 'ExampleNumber' => '81123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LV', + 'countryCode' => 371, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[269]|8[01]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_LY.php b/lib/libphonenumber/data/PhoneNumberMetadata_LY.php index f78e94a6..a5c5d2ce 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_LY.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_LY.php @@ -10,158 +10,117 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2569]\\d|71)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[13-5]|5[1347]|6[1-479]|71)\\d{7}', - 'ExampleNumber' => '212345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9[1-6]\\d{7}', - 'ExampleNumber' => '912345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LY', - 'countryCode' => 218, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[25-79]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2569]\\d|71)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2[13-5]|5[1347]|6[1-479]|71)\\d{7}', + 'ExampleNumber' => '212345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9[1-6]\\d{7}', + 'ExampleNumber' => '912345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LY', + 'countryCode' => 218, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{7})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[25-79]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MA.php b/lib/libphonenumber/data/PhoneNumberMetadata_MA.php index 75d97a5f..85d06e85 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MA.php @@ -10,208 +10,159 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[5-8]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '5(?:2(?:[015-79]\\d|2[02-9]|3[2-57]|4[2-8]|8[235-7])|3(?:[0-48]\\d|[57][2-9]|6[2-8]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}', - 'ExampleNumber' => '520123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:6(?:[0-79]\\d|8[0-247-9])|7(?:0[06-8]|6[1267]|7[0-27]))\\d{6}', - 'ExampleNumber' => '650123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{7}', - 'ExampleNumber' => '801234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '89\\d{7}', - 'ExampleNumber' => '891234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '5924[01]\\d{4}', - 'ExampleNumber' => '592401234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MA', - 'countryCode' => 212, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{5})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '5(?:29|38)', - 1 => '5(?:29|38)[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '5[45]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{5})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '5(?:2[2-489]|3[5-9]|9)|892', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{6})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[5-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => true, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[5-8]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '5(?:2(?:[015-79]\\d|2[02-9]|3[2-57]|4[2-8]|8[235-7])|3(?:[0-48]\\d|[57][2-9]|6[2-8]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}', + 'ExampleNumber' => '520123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:6(?:[0-79]\\d|8[0-247-9])|7(?:0[06-8]|6[1267]|7[0-27]))\\d{6}', + 'ExampleNumber' => '650123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{7}', + 'ExampleNumber' => '801234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '89\\d{7}', + 'ExampleNumber' => '891234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '5924[01]\\d{4}', + 'ExampleNumber' => '592401234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MA', + 'countryCode' => 212, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{5})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '5(?:29|38)', + 1 => '5(?:29|38)[89]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '5[45]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{5})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '5(?:2[2-489]|3[5-9]|9)|892', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{7})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{6})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[5-7]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => true, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MC.php b/lib/libphonenumber/data/PhoneNumberMetadata_MC.php index c9faab28..95073921 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MC.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MC.php @@ -10,233 +10,180 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '870\\d{5}|(?:[349]|6\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:870|9[2-47-9]\\d)\\d{5}', - 'ExampleNumber' => '99123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '4(?:4\\d|5[1-9])\\d{5}|(?:3|6\\d)\\d{7}', - 'ExampleNumber' => '612345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '90\\d{6}', - 'ExampleNumber' => '90123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '870\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MC', - 'countryCode' => 377, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '4', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[39]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '4', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[39]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '870\\d{5}|(?:[349]|6\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:870|9[2-47-9]\\d)\\d{5}', + 'ExampleNumber' => '99123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '4(?:4\\d|5[1-9])\\d{5}|(?:3|6\\d)\\d{7}', + 'ExampleNumber' => '612345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '90\\d{6}', + 'ExampleNumber' => '90123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '870\\d{5}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MC', + 'countryCode' => 377, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '4', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[39]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '4', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[39]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MD.php b/lib/libphonenumber/data/PhoneNumberMetadata_MD.php index 0d149124..6ba8d959 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MD.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MD.php @@ -10,185 +10,140 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[235-7]\\d|[89]0)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:(?:2[1-9]|3[1-79])\\d|5(?:33|5[257]))\\d{5}', - 'ExampleNumber' => '22212345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:562|6\\d\\d|7(?:[189]\\d|6[07]|7[457-9]))\\d{5}', - 'ExampleNumber' => '62112345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[056]\\d{5}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '808\\d{5}', - 'ExampleNumber' => '80812345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '3[08]\\d{6}', - 'ExampleNumber' => '30123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '803\\d{5}', - 'ExampleNumber' => '80312345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MD', - 'countryCode' => 373, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '22|3', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[25-7]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[235-7]\\d|[89]0)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:(?:2[1-9]|3[1-79])\\d|5(?:33|5[257]))\\d{5}', + 'ExampleNumber' => '22212345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:562|6\\d\\d|7(?:[189]\\d|6[07]|7[457-9]))\\d{5}', + 'ExampleNumber' => '62112345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[056]\\d{5}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '808\\d{5}', + 'ExampleNumber' => '80812345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '3[08]\\d{6}', + 'ExampleNumber' => '30123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '803\\d{5}', + 'ExampleNumber' => '80312345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MD', + 'countryCode' => 373, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '22|3', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[25-7]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ME.php b/lib/libphonenumber/data/PhoneNumberMetadata_ME.php index ab4674b3..b887cc01 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ME.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ME.php @@ -10,168 +10,127 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:20[2-8]|3(?:[0-2][2-7]|3[24-7])|4(?:0[2-467]|1[2467])|5(?:[01][2467]|2[2-467]))\\d{5}', - 'ExampleNumber' => '30234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6(?:00|3[024]|6[0-25]|[7-9]\\d)\\d{5}', - 'ExampleNumber' => '67622901', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80(?:[0-2578]|9\\d)\\d{5}', - 'ExampleNumber' => '80080002', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9(?:4[1568]|5[178])\\d{5}', - 'ExampleNumber' => '94515151', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '78[1-49]\\d{5}', - 'ExampleNumber' => '78108780', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '77[1-9]\\d{5}', - 'ExampleNumber' => '77273012', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ME', - 'countryCode' => 382, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:20[2-8]|3(?:[0-2][2-7]|3[24-7])|4(?:0[2-467]|1[2467])|5(?:[01][2467]|2[2-467]))\\d{5}', + 'ExampleNumber' => '30234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6(?:00|3[024]|6[0-25]|[7-9]\\d)\\d{5}', + 'ExampleNumber' => '67622901', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80(?:[0-2578]|9\\d)\\d{5}', + 'ExampleNumber' => '80080002', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9(?:4[1568]|5[178])\\d{5}', + 'ExampleNumber' => '94515151', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '78[1-49]\\d{5}', + 'ExampleNumber' => '78108780', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '77[1-9]\\d{5}', + 'ExampleNumber' => '77273012', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ME', + 'countryCode' => 382, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MF.php b/lib/libphonenumber/data/PhoneNumberMetadata_MF.php index c19b3d71..a160f700 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MF.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MF.php @@ -10,144 +10,105 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:590|69\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}', - 'ExampleNumber' => '590271234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '69(?:0\\d\\d|1(?:2[29]|3[0-5]))\\d{4}', - 'ExampleNumber' => '690001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MF', - 'countryCode' => 590, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:590|69\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}', + 'ExampleNumber' => '590271234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '69(?:0\\d\\d|1(?:2[29]|3[0-5]))\\d{4}', + 'ExampleNumber' => '690001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MF', + 'countryCode' => 590, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MG.php b/lib/libphonenumber/data/PhoneNumberMetadata_MG.php index 826fc3a8..3866aea5 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MG.php @@ -10,160 +10,119 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[23]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2072[29]\\d{4}|20(?:2\\d|4[47]|5[3467]|6[279]|7[35]|8[268]|9[245])\\d{5}', - 'ExampleNumber' => '202123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '3[2-49]\\d{7}', - 'ExampleNumber' => '321234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '22\\d{7}', - 'ExampleNumber' => '221234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MG', - 'countryCode' => 261, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0|([24-9]\\d{6})$', - 'nationalPrefixTransformRule' => '20$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[23]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[23]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2072[29]\\d{4}|20(?:2\\d|4[47]|5[3467]|6[279]|7[35]|8[268]|9[245])\\d{5}', + 'ExampleNumber' => '202123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '3[2-49]\\d{7}', + 'ExampleNumber' => '321234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '22\\d{7}', + 'ExampleNumber' => '221234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MG', + 'countryCode' => 261, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0|([24-9]\\d{6})$', + 'nationalPrefixTransformRule' => '20$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[23]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MH.php b/lib/libphonenumber/data/PhoneNumberMetadata_MH.php index 8581495b..f5f4a3b4 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MH.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MH.php @@ -10,157 +10,116 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '329\\d{4}|(?:[256]\\d|45)\\d{5}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:247|528|625)\\d{4}', - 'ExampleNumber' => '2471234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:(?:23|54)5|329|45[56])\\d{4}', - 'ExampleNumber' => '2351234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '635\\d{4}', - 'ExampleNumber' => '6351234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MH', - 'countryCode' => 692, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-6]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '329\\d{4}|(?:[256]\\d|45)\\d{5}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:247|528|625)\\d{4}', + 'ExampleNumber' => '2471234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:(?:23|54)5|329|45[56])\\d{4}', + 'ExampleNumber' => '2351234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '635\\d{4}', + 'ExampleNumber' => '6351234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MH', + 'countryCode' => 692, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[2-6]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MK.php b/lib/libphonenumber/data/PhoneNumberMetadata_MK.php index 64acea95..e739f60c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MK.php @@ -10,187 +10,142 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-578]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:[23]\\d|5[0-24578]|6[01]|82)|3(?:1[3-68]|[23][2-68]|4[23568])|4(?:[23][2-68]|4[3-68]|5[2568]|6[25-8]|7[24-68]|8[4-68]))\\d{5}', - 'ExampleNumber' => '22012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7(?:(?:[0-25-8]\\d|3[2-4]|9[23])\\d|421)\\d{4}', - 'ExampleNumber' => '72345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '5[02-9]\\d{6}', - 'ExampleNumber' => '50012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '8(?:0[1-9]|[1-9]\\d)\\d{5}', - 'ExampleNumber' => '80123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MK', - 'countryCode' => 389, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[347]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[58]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-578]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:[23]\\d|5[0-24578]|6[01]|82)|3(?:1[3-68]|[23][2-68]|4[23568])|4(?:[23][2-68]|4[3-68]|5[2568]|6[25-8]|7[24-68]|8[4-68]))\\d{5}', + 'ExampleNumber' => '22012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7(?:(?:[0-25-8]\\d|3[2-4]|9[23])\\d|421)\\d{4}', + 'ExampleNumber' => '72345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '5[02-9]\\d{6}', + 'ExampleNumber' => '50012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '8(?:0[1-9]|[1-9]\\d)\\d{5}', + 'ExampleNumber' => '80123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MK', + 'countryCode' => 389, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[347]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[58]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ML.php b/lib/libphonenumber/data/PhoneNumberMetadata_ML.php index 43e4f314..abba7fcc 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ML.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ML.php @@ -10,180 +10,135 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[246-9]\\d|50)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:07[0-8]|12[67])\\d{4}|(?:2(?:02|1[4-689])|4(?:0[0-4]|4[1-39]))\\d{5}', - 'ExampleNumber' => '20212345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '2(?:079|17\\d)\\d{4}|(?:50|[679]\\d|8[239])\\d{6}', - 'ExampleNumber' => '65012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{6}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '80\\d{6}', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ML', - 'countryCode' => 223, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '67[057-9]|74[045]', - 1 => '67(?:0[09]|[59]9|77|8[89])|74(?:0[02]|44|55)', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[24-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[24-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[246-9]\\d|50)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:07[0-8]|12[67])\\d{4}|(?:2(?:02|1[4-689])|4(?:0[0-4]|4[1-39]))\\d{5}', + 'ExampleNumber' => '20212345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '2(?:079|17\\d)\\d{4}|(?:50|[679]\\d|8[239])\\d{6}', + 'ExampleNumber' => '65012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{6}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '80\\d{6}', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ML', + 'countryCode' => 223, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '67[057-9]|74[045]', + 1 => '67(?:0[09]|[59]9|77|8[89])|74(?:0[02]|44|55)', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[24-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[24-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MM.php b/lib/libphonenumber/data/PhoneNumberMetadata_MM.php index 8296cd96..bad176ac 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MM.php @@ -10,270 +10,213 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:(?:2\\d|3[56]|[89][0-6])\\d|4(?:2[2-469]|39|46|6[25]|7[0-2])|6)|2(?:2(?:00|8[34])|4(?:0\\d|2[246]|39|46|62|7[0-2])|51\\d\\d)|4(?:2(?:2\\d\\d|48[0-2])|[34]20\\d)|6(?:0(?:[23]|88\\d)|(?:124|320|[56]2\\d)\\d|247[23]|4(?:2[04]\\d|47[23])|7(?:(?:3\\d|8[01459])\\d|4(?:39|60|7[01])))|8(?:[1-3]2\\d|5(?:2\\d|4[1-9]))\\d)\\d{4}|5(?:2(?:2\\d{5,6}|47[023]\\d{4})|(?:347[23]|42(?:1|86)|(?:522|820)\\d|7(?:20\\d|48[0-2])|9(?:20\\d|47[01]))\\d{4})|7(?:120\\d{4,5}|(?:425\\d|5(?:202|96\\d))\\d{4})|(?:(?:1[2-6]\\d|4(?:2[24-8]|356|[46][2-6]|5[35])|5(?:[27][2-8]|3[2-68]|4[25-8]|5[23]|6[2-4]|8[25-7]|9[2-7])|6(?:[19]20|42[03-6]|(?:52|7[45])\\d)|7(?:[04][25-8]|[15][235-7]|22|3[2-4]))\\d|8(?:[135]2\\d\\d|2(?:2\\d\\d|320)))\\d{3}|25\\d{5,6}|(?:2[2-9]|43[235-7]|6(?:1[2356]|[24][2-6]|3[256]|5[2-4]|6[2-8]|7[235-7]|8[245]|9[24])|8(?:1[235689]|2[2-8]|32|4[24-7]|5[245]|6[23]))\\d{4}|(?:4[35]|5[48]|63|7[0145]|8[13])470\\d{4}|(?:4[35]|5[48]|63|7[0145]|8[13])4\\d{4}', - 'ExampleNumber' => '1234567', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6[89]|89)\\d|7(?:3|5[0-2]|[6-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6]|9(?:[089]|[5-7]\\d\\d))\\d)\\d{4}|9[69]1\\d{6}|9[68]\\d{6}', - 'ExampleNumber' => '92123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80080(?:[01][1-9]|2\\d)\\d{3}', - 'ExampleNumber' => '8008001234', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '1333\\d{4}|[12]468\\d{4}', - 'ExampleNumber' => '13331234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MM', - 'countryCode' => 95, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '16|2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[4-7]|8[1-35]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4,6})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9(?:2[0-4]|[35-9]|4[137-9])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '92', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d)(\\d{5})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:(?:2\\d|3[56]|[89][0-6])\\d|4(?:2[2-469]|39|46|6[25]|7[0-2])|6)|2(?:2(?:00|8[34])|4(?:0\\d|2[246]|39|46|62|7[0-2])|51\\d\\d)|4(?:2(?:2\\d\\d|48[0-2])|[34]20\\d)|6(?:0(?:[23]|88\\d)|(?:124|320|[56]2\\d)\\d|247[23]|4(?:2[04]\\d|47[23])|7(?:(?:3\\d|8[01459])\\d|4(?:39|60|7[01])))|8(?:[1-3]2\\d|5(?:2\\d|4[1-9]))\\d)\\d{4}|5(?:2(?:2\\d{5,6}|47[023]\\d{4})|(?:347[23]|42(?:1|86)|(?:522|820)\\d|7(?:20\\d|48[0-2])|9(?:20\\d|47[01]))\\d{4})|7(?:120\\d{4,5}|(?:425\\d|5(?:202|96\\d))\\d{4})|(?:(?:1[2-6]\\d|4(?:2[24-8]|356|[46][2-6]|5[35])|5(?:[27][2-8]|3[2-68]|4[25-8]|5[23]|6[2-4]|8[25-7]|9[2-7])|6(?:[19]20|42[03-6]|(?:52|7[45])\\d)|7(?:[04][25-8]|[15][235-7]|22|3[2-4]))\\d|8(?:[135]2\\d\\d|2(?:2\\d\\d|320)))\\d{3}|25\\d{5,6}|(?:2[2-9]|43[235-7]|6(?:1[2356]|[24][2-6]|3[256]|5[2-4]|6[2-8]|7[235-7]|8[245]|9[24])|8(?:1[235689]|2[2-8]|32|4[24-7]|5[245]|6[23]))\\d{4}|(?:4[35]|5[48]|63|7[0145]|8[13])470\\d{4}|(?:4[35]|5[48]|63|7[0145]|8[13])4\\d{4}', + 'ExampleNumber' => '1234567', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6[89]|89)\\d|7(?:3|5[0-2]|[6-9]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6]|9(?:[089]|[5-7]\\d\\d))\\d)\\d{4}|9[69]1\\d{6}|9[68]\\d{6}', + 'ExampleNumber' => '92123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80080(?:[01][1-9]|2\\d)\\d{3}', + 'ExampleNumber' => '8008001234', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '1333\\d{4}|[12]468\\d{4}', + 'ExampleNumber' => '13331234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MM', + 'countryCode' => 95, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '16|2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[12]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[4-7]|8[1-35]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4,6})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9(?:2[0-4]|[35-9]|4[137-9])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '92', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d)(\\d{5})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MN.php b/lib/libphonenumber/data/PhoneNumberMetadata_MN.php index 16593db7..ea7dad4f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MN.php @@ -10,216 +10,167 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[12]\\d{7,9}|[57-9]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[12](?:3[2-8]|4[2-68]|5[1-4689])\\d{6,7}|(?:11(?:3\\d|4[568])|(?:(?:21|5[0568])\\d|70[0-5])\\d)\\d{4}|[12]2(?:[1-3]\\d{5,6}|7\\d{6})', - 'ExampleNumber' => '50123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:8(?:[05689]\\d|3[01])|9(?:[014-9]\\d|20|3[0-4]))\\d{5}', - 'ExampleNumber' => '88123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '7(?:100|5(?:0[0579]|1[015]|[389]5|[57][57])|(?:6[0167]|7\\d|8[01])\\d)\\d{4}', - 'ExampleNumber' => '75153456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MN', - 'countryCode' => 976, - 'internationalPrefix' => '001', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[57-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{5,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]2[1-3]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{5,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[12](?:27|3[2-8]|4[2-68]|5[1-4689])', - 1 => '[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{5})(\\d{4,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[12]\\d{7,9}|[57-9]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + 2 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[12](?:3[2-8]|4[2-68]|5[1-4689])\\d{6,7}|(?:11(?:3\\d|4[568])|(?:(?:21|5[0568])\\d|70[0-5])\\d)\\d{4}|[12]2(?:[1-3]\\d{5,6}|7\\d{6})', + 'ExampleNumber' => '50123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + 2 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:8(?:[05689]\\d|3[01])|9(?:[014-9]\\d|20|3[0-4]))\\d{5}', + 'ExampleNumber' => '88123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '7(?:100|5(?:0[0579]|1[015]|[389]5|[57][57])|(?:6[0167]|7\\d|8[01])\\d)\\d{4}', + 'ExampleNumber' => '75153456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MN', + 'countryCode' => 976, + 'internationalPrefix' => '001', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[12]1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[57-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{5,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[12]2[1-3]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{5,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[12](?:27|3[2-8]|4[2-68]|5[1-4689])', + 1 => '[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{5})(\\d{4,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[12]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MO.php b/lib/libphonenumber/data/PhoneNumberMetadata_MO.php index c6eed27e..1472814a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MO.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:28|[68]\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:28[2-57-9]|8(?:11|[2-57-9]\\d))\\d{5}', - 'ExampleNumber' => '28212345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6(?:[2356]\\d\\d|8(?:[02][5-9]|[1478]\\d|[356][0-4]))\\d{4}', - 'ExampleNumber' => '66123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MO', - 'countryCode' => 853, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[268]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:28|[68]\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:28[2-57-9]|8(?:11|[2-57-9]\\d))\\d{5}', + 'ExampleNumber' => '28212345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6(?:[2356]\\d\\d|8(?:[02][5-9]|[1478]\\d|[356][0-4]))\\d{4}', + 'ExampleNumber' => '66123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MO', + 'countryCode' => 853, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[268]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MP.php b/lib/libphonenumber/data/PhoneNumberMetadata_MP.php index 3b8813f7..19c77469 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MP.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MP.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[58]\\d{9}|(?:67|90)0\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}', - 'ExampleNumber' => '6702345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}', - 'ExampleNumber' => '6702345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MP', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', - 'nationalPrefixTransformRule' => '670$1', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '670', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[58]\\d{9}|(?:67|90)0\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}', + 'ExampleNumber' => '6702345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '670(?:2(?:3[3-7]|56|8[5-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}', + 'ExampleNumber' => '6702345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MP', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', + 'nationalPrefixTransformRule' => '670$1', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '670', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MQ.php b/lib/libphonenumber/data/PhoneNumberMetadata_MQ.php index b6baa26c..c2566255 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MQ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MQ.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:596|69\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '596(?:0[0-7]|10|2[7-9]|3[05-9]|4[0-46-8]|[5-7]\\d|8[09]|9[4-8])\\d{4}', - 'ExampleNumber' => '596301234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '69(?:6(?:[0-47-9]\\d|5[0-6]|6[0-4])|727)\\d{4}', - 'ExampleNumber' => '696201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MQ', - 'countryCode' => 596, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[56]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:596|69\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '596(?:0[0-7]|10|2[7-9]|3[05-9]|4[0-46-8]|[5-7]\\d|8[09]|9[4-8])\\d{4}', + 'ExampleNumber' => '596301234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '69(?:6(?:[0-47-9]\\d|5[0-6]|6[0-4])|727)\\d{4}', + 'ExampleNumber' => '696201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MQ', + 'countryCode' => 596, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[56]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MR.php b/lib/libphonenumber/data/PhoneNumberMetadata_MR.php index 79788349..f31c211c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MR.php @@ -10,155 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2-4]\\d\\d|800)\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:25[08]|35\\d|45[1-7])\\d{5}', - 'ExampleNumber' => '35123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[2-4][0-46-9]\\d{6}', - 'ExampleNumber' => '22123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MR', - 'countryCode' => 222, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-48]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2-4]\\d\\d|800)\\d{5}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:25[08]|35\\d|45[1-7])\\d{5}', + 'ExampleNumber' => '35123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[2-4][0-46-9]\\d{6}', + 'ExampleNumber' => '22123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MR', + 'countryCode' => 222, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[2-48]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MS.php b/lib/libphonenumber/data/PhoneNumberMetadata_MS.php index b3c5261d..2baea8e2 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MS.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MS.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '66449\\d{5}|(?:[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '664491\\d{4}', - 'ExampleNumber' => '6644912345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '66449[2-6]\\d{4}', - 'ExampleNumber' => '6644923456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MS', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|(4\\d{6})$', - 'nationalPrefixTransformRule' => '664$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '664', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '66449\\d{5}|(?:[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '664491\\d{4}', + 'ExampleNumber' => '6644912345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '66449[2-6]\\d{4}', + 'ExampleNumber' => '6644923456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MS', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|(4\\d{6})$', + 'nationalPrefixTransformRule' => '664$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '664', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MT.php b/lib/libphonenumber/data/PhoneNumberMetadata_MT.php index 4212b5ee..74005686 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MT.php @@ -10,159 +10,118 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '203[1-4]\\d{4}|2(?:0[169]|[1-357]\\d)\\d{5}', - 'ExampleNumber' => '21001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:7(?:210|[79]\\d\\d)|9(?:2(?:1[01]|31)|69[67]|8(?:1[1-3]|89|97)|9\\d\\d))\\d{4}', - 'ExampleNumber' => '96961234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800[3467]\\d{4}', - 'ExampleNumber' => '80071234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '5(?:0(?:0(?:37|43)|(?:6\\d|70|9[0168])\\d)|[12]\\d0[1-5])\\d{3}', - 'ExampleNumber' => '50037123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '3550\\d{4}', - 'ExampleNumber' => '35501234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '7117\\d{4}', - 'ExampleNumber' => '71171234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '501\\d{5}', - 'ExampleNumber' => '50112345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MT', - 'countryCode' => 356, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2357-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '203[1-4]\\d{4}|2(?:0[169]|[1-357]\\d)\\d{5}', + 'ExampleNumber' => '21001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:7(?:210|[79]\\d\\d)|9(?:2(?:1[01]|31)|69[67]|8(?:1[1-3]|89|97)|9\\d\\d))\\d{4}', + 'ExampleNumber' => '96961234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800[3467]\\d{4}', + 'ExampleNumber' => '80071234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '5(?:0(?:0(?:37|43)|(?:6\\d|70|9[0168])\\d)|[12]\\d0[1-5])\\d{3}', + 'ExampleNumber' => '50037123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '3550\\d{4}', + 'ExampleNumber' => '35501234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '7117\\d{4}', + 'ExampleNumber' => '71171234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '501\\d{5}', + 'ExampleNumber' => '50112345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MT', + 'countryCode' => 356, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2357-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MU.php b/lib/libphonenumber/data/PhoneNumberMetadata_MU.php index 3794cdcd..32f16ef2 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MU.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MU.php @@ -10,175 +10,132 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2-468]|5\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:[03478]\\d|1[0-7]|6[0-79])|4(?:[013568]\\d|2[4-7])|54(?:[34]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}', - 'ExampleNumber' => '54480123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|5(?:2[589]|4[3489]|7\\d|8[0-689]|9[0-8])\\d{5}', - 'ExampleNumber' => '52512345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[0-2]\\d{4}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '30\\d{5}', - 'ExampleNumber' => '3012345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '3(?:20|9\\d)\\d{4}', - 'ExampleNumber' => '3201234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MU', - 'countryCode' => 230, - 'internationalPrefix' => '0(?:0|[24-7]0|3[03])', - 'preferredInternationalPrefix' => '020', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-46]|8[013]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2-468]|5\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:[03478]\\d|1[0-7]|6[0-79])|4(?:[013568]\\d|2[4-7])|54(?:[34]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}', + 'ExampleNumber' => '54480123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|5(?:2[589]|4[3489]|7\\d|8[0-689]|9[0-8])\\d{5}', + 'ExampleNumber' => '52512345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[0-2]\\d{4}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '30\\d{5}', + 'ExampleNumber' => '3012345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '3(?:20|9\\d)\\d{4}', + 'ExampleNumber' => '3201234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MU', + 'countryCode' => 230, + 'internationalPrefix' => '0(?:0|[24-7]0|3[03])', + 'preferredInternationalPrefix' => '020', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-46]|8[013]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '5', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MV.php b/lib/libphonenumber/data/PhoneNumberMetadata_MV.php index f3603abc..55cc9bd0 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MV.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MV.php @@ -10,176 +10,133 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3(?:0[0-3]|3[0-59])|6(?:[57][02468]|6[024-68]|8[024689]))\\d{4}', - 'ExampleNumber' => '6701234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '46[46]\\d{4}|(?:7[2-9]|9[14-9])\\d{5}', - 'ExampleNumber' => '7712345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{7}', - 'ExampleNumber' => '9001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '4[05]0\\d{4}', - 'ExampleNumber' => '4001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MV', - 'countryCode' => 960, - 'internationalPrefix' => '0(?:0|19)', - 'preferredInternationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[3467]|9[14-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3(?:0[0-3]|3[0-59])|6(?:[57][02468]|6[024-68]|8[024689]))\\d{4}', + 'ExampleNumber' => '6701234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '46[46]\\d{4}|(?:7[2-9]|9[14-9])\\d{5}', + 'ExampleNumber' => '7712345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{7}', + 'ExampleNumber' => '9001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '4[05]0\\d{4}', + 'ExampleNumber' => '4001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MV', + 'countryCode' => 960, + 'internationalPrefix' => '0(?:0|19)', + 'preferredInternationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[3467]|9[14-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MW.php b/lib/libphonenumber/data/PhoneNumberMetadata_MW.php index d60de794..bd87ef13 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MW.php @@ -10,196 +10,149 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{6}(?:\\d{2})?|(?:[23]1|77|88|99)\\d{7}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1[2-9]|21\\d\\d)\\d{5}', - 'ExampleNumber' => '1234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '111\\d{6}|(?:77|88|99)\\d{7}', - 'ExampleNumber' => '991234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '31\\d{7}', - 'ExampleNumber' => '310123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MW', - 'countryCode' => 265, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[2-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[17-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{6}(?:\\d{2})?|(?:[23]1|77|88|99)\\d{7}', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1[2-9]|21\\d\\d)\\d{5}', + 'ExampleNumber' => '1234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '111\\d{6}|(?:77|88|99)\\d{7}', + 'ExampleNumber' => '991234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '31\\d{7}', + 'ExampleNumber' => '310123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MW', + 'countryCode' => 265, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[2-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[17-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MX.php b/lib/libphonenumber/data/PhoneNumberMetadata_MX.php index fbb3df85..587e1a96 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MX.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MX.php @@ -10,264 +10,207 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1\\d|[2-9])\\d{9}', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - 1 => 8, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:0[01]|2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-7][1-9]|3[1-8]|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7}', - 'ExampleNumber' => '2001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - 1 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:1(?:2(?:2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-7][1-9]|3[1-8]|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))|2(?:2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-7][1-9]|3[1-8]|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7}', - 'ExampleNumber' => '12221234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - 1 => 8, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|88)\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{7}', - 'ExampleNumber' => '9001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '300\\d{7}', - 'ExampleNumber' => '3001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '500\\d{7}', - 'ExampleNumber' => '5001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MX', - 'countryCode' => 52, - 'internationalPrefix' => '0[09]', - 'preferredInternationalPrefix' => '00', - 'nationalPrefix' => '01', - 'nationalPrefixForParsing' => '0[12]|04[45]([2-9]\\d{9})$', - 'nationalPrefixTransformRule' => '1$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{5})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '53', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '33|5[56]|81', - ), - 'nationalPrefixFormattingRule' => '01 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '01 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:33|5[56]|81)', - ), - 'nationalPrefixFormattingRule' => '044 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '044 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '33|5[56]|81', - ), - 'nationalPrefixFormattingRule' => '01 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '01 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:33|5[56]|81)', - ), - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1\\d|[2-9])\\d{9}', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + 1 => 8, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:0[01]|2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-7][1-9]|3[1-8]|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7}', + 'ExampleNumber' => '2001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + 1 => 8, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:1(?:2(?:2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-7][1-9]|3[1-8]|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))|2(?:2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-7][1-9]|3[1-8]|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))\\d{7}', + 'ExampleNumber' => '12221234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + 1 => 8, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|88)\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{7}', + 'ExampleNumber' => '9001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '300\\d{7}', + 'ExampleNumber' => '3001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '500\\d{7}', + 'ExampleNumber' => '5001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MX', + 'countryCode' => 52, + 'internationalPrefix' => '0[09]', + 'preferredInternationalPrefix' => '00', + 'nationalPrefix' => '01', + 'nationalPrefixForParsing' => '0[12]|04[45]([2-9]\\d{9})$', + 'nationalPrefixTransformRule' => '1$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{5})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '53', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '33|5[56]|81', + ], + 'nationalPrefixFormattingRule' => '01 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '01 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1(?:33|5[56]|81)', + ], + 'nationalPrefixFormattingRule' => '044 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '044 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '33|5[56]|81', + ], + 'nationalPrefixFormattingRule' => '01 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '01 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1(?:33|5[56]|81)', + ], + ], + 3 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MY.php b/lib/libphonenumber/data/PhoneNumberMetadata_MY.php index 09d31251..24744d7f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MY.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MY.php @@ -10,232 +10,181 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{8,9}|(?:3\\d|[4-9])\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3(?:2[0-36-9]|3[0-368]|4[0-278]|5[0-24-8]|6[0-467]|7[1246-9]|8\\d|9[0-57])\\d|4(?:2[0-689]|[3-79]\\d|8[1-35689])|5(?:2[0-589]|[3468]\\d|5[0-489]|7[1-9]|9[23])|6(?:2[2-9]|3[1357-9]|[46]\\d|5[0-6]|7[0-35-9]|85|9[015-8])|7(?:[2579]\\d|3[03-68]|4[0-8]|6[5-9]|8[0-35-9])|8(?:[24][2-8]|3[2-5]|5[2-7]|6[2-589]|7[2-578]|[89][2-9])|9(?:0[57]|13|[25-7]\\d|[3489][0-8]))\\d{5}', - 'ExampleNumber' => '323856789', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '1(?:4400|8(?:47|8[27])[0-4])\\d{4}|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d))|(?:[23679][2-9]|4[235-9]|59\\d)\\d|8(?:1[23]|[236]\\d|4[06]|5[7-9]|7[016-9]|8[01]|9[0-8]))\\d{5}', - 'ExampleNumber' => '123456789', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[378]00\\d{6}', - 'ExampleNumber' => '1300123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1600\\d{6}', - 'ExampleNumber' => '1600123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '154(?:6(?:0\\d|1[0-3])|8(?:[25]1|4[0189]|7[0-4679]))\\d{4}', - 'ExampleNumber' => '1546012345', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MY', - 'countryCode' => 60, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[4-79]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1(?:[0249]|[367][2-9]|8[1-9])|8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{4})(\\d{4})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{4})', - 'format' => '$1-$2-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[36-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '15', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{8,9}|(?:3\\d|[4-9])\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3(?:2[0-36-9]|3[0-368]|4[0-278]|5[0-24-8]|6[0-467]|7[1246-9]|8\\d|9[0-57])\\d|4(?:2[0-689]|[3-79]\\d|8[1-35689])|5(?:2[0-589]|[3468]\\d|5[0-489]|7[1-9]|9[23])|6(?:2[2-9]|3[1357-9]|[46]\\d|5[0-6]|7[0-35-9]|85|9[015-8])|7(?:[2579]\\d|3[03-68]|4[0-8]|6[5-9]|8[0-35-9])|8(?:[24][2-8]|3[2-5]|5[2-7]|6[2-589]|7[2-578]|[89][2-9])|9(?:0[57]|13|[25-7]\\d|[3489][0-8]))\\d{5}', + 'ExampleNumber' => '323856789', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '1(?:4400|8(?:47|8[27])[0-4])\\d{4}|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d))|(?:[23679][2-9]|4[235-9]|59\\d)\\d|8(?:1[23]|[236]\\d|4[06]|5[7-9]|7[016-9]|8[01]|9[0-8]))\\d{5}', + 'ExampleNumber' => '123456789', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[378]00\\d{6}', + 'ExampleNumber' => '1300123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1600\\d{6}', + 'ExampleNumber' => '1600123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '154(?:6(?:0\\d|1[0-3])|8(?:[25]1|4[0189]|7[0-4679]))\\d{4}', + 'ExampleNumber' => '1546012345', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MY', + 'countryCode' => 60, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[4-79]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1(?:[0249]|[367][2-9]|8[1-9])|8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{4})(\\d{4})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{4})', + 'format' => '$1-$2-$3-$4', + 'leadingDigitsPatterns' => [ + 0 => '1[36-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '15', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_MZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_MZ.php index 6f9b1bac..5ddf0403 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_MZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_MZ.php @@ -10,171 +10,128 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:2|8\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}', - 'ExampleNumber' => '21123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '8[2-7]\\d{7}', - 'ExampleNumber' => '821234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MZ', - 'countryCode' => 258, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2|8[2-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:2|8\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}', + 'ExampleNumber' => '21123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '8[2-7]\\d{7}', + 'ExampleNumber' => '821234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MZ', + 'countryCode' => 258, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2|8[2-7]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NA.php b/lib/libphonenumber/data/PhoneNumberMetadata_NA.php index 63058ba9..d7759353 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NA.php @@ -10,199 +10,152 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[68]\\d{7,8}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '6(?:1(?:[02-4]\\d\\d|17)|2(?:17|54\\d|69|70)|3(?:17|2[0237]\\d|34|6[289]|7[01]|81)|4(?:17|(?:27|41|5[25])\\d|69|7[01])|5(?:17|2[236-8]\\d|69|7[01])|6(?:17|26\\d|38|42|69|7[01])|7(?:17|(?:2[2-4]|30)\\d|6[89]|7[01]))\\d{4}|6(?:1(?:2[2-7]|3[01378]|4[0-4]|69|7[014])|25[0-46-8]|32\\d|4(?:2[0-27]|4[016]|5[0-357])|52[02-9]|62[56]|7(?:2[2-69]|3[013]))\\d{4}', - 'ExampleNumber' => '61221234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:60|8[1245])\\d{7}', - 'ExampleNumber' => '811234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{7}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '8701\\d{5}', - 'ExampleNumber' => '870123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '8(?:3\\d\\d|86)\\d{5}', - 'ExampleNumber' => '88612345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NA', - 'countryCode' => 264, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '88', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '87', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[68]\\d{7,8}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '6(?:1(?:[02-4]\\d\\d|17)|2(?:17|54\\d|69|70)|3(?:17|2[0237]\\d|34|6[289]|7[01]|81)|4(?:17|(?:27|41|5[25])\\d|69|7[01])|5(?:17|2[236-8]\\d|69|7[01])|6(?:17|26\\d|38|42|69|7[01])|7(?:17|(?:2[2-4]|30)\\d|6[89]|7[01]))\\d{4}|6(?:1(?:2[2-7]|3[01378]|4[0-4]|69|7[014])|25[0-46-8]|32\\d|4(?:2[0-27]|4[016]|5[0-357])|52[02-9]|62[56]|7(?:2[2-69]|3[013]))\\d{4}', + 'ExampleNumber' => '61221234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:60|8[1245])\\d{7}', + 'ExampleNumber' => '811234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{7}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '8701\\d{5}', + 'ExampleNumber' => '870123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '8(?:3\\d\\d|86)\\d{5}', + 'ExampleNumber' => '88612345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NA', + 'countryCode' => 264, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '88', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '87', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NC.php b/lib/libphonenumber/data/PhoneNumberMetadata_NC.php index 5f1a1441..7bdd8a95 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NC.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NC.php @@ -10,179 +10,134 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-57-9]\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}', - 'ExampleNumber' => '201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:5[0-4]|[79]\\d|8[0-79])\\d{4}', - 'ExampleNumber' => '751234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '36\\d{4}', - 'ExampleNumber' => '366711', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NC', - 'countryCode' => 687, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '5[6-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1.$2.$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-57-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1.$2.$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-57-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-57-9]\\d{5}', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}', + 'ExampleNumber' => '201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:5[0-4]|[79]\\d|8[0-79])\\d{4}', + 'ExampleNumber' => '751234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '36\\d{4}', + 'ExampleNumber' => '366711', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NC', + 'countryCode' => 687, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '5[6-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1.$2.$3', + 'leadingDigitsPatterns' => [ + 0 => '[2-57-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1.$2.$3', + 'leadingDigitsPatterns' => [ + 0 => '[2-57-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NE.php b/lib/libphonenumber/data/PhoneNumberMetadata_NE.php index 4f212b82..4ba8d735 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NE.php @@ -10,168 +10,125 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[0289]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:0(?:20|3[1-8]|4[13-5]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}', - 'ExampleNumber' => '20201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:8[04589]|9\\d)\\d{6}', - 'ExampleNumber' => '93123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '08\\d{6}', - 'ExampleNumber' => '08123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '09\\d{6}', - 'ExampleNumber' => '09123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NE', - 'countryCode' => 227, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '08', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[089]|2[01]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[0289]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:0(?:20|3[1-8]|4[13-5]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}', + 'ExampleNumber' => '20201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:8[04589]|9\\d)\\d{6}', + 'ExampleNumber' => '93123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '08\\d{6}', + 'ExampleNumber' => '08123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '09\\d{6}', + 'ExampleNumber' => '09123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NE', + 'countryCode' => 227, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '08', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[089]|2[01]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NF.php b/lib/libphonenumber/data/PhoneNumberMetadata_NF.php index 20932cf5..1cfc0a0a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NF.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NF.php @@ -10,171 +10,128 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[13]\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:06|17|28|39)|3[0-2]\\d)\\d{3}', - 'ExampleNumber' => '106609', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '3[58]\\d{4}', - 'ExampleNumber' => '381234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NF', - 'countryCode' => 672, - 'internationalPrefix' => '00', - 'nationalPrefixForParsing' => '([0-258]\\d{4})$', - 'nationalPrefixTransformRule' => '3$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[13]\\d{5}', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:06|17|28|39)|3[0-2]\\d)\\d{3}', + 'ExampleNumber' => '106609', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '3[58]\\d{4}', + 'ExampleNumber' => '381234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NF', + 'countryCode' => 672, + 'internationalPrefix' => '00', + 'nationalPrefixForParsing' => '([0-258]\\d{4})$', + 'nationalPrefixTransformRule' => '3$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NG.php b/lib/libphonenumber/data/PhoneNumberMetadata_NG.php index a19eb465..162cff6b 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NG.php @@ -10,241 +10,190 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 10, - 3 => 11, - 4 => 12, - 5 => 13, - 6 => 14, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:(?:[1-356]\\d|4[02-8]|7[0-79]|8[2-9])\\d|9(?:0[3-9]|[1-9]\\d))\\d{5}|(?:[12]\\d|4[147]|5[14579]|6[1578]|7[0-3578])\\d{5}', - 'ExampleNumber' => '18040123', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:707[0-3]|8(?:01|19)[01])\\d{6}|(?:70[1-689]|8(?:0[2-9]|1[0-8])|90[1-35-9])\\d{7}', - 'ExampleNumber' => '8021234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7,11}', - 'ExampleNumber' => '80017591759', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - 2 => 12, - 3 => 13, - 4 => 14, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '700\\d{7,11}', - 'ExampleNumber' => '7001234567', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - 2 => 12, - 3 => 13, - 4 => 14, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NG', - 'countryCode' => 234, - 'internationalPrefix' => '009', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '78', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[12]|9(?:0[3-9]|[1-9])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2,3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-7]|8[2-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[7-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4,5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[78]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{5})(\\d{5,6})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[78]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 10, + 3 => 11, + 4 => 12, + 5 => 13, + 6 => 14, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:(?:[1-356]\\d|4[02-8]|7[0-79]|8[2-9])\\d|9(?:0[3-9]|[1-9]\\d))\\d{5}|(?:[12]\\d|4[147]|5[14579]|6[1578]|7[0-3578])\\d{5}', + 'ExampleNumber' => '18040123', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:707[0-3]|8(?:01|19)[01])\\d{6}|(?:70[1-689]|8(?:0[2-9]|1[0-8])|90[1-35-9])\\d{7}', + 'ExampleNumber' => '8021234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7,11}', + 'ExampleNumber' => '80017591759', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + 2 => 12, + 3 => 13, + 4 => 14, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '700\\d{7,11}', + 'ExampleNumber' => '7001234567', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + 2 => 12, + 3 => 13, + 4 => 14, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NG', + 'countryCode' => 234, + 'internationalPrefix' => '009', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '78', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[12]|9(?:0[3-9]|[1-9])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2,3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3-7]|8[2-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[7-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4,5})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[78]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{5})(\\d{5,6})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[78]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NI.php b/lib/libphonenumber/data/PhoneNumberMetadata_NI.php index c771bad8..2bfeeca7 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NI.php @@ -10,155 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1800|[25-8]\\d{3})\\d{4}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2\\d{7}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}', - 'ExampleNumber' => '81234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1800\\d{4}', - 'ExampleNumber' => '18001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NI', - 'countryCode' => 505, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[125-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1800|[25-8]\\d{3})\\d{4}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2\\d{7}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}', + 'ExampleNumber' => '81234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1800\\d{4}', + 'ExampleNumber' => '18001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NI', + 'countryCode' => 505, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[125-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NL.php b/lib/libphonenumber/data/PhoneNumberMetadata_NL.php index 5118782d..0f6cac28 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NL.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NL.php @@ -10,327 +10,262 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|[89]\\d{6,9}|1\\d{4,5}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - 5 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:[035]\\d|1[13-578]|6[124-8]|7[24]|8[0-467])|2(?:[0346]\\d|2[2-46-9]|5[125]|9[479])|3(?:[03568]\\d|1[3-8]|2[01]|4[1-8])|4(?:[0356]\\d|1[1-368]|7[58]|8[15-8]|9[23579])|5(?:[0358]\\d|[19][1-9]|2[1-57-9]|4[13-8]|6[126]|7[0-3578])|7\\d\\d)\\d{6}', - 'ExampleNumber' => '101234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6[1-58]\\d{7}', - 'ExampleNumber' => '612345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{4,7}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[069]\\d{4,7}', - 'ExampleNumber' => '9061234', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '(?:85|91)\\d{7}', - 'ExampleNumber' => '851234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '66\\d{7}', - 'ExampleNumber' => '662345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '140(?:1[035]|2[0346]|3[03568]|4[0356]|5[0358]|8[458])|(?:140(?:1[16-8]|2[259]|3[124]|4[17-9]|5[124679]|7)|8[478]\\d{6})\\d', - 'ExampleNumber' => '14020', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '140(?:1[035]|2[0346]|3[03568]|4[0356]|5[0358]|8[458])|140(?:1[16-8]|2[259]|3[124]|4[17-9]|5[124679]|7)\\d', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NL', - 'countryCode' => 31, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1[238]|[34]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '14', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{4,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '66', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d)(\\d{8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[16-8]|2[259]|3[124]|4[17-9]|5[124679]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-57-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '66', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[16-8]|2[259]|3[124]|4[17-9]|5[124679]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-57-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|[89]\\d{6,9}|1\\d{4,5}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + 5 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:[035]\\d|1[13-578]|6[124-8]|7[24]|8[0-467])|2(?:[0346]\\d|2[2-46-9]|5[125]|9[479])|3(?:[03568]\\d|1[3-8]|2[01]|4[1-8])|4(?:[0356]\\d|1[1-368]|7[58]|8[15-8]|9[23579])|5(?:[0358]\\d|[19][1-9]|2[1-57-9]|4[13-8]|6[126]|7[0-3578])|7\\d\\d)\\d{6}', + 'ExampleNumber' => '101234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6[1-58]\\d{7}', + 'ExampleNumber' => '612345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{4,7}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[069]\\d{4,7}', + 'ExampleNumber' => '9061234', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '(?:85|91)\\d{7}', + 'ExampleNumber' => '851234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '66\\d{7}', + 'ExampleNumber' => '662345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '140(?:1[035]|2[0346]|3[03568]|4[0356]|5[0358]|8[458])|(?:140(?:1[16-8]|2[259]|3[124]|4[17-9]|5[124679]|7)|8[478]\\d{6})\\d', + 'ExampleNumber' => '14020', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '140(?:1[035]|2[0346]|3[03568]|4[0356]|5[0358]|8[458])|140(?:1[16-8]|2[259]|3[124]|4[17-9]|5[124679]|7)\\d', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NL', + 'countryCode' => 31, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '1[238]|[34]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3,4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '14', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{6})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{4,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[89]0', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '66', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d)(\\d{8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[16-8]|2[259]|3[124]|4[17-9]|5[124679]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-57-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[89]0', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '66', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[16-8]|2[259]|3[124]|4[17-9]|5[124679]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-57-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NO.php b/lib/libphonenumber/data/PhoneNumberMetadata_NO.php index 56ba6b0a..c58a65ab 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NO.php @@ -10,183 +10,140 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:0|[2-9]\\d{3})\\d{4}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-4679]|7[0-8])\\d{6}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:4[015-8]|5[89]|9\\d)\\d{6}', - 'ExampleNumber' => '40612345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[01]\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '82[09]\\d{5}', - 'ExampleNumber' => '82012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '810(?:0[0-6]|[2-8]\\d)\\d{3}', - 'ExampleNumber' => '81021234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '880\\d{5}', - 'ExampleNumber' => '88012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '85[0-5]\\d{5}', - 'ExampleNumber' => '85012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:0[2-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}', - 'ExampleNumber' => '02000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '81[23]\\d{5}', - 'ExampleNumber' => '81212345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NO', - 'countryCode' => 47, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[489]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[235-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => true, - 'leadingDigits' => '[02-689]|7[0-8]', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:0|[2-9]\\d{3})\\d{4}', + 'PossibleLength' => [ + 0 => 5, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-4679]|7[0-8])\\d{6}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:4[015-8]|5[89]|9\\d)\\d{6}', + 'ExampleNumber' => '40612345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[01]\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '82[09]\\d{5}', + 'ExampleNumber' => '82012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '810(?:0[0-6]|[2-8]\\d)\\d{3}', + 'ExampleNumber' => '81021234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '880\\d{5}', + 'ExampleNumber' => '88012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '85[0-5]\\d{5}', + 'ExampleNumber' => '85012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:0[2-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}', + 'ExampleNumber' => '02000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '81[23]\\d{5}', + 'ExampleNumber' => '81212345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NO', + 'countryCode' => 47, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[489]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[235-7]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => true, + 'leadingDigits' => '[02-689]|7[0-8]', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NP.php b/lib/libphonenumber/data/PhoneNumberMetadata_NP.php index 29e42894..96408605 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NP.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NP.php @@ -10,187 +10,142 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d{9}|[1-9]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '1[0-6]\\d{6}|(?:2[13-79]|3[135-8]|4[146-9]|5[135-7]|6[13-9]|7[15-9]|8[1-46-9]|9[1-79])[2-6]\\d{5}', - 'ExampleNumber' => '14567890', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9(?:6[0-3]|7[245]|8[0-24-68])\\d{7}', - 'ExampleNumber' => '9841234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NP', - 'countryCode' => 977, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{7})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '1[2-6]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{6})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-8]|9(?:[1-579]|6[2-6])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{7})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d{9}|[1-9]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '1[0-6]\\d{6}|(?:2[13-79]|3[135-8]|4[146-9]|5[135-7]|6[13-9]|7[15-9]|8[1-46-9]|9[1-79])[2-6]\\d{5}', + 'ExampleNumber' => '14567890', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9(?:6[0-3]|7[245]|8[0-24-68])\\d{7}', + 'ExampleNumber' => '9841234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NP', + 'countryCode' => 977, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{7})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '1[2-6]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{6})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[1-8]|9(?:[1-579]|6[2-6])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{7})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NR.php b/lib/libphonenumber/data/PhoneNumberMetadata_NR.php index c3bbe2b0..9f0e327b 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NR.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:444|55\\d|888)\\d{4}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:444|888)\\d{4}', - 'ExampleNumber' => '4441234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '55[4-9]\\d{4}', - 'ExampleNumber' => '5551234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NR', - 'countryCode' => 674, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[458]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:444|55\\d|888)\\d{4}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:444|888)\\d{4}', + 'ExampleNumber' => '4441234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '55[4-9]\\d{4}', + 'ExampleNumber' => '5551234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NR', + 'countryCode' => 674, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[458]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NU.php b/lib/libphonenumber/data/PhoneNumberMetadata_NU.php index a60fa5ea..9d68bbba 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NU.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NU.php @@ -10,157 +10,116 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[47]|888\\d)\\d{3}', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[47]\\d{3}', - 'ExampleNumber' => '7012', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '888[4-9]\\d{3}', - 'ExampleNumber' => '8884012', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NU', - 'countryCode' => 683, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[47]|888\\d)\\d{3}', + 'PossibleLength' => [ + 0 => 4, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[47]\\d{3}', + 'ExampleNumber' => '7012', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '888[4-9]\\d{3}', + 'ExampleNumber' => '8884012', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NU', + 'countryCode' => 683, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_NZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_NZ.php index a6dc9c7e..2a5809b6 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_NZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_NZ.php @@ -10,219 +10,170 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[28]\\d{7,9}|[346]\\d{7}|(?:508|[79]\\d)\\d{6,7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '24099\\d{3}|(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}', - 'ExampleNumber' => '32345678', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '2[0-28]\\d{8}|2[0-27-9]\\d{7}|21\\d{6}', - 'ExampleNumber' => '211234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '508\\d{6,7}|80\\d{6,8}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90\\d{6,7}', - 'ExampleNumber' => '900123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70\\d{7}', - 'ExampleNumber' => '701234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '[28]6\\d{6,7}', - 'ExampleNumber' => '26123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NZ', - 'countryCode' => 64, - 'internationalPrefix' => '0(?:0|161)', - 'preferredInternationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '24|[346]|7[2-57-9]|9[2-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:10|74)|[59]|80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[028]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,5})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:[169]|7[0-35-9])|7|86', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[28]\\d{7,9}|[346]\\d{7}|(?:508|[79]\\d)\\d{6,7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '24099\\d{3}|(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}', + 'ExampleNumber' => '32345678', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '2[0-28]\\d{8}|2[0-27-9]\\d{7}|21\\d{6}', + 'ExampleNumber' => '211234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '508\\d{6,7}|80\\d{6,8}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90\\d{6,7}', + 'ExampleNumber' => '900123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70\\d{7}', + 'ExampleNumber' => '701234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '[28]6\\d{6,7}', + 'ExampleNumber' => '26123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NZ', + 'countryCode' => 64, + 'internationalPrefix' => '0(?:0|161)', + 'preferredInternationalPrefix' => '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)(\\d{3})(\\d{4})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '24|[346]|7[2-57-9]|9[2-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:10|74)|[59]|80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[028]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,5})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:[169]|7[0-35-9])|7|86', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_OM.php b/lib/libphonenumber/data/PhoneNumberMetadata_OM.php index f2a702ee..3328578f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_OM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_OM.php @@ -10,185 +10,140 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[279]\\d{3}|500)\\d{4}|8007\\d{4,5}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2[2-6]\\d{6}', - 'ExampleNumber' => '23123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '90[1-9]\\d{5}|(?:7[129]|9[1-9])\\d{6}', - 'ExampleNumber' => '92123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '500\\d{4}|8007\\d{4,5}', - 'ExampleNumber' => '80071234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{5}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'OM', - 'countryCode' => 968, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[58]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[79]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[279]\\d{3}|500)\\d{4}|8007\\d{4,5}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2[2-6]\\d{6}', + 'ExampleNumber' => '23123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '90[1-9]\\d{5}|(?:7[129]|9[1-9])\\d{6}', + 'ExampleNumber' => '92123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '500\\d{4}|8007\\d{4,5}', + 'ExampleNumber' => '80071234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{5}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'OM', + 'countryCode' => 968, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[58]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[79]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PA.php b/lib/libphonenumber/data/PhoneNumberMetadata_PA.php index b100a594..f445aa2d 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PA.php @@ -10,172 +10,129 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[1-57-9]|6\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:0\\d|1[479]|2[37]|3[0137]|4[17]|5[05]|[68][58]|7[0167]|9[39])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[026-9])|3(?:[089]\\d|1[014-7]|2[0-35]|33|4[0-579]|55|6[068]|7[06-8])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[05]|7[0-24-9]|8[7-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}', - 'ExampleNumber' => '2001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:1[16]1|21[89]|6(?:[02-9]\\d|1[0-6])\\d|8(?:1[01]|7[23]))\\d{4}', - 'ExampleNumber' => '61234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{4}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:8(?:22|55|60|7[78]|86)|9(?:00|81))\\d{4}', - 'ExampleNumber' => '8601234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PA', - 'countryCode' => 507, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-57-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[1-57-9]|6\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:0\\d|1[479]|2[37]|3[0137]|4[17]|5[05]|[68][58]|7[0167]|9[39])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[026-9])|3(?:[089]\\d|1[014-7]|2[0-35]|33|4[0-579]|55|6[068]|7[06-8])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[05]|7[0-24-9]|8[7-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}', + 'ExampleNumber' => '2001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:1[16]1|21[89]|6(?:[02-9]\\d|1[0-6])\\d|8(?:1[01]|7[23]))\\d{4}', + 'ExampleNumber' => '61234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{4}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:8(?:22|55|60|7[78]|86)|9(?:00|81))\\d{4}', + 'ExampleNumber' => '8601234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PA', + 'countryCode' => 507, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[1-57-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PE.php b/lib/libphonenumber/data/PhoneNumberMetadata_PE.php index 90747c0e..2fc1243e 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PE.php @@ -10,208 +10,161 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[14-8]|9\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '19(?:[02-68]\\d|1[035-9]|7[0-689]|9[1-9])\\d{4}|(?:1[0-8]|4[1-4]|5[1-46]|6[1-7]|7[2-46]|8[2-4])\\d{6}', - 'ExampleNumber' => '11234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9\\d{8}', - 'ExampleNumber' => '912345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '805\\d{5}', - 'ExampleNumber' => '80512345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '801\\d{5}', - 'ExampleNumber' => '80112345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '80[24]\\d{5}', - 'ExampleNumber' => '80212345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PE', - 'countryCode' => 51, - 'internationalPrefix' => '19(?:1[124]|77|90)00', - 'nationalPrefix' => '0', - 'preferredExtnPrefix' => ' Anexo ', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '80', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[4-8]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[14-8]|9\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '19(?:[02-68]\\d|1[035-9]|7[0-689]|9[1-9])\\d{4}|(?:1[0-8]|4[1-4]|5[1-46]|6[1-7]|7[2-46]|8[2-4])\\d{6}', + 'ExampleNumber' => '11234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9\\d{8}', + 'ExampleNumber' => '912345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '805\\d{5}', + 'ExampleNumber' => '80512345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '801\\d{5}', + 'ExampleNumber' => '80112345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '80[24]\\d{5}', + 'ExampleNumber' => '80212345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PE', + 'countryCode' => 51, + 'internationalPrefix' => '19(?:1[124]|77|90)00', + 'nationalPrefix' => '0', + 'preferredExtnPrefix' => ' Anexo ', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '80', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[4-8]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PF.php b/lib/libphonenumber/data/PhoneNumberMetadata_PF.php index b9af5d54..97c66f31 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PF.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PF.php @@ -10,169 +10,126 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[48]\\d{7}|4\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '4(?:[09][4-689]\\d|4)\\d{4}', - 'ExampleNumber' => '40412345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '8[7-9]\\d{6}', - 'ExampleNumber' => '87123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '44\\d{4}', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PF', - 'countryCode' => 689, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '44', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[48]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[48]\\d{7}|4\\d{5}', + 'PossibleLength' => [ + 0 => 6, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '4(?:[09][4-689]\\d|4)\\d{4}', + 'ExampleNumber' => '40412345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '8[7-9]\\d{6}', + 'ExampleNumber' => '87123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '44\\d{4}', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PF', + 'countryCode' => 689, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '44', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[48]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PG.php b/lib/libphonenumber/data/PhoneNumberMetadata_PG.php index 63410d17..ae044bb0 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PG.php @@ -10,173 +10,130 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:64[1-9]|7730|85[02-46-9])\\d{4}|(?:3[0-2]|4[257]|5[34]|77[0-24]|9[78])\\d{5}', - 'ExampleNumber' => '3123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '775\\d{5}|(?:7[0-689]|81)\\d{6}', - 'ExampleNumber' => '70123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '180\\d{4}', - 'ExampleNumber' => '1801234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '2(?:0[0-47]|7[568])\\d{4}', - 'ExampleNumber' => '2751234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PG', - 'countryCode' => 675, - 'internationalPrefix' => '00|140[1-3]', - 'preferredInternationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '18|[2-69]|85', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[78]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:64[1-9]|7730|85[02-46-9])\\d{4}|(?:3[0-2]|4[257]|5[34]|77[0-24]|9[78])\\d{5}', + 'ExampleNumber' => '3123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '775\\d{5}|(?:7[0-689]|81)\\d{6}', + 'ExampleNumber' => '70123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '180\\d{4}', + 'ExampleNumber' => '1801234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '2(?:0[0-47]|7[568])\\d{4}', + 'ExampleNumber' => '2751234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PG', + 'countryCode' => 675, + 'internationalPrefix' => '00|140[1-3]', + 'preferredInternationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '18|[2-69]|85', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[78]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PH.php b/lib/libphonenumber/data/PhoneNumberMetadata_PH.php index a5bf2d1a..92ea2eb5 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PH.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PH.php @@ -10,263 +10,208 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1800|8)\\d{7,9}|2\\d{5}(?:\\d{2})?|(?:[3-7]|9\\d)\\d{8}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - 5 => 12, - 6 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - 2 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2\\d{5}(?:\\d{2})?|88(?:22\\d\\d|42)\\d{4}|88\\d{7}|(?:3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578]|8[2-7])\\d{7}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - 2 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:81[37]|9(?:0[5-9]|1[0-24-9]|2[0-35-9]|[35]\\d|4[235-9]|6[0-25-8]|7[1-9]|8[19]|9[4-9]))\\d{7}', - 'ExampleNumber' => '9051234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1800\\d{7,9}', - 'ExampleNumber' => '180012345678', - 'PossibleLength' => - array ( - 0 => 11, - 1 => 12, - 2 => 13, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PH', - 'countryCode' => 63, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{4,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2', - 1 => '3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{5})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '346|4(?:27|9[35])|883', - 1 => '3469|4(?:279|9(?:30|56))|8834', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-7]|8[2-8]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1800|8)\\d{7,9}|2\\d{5}(?:\\d{2})?|(?:[3-7]|9\\d)\\d{8}', + 'PossibleLength' => [ + 0 => 6, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + 5 => 12, + 6 => 13, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + 2 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2\\d{5}(?:\\d{2})?|88(?:22\\d\\d|42)\\d{4}|88\\d{7}|(?:3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578]|8[2-7])\\d{7}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + 0 => 6, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + 2 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:81[37]|9(?:0[5-9]|1[0-24-9]|2[0-35-9]|[35]\\d|4[235-9]|6[0-25-8]|7[1-9]|8[19]|9[4-9]))\\d{7}', + 'ExampleNumber' => '9051234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1800\\d{7,9}', + 'ExampleNumber' => '180012345678', + 'PossibleLength' => [ + 0 => 11, + 1 => 12, + 2 => 13, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PH', + 'countryCode' => 63, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{4,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2', + 1 => '3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{5})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '346|4(?:27|9[35])|883', + 1 => '3469|4(?:279|9(?:30|56))|8834', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3-7]|8[2-8]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PK.php b/lib/libphonenumber/data/PhoneNumberMetadata_PK.php index 6e54a91d..a3bfd2aa 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PK.php @@ -10,264 +10,209 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[025-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - 3 => 11, - 4 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:(?:21|42)[2-9]|58[126])\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}', - 'ExampleNumber' => '2123456789', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '3(?:[014]\\d|2[0-5]|3[0-7]|55|64)\\d{7}', - 'ExampleNumber' => '3012345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{5}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '122\\d{6}', - 'ExampleNumber' => '122044444', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:0[468]|[1-8])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}', - 'ExampleNumber' => '21111825888', - 'PossibleLength' => - array ( - 0 => 11, - 1 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PK', - 'countryCode' => 92, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{7,8})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{6,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])', - 1 => '9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{5})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '58', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[24-9]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[025-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + 3 => 11, + 4 => 12, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + 2 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:(?:21|42)[2-9]|58[126])\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}', + 'ExampleNumber' => '2123456789', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '3(?:[014]\\d|2[0-5]|3[0-7]|55|64)\\d{7}', + 'ExampleNumber' => '3012345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{5}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '122\\d{6}', + 'ExampleNumber' => '122044444', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:0[468]|[1-8])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}', + 'ExampleNumber' => '21111825888', + 'PossibleLength' => [ + 0 => 11, + 1 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PK', + 'countryCode' => 92, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]0', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{7,8})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{6,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])', + 1 => '9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{5})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '58', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[24-9]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PL.php b/lib/libphonenumber/data/PhoneNumberMetadata_PL.php index 4efbbebb..a66706fe 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PL.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PL.php @@ -10,232 +10,181 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-57-9]\\d{6}(?:\\d{2})?|6\\d{5,8}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])(?:[02-9]\\d{6}|1(?:[0-8]\\d{5}|9\\d{3}(?:\\d{2})?))', - 'ExampleNumber' => '123456789', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}', - 'ExampleNumber' => '512345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '70[01346-8]\\d{6}', - 'ExampleNumber' => '701234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '801\\d{6}', - 'ExampleNumber' => '801234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '39\\d{7}', - 'ExampleNumber' => '391234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '64\\d{4,7}', - 'ExampleNumber' => '641234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '804\\d{6}', - 'ExampleNumber' => '804123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PL', - 'countryCode' => 48, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{5})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '19', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '11|64', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1', - 1 => '(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '64', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '39|45|5[0137]|6[0469]|7[02389]|8[08]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[2-8]|[2-8]|9[145]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-57-9]\\d{6}(?:\\d{2})?|6\\d{5,8}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])(?:[02-9]\\d{6}|1(?:[0-8]\\d{5}|9\\d{3}(?:\\d{2})?))', + 'ExampleNumber' => '123456789', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}', + 'ExampleNumber' => '512345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '70[01346-8]\\d{6}', + 'ExampleNumber' => '701234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '801\\d{6}', + 'ExampleNumber' => '801234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '39\\d{7}', + 'ExampleNumber' => '391234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '64\\d{4,7}', + 'ExampleNumber' => '641234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '804\\d{6}', + 'ExampleNumber' => '804123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PL', + 'countryCode' => 48, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{5})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '19', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '11|64', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1', + 1 => '(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '64', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '39|45|5[0137]|6[0469]|7[02389]|8[08]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1[2-8]|[2-8]|9[145]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PM.php b/lib/libphonenumber/data/PhoneNumberMetadata_PM.php index f6227217..a7aa7eb0 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PM.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[45]\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:4[1-3]|50)\\d{4}', - 'ExampleNumber' => '430123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:4[02-4]|5[05])\\d{4}', - 'ExampleNumber' => '551234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PM', - 'countryCode' => 508, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[45]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[45]\\d{5}', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:4[1-3]|50)\\d{4}', + 'ExampleNumber' => '430123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:4[02-4]|5[05])\\d{4}', + 'ExampleNumber' => '551234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PM', + 'countryCode' => 508, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[45]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PR.php b/lib/libphonenumber/data/PhoneNumberMetadata_PR.php index 6bf47f25..5c907bb7 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PR.php @@ -10,151 +10,112 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[589]\\d\\d|787)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:787|939)[2-9]\\d{6}', - 'ExampleNumber' => '7872345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:787|939)[2-9]\\d{6}', - 'ExampleNumber' => '7872345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PR', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '787|939', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[589]\\d\\d|787)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:787|939)[2-9]\\d{6}', + 'ExampleNumber' => '7872345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:787|939)[2-9]\\d{6}', + 'ExampleNumber' => '7872345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PR', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '787|939', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PS.php b/lib/libphonenumber/data/PhoneNumberMetadata_PS.php index aa2342f7..923e314e 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PS.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PS.php @@ -10,190 +10,145 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2489]2\\d{6}|(?:1\\d|5)\\d{8}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:22[2-47-9]|42[45]|82[01458]|92[369])\\d{5}', - 'ExampleNumber' => '22234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '5[69]\\d{7}', - 'ExampleNumber' => '599123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1800\\d{6}', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '1700\\d{6}', - 'ExampleNumber' => '1700123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PS', - 'countryCode' => 970, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2489]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2489]2\\d{6}|(?:1\\d|5)\\d{8}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:22[2-47-9]|42[45]|82[01458]|92[369])\\d{5}', + 'ExampleNumber' => '22234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '5[69]\\d{7}', + 'ExampleNumber' => '599123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1800\\d{6}', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '1700\\d{6}', + 'ExampleNumber' => '1700123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PS', + 'countryCode' => 970, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2489]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '5', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PT.php b/lib/libphonenumber/data/PhoneNumberMetadata_PT.php index 5d535f76..2be9af48 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PT.php @@ -10,173 +10,130 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[26-9]\\d|30)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:[12]\\d|[35][1-689]|4[1-59]|6[1-35689]|7[1-9]|8[1-69]|9[1256])\\d{6}', - 'ExampleNumber' => '212345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9(?:[1-36]\\d\\d|480)\\d{5}', - 'ExampleNumber' => '912345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[02]\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:6(?:0[178]|4[68])\\d|76(?:0[1-57]|1[2-47]|2[237]))\\d{5}', - 'ExampleNumber' => '760123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '80(?:8\\d|9[1579])\\d{5}', - 'ExampleNumber' => '808123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '884[0-4689]\\d{5}', - 'ExampleNumber' => '884123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '30\\d{7}', - 'ExampleNumber' => '301234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '70(?:7\\d|8[17])\\d{5}', - 'ExampleNumber' => '707123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '600\\d{6}', - 'ExampleNumber' => '600110000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PT', - 'countryCode' => 351, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[12]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[236-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[26-9]\\d|30)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:[12]\\d|[35][1-689]|4[1-59]|6[1-35689]|7[1-9]|8[1-69]|9[1256])\\d{6}', + 'ExampleNumber' => '212345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9(?:[1-36]\\d\\d|480)\\d{5}', + 'ExampleNumber' => '912345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[02]\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:6(?:0[178]|4[68])\\d|76(?:0[1-57]|1[2-47]|2[237]))\\d{5}', + 'ExampleNumber' => '760123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '80(?:8\\d|9[1579])\\d{5}', + 'ExampleNumber' => '808123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '884[0-4689]\\d{5}', + 'ExampleNumber' => '884123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '30\\d{7}', + 'ExampleNumber' => '301234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '70(?:7\\d|8[17])\\d{5}', + 'ExampleNumber' => '707123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '600\\d{6}', + 'ExampleNumber' => '600110000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PT', + 'countryCode' => 351, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[12]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[236-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PW.php b/lib/libphonenumber/data/PhoneNumberMetadata_PW.php index dc2b33fa..afbaf7dc 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PW.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[25-8]\\d\\d|345|488|900)\\d{4}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:55|77)|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76)|900)\\d{4}', - 'ExampleNumber' => '2771234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:6[2-4689]0|77\\d|88[0-4])\\d{4}', - 'ExampleNumber' => '6201234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PW', - 'countryCode' => 680, - 'internationalPrefix' => '01[12]', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[25-8]\\d\\d|345|488|900)\\d{4}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:55|77)|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76)|900)\\d{4}', + 'ExampleNumber' => '2771234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:6[2-4689]0|77\\d|88[0-4])\\d{4}', + 'ExampleNumber' => '6201234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PW', + 'countryCode' => 680, + 'internationalPrefix' => '01[12]', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_PY.php b/lib/libphonenumber/data/PhoneNumberMetadata_PY.php index e66ae79a..b1f470c1 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_PY.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_PY.php @@ -10,241 +10,188 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '59\\d{4,6}|(?:[2-46-9]\\d|5[0-8])\\d{4,7}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36])\\d{5,7}|(?:2(?:2[4-68]|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51)|4(?:3[12]|5[13]|9[1-47])|5(?:[1-4]\\d|5[02-4])|6(?:3[1-3]|44|7[1-46-8])|7(?:4[0-4]|6[1-578]|75|8[0-8])|858)\\d{5,6}', - 'ExampleNumber' => '212345678', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9(?:51|6[129]|[78][1-6]|9[1-5])\\d{6}', - 'ExampleNumber' => '961456789', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '8700[0-4]\\d{4}', - 'ExampleNumber' => '870012345', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '[2-9]0\\d{4,7}', - 'ExampleNumber' => '201234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PY', - 'countryCode' => 595, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]0', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2[279]|3[13-5]|4[359]|5|6[347]|7[46-8]|85', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '87', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-8]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '59\\d{4,6}|(?:[2-46-9]\\d|5[0-8])\\d{4,7}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36])\\d{5,7}|(?:2(?:2[4-68]|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51)|4(?:3[12]|5[13]|9[1-47])|5(?:[1-4]\\d|5[02-4])|6(?:3[1-3]|44|7[1-46-8])|7(?:4[0-4]|6[1-578]|75|8[0-8])|858)\\d{5,6}', + 'ExampleNumber' => '212345678', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9(?:51|6[129]|[78][1-6]|9[1-5])\\d{6}', + 'ExampleNumber' => '961456789', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '8700[0-4]\\d{4}', + 'ExampleNumber' => '870012345', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '[2-9]0\\d{4,7}', + 'ExampleNumber' => '201234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PY', + 'countryCode' => 595, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]0', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{4,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2[279]|3[13-5]|4[359]|5|6[347]|7[46-8]|85', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '87', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-8]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_QA.php b/lib/libphonenumber/data/PhoneNumberMetadata_QA.php index a2eb70cf..8c465bed 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_QA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_QA.php @@ -10,173 +10,130 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '800\\d{4}|(?:2|[3-7]\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '4[04]\\d{6}', - 'ExampleNumber' => '44123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[35-7]\\d{7}', - 'ExampleNumber' => '33123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{4}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '2(?:[12]\\d|61)\\d{4}', - 'ExampleNumber' => '2123456', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'QA', - 'countryCode' => 974, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2[126]|8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '800\\d{4}|(?:2|[3-7]\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '4[04]\\d{6}', + 'ExampleNumber' => '44123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[35-7]\\d{7}', + 'ExampleNumber' => '33123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{4}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '2(?:[12]\\d|61)\\d{4}', + 'ExampleNumber' => '2123456', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'QA', + 'countryCode' => 974, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2[126]|8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[3-7]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_RE.php b/lib/libphonenumber/data/PhoneNumberMetadata_RE.php index 3630f6af..aa8eb45f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_RE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_RE.php @@ -10,160 +10,119 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:26|[68]\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '262\\d{6}', - 'ExampleNumber' => '262161234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '69(?:2\\d\\d|3(?:0[0-46]|1[013]|2[0-2]|3[0-39]|4\\d|5[05]|6[0-26]|7[0-27]|8[0-8]|9[0-479]))\\d{4}', - 'ExampleNumber' => '692123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{7}', - 'ExampleNumber' => '801234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '89[1-37-9]\\d{6}', - 'ExampleNumber' => '891123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '8(?:1[019]|2[0156]|84|90)\\d{6}', - 'ExampleNumber' => '810123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RE', - 'countryCode' => 262, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[268]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => true, - 'leadingDigits' => '262|69|8', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:26|[68]\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '262\\d{6}', + 'ExampleNumber' => '262161234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '69(?:2\\d\\d|3(?:0[0-46]|1[013]|2[0-2]|3[0-39]|4\\d|5[05]|6[0-26]|7[0-27]|8[0-8]|9[0-479]))\\d{4}', + 'ExampleNumber' => '692123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{7}', + 'ExampleNumber' => '801234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '89[1-37-9]\\d{6}', + 'ExampleNumber' => '891123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '8(?:1[019]|2[0156]|84|90)\\d{6}', + 'ExampleNumber' => '810123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RE', + 'countryCode' => 262, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[268]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => true, + 'leadingDigits' => '262|69|8', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_RO.php b/lib/libphonenumber/data/PhoneNumberMetadata_RO.php index a79d8069..0e6c7519 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_RO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_RO.php @@ -10,204 +10,157 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[237]\\d|[89]0)\\d{7}|[23]\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[23][13-6]\\d{7}|(?:2(?:19\\d|[3-6]\\d9)|31\\d\\d)\\d\\d', - 'ExampleNumber' => '211234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7120\\d{5}|7(?:[02-7]\\d|1[01]|8[03-8]|99)\\d{6}', - 'ExampleNumber' => '712034567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[036]\\d{6}', - 'ExampleNumber' => '900123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '801\\d{6}', - 'ExampleNumber' => '801123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '37\\d{7}', - 'ExampleNumber' => '372123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RO', - 'countryCode' => 40, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'preferredExtnPrefix' => ' int ', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2[3-6]', - 1 => '2[3-6]\\d9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '219|31', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[23]1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[237-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[237]\\d|[89]0)\\d{7}|[23]\\d{5}', + 'PossibleLength' => [ + 0 => 6, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[23][13-6]\\d{7}|(?:2(?:19\\d|[3-6]\\d9)|31\\d\\d)\\d\\d', + 'ExampleNumber' => '211234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7120\\d{5}|7(?:[02-7]\\d|1[01]|8[03-8]|99)\\d{6}', + 'ExampleNumber' => '712034567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[036]\\d{6}', + 'ExampleNumber' => '900123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '801\\d{6}', + 'ExampleNumber' => '801123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '37\\d{7}', + 'ExampleNumber' => '372123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RO', + 'countryCode' => 40, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'preferredExtnPrefix' => ' int ', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2[3-6]', + 1 => '2[3-6]\\d9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '219|31', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[23]1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[237-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_RS.php b/lib/libphonenumber/data/PhoneNumberMetadata_RS.php index 0a066c76..4e1c722e 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_RS.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_RS.php @@ -10,196 +10,153 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - 5 => 11, - 6 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:11[1-9]\\d|(?:2[389]|39)(?:0[2-9]|[2-9]\\d))\\d{3,8}|(?:1[02-9]|2[0-24-7]|3[0-8])[2-9]\\d{4,9}', - 'ExampleNumber' => '10234567', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - 4 => 11, - 5 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6(?:[0-689]|7\\d)\\d{6,7}', - 'ExampleNumber' => '601234567', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{3,9}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:78\\d|90[0169])\\d{3,7}', - 'ExampleNumber' => '90012345', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '7[06]\\d{4,10}', - 'ExampleNumber' => '700123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RS', - 'countryCode' => 381, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3,9})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:2[389]|39)0|[7-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{5,10})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-36]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + 5 => 11, + 6 => 12, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:11[1-9]\\d|(?:2[389]|39)(?:0[2-9]|[2-9]\\d))\\d{3,8}|(?:1[02-9]|2[0-24-7]|3[0-8])[2-9]\\d{4,9}', + 'ExampleNumber' => '10234567', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + 4 => 11, + 5 => 12, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 4, + 1 => 5, + 2 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6(?:[0-689]|7\\d)\\d{6,7}', + 'ExampleNumber' => '601234567', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{3,9}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:78\\d|90[0169])\\d{3,7}', + 'ExampleNumber' => '90012345', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '7[06]\\d{4,10}', + 'ExampleNumber' => '700123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RS', + 'countryCode' => 381, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3,9})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '(?:2[389]|39)0|[7-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{5,10})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[1-36]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_RU.php b/lib/libphonenumber/data/PhoneNumberMetadata_RU.php index b386f3c7..f69836d0 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_RU.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_RU.php @@ -10,267 +10,210 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[347-9]\\d{9}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15]|6[1-35-79]|7[1-37-9]))\\d{7}', - 'ExampleNumber' => '3011234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9\\d{9}', - 'ExampleNumber' => '9123456789', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[04]\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '80[39]\\d{7}', - 'ExampleNumber' => '8091234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '808\\d{7}', - 'ExampleNumber' => '8081234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RU', - 'countryCode' => 7, - 'internationalPrefix' => '810', - 'preferredInternationalPrefix' => '8~10', - 'nationalPrefix' => '8', - 'nationalPrefixForParsing' => '8', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[0-79]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '7(?:1[0-8]|2[1-9])', - 1 => '7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))', - 2 => '7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2', - ), - 'nationalPrefixFormattingRule' => '8 ($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{5})(\\d)(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '7(?:1[0-68]|2[1-9])', - 1 => '7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))', - 2 => '7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]', - ), - 'nationalPrefixFormattingRule' => '8 ($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '8 ($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '[3489]', - ), - 'nationalPrefixFormattingRule' => '8 ($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '7(?:1[0-8]|2[1-9])', - 1 => '7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))', - 2 => '7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2', - ), - 'nationalPrefixFormattingRule' => '8 ($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{5})(\\d)(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '7(?:1[0-68]|2[1-9])', - 1 => '7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))', - 2 => '7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]', - ), - 'nationalPrefixFormattingRule' => '8 ($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '8 ($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '[3489]', - ), - 'nationalPrefixFormattingRule' => '8 ($1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'mainCountryForCode' => true, - 'leadingDigits' => '3[04-689]|[489]', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[347-9]\\d{9}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15]|6[1-35-79]|7[1-37-9]))\\d{7}', + 'ExampleNumber' => '3011234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9\\d{9}', + 'ExampleNumber' => '9123456789', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[04]\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '80[39]\\d{7}', + 'ExampleNumber' => '8091234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '808\\d{7}', + 'ExampleNumber' => '8081234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RU', + 'countryCode' => 7, + 'internationalPrefix' => '810', + 'preferredInternationalPrefix' => '8~10', + 'nationalPrefix' => '8', + 'nationalPrefixForParsing' => '8', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[0-79]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '7(?:1[0-8]|2[1-9])', + 1 => '7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))', + 2 => '7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2', + ], + 'nationalPrefixFormattingRule' => '8 ($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{5})(\\d)(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '7(?:1[0-68]|2[1-9])', + 1 => '7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))', + 2 => '7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]', + ], + 'nationalPrefixFormattingRule' => '8 ($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '8 ($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2-$3-$4', + 'leadingDigitsPatterns' => [ + 0 => '[3489]', + ], + 'nationalPrefixFormattingRule' => '8 ($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '7(?:1[0-8]|2[1-9])', + 1 => '7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))', + 2 => '7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2', + ], + 'nationalPrefixFormattingRule' => '8 ($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{5})(\\d)(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '7(?:1[0-68]|2[1-9])', + 1 => '7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))', + 2 => '7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]', + ], + 'nationalPrefixFormattingRule' => '8 ($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '8 ($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2-$3-$4', + 'leadingDigitsPatterns' => [ + 0 => '[3489]', + ], + 'nationalPrefixFormattingRule' => '8 ($1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'mainCountryForCode' => true, + 'leadingDigits' => '3[04-689]|[489]', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_RW.php b/lib/libphonenumber/data/PhoneNumberMetadata_RW.php index 70fdd4c9..59f986a7 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_RW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_RW.php @@ -10,186 +10,141 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:06|[27]\\d\\d|[89]00)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:06|2[258]\\d)\\d{6}', - 'ExampleNumber' => '250123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[238]\\d{7}', - 'ExampleNumber' => '720123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{6}', - 'ExampleNumber' => '900123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RW', - 'countryCode' => 250, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[7-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:06|[27]\\d\\d|[89]00)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:06|2[258]\\d)\\d{6}', + 'ExampleNumber' => '250123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[238]\\d{7}', + 'ExampleNumber' => '720123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{6}', + 'ExampleNumber' => '900123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RW', + 'countryCode' => 250, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[7-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SA.php b/lib/libphonenumber/data/PhoneNumberMetadata_SA.php index 45f07d54..3329c127 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SA.php @@ -10,217 +10,168 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '92\\d{7}|(?:[15]|8\\d)\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '1(?:1\\d|2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}', - 'ExampleNumber' => '112345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '5(?:[013-689]\\d|7[0-36-8])\\d{6}', - 'ExampleNumber' => '512345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '925\\d{6}', - 'ExampleNumber' => '925012345', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '920\\d{6}', - 'ExampleNumber' => '920012345', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '811\\d{7}', - 'ExampleNumber' => '8110123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SA', - 'countryCode' => 966, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '5', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '81', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '92\\d{7}|(?:[15]|8\\d)\\d{8}', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '1(?:1\\d|2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}', + 'ExampleNumber' => '112345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '5(?:[013-689]\\d|7[0-36-8])\\d{6}', + 'ExampleNumber' => '512345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '925\\d{6}', + 'ExampleNumber' => '925012345', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '920\\d{6}', + 'ExampleNumber' => '920012345', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '811\\d{7}', + 'ExampleNumber' => '8110123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SA', + 'countryCode' => 966, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '5', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '81', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SB.php b/lib/libphonenumber/data/PhoneNumberMetadata_SB.php index b1a0541f..461c6216 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SB.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SB.php @@ -10,160 +10,119 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[1-6]|[7-9]\\d\\d)\\d{4}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}', - 'ExampleNumber' => '40123', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '48\\d{3}|(?:(?:7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}', - 'ExampleNumber' => '7421234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[38]\\d{3}', - 'ExampleNumber' => '18123', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '5[12]\\d{3}', - 'ExampleNumber' => '51123', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SB', - 'countryCode' => 677, - 'internationalPrefix' => '0[01]', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '7|8[4-9]|9(?:[1-8]|9[0-8])', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[1-6]|[7-9]\\d\\d)\\d{4}', + 'PossibleLength' => [ + 0 => 5, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}', + 'ExampleNumber' => '40123', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '48\\d{3}|(?:(?:7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}', + 'ExampleNumber' => '7421234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[38]\\d{3}', + 'ExampleNumber' => '18123', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '5[12]\\d{3}', + 'ExampleNumber' => '51123', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SB', + 'countryCode' => 677, + 'internationalPrefix' => '0[01]', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '7|8[4-9]|9(?:[1-8]|9[0-8])', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SC.php b/lib/libphonenumber/data/PhoneNumberMetadata_SC.php index dc829032..a1de8fd7 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SC.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SC.php @@ -10,157 +10,116 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '8000\\d{3}|(?:[249]\\d|64)\\d{5}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '4[2-46]\\d{5}', - 'ExampleNumber' => '4217123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '2[5-8]\\d{5}', - 'ExampleNumber' => '2510123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8000\\d{3}', - 'ExampleNumber' => '8000000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '971\\d{4}|(?:64|95)\\d{5}', - 'ExampleNumber' => '6412345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SC', - 'countryCode' => 248, - 'internationalPrefix' => '010|0[0-2]', - 'preferredInternationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[246]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '8000\\d{3}|(?:[249]\\d|64)\\d{5}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '4[2-46]\\d{5}', + 'ExampleNumber' => '4217123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '2[5-8]\\d{5}', + 'ExampleNumber' => '2510123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8000\\d{3}', + 'ExampleNumber' => '8000000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '971\\d{4}|(?:64|95)\\d{5}', + 'ExampleNumber' => '6412345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SC', + 'countryCode' => 248, + 'internationalPrefix' => '010|0[0-2]', + 'preferredInternationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[246]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SD.php b/lib/libphonenumber/data/PhoneNumberMetadata_SD.php index 14cb71ff..82e626fb 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SD.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SD.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '1(?:5[3-7]|8[35-7])\\d{6}', - 'ExampleNumber' => '153123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:1[0-2]|9[0-3569])\\d{7}', - 'ExampleNumber' => '911231234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SD', - 'countryCode' => 249, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[19]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '1(?:5[3-7]|8[35-7])\\d{6}', + 'ExampleNumber' => '153123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:1[0-2]|9[0-3569])\\d{7}', + 'ExampleNumber' => '911231234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SD', + 'countryCode' => 249, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[19]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SE.php b/lib/libphonenumber/data/PhoneNumberMetadata_SE.php index 181a8ad7..87cbdb58 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SE.php @@ -10,423 +10,336 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - 5 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '10[1-8]\\d{6}|90[1-9]\\d{4,6}|(?:[12][136]|3[356]|4[0246]|6[03]|8\\d)\\d{5,7}|(?:1(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)|2(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])|3(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])|4(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])|6(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])|9(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8]))\\d{5,6}', - 'ExampleNumber' => '8123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[02369]\\d{7}', - 'ExampleNumber' => '701234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '20\\d{4,7}', - 'ExampleNumber' => '20123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '649\\d{6}|9(?:00|39|44)[1-8]\\d{3,6}', - 'ExampleNumber' => '9001234567', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '77[0-7]\\d{6}', - 'ExampleNumber' => '771234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '75[1-8]\\d{6}', - 'ExampleNumber' => '751234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '74[02-9]\\d{6}', - 'ExampleNumber' => '740123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '(?:25[245]|67[3-68])\\d{9}', - 'ExampleNumber' => '254123456789', - 'PossibleLength' => - array ( - 0 => 12, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SE', - 'countryCode' => 46, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2,3})(\\d{2})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '20', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '9(?:00|39|44)', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[12][136]|3[356]|4[0246]|6[03]|90[1-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{2,3})(\\d{2})(\\d{2})', - 'format' => '$1-$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{2,3})(\\d{2})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{2,3})(\\d{3})', - 'format' => '$1-$2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9(?:00|39|44)', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})', - 'format' => '$1-$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1-$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1-$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1-$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 10 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1-$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 11 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1-$2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '[26]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2,3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '20', - ), - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '9(?:00|39|44)', - ), - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[12][136]|3[356]|4[0246]|6[03]|90[1-9]', - ), - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{2,3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{2,3})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])', - ), - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{2,3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9(?:00|39|44)', - ), - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]', - ), - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - ), - 8 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - ), - 9 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])', - ), - ), - 10 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{3})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - ), - 11 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4 $5', - 'leadingDigitsPatterns' => - array ( - 0 => '[26]', - ), - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + 5 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '10[1-8]\\d{6}|90[1-9]\\d{4,6}|(?:[12][136]|3[356]|4[0246]|6[03]|8\\d)\\d{5,7}|(?:1(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)|2(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])|3(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])|4(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])|6(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])|9(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8]))\\d{5,6}', + 'ExampleNumber' => '8123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[02369]\\d{7}', + 'ExampleNumber' => '701234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '20\\d{4,7}', + 'ExampleNumber' => '20123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '649\\d{6}|9(?:00|39|44)[1-8]\\d{3,6}', + 'ExampleNumber' => '9001234567', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '77[0-7]\\d{6}', + 'ExampleNumber' => '771234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '75[1-8]\\d{6}', + 'ExampleNumber' => '751234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '74[02-9]\\d{6}', + 'ExampleNumber' => '740123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '(?:25[245]|67[3-68])\\d{9}', + 'ExampleNumber' => '254123456789', + 'PossibleLength' => [ + 0 => 12, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SE', + 'countryCode' => 46, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2,3})(\\d{2})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '20', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '9(?:00|39|44)', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[12][136]|3[356]|4[0246]|6[03]|90[1-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{2,3})(\\d{2})(\\d{2})', + 'format' => '$1-$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{2,3})(\\d{2})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{2,3})(\\d{3})', + 'format' => '$1-$2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9(?:00|39|44)', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})', + 'format' => '$1-$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1-$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})', + 'format' => '$1-$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1-$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 10 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1-$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 11 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1-$2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '[26]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2,3})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '20', + ], + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '9(?:00|39|44)', + ], + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[12][136]|3[356]|4[0246]|6[03]|90[1-9]', + ], + ], + 3 => [ + 'pattern' => '(\\d)(\\d{2,3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{2,3})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])', + ], + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{2,3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9(?:00|39|44)', + ], + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]', + ], + ], + 7 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + ], + 8 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + ], + 9 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])', + ], + ], + 10 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{3})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + ], + 11 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4 $5', + 'leadingDigitsPatterns' => [ + 0 => '[26]', + ], + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SG.php b/lib/libphonenumber/data/PhoneNumberMetadata_SG.php index e67defc9..4c0d3188 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SG.php @@ -10,263 +10,206 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 10, - 2 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '6[1-9]\\d{6}', - 'ExampleNumber' => '61234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:8[1-8]|9[0-8])\\d{6}', - 'ExampleNumber' => '81234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '(?:18|8)00\\d{7}', - 'ExampleNumber' => '18001234567', - 'PossibleLength' => - array ( - 0 => 10, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1900\\d{7}', - 'ExampleNumber' => '19001234567', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '3[12]\\d{6}', - 'ExampleNumber' => '31234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '7000\\d{7}', - 'ExampleNumber' => '70001234567', - 'PossibleLength' => - array ( - 0 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SG', - 'countryCode' => 65, - 'internationalPrefix' => '0[0-3]\\d', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4,5})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '1[0135-7]|77', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[369]|8[1-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[369]|8[1-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 10, + 2 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '6[1-9]\\d{6}', + 'ExampleNumber' => '61234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:8[1-8]|9[0-8])\\d{6}', + 'ExampleNumber' => '81234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '(?:18|8)00\\d{7}', + 'ExampleNumber' => '18001234567', + 'PossibleLength' => [ + 0 => 10, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1900\\d{7}', + 'ExampleNumber' => '19001234567', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '3[12]\\d{6}', + 'ExampleNumber' => '31234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '7000\\d{7}', + 'ExampleNumber' => '70001234567', + 'PossibleLength' => [ + 0 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SG', + 'countryCode' => 65, + 'internationalPrefix' => '0[0-3]\\d', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4,5})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '1[0135-7]|77', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[369]|8[1-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[369]|8[1-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SH.php b/lib/libphonenumber/data/PhoneNumberMetadata_SH.php index 75d96feb..f6ded111 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SH.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SH.php @@ -10,147 +10,108 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[256]\\d|8)\\d{3}', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:[0-57-9]\\d|6[4-9])\\d\\d', - 'ExampleNumber' => '22158', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[56]\\d{4}', - 'ExampleNumber' => '51234', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '262\\d\\d', - 'ExampleNumber' => '26212', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SH', - 'countryCode' => 290, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => true, - 'leadingDigits' => '[256]', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[256]\\d|8)\\d{3}', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:[0-57-9]\\d|6[4-9])\\d\\d', + 'ExampleNumber' => '22158', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[56]\\d{4}', + 'ExampleNumber' => '51234', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '262\\d\\d', + 'ExampleNumber' => '26212', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SH', + 'countryCode' => 290, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => true, + 'leadingDigits' => '[256]', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SI.php b/lib/libphonenumber/data/PhoneNumberMetadata_SI.php index 58a33686..209223c4 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SI.php @@ -10,206 +10,159 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[1-357][2-8]|4[24-8])\\d{6}', - 'ExampleNumber' => '12345678', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6(?:5(?:1\\d|55|[67]0)|9(?:10|[69]\\d))\\d{4}|(?:[37][01]|4[0139]|51|6[48])\\d{6}', - 'ExampleNumber' => '31234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{4,6}', - 'ExampleNumber' => '80123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '89[1-3]\\d{2,5}|90\\d{4,6}', - 'ExampleNumber' => '90123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '(?:59\\d\\d|8(?:1(?:[67]\\d|8[01389])|2(?:0\\d|2[0378]|8[0-2489])|3[389]\\d))\\d{4}', - 'ExampleNumber' => '59012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SI', - 'countryCode' => 386, - 'internationalPrefix' => '00|10(?:22|66|88|99)', - 'preferredInternationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8[09]|9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '59|8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[37][01]|4[0139]|51|6', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-57]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:[1-357][2-8]|4[24-8])\\d{6}', + 'ExampleNumber' => '12345678', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6(?:5(?:1\\d|55|[67]0)|9(?:10|[69]\\d))\\d{4}|(?:[37][01]|4[0139]|51|6[48])\\d{6}', + 'ExampleNumber' => '31234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{4,6}', + 'ExampleNumber' => '80123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '89[1-3]\\d{2,5}|90\\d{4,6}', + 'ExampleNumber' => '90123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '(?:59\\d\\d|8(?:1(?:[67]\\d|8[01389])|2(?:0\\d|2[0378]|8[0-2489])|3[389]\\d))\\d{4}', + 'ExampleNumber' => '59012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SI', + 'countryCode' => 386, + 'internationalPrefix' => '00|10(?:22|66|88|99)', + 'preferredInternationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8[09]|9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '59|8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[37][01]|4[0139]|51|6', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[1-57]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SJ.php b/lib/libphonenumber/data/PhoneNumberMetadata_SJ.php index b38df4d5..c254a882 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SJ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SJ.php @@ -10,159 +10,120 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '0\\d{4}|(?:[4589]\\d|79)\\d{6}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '79\\d{6}', - 'ExampleNumber' => '79123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:4[015-8]|5[89]|9\\d)\\d{6}', - 'ExampleNumber' => '41234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[01]\\d{5}', - 'ExampleNumber' => '80012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '82[09]\\d{5}', - 'ExampleNumber' => '82012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '810(?:0[0-6]|[2-8]\\d)\\d{3}', - 'ExampleNumber' => '81021234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '880\\d{5}', - 'ExampleNumber' => '88012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '85[0-5]\\d{5}', - 'ExampleNumber' => '85012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:0[2-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}', - 'ExampleNumber' => '02000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '81[23]\\d{5}', - 'ExampleNumber' => '81212345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SJ', - 'countryCode' => 47, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '79', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '0\\d{4}|(?:[4589]\\d|79)\\d{6}', + 'PossibleLength' => [ + 0 => 5, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '79\\d{6}', + 'ExampleNumber' => '79123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:4[015-8]|5[89]|9\\d)\\d{6}', + 'ExampleNumber' => '41234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[01]\\d{5}', + 'ExampleNumber' => '80012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '82[09]\\d{5}', + 'ExampleNumber' => '82012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '810(?:0[0-6]|[2-8]\\d)\\d{3}', + 'ExampleNumber' => '81021234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '880\\d{5}', + 'ExampleNumber' => '88012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '85[0-5]\\d{5}', + 'ExampleNumber' => '85012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:0[2-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}', + 'ExampleNumber' => '02000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '81[23]\\d{5}', + 'ExampleNumber' => '81212345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SJ', + 'countryCode' => 47, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '79', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SK.php b/lib/libphonenumber/data/PhoneNumberMetadata_SK.php index 82a57797..55376017 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SK.php @@ -10,296 +10,235 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:16|[2-9]\\d{3})|[3-5][1-8]\\d{3})\\d{4}|(?:2|[3-5][1-8])1[67]\\d{3}|[3-5][1-8]16\\d\\d', - 'ExampleNumber' => '221234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|[45]\\d)\\d{6}', - 'ExampleNumber' => '912123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9(?:00|[78]\\d)\\d{6}', - 'ExampleNumber' => '900123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '8[5-9]\\d{7}', - 'ExampleNumber' => '850123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '6(?:02|5[0-4]|9[0-6])\\d{6}', - 'ExampleNumber' => '690123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '9090\\d{3}', - 'ExampleNumber' => '9090123', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '96\\d{7}', - 'ExampleNumber' => '961234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '9090\\d{3}|(?:602|8(?:00|[5-9]\\d)|9(?:00|[78]\\d))\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SK', - 'countryCode' => 421, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '21', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-5][1-8]1', - 1 => '[3-5][1-8]1[67]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '909', - 1 => '9090', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1/$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[689]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1/$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-5]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{2})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '21', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-5][1-8]1', - 1 => '[3-5][1-8]1[67]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})', - 'format' => '$1/$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[689]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1/$2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-5]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:16|[2-9]\\d{3})|[3-5][1-8]\\d{3})\\d{4}|(?:2|[3-5][1-8])1[67]\\d{3}|[3-5][1-8]16\\d\\d', + 'ExampleNumber' => '221234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|[45]\\d)\\d{6}', + 'ExampleNumber' => '912123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9(?:00|[78]\\d)\\d{6}', + 'ExampleNumber' => '900123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '8[5-9]\\d{7}', + 'ExampleNumber' => '850123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '6(?:02|5[0-4]|9[0-6])\\d{6}', + 'ExampleNumber' => '690123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '9090\\d{3}', + 'ExampleNumber' => '9090123', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '96\\d{7}', + 'ExampleNumber' => '961234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '9090\\d{3}|(?:602|8(?:00|[5-9]\\d)|9(?:00|[78]\\d))\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SK', + 'countryCode' => 421, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '21', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3-5][1-8]1', + 1 => '[3-5][1-8]1[67]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{3})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '909', + 1 => '9090', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})', + 'format' => '$1/$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[689]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1/$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[3-5]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{2})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '21', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3-5][1-8]1', + 1 => '[3-5][1-8]1[67]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})', + 'format' => '$1/$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[689]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1/$2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[3-5]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SL.php b/lib/libphonenumber/data/PhoneNumberMetadata_SL.php index bfc44cf0..afb6bc22 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SL.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SL.php @@ -10,158 +10,117 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2-578]\\d|66|99)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[235]2[2-4][2-9]\\d{4}', - 'ExampleNumber' => '22221234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:2[15]|3[013-5]|4[04]|5[05]|66|7[5-9]|8[08]|99)\\d{6}', - 'ExampleNumber' => '25123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SL', - 'countryCode' => 232, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2-578]\\d|66|99)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[235]2[2-4][2-9]\\d{4}', + 'ExampleNumber' => '22221234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:2[15]|3[013-5]|4[04]|5[05]|66|7[5-9]|8[08]|99)\\d{6}', + 'ExampleNumber' => '25123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SL', + 'countryCode' => 232, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SM.php b/lib/libphonenumber/data/PhoneNumberMetadata_SM.php index d9afec16..4aa7ba14 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SM.php @@ -10,213 +10,164 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:0549|[5-7]\\d)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '0549(?:8[0157-9]|9\\d)\\d{4}', - 'ExampleNumber' => '0549886377', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6[16]\\d{6}', - 'ExampleNumber' => '66661212', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '7[178]\\d{6}', - 'ExampleNumber' => '71123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '5[158]\\d{6}', - 'ExampleNumber' => '58001110', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SM', - 'countryCode' => 378, - 'internationalPrefix' => '00', - 'nationalPrefixForParsing' => '([89]\\d{5})$', - 'nationalPrefixTransformRule' => '0549$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[5-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[5-7]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:0549|[5-7]\\d)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '0549(?:8[0157-9]|9\\d)\\d{4}', + 'ExampleNumber' => '0549886377', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6[16]\\d{6}', + 'ExampleNumber' => '66661212', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '7[178]\\d{6}', + 'ExampleNumber' => '71123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '5[158]\\d{6}', + 'ExampleNumber' => '58001110', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SM', + 'countryCode' => 378, + 'internationalPrefix' => '00', + 'nationalPrefixForParsing' => '([89]\\d{5})$', + 'nationalPrefixTransformRule' => '0549$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{6})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[5-7]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[5-7]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SN.php b/lib/libphonenumber/data/PhoneNumberMetadata_SN.php index dccf6bfc..876f82e1 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SN.php @@ -10,170 +10,127 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[378]\\d{4}|93330)\\d{4}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '3(?:0(?:1[0-2]|80)|282|3(?:8[1-9]|9[3-9])|611)\\d{5}', - 'ExampleNumber' => '301012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7(?:[06-8]\\d|21|90)\\d{6}', - 'ExampleNumber' => '701234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '88[4689]\\d{6}', - 'ExampleNumber' => '884123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '81[02468]\\d{6}', - 'ExampleNumber' => '810123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '93330\\d{4}|3(?:392|9[01]\\d)\\d{5}', - 'ExampleNumber' => '933301234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SN', - 'countryCode' => 221, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[379]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[378]\\d{4}|93330)\\d{4}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '3(?:0(?:1[0-2]|80)|282|3(?:8[1-9]|9[3-9])|611)\\d{5}', + 'ExampleNumber' => '301012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7(?:[06-8]\\d|21|90)\\d{6}', + 'ExampleNumber' => '701234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '88[4689]\\d{6}', + 'ExampleNumber' => '884123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '81[02468]\\d{6}', + 'ExampleNumber' => '810123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '93330\\d{4}|3(?:392|9[01]\\d)\\d{5}', + 'ExampleNumber' => '933301234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SN', + 'countryCode' => 221, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[379]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SO.php b/lib/libphonenumber/data/PhoneNumberMetadata_SO.php index 3ab2c674..b72e760f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SO.php @@ -10,224 +10,173 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[346-9]\\d{8}|[12679]\\d{7}|(?:[1-4]\\d|59)\\d{5}|[1348]\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|59)\\d{5}|(?:[134]\\d|8[125])\\d{4}', - 'ExampleNumber' => '4012345', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '28\\d{5}|(?:6[1-9]|79)\\d{6,7}|(?:15|24|(?:3[59]|4[89]|8[08])\\d|60|7[1-8]|9(?:0[67]|[2-9]))\\d{6}', - 'ExampleNumber' => '71123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SO', - 'countryCode' => 252, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8[125]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{6})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '[134]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d)(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1|2[0-79]|3[0-46-8]|4[0-7]|59', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d)(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '24|[67]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[348]|64|79[0-8]|90', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{2})(\\d{5,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1|28|6[1-35-9]|799|9[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[346-9]\\d{8}|[12679]\\d{7}|(?:[1-4]\\d|59)\\d{5}|[1348]\\d{5}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|59)\\d{5}|(?:[134]\\d|8[125])\\d{4}', + 'ExampleNumber' => '4012345', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '28\\d{5}|(?:6[1-9]|79)\\d{6,7}|(?:15|24|(?:3[59]|4[89]|8[08])\\d|60|7[1-8]|9(?:0[67]|[2-9]))\\d{6}', + 'ExampleNumber' => '71123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SO', + 'countryCode' => 252, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8[125]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{6})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '[134]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d)(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1|2[0-79]|3[0-46-8]|4[0-7]|59', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d)(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '24|[67]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[348]|64|79[0-8]|90', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{2})(\\d{5,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1|28|6[1-35-9]|799|9[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SR.php b/lib/libphonenumber/data/PhoneNumberMetadata_SR.php index 4925dafb..55d855a5 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SR.php @@ -10,182 +10,137 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2-5]|68|[78]\\d)\\d{5}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[1-3]|3[0-7]|(?:4|68)\\d|5[2-58])\\d{4}', - 'ExampleNumber' => '211234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:7[124-7]|8[125-9])\\d{5}', - 'ExampleNumber' => '7412345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '56\\d{4}', - 'ExampleNumber' => '561234', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SR', - 'countryCode' => 597, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '56', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-5]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[6-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2-5]|68|[78]\\d)\\d{5}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2[1-3]|3[0-7]|(?:4|68)\\d|5[2-58])\\d{4}', + 'ExampleNumber' => '211234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:7[124-7]|8[125-9])\\d{5}', + 'ExampleNumber' => '7412345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '56\\d{4}', + 'ExampleNumber' => '561234', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SR', + 'countryCode' => 597, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '56', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[2-5]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[6-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SS.php b/lib/libphonenumber/data/PhoneNumberMetadata_SS.php index 5e1abd4e..9044ec65 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SS.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SS.php @@ -10,156 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '18\\d{7}', - 'ExampleNumber' => '181234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:12|9[1257])\\d{7}', - 'ExampleNumber' => '977123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SS', - 'countryCode' => 211, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[19]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '18\\d{7}', + 'ExampleNumber' => '181234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:12|9[1257])\\d{7}', + 'ExampleNumber' => '977123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SS', + 'countryCode' => 211, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[19]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ST.php b/lib/libphonenumber/data/PhoneNumberMetadata_ST.php index 79e003da..cd9927e2 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ST.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ST.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:22|9\\d)\\d{5}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '22\\d{5}', - 'ExampleNumber' => '2221234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}', - 'ExampleNumber' => '9812345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ST', - 'countryCode' => 239, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[29]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:22|9\\d)\\d{5}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '22\\d{5}', + 'ExampleNumber' => '2221234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}', + 'ExampleNumber' => '9812345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ST', + 'countryCode' => 239, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[29]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SV.php b/lib/libphonenumber/data/PhoneNumberMetadata_SV.php index 23e1ed97..70f757fb 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SV.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SV.php @@ -10,188 +10,143 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2[1-6]\\d{6}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '[67]\\d{7}', - 'ExampleNumber' => '70123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{4}(?:\\d{4})?', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{4}(?:\\d{4})?', - 'ExampleNumber' => '9001234', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SV', - 'countryCode' => 503, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[267]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2[1-6]\\d{6}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '[67]\\d{7}', + 'ExampleNumber' => '70123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{4}(?:\\d{4})?', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + 0 => 7, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{4}(?:\\d{4})?', + 'ExampleNumber' => '9001234', + 'PossibleLength' => [ + 0 => 7, + 1 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SV', + 'countryCode' => 503, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[267]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SX.php b/lib/libphonenumber/data/PhoneNumberMetadata_SX.php index be193924..58de3d32 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SX.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SX.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '7215(?:4[2-8]|8[239]|9[056])\\d{4}', - 'ExampleNumber' => '7215425678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}', - 'ExampleNumber' => '7215205678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SX', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|(5\\d{6})$', - 'nationalPrefixTransformRule' => '721$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '721', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '7215(?:4[2-8]|8[239]|9[056])\\d{4}', + 'ExampleNumber' => '7215425678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}', + 'ExampleNumber' => '7215205678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SX', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|(5\\d{6})$', + 'nationalPrefixTransformRule' => '721$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '721', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SY.php b/lib/libphonenumber/data/PhoneNumberMetadata_SY.php index be750bd8..39d70f09 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SY.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SY.php @@ -10,174 +10,131 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-39]\\d{8}|[1-5]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[12]1\\d{6,7}|(?:1(?:[2356]|4\\d)|2[235]|3(?:[13]\\d|4)|4[13]|5[1-3])\\d{6}', - 'ExampleNumber' => '112345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - 1 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9(?:22|[3-589]\\d|6[024-9])\\d{6}', - 'ExampleNumber' => '944567890', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SY', - 'countryCode' => 963, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-5]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-39]\\d{8}|[1-5]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[12]1\\d{6,7}|(?:1(?:[2356]|4\\d)|2[235]|3(?:[13]\\d|4)|4[13]|5[1-3])\\d{6}', + 'ExampleNumber' => '112345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + 1 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9(?:22|[3-589]\\d|6[024-9])\\d{6}', + 'ExampleNumber' => '944567890', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SY', + 'countryCode' => 963, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-5]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_SZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_SZ.php index 3e7de3ce..8864ee39 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_SZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_SZ.php @@ -10,176 +10,133 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '0800\\d{4}|(?:[237]\\d|900)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '[23][2-5]\\d{6}', - 'ExampleNumber' => '22171234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[6-9]\\d{6}', - 'ExampleNumber' => '76123456', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0800\\d{4}', - 'ExampleNumber' => '08001234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{6}', - 'ExampleNumber' => '900012345', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '70\\d{6}', - 'ExampleNumber' => '70012345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '0800\\d{4}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SZ', - 'countryCode' => 268, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[0237]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{5})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '0800\\d{4}|(?:[237]\\d|900)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '[23][2-5]\\d{6}', + 'ExampleNumber' => '22171234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[6-9]\\d{6}', + 'ExampleNumber' => '76123456', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0800\\d{4}', + 'ExampleNumber' => '08001234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{6}', + 'ExampleNumber' => '900012345', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '70\\d{6}', + 'ExampleNumber' => '70012345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '0800\\d{4}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SZ', + 'countryCode' => 268, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[0237]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{5})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TA.php b/lib/libphonenumber/data/PhoneNumberMetadata_TA.php index 586e0f37..332df2d7 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TA.php @@ -10,142 +10,103 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '8\\d{3}', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '8\\d{3}', - 'ExampleNumber' => '8999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TA', - 'countryCode' => 290, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '8', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '8\\d{3}', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '8\\d{3}', + 'ExampleNumber' => '8999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TA', + 'countryCode' => 290, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '8', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TC.php b/lib/libphonenumber/data/PhoneNumberMetadata_TC.php index ac47eb7e..536ac30e 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TC.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TC.php @@ -10,154 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|649|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '649(?:712|9(?:4\\d|50))\\d{4}', - 'ExampleNumber' => '6497121234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '649(?:2(?:3[129]|4[1-7])|3(?:3[1-389]|4[1-8])|4[34][1-3])\\d{4}', - 'ExampleNumber' => '6492311234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '64971[01]\\d{4}', - 'ExampleNumber' => '6497101234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TC', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-479]\\d{6})$', - 'nationalPrefixTransformRule' => '649$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '649', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[58]\\d\\d|649|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '649(?:712|9(?:4\\d|50))\\d{4}', + 'ExampleNumber' => '6497121234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '649(?:2(?:3[129]|4[1-7])|3(?:3[1-389]|4[1-8])|4[34][1-3])\\d{4}', + 'ExampleNumber' => '6492311234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '64971[01]\\d{4}', + 'ExampleNumber' => '6497101234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TC', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-479]\\d{6})$', + 'nationalPrefixTransformRule' => '649$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '649', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TD.php b/lib/libphonenumber/data/PhoneNumberMetadata_TD.php index 0aac9dca..ec11f872 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TD.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TD.php @@ -10,155 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:22|[69]\\d|77)\\d{6}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '22(?:[37-9]0|5[0-5]|6[89])\\d{4}', - 'ExampleNumber' => '22501234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:6[023568]|77|9\\d)\\d{6}', - 'ExampleNumber' => '63012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TD', - 'countryCode' => 235, - 'internationalPrefix' => '00|16', - 'preferredInternationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[2679]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:22|[69]\\d|77)\\d{6}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '22(?:[37-9]0|5[0-5]|6[89])\\d{4}', + 'ExampleNumber' => '22501234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:6[023568]|77|9\\d)\\d{6}', + 'ExampleNumber' => '63012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TD', + 'countryCode' => 235, + 'internationalPrefix' => '00|16', + 'preferredInternationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[2679]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TG.php b/lib/libphonenumber/data/PhoneNumberMetadata_TG.php index e65d36de..bdc62400 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TG.php @@ -10,154 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[279]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:2[2-7]|3[23]|4[45]|55|6[67]|77)\\d{5}', - 'ExampleNumber' => '22212345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:7[09]|9[0-36-9])\\d{6}', - 'ExampleNumber' => '90112345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TG', - 'countryCode' => 228, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[279]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[279]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:2[2-7]|3[23]|4[45]|55|6[67]|77)\\d{5}', + 'ExampleNumber' => '22212345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:7[09]|9[0-36-9])\\d{6}', + 'ExampleNumber' => '90112345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TG', + 'countryCode' => 228, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[279]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TH.php b/lib/libphonenumber/data/PhoneNumberMetadata_TH.php index 92bb20cd..622080c6 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TH.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TH.php @@ -10,190 +10,145 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{8,9}|(?:[2-57]|[689]\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}', - 'ExampleNumber' => '21234567', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:14|6[1-6]|[89]\\d)\\d{7}', - 'ExampleNumber' => '812345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1800\\d{6}', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1900\\d{6}', - 'ExampleNumber' => '1900123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '6[08]\\d{7}', - 'ExampleNumber' => '601234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TH', - 'countryCode' => 66, - 'internationalPrefix' => '00[1-9]', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '14|[3-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{8,9}|(?:[2-57]|[689]\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}', + 'ExampleNumber' => '21234567', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:14|6[1-6]|[89]\\d)\\d{7}', + 'ExampleNumber' => '812345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1800\\d{6}', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1900\\d{6}', + 'ExampleNumber' => '1900123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '6[08]\\d{7}', + 'ExampleNumber' => '601234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TH', + 'countryCode' => 66, + 'internationalPrefix' => '00[1-9]', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '14|[3-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TJ.php b/lib/libphonenumber/data/PhoneNumberMetadata_TJ.php index f701cac7..65a55c02 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TJ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TJ.php @@ -10,202 +10,155 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[3-59]\\d|77|88)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 3, - 1 => 5, - 2 => 6, - 3 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}', - 'ExampleNumber' => '372123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 3, - 1 => 5, - 2 => 6, - 3 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '41[18]\\d{6}|(?:5[05]|77|88|9[0-35-9])\\d{7}', - 'ExampleNumber' => '917123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TJ', - 'countryCode' => 992, - 'internationalPrefix' => '810', - 'preferredInternationalPrefix' => '8~10', - 'nationalPrefix' => '8', - 'nationalPrefixForParsing' => '8', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{6})(\\d)(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '331', - 1 => '3317', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[34]7|91[78]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d)(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '3', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[457-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[3-59]\\d|77|88)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 3, + 1 => 5, + 2 => 6, + 3 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}', + 'ExampleNumber' => '372123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 3, + 1 => 5, + 2 => 6, + 3 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '41[18]\\d{6}|(?:5[05]|77|88|9[0-35-9])\\d{7}', + 'ExampleNumber' => '917123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TJ', + 'countryCode' => 992, + 'internationalPrefix' => '810', + 'preferredInternationalPrefix' => '8~10', + 'nationalPrefix' => '8', + 'nationalPrefixForParsing' => '8', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{6})(\\d)(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '331', + 1 => '3317', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[34]7|91[78]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d)(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '3', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[457-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TK.php b/lib/libphonenumber/data/PhoneNumberMetadata_TK.php index 1b5ac9fb..620dc2fb 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TK.php @@ -10,145 +10,106 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-47]\\d{3,6}', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[2-4]|[34]\\d)\\d{2,5}', - 'ExampleNumber' => '3101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[2-4]\\d{2,5}', - 'ExampleNumber' => '7290', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TK', - 'countryCode' => 690, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-47]\\d{3,6}', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2[2-4]|[34]\\d)\\d{2,5}', + 'ExampleNumber' => '3101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[2-4]\\d{2,5}', + 'ExampleNumber' => '7290', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TK', + 'countryCode' => 690, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TL.php b/lib/libphonenumber/data/PhoneNumberMetadata_TL.php index 5f6457a3..4809cd25 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TL.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TL.php @@ -10,175 +10,132 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[1-5]|3[1-9]|4[1-4])\\d{5}', - 'ExampleNumber' => '2112345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[3-8]\\d{6}', - 'ExampleNumber' => '77212345', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{5}', - 'ExampleNumber' => '8012345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90\\d{5}', - 'ExampleNumber' => '9012345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '70\\d{5}', - 'ExampleNumber' => '7012345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TL', - 'countryCode' => 670, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-489]|70', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2[1-5]|3[1-9]|4[1-4])\\d{5}', + 'ExampleNumber' => '2112345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[3-8]\\d{6}', + 'ExampleNumber' => '77212345', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{5}', + 'ExampleNumber' => '8012345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90\\d{5}', + 'ExampleNumber' => '9012345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '70\\d{5}', + 'ExampleNumber' => '7012345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TL', + 'countryCode' => 670, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[2-489]|70', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TM.php b/lib/libphonenumber/data/PhoneNumberMetadata_TM.php index 98975dcd..28f5b3c4 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TM.php @@ -10,181 +10,136 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-6]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}', - 'ExampleNumber' => '12345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '6[1-9]\\d{6}', - 'ExampleNumber' => '66123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TM', - 'countryCode' => 993, - 'internationalPrefix' => '810', - 'preferredInternationalPrefix' => '8~10', - 'nationalPrefix' => '8', - 'nationalPrefixForParsing' => '8', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '12', - ), - 'nationalPrefixFormattingRule' => '(8 $1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{2})(\\d{2})', - 'format' => '$1 $2-$3-$4', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-5]', - ), - 'nationalPrefixFormattingRule' => '(8 $1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '6', - ), - 'nationalPrefixFormattingRule' => '8 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-6]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}', + 'ExampleNumber' => '12345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '6[1-9]\\d{6}', + 'ExampleNumber' => '66123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TM', + 'countryCode' => 993, + 'internationalPrefix' => '810', + 'preferredInternationalPrefix' => '8~10', + 'nationalPrefix' => '8', + 'nationalPrefixForParsing' => '8', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2-$3-$4', + 'leadingDigitsPatterns' => [ + 0 => '12', + ], + 'nationalPrefixFormattingRule' => '(8 $1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{2})(\\d{2})', + 'format' => '$1 $2-$3-$4', + 'leadingDigitsPatterns' => [ + 0 => '[1-5]', + ], + 'nationalPrefixFormattingRule' => '(8 $1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '6', + ], + 'nationalPrefixFormattingRule' => '8 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TN.php b/lib/libphonenumber/data/PhoneNumberMetadata_TN.php index 2b4f2bb9..b74f00fa 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TN.php @@ -10,157 +10,116 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-57-9]\\d{7}', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '81200\\d{3}|(?:3[0-2]|7\\d)\\d{6}', - 'ExampleNumber' => '30010123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-6])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}', - 'ExampleNumber' => '20123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8010\\d{4}', - 'ExampleNumber' => '80101234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '88\\d{6}', - 'ExampleNumber' => '88123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '8[12]10\\d{4}', - 'ExampleNumber' => '81101234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TN', - 'countryCode' => 216, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-57-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-57-9]\\d{7}', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '81200\\d{3}|(?:3[0-2]|7\\d)\\d{6}', + 'ExampleNumber' => '30010123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-6])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}', + 'ExampleNumber' => '20123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8010\\d{4}', + 'ExampleNumber' => '80101234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '88\\d{6}', + 'ExampleNumber' => '88123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '8[12]10\\d{4}', + 'ExampleNumber' => '81101234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TN', + 'countryCode' => 216, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-57-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TO.php b/lib/libphonenumber/data/PhoneNumberMetadata_TO.php index f587751f..5457bf5c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TO.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TO.php @@ -10,183 +10,138 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[78]\\d{6}|[2-478]\\d{4}|(?:080|[56])0\\d{3}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2\\d|3[1-8]|4[1-4]|[56]0|7[0149]|8[05])\\d{3}', - 'ExampleNumber' => '20123', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:7[578]|8[46-9])\\d{5}', - 'ExampleNumber' => '7715123', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0800\\d{3}', - 'ExampleNumber' => '0800222', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TO', - 'countryCode' => 676, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-6]|7[014]|8[05]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '0', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '7[578]|8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[78]\\d{6}|[2-478]\\d{4}|(?:080|[56])0\\d{3}', + 'PossibleLength' => [ + 0 => 5, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2\\d|3[1-8]|4[1-4]|[56]0|7[0149]|8[05])\\d{3}', + 'ExampleNumber' => '20123', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:7[578]|8[46-9])\\d{5}', + 'ExampleNumber' => '7715123', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0800\\d{3}', + 'ExampleNumber' => '0800222', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TO', + 'countryCode' => 676, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[2-6]|7[014]|8[05]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{3})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '0', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '7[578]|8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TR.php b/lib/libphonenumber/data/PhoneNumberMetadata_TR.php index 2f9c4688..0aba8812 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TR.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TR.php @@ -10,245 +10,192 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[2-58]\\d\\d|900)\\d{7}|4\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}', - 'ExampleNumber' => '2123456789', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '56161\\d{5}|5(?:0[15-7]|1[06]|24|[34]\\d|5[1-59]|9[46])\\d{7}', - 'ExampleNumber' => '5012345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:8[89]8|900)\\d{7}', - 'ExampleNumber' => '9001234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '592(?:21[12]|461)\\d{4}', - 'ExampleNumber' => '5922121234', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'NationalNumberPattern' => '512\\d{7}', - 'ExampleNumber' => '5123456789', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:444|850\\d{3})\\d{4}', - 'ExampleNumber' => '4441444', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '444\\d{4}', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TR', - 'countryCode' => 90, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d)(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '444', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '512|8[0589]|90', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '5(?:[0-59]|61)', - 1 => '5(?:[0-59]|616)', - 2 => '5(?:[0-59]|6161)', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[24][1-8]|3[1-9]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '512|8[0589]|90', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '5(?:[0-59]|61)', - 1 => '5(?:[0-59]|616)', - 2 => '5(?:[0-59]|6161)', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[24][1-8]|3[1-9]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[2-58]\\d\\d|900)\\d{7}|4\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}', + 'ExampleNumber' => '2123456789', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '56161\\d{5}|5(?:0[15-7]|1[06]|24|[34]\\d|5[1-59]|9[46])\\d{7}', + 'ExampleNumber' => '5012345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:8[89]8|900)\\d{7}', + 'ExampleNumber' => '9001234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '592(?:21[12]|461)\\d{4}', + 'ExampleNumber' => '5922121234', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'NationalNumberPattern' => '512\\d{7}', + 'ExampleNumber' => '5123456789', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:444|850\\d{3})\\d{4}', + 'ExampleNumber' => '4441444', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '444\\d{4}', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TR', + 'countryCode' => 90, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d)(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '444', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '512|8[0589]|90', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '5(?:[0-59]|61)', + 1 => '5(?:[0-59]|616)', + 2 => '5(?:[0-59]|6161)', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[24][1-8]|3[1-9]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '512|8[0589]|90', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '5(?:[0-59]|61)', + 1 => '5(?:[0-59]|616)', + 2 => '5(?:[0-59]|6161)', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[24][1-8]|3[1-9]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TT.php b/lib/libphonenumber/data/PhoneNumberMetadata_TT.php index de484ce5..0fe698ef 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TT.php @@ -10,154 +10,115 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '868(?:2(?:01|1[89]|[23]\\d)|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}', - 'ExampleNumber' => '8682211234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '868(?:2(?:6[6-9]|[7-9]\\d)|[37](?:0[1-9]|1[02-9]|[2-9]\\d)|4[6-9]\\d|6(?:20|78|8\\d))\\d{4}', - 'ExampleNumber' => '8682911234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '868619\\d{4}', - 'ExampleNumber' => '8686191234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TT', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-46-8]\\d{6})$', - 'nationalPrefixTransformRule' => '868$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '868', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '868(?:2(?:01|1[89]|[23]\\d)|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}', + 'ExampleNumber' => '8682211234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '868(?:2(?:6[6-9]|[7-9]\\d)|[37](?:0[1-9]|1[02-9]|[2-9]\\d)|4[6-9]\\d|6(?:20|78|8\\d))\\d{4}', + 'ExampleNumber' => '8682911234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '868619\\d{4}', + 'ExampleNumber' => '8686191234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TT', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-46-8]\\d{6})$', + 'nationalPrefixTransformRule' => '868$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '868', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TV.php b/lib/libphonenumber/data/PhoneNumberMetadata_TV.php index 416cd0c0..b8e44663 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TV.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TV.php @@ -10,147 +10,108 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:2|7\\d\\d|90)\\d{4}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2[02-9]\\d{3}', - 'ExampleNumber' => '20123', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:7[01]\\d|90)\\d{4}', - 'ExampleNumber' => '901234', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TV', - 'countryCode' => 688, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:2|7\\d\\d|90)\\d{4}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2[02-9]\\d{3}', + 'ExampleNumber' => '20123', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:7[01]\\d|90)\\d{4}', + 'ExampleNumber' => '901234', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TV', + 'countryCode' => 688, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TW.php b/lib/libphonenumber/data/PhoneNumberMetadata_TW.php index 25ac2235..d32295c0 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TW.php @@ -10,222 +10,173 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[24589]|7\\d)\\d{8}|[2-8]\\d{7}|2\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '24\\d{6,7}|8(?:2(?:3\\d|66)|36[24-9])\\d{4}|(?:2[235-8]\\d|3[2-9]|4(?:[239]\\d|[78])|5[2-8]|6[235-79]|7[1-9]|8[7-9])\\d{6}', - 'ExampleNumber' => '221234567', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9[0-8]\\d{7}', - 'ExampleNumber' => '912345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[0-79]\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '20(?:[013-9]\\d\\d|2)\\d{4}', - 'ExampleNumber' => '203123456', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '99\\d{7}', - 'ExampleNumber' => '990123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '70\\d{8}', - 'ExampleNumber' => '7012345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '50[0-46-9]\\d{6}', - 'ExampleNumber' => '500123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TW', - 'countryCode' => 886, - 'internationalPrefix' => '0(?:0[25-79]|19)', - 'nationalPrefix' => '0', - 'preferredExtnPrefix' => '#', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d)(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '202', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3,4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[25][2-8]|[346]|7[1-9]|8[237-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[258]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[24589]|7\\d)\\d{8}|[2-8]\\d{7}|2\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '24\\d{6,7}|8(?:2(?:3\\d|66)|36[24-9])\\d{4}|(?:2[235-8]\\d|3[2-9]|4(?:[239]\\d|[78])|5[2-8]|6[235-79]|7[1-9]|8[7-9])\\d{6}', + 'ExampleNumber' => '221234567', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9[0-8]\\d{7}', + 'ExampleNumber' => '912345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[0-79]\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '20(?:[013-9]\\d\\d|2)\\d{4}', + 'ExampleNumber' => '203123456', + 'PossibleLength' => [ + 0 => 7, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '99\\d{7}', + 'ExampleNumber' => '990123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '70\\d{8}', + 'ExampleNumber' => '7012345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '50[0-46-9]\\d{6}', + 'ExampleNumber' => '500123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TW', + 'countryCode' => 886, + 'internationalPrefix' => '0(?:0[25-79]|19)', + 'nationalPrefix' => '0', + 'preferredExtnPrefix' => '#', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d)(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '202', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{3,4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[25][2-8]|[346]|7[1-9]|8[237-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[258]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_TZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_TZ.php index 2420424f..3060128a 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_TZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_TZ.php @@ -10,184 +10,139 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[26-8]\\d|41|90)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2[2-8]\\d{7}', - 'ExampleNumber' => '222345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:6[2-9]|7[13-9])\\d{7}', - 'ExampleNumber' => '621234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[08]\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90\\d{7}', - 'ExampleNumber' => '900123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '8(?:40|6[01])\\d{6}', - 'ExampleNumber' => '840123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '41\\d{7}', - 'ExampleNumber' => '412345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '(?:8(?:[04]0|6[01])|90\\d)\\d{6}', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TZ', - 'countryCode' => 255, - 'internationalPrefix' => '00[056]', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[24]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[67]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[26-8]\\d|41|90)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2[2-8]\\d{7}', + 'ExampleNumber' => '222345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:6[2-9]|7[13-9])\\d{7}', + 'ExampleNumber' => '621234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[08]\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90\\d{7}', + 'ExampleNumber' => '900123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '8(?:40|6[01])\\d{6}', + 'ExampleNumber' => '840123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '41\\d{7}', + 'ExampleNumber' => '412345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '(?:8(?:[04]0|6[01])|90\\d)\\d{6}', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TZ', + 'countryCode' => 255, + 'internationalPrefix' => '00[056]', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{2})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[24]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[67]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_UA.php b/lib/libphonenumber/data/PhoneNumberMetadata_UA.php index 0db34733..ef12a37c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_UA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_UA.php @@ -10,208 +10,161 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[89]\\d{9}|[3-9]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}', - 'ExampleNumber' => '311234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:50|6[36-8]|7[1-3]|9[1-9])\\d{7}', - 'ExampleNumber' => '501234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800[1-8]\\d{5,6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[239]\\d{5,6}', - 'ExampleNumber' => '900212345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '89[1-579]\\d{6}', - 'ExampleNumber' => '891234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'UA', - 'countryCode' => 380, - 'internationalPrefix' => '00', - 'preferredInternationalPrefix' => '0~0', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]', - 1 => '6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '4[45][0-5]|5(?:0|6[37])|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]', - 1 => '4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[3-6]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[89]\\d{9}|[3-9]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + 2 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}', + 'ExampleNumber' => '311234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + 2 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:50|6[36-8]|7[1-3]|9[1-9])\\d{7}', + 'ExampleNumber' => '501234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800[1-8]\\d{5,6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[239]\\d{5,6}', + 'ExampleNumber' => '900212345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '89[1-579]\\d{6}', + 'ExampleNumber' => '891234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'UA', + 'countryCode' => 380, + 'internationalPrefix' => '00', + 'preferredInternationalPrefix' => '0~0', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]', + 1 => '6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '4[45][0-5]|5(?:0|6[37])|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]', + 1 => '4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[3-6]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_UG.php b/lib/libphonenumber/data/PhoneNumberMetadata_UG.php index df41b281..b66c8576 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_UG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_UG.php @@ -10,189 +10,144 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '800\\d{6}|(?:[29]0|[347]\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '20(?:(?:240|30[0-4])\\d|6(?:00[0-2]|30[0-4]))\\d{3}|(?:20(?:[0147]\\d|[26][5-9]|3[2367]|5[0-4]|8[0-2])|[34]\\d{3})\\d{5}', - 'ExampleNumber' => '312345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7260\\d{5}|7(?:[0157-9]\\d|2[03]|30|4[0-4])\\d{6}', - 'ExampleNumber' => '712345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800[1-3]\\d{5}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[1-3]\\d{6}', - 'ExampleNumber' => '901123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'UG', - 'countryCode' => 256, - 'internationalPrefix' => '00[057]', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{4})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '202', - 1 => '2024', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[27-9]|4(?:6[45]|[7-9])', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[34]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '800\\d{6}|(?:[29]0|[347]\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + 2 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '20(?:(?:240|30[0-4])\\d|6(?:00[0-2]|30[0-4]))\\d{3}|(?:20(?:[0147]\\d|[26][5-9]|3[2367]|5[0-4]|8[0-2])|[34]\\d{3})\\d{5}', + 'ExampleNumber' => '312345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 5, + 1 => 6, + 2 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7260\\d{5}|7(?:[0157-9]\\d|2[03]|30|4[0-4])\\d{6}', + 'ExampleNumber' => '712345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800[1-3]\\d{5}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[1-3]\\d{6}', + 'ExampleNumber' => '901123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'UG', + 'countryCode' => 256, + 'internationalPrefix' => '00[057]', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{4})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '202', + 1 => '2024', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[27-9]|4(?:6[45]|[7-9])', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[34]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_US.php b/lib/libphonenumber/data/PhoneNumberMetadata_US.php index 3dbcc3b6..e90b9bde 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_US.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_US.php @@ -10,184 +10,139 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-9]\\d{9}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}', - 'ExampleNumber' => '2015550123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}', - 'ExampleNumber' => '2015550123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '710[2-9]\\d{6}', - 'ExampleNumber' => '7102123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'US', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '($1) $2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', - 'format' => '$1-$2-$3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-9]', - ), - ), - ), - 'mainCountryForCode' => true, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-9]\\d{9}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}', + 'ExampleNumber' => '2015550123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[0135]|3[0-24679]|4[67]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[0235]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[017]|6[0-279]|78|8[0-2])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-28]|4[3578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0179]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}', + 'ExampleNumber' => '2015550123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '710[2-9]\\d{6}', + 'ExampleNumber' => '7102123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'US', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '($1) $2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{4})', + 'format' => '$1-$2-$3', + 'leadingDigitsPatterns' => [ + 0 => '[2-9]', + ], + ], + ], + 'mainCountryForCode' => true, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_UY.php b/lib/libphonenumber/data/PhoneNumberMetadata_UY.php index fe59435d..6bf226f9 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_UY.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_UY.php @@ -10,190 +10,145 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[249]\\d\\d|80)\\d{5}|9\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2\\d|4[2-7])\\d{6}', - 'ExampleNumber' => '21231234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '9[1-9]\\d{6}', - 'ExampleNumber' => '94231234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80[05]\\d{4}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '90[0-8]\\d{4}', - 'ExampleNumber' => '9001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'UY', - 'countryCode' => 598, - 'internationalPrefix' => '0(?:0|1[3-9]\\d)', - 'preferredInternationalPrefix' => '00', - 'nationalPrefix' => '0', - 'preferredExtnPrefix' => ' int. ', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8|90', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '9', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{4})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[24]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[249]\\d\\d|80)\\d{5}|9\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2\\d|4[2-7])\\d{6}', + 'ExampleNumber' => '21231234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '9[1-9]\\d{6}', + 'ExampleNumber' => '94231234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80[05]\\d{4}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '90[0-8]\\d{4}', + 'ExampleNumber' => '9001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'UY', + 'countryCode' => 598, + 'internationalPrefix' => '0(?:0|1[3-9]\\d)', + 'preferredInternationalPrefix' => '00', + 'nationalPrefix' => '0', + 'preferredExtnPrefix' => ' int. ', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8|90', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '9', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{4})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[24]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_UZ.php b/lib/libphonenumber/data/PhoneNumberMetadata_UZ.php index 474402a5..4ac28c27 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_UZ.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_UZ.php @@ -10,157 +10,116 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[679]\\d{8}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '78(?:1(?:13|2[02]|50)|2(?:10|2[139]|98)|77[01])\\d{4}|(?:6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d\\d|7(?:[23]\\d|7[69])|9(?:22|4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[124-6]|9[135-8])|1[12]\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}', - 'ExampleNumber' => '669050123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(?:2(?:1[1267]|3[01]|5\\d|7[0-4])|(?:5[67]|7\\d)\\d|6(?:2[0-26]|8\\d)))|7(?:0\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\d|41[179]|5(?:[349]\\d|5[0-2])|7(?:0[017]|[13]\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07])))|9[0-57-9]\\d{3})\\d{4}', - 'ExampleNumber' => '912345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'UZ', - 'countryCode' => 998, - 'internationalPrefix' => '810', - 'preferredInternationalPrefix' => '8~10', - 'nationalPrefix' => '8', - 'nationalPrefixForParsing' => '8', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[679]', - ), - 'nationalPrefixFormattingRule' => '8 $1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[679]\\d{8}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '78(?:1(?:13|2[02]|50)|2(?:10|2[139]|98)|77[01])\\d{4}|(?:6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d\\d|7(?:[23]\\d|7[69])|9(?:22|4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[124-6]|9[135-8])|1[12]\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}', + 'ExampleNumber' => '669050123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(?:2(?:1[1267]|3[01]|5\\d|7[0-4])|(?:5[67]|7\\d)\\d|6(?:2[0-26]|8\\d)))|7(?:0\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\d|41[179]|5(?:[349]\\d|5[0-2])|7(?:0[017]|[13]\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07])))|9[0-57-9]\\d{3})\\d{4}', + 'ExampleNumber' => '912345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'UZ', + 'countryCode' => 998, + 'internationalPrefix' => '810', + 'preferredInternationalPrefix' => '8~10', + 'nationalPrefix' => '8', + 'nationalPrefixForParsing' => '8', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[679]', + ], + 'nationalPrefixFormattingRule' => '8 $1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_VA.php b/lib/libphonenumber/data/PhoneNumberMetadata_VA.php index 669bd636..7d5d8bf9 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_VA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_VA.php @@ -10,167 +10,128 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '0\\d{6,10}|55\\d{8}|[08]\\d{5}|(?:3[0-8]|8)\\d{7,9}|(?:1\\d|39)\\d{7,8}', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - 3 => 9, - 4 => 10, - 5 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '06698\\d{1,6}', - 'ExampleNumber' => '0669812345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '33\\d{9}|3[1-9]\\d{8}|3[2-9]\\d{7}', - 'ExampleNumber' => '3123456789', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - 2 => 11, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80(?:0\\d{3}|3)\\d{3}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:0878\\d\\d|89(?:2|4[5-9]\\d))\\d{3}|89[45][0-4]\\d\\d|(?:1(?:44|6[346])|89(?:5[5-9]|9))\\d{6}', - 'ExampleNumber' => '899123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '84(?:[08]\\d{3}|[17])\\d{3}', - 'ExampleNumber' => '848123456', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '1(?:78\\d|99)\\d{6}', - 'ExampleNumber' => '1781234567', - 'PossibleLength' => - array ( - 0 => 9, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '55\\d{8}', - 'ExampleNumber' => '5512345678', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VA', - 'countryCode' => 39, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '06698', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '0\\d{6,10}|55\\d{8}|[08]\\d{5}|(?:3[0-8]|8)\\d{7,9}|(?:1\\d|39)\\d{7,8}', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + 3 => 9, + 4 => 10, + 5 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '06698\\d{1,6}', + 'ExampleNumber' => '0669812345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '33\\d{9}|3[1-9]\\d{8}|3[2-9]\\d{7}', + 'ExampleNumber' => '3123456789', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + 2 => 11, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80(?:0\\d{3}|3)\\d{3}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:0878\\d\\d|89(?:2|4[5-9]\\d))\\d{3}|89[45][0-4]\\d\\d|(?:1(?:44|6[346])|89(?:5[5-9]|9))\\d{6}', + 'ExampleNumber' => '899123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '84(?:[08]\\d{3}|[17])\\d{3}', + 'ExampleNumber' => '848123456', + 'PossibleLength' => [ + 0 => 6, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '1(?:78\\d|99)\\d{6}', + 'ExampleNumber' => '1781234567', + 'PossibleLength' => [ + 0 => 9, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '55\\d{8}', + 'ExampleNumber' => '5512345678', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VA', + 'countryCode' => 39, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '06698', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_VC.php b/lib/libphonenumber/data/PhoneNumberMetadata_VC.php index cc572de7..1c7ac1fd 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_VC.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_VC.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[58]\\d\\d|784|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '784(?:266|3(?:6[6-9]|7\\d|8[0-24-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}', - 'ExampleNumber' => '7842661234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4]))\\d{4}', - 'ExampleNumber' => '7844301234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VC', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-7]\\d{6})$', - 'nationalPrefixTransformRule' => '784$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '784', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[58]\\d\\d|784|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '784(?:266|3(?:6[6-9]|7\\d|8[0-24-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}', + 'ExampleNumber' => '7842661234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4]))\\d{4}', + 'ExampleNumber' => '7844301234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VC', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-7]\\d{6})$', + 'nationalPrefixTransformRule' => '784$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '784', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_VE.php b/lib/libphonenumber/data/PhoneNumberMetadata_VE.php index 4aca3ec3..e1046d98 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_VE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_VE.php @@ -10,160 +10,119 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[89]00\\d{7}|(?:[24]\\d|50)\\d{8}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2(?:12|3[457-9]|[467]\\d|[58][1-9]|9[1-6])|50[01])\\d{7}', - 'ExampleNumber' => '2121234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '4(?:1[24-8]|2[46])\\d{7}', - 'ExampleNumber' => '4121234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{7}', - 'ExampleNumber' => '8001234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{7}', - 'ExampleNumber' => '9001234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VE', - 'countryCode' => 58, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{7})', - 'format' => '$1-$2', - 'leadingDigitsPatterns' => - array ( - 0 => '[24589]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '$CC $1', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[89]00\\d{7}|(?:[24]\\d|50)\\d{8}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2(?:12|3[457-9]|[467]\\d|[58][1-9]|9[1-6])|50[01])\\d{7}', + 'ExampleNumber' => '2121234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '4(?:1[24-8]|2[46])\\d{7}', + 'ExampleNumber' => '4121234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{7}', + 'ExampleNumber' => '8001234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{7}', + 'ExampleNumber' => '9001234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VE', + 'countryCode' => 58, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{7})', + 'format' => '$1-$2', + 'leadingDigitsPatterns' => [ + 0 => '[24589]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '$CC $1', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_VG.php b/lib/libphonenumber/data/PhoneNumberMetadata_VG.php index 76127a2f..57f16b1c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_VG.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_VG.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:284|[58]\\d\\d|900)\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '284496[0-5]\\d{3}|284(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}', - 'ExampleNumber' => '2842291234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '284496[6-9]\\d{3}|284(?:3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|99)|54[0-57])\\d{4}', - 'ExampleNumber' => '2843001234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VG', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-578]\\d{6})$', - 'nationalPrefixTransformRule' => '284$1', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '284', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:284|[58]\\d\\d|900)\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '284496[0-5]\\d{3}|284(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}', + 'ExampleNumber' => '2842291234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '284496[6-9]\\d{3}|284(?:3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|99)|54[0-57])\\d{4}', + 'ExampleNumber' => '2843001234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VG', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-578]\\d{6})$', + 'nationalPrefixTransformRule' => '284$1', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '284', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_VI.php b/lib/libphonenumber/data/PhoneNumberMetadata_VI.php index 6d90c2cc..18e3f190 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_VI.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_VI.php @@ -10,152 +10,113 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[58]\\d{9}|(?:34|90)0\\d{7}', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}', - 'ExampleNumber' => '3406421234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}', - 'ExampleNumber' => '3406421234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 7, - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '8002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900[2-9]\\d{6}', - 'ExampleNumber' => '9002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', - 'ExampleNumber' => '5002345678', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VI', - 'countryCode' => 1, - 'internationalPrefix' => '011', - 'nationalPrefix' => '1', - 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', - 'nationalPrefixTransformRule' => '340$1', - 'sameMobileAndFixedLinePattern' => true, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '340', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[58]\\d{9}|(?:34|90)0\\d{7}', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}', + 'ExampleNumber' => '3406421234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '340(?:2(?:01|2[06-8]|44|77)|3(?:32|44)|4(?:22|7[34])|5(?:1[34]|55)|6(?:26|4[23]|77|9[023])|7(?:1[2-57-9]|27|7\\d)|884|998)\\d{4}', + 'ExampleNumber' => '3406421234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 7, + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '8(?:00|33|44|55|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '8002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900[2-9]\\d{6}', + 'ExampleNumber' => '9002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'NationalNumberPattern' => '5(?:00|2[12]|33|44|66|77|88)[2-9]\\d{6}', + 'ExampleNumber' => '5002345678', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VI', + 'countryCode' => 1, + 'internationalPrefix' => '011', + 'nationalPrefix' => '1', + 'nationalPrefixForParsing' => '1|([2-9]\\d{6})$', + 'nationalPrefixTransformRule' => '340$1', + 'sameMobileAndFixedLinePattern' => true, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '340', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_VN.php b/lib/libphonenumber/data/PhoneNumberMetadata_VN.php index d61b3d88..3ed04772 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_VN.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_VN.php @@ -10,332 +10,265 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '2(?:0[3-9]|1[0-689]|2[0-25-9]|3[2-9]|4[2-8]|5[124-9]|6[0-39]|7[0-7]|8[2-7]|9[0-4679])\\d{7}', - 'ExampleNumber' => '2101234567', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:(?:3\\d|7[06-9])\\d|5(?:2[238]|[689]\\d)|8(?:[1-58]\\d|6[25-9]|79|9[689])|9(?:[0-8]\\d|9[013-9]))\\d{6}', - 'ExampleNumber' => '912345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:228\\d{4}|800\\d{4,6})', - 'ExampleNumber' => '1800123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1900\\d{4,6}', - 'ExampleNumber' => '1900123456', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - 2 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '672\\d{6}', - 'ExampleNumber' => '672012345', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:[17]99|80\\d)\\d{4}|69\\d{5,6}', - 'ExampleNumber' => '1992000', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'NationalNumberPattern' => '[17]99\\d{4}|69\\d{5,6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VN', - 'countryCode' => 84, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[17]99', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '69', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{4})(\\d{4,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[69]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3578]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 6 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[48]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 7 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 1 => - array ( - 'pattern' => '(\\d{4})(\\d{4,6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3 $4', - 'leadingDigitsPatterns' => - array ( - 0 => '[69]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 3 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[3578]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2[48]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{4})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => true, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '2(?:0[3-9]|1[0-689]|2[0-25-9]|3[2-9]|4[2-8]|5[124-9]|6[0-39]|7[0-7]|8[2-7]|9[0-4679])\\d{7}', + 'ExampleNumber' => '2101234567', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:(?:3\\d|7[06-9])\\d|5(?:2[238]|[689]\\d)|8(?:[1-58]\\d|6[25-9]|79|9[689])|9(?:[0-8]\\d|9[013-9]))\\d{6}', + 'ExampleNumber' => '912345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:228\\d{4}|800\\d{4,6})', + 'ExampleNumber' => '1800123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1900\\d{4,6}', + 'ExampleNumber' => '1900123456', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + 2 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '672\\d{6}', + 'ExampleNumber' => '672012345', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:[17]99|80\\d)\\d{4}|69\\d{5,6}', + 'ExampleNumber' => '1992000', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'NationalNumberPattern' => '[17]99\\d{4}|69\\d{5,6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VN', + 'countryCode' => 84, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[17]99', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{4,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '69', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{4})(\\d{4,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[69]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3578]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 6 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[48]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 7 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 1 => [ + 'pattern' => '(\\d{4})(\\d{4,6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3 $4', + 'leadingDigitsPatterns' => [ + 0 => '[69]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 3 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[3578]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{4})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2[48]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{4})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => true, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_VU.php b/lib/libphonenumber/data/PhoneNumberMetadata_VU.php index bfc6e0b8..7a2bc595 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_VU.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_VU.php @@ -10,160 +10,119 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[23]\\d|[48]8)\\d{3}|(?:[57]\\d|90)\\d{5}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:38[0-8]|48[4-9])\\d\\d|(?:2[02-9]|3[4-7]|88)\\d{3}', - 'ExampleNumber' => '22123', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '57[2-5]\\d{4}|(?:5[0-689]|7[013-7])\\d{5}', - 'ExampleNumber' => '5912345', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '90[1-9]\\d{4}', - 'ExampleNumber' => '9010123', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '(?:3[03]|900\\d)\\d{3}', - 'ExampleNumber' => '30123', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VU', - 'countryCode' => 678, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[579]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[23]\\d|[48]8)\\d{3}|(?:[57]\\d|90)\\d{5}', + 'PossibleLength' => [ + 0 => 5, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:38[0-8]|48[4-9])\\d\\d|(?:2[02-9]|3[4-7]|88)\\d{3}', + 'ExampleNumber' => '22123', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '57[2-5]\\d{4}|(?:5[0-689]|7[013-7])\\d{5}', + 'ExampleNumber' => '5912345', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '90[1-9]\\d{4}', + 'ExampleNumber' => '9010123', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '(?:3[03]|900\\d)\\d{3}', + 'ExampleNumber' => '30123', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VU', + 'countryCode' => 678, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[579]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_WF.php b/lib/libphonenumber/data/PhoneNumberMetadata_WF.php index e261b7a4..ded664f8 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_WF.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_WF.php @@ -10,155 +10,114 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:[45]0|68|72|8\\d)\\d{4}', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:50|68|72)\\d{4}', - 'ExampleNumber' => '501234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:50|68|72|8[23])\\d{4}', - 'ExampleNumber' => '501234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'NationalNumberPattern' => '[48]0\\d{4}', - 'ExampleNumber' => '401234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'WF', - 'countryCode' => 681, - 'internationalPrefix' => '00', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[4-8]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:[45]0|68|72|8\\d)\\d{4}', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:50|68|72)\\d{4}', + 'ExampleNumber' => '501234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:50|68|72|8[23])\\d{4}', + 'ExampleNumber' => '501234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'NationalNumberPattern' => '[48]0\\d{4}', + 'ExampleNumber' => '401234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'WF', + 'countryCode' => 681, + 'internationalPrefix' => '00', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{2})(\\d{2})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[4-8]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_WS.php b/lib/libphonenumber/data/PhoneNumberMetadata_WS.php index 2d312880..4d5c136c 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_WS.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_WS.php @@ -10,186 +10,141 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-6]\\d{4}|8\\d{5}(?:\\d{4})?|[78]\\d{6}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:[2-5]\\d|6[1-9])\\d{3}', - 'ExampleNumber' => '22123', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:7[25-7]|8(?:[3-7]|9\\d{3}))\\d{5}', - 'ExampleNumber' => '7212345', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{3}', - 'ExampleNumber' => '800123', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'WS', - 'countryCode' => 685, - 'internationalPrefix' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{5})', - 'format' => '$1', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-6]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3,7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-6]\\d{4}|8\\d{5}(?:\\d{4})?|[78]\\d{6}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:[2-5]\\d|6[1-9])\\d{3}', + 'ExampleNumber' => '22123', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:7[25-7]|8(?:[3-7]|9\\d{3}))\\d{5}', + 'ExampleNumber' => '7212345', + 'PossibleLength' => [ + 0 => 7, + 1 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{3}', + 'ExampleNumber' => '800123', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'WS', + 'countryCode' => 685, + 'internationalPrefix' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{5})', + 'format' => '$1', + 'leadingDigitsPatterns' => [ + 0 => '[2-6]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3,7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_XK.php b/lib/libphonenumber/data/PhoneNumberMetadata_XK.php index e1e658d4..d829f945 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_XK.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_XK.php @@ -10,186 +10,141 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}', - 'PossibleLength' => - array ( - 0 => 8, - 1 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:2[89]|39)0\\d{6}|[23][89]\\d{6}', - 'ExampleNumber' => '28012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '4[3-79]\\d{6}', - 'ExampleNumber' => '43201234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{5}', - 'ExampleNumber' => '80001234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '900\\d{5}', - 'ExampleNumber' => '90001234', - 'PossibleLength' => - array ( - 0 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'XK', - 'countryCode' => 383, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[89]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[2-4]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[23]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}', + 'PossibleLength' => [ + 0 => 8, + 1 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:2[89]|39)0\\d{6}|[23][89]\\d{6}', + 'ExampleNumber' => '28012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '4[3-79]\\d{6}', + 'ExampleNumber' => '43201234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{5}', + 'ExampleNumber' => '80001234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '900\\d{5}', + 'ExampleNumber' => '90001234', + 'PossibleLength' => [ + 0 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'XK', + 'countryCode' => 383, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[89]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[2-4]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[23]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_YE.php b/lib/libphonenumber/data/PhoneNumberMetadata_YE.php index 64814c4a..faf78efa 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_YE.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_YE.php @@ -10,175 +10,132 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '(?:1|7\\d)\\d{7}|[1-7]\\d{6}', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - 2 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '17\\d{6}|(?:[12][2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-68])\\d{5}', - 'ExampleNumber' => '1234567', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7[0137]\\d{7}', - 'ExampleNumber' => '712345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'YE', - 'countryCode' => 967, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-6]|7[24-68]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '(?:1|7\\d)\\d{7}|[1-7]\\d{6}', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + 2 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '17\\d{6}|(?:[12][2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-68])\\d{5}', + 'ExampleNumber' => '1234567', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7[0137]\\d{7}', + 'ExampleNumber' => '712345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'YE', + 'countryCode' => 967, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-6]|7[24-68]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_YT.php b/lib/libphonenumber/data/PhoneNumberMetadata_YT.php index b867a2ce..7ed476ff 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_YT.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_YT.php @@ -10,146 +10,107 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '80\\d{7}|(?:26|63)9\\d{6}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '269(?:0[67]|5[01]|6\\d|[78]0)\\d{4}', - 'ExampleNumber' => '269601234', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '639(?:0[0-79]|1[019]|[267]\\d|3[09]|[45]0|9[04-79])\\d{4}', - 'ExampleNumber' => '639012345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{7}', - 'ExampleNumber' => '801234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'YT', - 'countryCode' => 262, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingDigits' => '269|63', - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '80\\d{7}|(?:26|63)9\\d{6}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '269(?:0[67]|5[01]|6\\d|[78]0)\\d{4}', + 'ExampleNumber' => '269601234', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '639(?:0[0-79]|1[019]|[267]\\d|3[09]|[45]0|9[04-79])\\d{4}', + 'ExampleNumber' => '639012345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{7}', + 'ExampleNumber' => '801234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'YT', + 'countryCode' => 262, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingDigits' => '269|63', + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ZA.php b/lib/libphonenumber/data/PhoneNumberMetadata_ZA.php index f25832c6..6f3f8f8f 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ZA.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ZA.php @@ -10,207 +10,160 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d{8}|8\\d{4,7}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1[0-8]|2[1-378]|3[1-69]|4\\d|5[1346-8])\\d{7}', - 'ExampleNumber' => '101234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '8[1-4]\\d{3,7}|(?:6\\d|7[0-46-9]|85)\\d{7}', - 'ExampleNumber' => '711234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80\\d{7}', - 'ExampleNumber' => '801234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:86[2-9]|9[0-2]\\d)\\d{6}', - 'ExampleNumber' => '862345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'NationalNumberPattern' => '860\\d{6}', - 'ExampleNumber' => '860123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '87\\d{7}', - 'ExampleNumber' => '871234567', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'NationalNumberPattern' => '861\\d{6}', - 'ExampleNumber' => '861123456', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ZA', - 'countryCode' => 27, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{2})(\\d{3,4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8[1-4]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{2,3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '8[1-4]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '860', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-9]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => true, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d{8}|8\\d{4,7}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1[0-8]|2[1-378]|3[1-69]|4\\d|5[1346-8])\\d{7}', + 'ExampleNumber' => '101234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '8[1-4]\\d{3,7}|(?:6\\d|7[0-46-9]|85)\\d{7}', + 'ExampleNumber' => '711234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80\\d{7}', + 'ExampleNumber' => '801234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:86[2-9]|9[0-2]\\d)\\d{6}', + 'ExampleNumber' => '862345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'NationalNumberPattern' => '860\\d{6}', + 'ExampleNumber' => '860123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '87\\d{7}', + 'ExampleNumber' => '871234567', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'NationalNumberPattern' => '861\\d{6}', + 'ExampleNumber' => '861123456', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ZA', + 'countryCode' => 27, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{2})(\\d{3,4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8[1-4]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{2,3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '8[1-4]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '860', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[1-9]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => true, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ZM.php b/lib/libphonenumber/data/PhoneNumberMetadata_ZM.php index 6451238e..72609823 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ZM.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ZM.php @@ -10,207 +10,158 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '800\\d{6}|(?:21|76|9\\d)\\d{7}', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '21[1-8]\\d{6}', - 'ExampleNumber' => '211234567', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 6, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '(?:76|9[5-8])\\d{7}', - 'ExampleNumber' => '955123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '800\\d{6}', - 'ExampleNumber' => '800123456', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ZM', - 'countryCode' => 260, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[1-9]', - ), - 'nationalPrefixFormattingRule' => '', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[28]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[79]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[28]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '[79]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '800\\d{6}|(?:21|76|9\\d)\\d{7}', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '21[1-8]\\d{6}', + 'ExampleNumber' => '211234567', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 6, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '(?:76|9[5-8])\\d{7}', + 'ExampleNumber' => '955123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '800\\d{6}', + 'ExampleNumber' => '800123456', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ZM', + 'countryCode' => 260, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[1-9]', + ], + 'nationalPrefixFormattingRule' => '', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[28]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{2})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[79]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[28]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d{2})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '[79]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/PhoneNumberMetadata_ZW.php b/lib/libphonenumber/data/PhoneNumberMetadata_ZW.php index eca834b2..13ee9075 100755 --- a/lib/libphonenumber/data/PhoneNumberMetadata_ZW.php +++ b/lib/libphonenumber/data/PhoneNumberMetadata_ZW.php @@ -10,281 +10,222 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 7, - 3 => 8, - 4 => 9, - 5 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 3, - 1 => 4, - ), - ), - 'fixedLine' => - array ( - 'NationalNumberPattern' => '(?:1(?:(?:3\\d|9)\\d|[4-8])|2(?:(?:(?:0(?:2[014]|5)|(?:2[0157]|31|84|9)\\d\\d|[56](?:[14]\\d\\d|20)|7(?:[089]|2[03]|[35]\\d\\d))\\d|4(?:2\\d\\d|8))\\d|1(?:2|[39]\\d{4}))|3(?:(?:123|(?:29\\d|92)\\d)\\d\\d|7(?:[19]|[56]\\d))|5(?:0|1[2-478]|26|[37]2|4(?:2\\d{3}|83)|5(?:25\\d\\d|[78])|[689]\\d)|6(?:(?:[16-8]21|28|52[013])\\d\\d|[39])|8(?:[1349]28|523)\\d\\d)\\d{3}|(?:4\\d\\d|9[2-9])\\d{4,5}|(?:(?:2(?:(?:(?:0|8[146])\\d|7[1-7])\\d|2(?:[278]\\d|92)|58(?:2\\d|3))|3(?:[26]|9\\d{3})|5(?:4\\d|5)\\d\\d)\\d|6(?:(?:(?:[0-246]|[78]\\d)\\d|37)\\d|5[2-8]))\\d\\d|(?:2(?:[569]\\d|8[2-57-9])|3(?:[013-59]\\d|8[37])|6[89]8)\\d{3}', - 'ExampleNumber' => '1312345', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - 0 => 3, - 1 => 4, - ), - ), - 'mobile' => - array ( - 'NationalNumberPattern' => '7(?:1[2-9]|[37][1-9]|8[2-7])\\d{6}', - 'ExampleNumber' => '712345678', - 'PossibleLength' => - array ( - 0 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '80(?:[01]\\d|20|8[0-8])\\d{3}', - 'ExampleNumber' => '8001234', - 'PossibleLength' => - array ( - 0 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'sharedCost' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'personalNumber' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voip' => - array ( - 'NationalNumberPattern' => '86(?:1[12]|22|30|44|55|77|8[368])\\d{6}', - 'ExampleNumber' => '8686123456', - 'PossibleLength' => - array ( - 0 => 10, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'pager' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'uan' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'voicemail' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'noInternationalDialling' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ZW', - 'countryCode' => 263, - 'internationalPrefix' => '00', - 'nationalPrefix' => '0', - 'nationalPrefixForParsing' => '0', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - 0 => - array ( - 'pattern' => '(\\d{3})(\\d{3,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 1 => - array ( - 'pattern' => '(\\d)(\\d{3})(\\d{2,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '[49]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 2 => - array ( - 'pattern' => '(\\d{3})(\\d{4})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '80', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 3 => - array ( - 'pattern' => '(\\d{2})(\\d{7})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2', - 1 => '2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]', - ), - 'nationalPrefixFormattingRule' => '(0$1)', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 4 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '7', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 5 => - array ( - 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)', - 1 => '2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 6 => - array ( - 'pattern' => '(\\d{4})(\\d{6})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '8', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 7 => - array ( - 'pattern' => '(\\d{2})(\\d{3,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 8 => - array ( - 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', - 'format' => '$1 $2 $3', - 'leadingDigitsPatterns' => - array ( - 0 => '29[013-9]|39|54', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - 9 => - array ( - 'pattern' => '(\\d{4})(\\d{3,5})', - 'format' => '$1 $2', - 'leadingDigitsPatterns' => - array ( - 0 => '(?:25|54)8', - 1 => '258|5483', - ), - 'nationalPrefixFormattingRule' => '0$1', - 'domesticCarrierCodeFormattingRule' => '', - 'nationalPrefixOptionalWhenFormatting' => false, - ), - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 7, + 3 => 8, + 4 => 9, + 5 => 10, + ], + 'PossibleLengthLocalOnly' => [ + 0 => 3, + 1 => 4, + ], + ], + 'fixedLine' => [ + 'NationalNumberPattern' => '(?:1(?:(?:3\\d|9)\\d|[4-8])|2(?:(?:(?:0(?:2[014]|5)|(?:2[0157]|31|84|9)\\d\\d|[56](?:[14]\\d\\d|20)|7(?:[089]|2[03]|[35]\\d\\d))\\d|4(?:2\\d\\d|8))\\d|1(?:2|[39]\\d{4}))|3(?:(?:123|(?:29\\d|92)\\d)\\d\\d|7(?:[19]|[56]\\d))|5(?:0|1[2-478]|26|[37]2|4(?:2\\d{3}|83)|5(?:25\\d\\d|[78])|[689]\\d)|6(?:(?:[16-8]21|28|52[013])\\d\\d|[39])|8(?:[1349]28|523)\\d\\d)\\d{3}|(?:4\\d\\d|9[2-9])\\d{4,5}|(?:(?:2(?:(?:(?:0|8[146])\\d|7[1-7])\\d|2(?:[278]\\d|92)|58(?:2\\d|3))|3(?:[26]|9\\d{3})|5(?:4\\d|5)\\d\\d)\\d|6(?:(?:(?:[0-246]|[78]\\d)\\d|37)\\d|5[2-8]))\\d\\d|(?:2(?:[569]\\d|8[2-57-9])|3(?:[013-59]\\d|8[37])|6[89]8)\\d{3}', + 'ExampleNumber' => '1312345', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + 0 => 3, + 1 => 4, + ], + ], + 'mobile' => [ + 'NationalNumberPattern' => '7(?:1[2-9]|[37][1-9]|8[2-7])\\d{6}', + 'ExampleNumber' => '712345678', + 'PossibleLength' => [ + 0 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '80(?:[01]\\d|20|8[0-8])\\d{3}', + 'ExampleNumber' => '8001234', + 'PossibleLength' => [ + 0 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'sharedCost' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'personalNumber' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voip' => [ + 'NationalNumberPattern' => '86(?:1[12]|22|30|44|55|77|8[368])\\d{6}', + 'ExampleNumber' => '8686123456', + 'PossibleLength' => [ + 0 => 10, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'pager' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'uan' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'voicemail' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'noInternationalDialling' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ZW', + 'countryCode' => 263, + 'internationalPrefix' => '00', + 'nationalPrefix' => '0', + 'nationalPrefixForParsing' => '0', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + 0 => [ + 'pattern' => '(\\d{3})(\\d{3,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 1 => [ + 'pattern' => '(\\d)(\\d{3})(\\d{2,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '[49]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 2 => [ + 'pattern' => '(\\d{3})(\\d{4})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '80', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 3 => [ + 'pattern' => '(\\d{2})(\\d{7})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2', + 1 => '2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]', + ], + 'nationalPrefixFormattingRule' => '(0$1)', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 4 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '7', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 5 => [ + 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)', + 1 => '2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 6 => [ + 'pattern' => '(\\d{4})(\\d{6})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '8', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 7 => [ + 'pattern' => '(\\d{2})(\\d{3,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 8 => [ + 'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})', + 'format' => '$1 $2 $3', + 'leadingDigitsPatterns' => [ + 0 => '29[013-9]|39|54', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + 9 => [ + 'pattern' => '(\\d{4})(\\d{3,5})', + 'format' => '$1 $2', + 'leadingDigitsPatterns' => [ + 0 => '(?:25|54)8', + 1 => '258|5483', + ], + 'nationalPrefixFormattingRule' => '0$1', + 'domesticCarrierCodeFormattingRule' => '', + 'nationalPrefixOptionalWhenFormatting' => false, + ], + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AC.php b/lib/libphonenumber/data/ShortNumberMetadata_AC.php index 6bf0a13d..2bc297a7 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AC.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AC.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AC', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AC', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AD.php b/lib/libphonenumber/data/ShortNumberMetadata_AD.php index aa15f620..804e63f4 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AD.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AD.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[0268]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[0268]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[0268]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AD', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[0268]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[0268]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[0268]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AD', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AE.php b/lib/libphonenumber/data/ShortNumberMetadata_AE.php index 7958eec9..0c732aa6 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AE.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[149]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|99[7-9]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|99[7-9]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112|445[16]|99[7-9]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '445\\d', - 'ExampleNumber' => '4450', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[149]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|99[7-9]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|99[7-9]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112|445[16]|99[7-9]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '445\\d', + 'ExampleNumber' => '4450', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AF.php b/lib/libphonenumber/data/ShortNumberMetadata_AF.php index 99b25123..09f7ed38 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AF.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AF.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:02|19)', - 'ExampleNumber' => '102', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:02|19)', - 'ExampleNumber' => '102', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:02|19)|40404', - 'ExampleNumber' => '102', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AF', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:02|19)', + 'ExampleNumber' => '102', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:02|19)', + 'ExampleNumber' => '102', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:02|19)|40404', + 'ExampleNumber' => '102', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AF', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AG.php b/lib/libphonenumber/data/ShortNumberMetadata_AG.php index 7e44f9a8..311e8843 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AG.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '176|9(?:11|99)', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '176|9(?:11|99)', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AI.php b/lib/libphonenumber/data/ShortNumberMetadata_AI.php index cb6c028a..b76d813f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AI.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '176|911', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '176|911', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AL.php b/lib/libphonenumber/data/ShortNumberMetadata_AL.php index 418d0433..78d9b572 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AL.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AL.php @@ -10,116 +10,89 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[15]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6[01]\\d\\d)|2[7-9]|3[15]|41)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '5\\d{4}', - 'ExampleNumber' => '50000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|2[7-9])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:6(?:000|1(?:06|11|23))|8\\d\\d)|65\\d|89[12])|5\\d{4}|1(?:[1349]\\d|2[2-9])', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '123', - 'ExampleNumber' => '123', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '131|5\\d{4}', - 'ExampleNumber' => '131', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AL', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[15]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6[01]\\d\\d)|2[7-9]|3[15]|41)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '5\\d{4}', + 'ExampleNumber' => '50000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|2[7-9])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:6(?:000|1(?:06|11|23))|8\\d\\d)|65\\d|89[12])|5\\d{4}|1(?:[1349]\\d|2[2-9])', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '123', + 'ExampleNumber' => '123', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '131|5\\d{4}', + 'ExampleNumber' => '131', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AL', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AM.php b/lib/libphonenumber/data/ShortNumberMetadata_AM.php index 30d1d3cc..f6b0e2e1 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AM.php @@ -10,111 +10,84 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[148]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '10[1-3]', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '10[1-3]', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '(?:1|8[1-7])\\d\\d|40404', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[148]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '10[1-3]', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '10[1-3]', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '(?:1|8[1-7])\\d\\d|40404', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AO.php b/lib/libphonenumber/data/ShortNumberMetadata_AO.php index 14737495..3a3b3e7d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AO.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[235]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[235]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[235]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[235]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[235]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[235]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AR.php b/lib/libphonenumber/data/ShortNumberMetadata_AR.php index f9af3586..5ec83841 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AR.php @@ -10,114 +10,87 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[01389]\\d{1,4}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - 3 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '000|1(?:0[0-35-7]|1[0245]|2[15]|9)|911', - 'ExampleNumber' => '19', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '10[017]|911', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '000|1(?:0[0-35-7]|1[02-5]|2[15]|9)|3372|89338|911', - 'ExampleNumber' => '19', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '893\\d\\d', - 'ExampleNumber' => '89300', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:337|893\\d)\\d', - 'ExampleNumber' => '3370', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[01389]\\d{1,4}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + 3 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '000|1(?:0[0-35-7]|1[0245]|2[15]|9)|911', + 'ExampleNumber' => '19', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '10[017]|911', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '000|1(?:0[0-35-7]|1[02-5]|2[15]|9)|3372|89338|911', + 'ExampleNumber' => '19', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '893\\d\\d', + 'ExampleNumber' => '89300', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:337|893\\d)\\d', + 'ExampleNumber' => '3370', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AS.php b/lib/libphonenumber/data/ShortNumberMetadata_AS.php index 5b8c640e..cbf8ccdd 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AS.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AS.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[49]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '40404|911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AS', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[49]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '40404|911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AS', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AT.php b/lib/libphonenumber/data/ShortNumberMetadata_AT.php index b90242f0..872f4954 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AT.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '116\\d{3}|1(?:[12]2|33|44)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:[12]2|33|44)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '116(?:00[06]|1(?:17|23))|1(?:[12]2|33|44)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '116\\d{3}|1(?:[12]2|33|44)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:[12]2|33|44)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '116(?:00[06]|1(?:17|23))|1(?:[12]2|33|44)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AU.php b/lib/libphonenumber/data/ShortNumberMetadata_AU.php index 3c4eb912..606f93ed 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AU.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AU.php @@ -10,129 +10,102 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[0-27]\\d{2,7}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - 4 => 7, - 5 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '000|1(?:06|12|258885|55\\d)|733', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1(?:2(?:34|456)|9\\d{4,6})', - 'ExampleNumber' => '1234', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - 4 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '000|1(?:06|12)', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '000|1(?:06|1(?:00|2|9[46])|2(?:[23]\\d|(?:4|5\\d)\\d{2,3}|8(?:[013-9]\\d|2))|555|9\\d{4,6})|225|7(?:33|67)', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '1(?:1[09]\\d|24733)|225|767', - 'ExampleNumber' => '225', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1(?:258885|55\\d)', - 'ExampleNumber' => '1550', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '19\\d{4,6}', - 'ExampleNumber' => '190000', - 'PossibleLength' => - array ( - 0 => 6, - 1 => 7, - 2 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AU', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[0-27]\\d{2,7}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + 4 => 7, + 5 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '000|1(?:06|12|258885|55\\d)|733', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1(?:2(?:34|456)|9\\d{4,6})', + 'ExampleNumber' => '1234', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 7, + 4 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '000|1(?:06|12)', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '000|1(?:06|1(?:00|2|9[46])|2(?:[23]\\d|(?:4|5\\d)\\d{2,3}|8(?:[013-9]\\d|2))|555|9\\d{4,6})|225|7(?:33|67)', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '1(?:1[09]\\d|24733)|225|767', + 'ExampleNumber' => '225', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1(?:258885|55\\d)', + 'ExampleNumber' => '1550', + 'PossibleLength' => [ + 0 => 4, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '19\\d{4,6}', + 'ExampleNumber' => '190000', + 'PossibleLength' => [ + 0 => 6, + 1 => 7, + 2 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AU', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AW.php b/lib/libphonenumber/data/ShortNumberMetadata_AW.php index 36e21672..42f01a29 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AW.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '100|911', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '100|911', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:00|76)|911', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '100|911', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '100|911', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:00|76)|911', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AX.php b/lib/libphonenumber/data/ShortNumberMetadata_AX.php index 5952d39c..0518a6a7 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AX.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AX.php @@ -10,106 +10,79 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[17]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112|75[12]\\d\\d', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AX', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[17]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112|75[12]\\d\\d', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AX', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_AZ.php b/lib/libphonenumber/data/ShortNumberMetadata_AZ.php index 5d474061..d80eab8b 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_AZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_AZ.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[148]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)|(?:404|880)0', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '(?:404|880)\\d', - 'ExampleNumber' => '4040', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:404|880)\\d', - 'ExampleNumber' => '4040', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'AZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[148]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)|(?:404|880)0', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '(?:404|880)\\d', + 'ExampleNumber' => '4040', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:404|880)\\d', + 'ExampleNumber' => '4040', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'AZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BA.php b/lib/libphonenumber/data/ShortNumberMetadata_BA.php index 9af54db8..41478a29 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BA.php @@ -10,109 +10,82 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:16\\d{3}|2[2-4])', - 'ExampleNumber' => '122', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '12[2-4]', - 'ExampleNumber' => '122', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:16(?:00[06]|1(?:1[17]|23))|2(?:0[0-7]|[2-5]|6[0-26])|(?:[3-5]|7\\d)\\d\\d)|1(?:18|2[78])\\d\\d?', - 'ExampleNumber' => '122', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:16\\d{3}|2[2-4])', + 'ExampleNumber' => '122', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '12[2-4]', + 'ExampleNumber' => '122', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:16(?:00[06]|1(?:1[17]|23))|2(?:0[0-7]|[2-5]|6[0-26])|(?:[3-5]|7\\d)\\d\\d)|1(?:18|2[78])\\d\\d?', + 'ExampleNumber' => '122', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BB.php b/lib/libphonenumber/data/ShortNumberMetadata_BB.php index b110966f..a69c8c58 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BB.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BB.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[2-689]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '[2359]11', - 'ExampleNumber' => '211', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '[2359]11', - 'ExampleNumber' => '211', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '[2-689]11', - 'ExampleNumber' => '211', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '[468]11', - 'ExampleNumber' => '411', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BB', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[2-689]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '[2359]11', + 'ExampleNumber' => '211', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '[2359]11', + 'ExampleNumber' => '211', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '[2-689]11', + 'ExampleNumber' => '211', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '[468]11', + 'ExampleNumber' => '411', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BB', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BD.php b/lib/libphonenumber/data/ShortNumberMetadata_BD.php index 364e5cdc..6286cd04 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BD.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BD.php @@ -10,112 +10,85 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1579]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '10[0-26]|[19]99', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '10[0-2]|[19]99', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0(?:[0-369]|5[1-4]|7[0-4]|8[0-29])|1[16-9]|2(?:[134]|2[0-5])|3(?:1\\d?|6[3-6])|5[2-9])|5012|786|9594|[19]99|1(?:0(?:50|6\\d)|33|4(?:0|1\\d))\\d', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1(?:11|2[13])|(?:501|959)\\d|786', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '959\\d', - 'ExampleNumber' => '9590', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BD', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1579]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '10[0-26]|[19]99', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '10[0-2]|[19]99', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0(?:[0-369]|5[1-4]|7[0-4]|8[0-29])|1[16-9]|2(?:[134]|2[0-5])|3(?:1\\d?|6[3-6])|5[2-9])|5012|786|9594|[19]99|1(?:0(?:50|6\\d)|33|4(?:0|1\\d))\\d', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1(?:11|2[13])|(?:501|959)\\d|786', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '959\\d', + 'ExampleNumber' => '9590', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BD', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BE.php b/lib/libphonenumber/data/ShortNumberMetadata_BE.php index 75a58ace..6c52ff55 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BE.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d\\d(?:\\d(?:\\d{2})?)?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[0-25-8]|1[02]|7(?:12|77)|813)|(?:116|8)\\d{3}', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1(?:2[03]|40)4|(?:1(?:[24]1|3[01])|[2-79]\\d\\d)\\d', - 'ExampleNumber' => '1204', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[01]|12)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[0-8]|1(?:[027]|6117)|2(?:12|3[0-24])|313|414|5(?:1[05]|5[15]|66|95)|6(?:1[167]|36|6[16])|7(?:0[07]|1[27-9]|22|33|65|7[017])|81[39])|[2-9]\\d{3}|1(?:1600|45)0|1(?:[2-4]9|78)9|1[2-4]0[47]', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '[2-9]\\d{3}', - 'ExampleNumber' => '2000', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d\\d(?:\\d(?:\\d{2})?)?', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[0-25-8]|1[02]|7(?:12|77)|813)|(?:116|8)\\d{3}', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1(?:2[03]|40)4|(?:1(?:[24]1|3[01])|[2-79]\\d\\d)\\d', + 'ExampleNumber' => '1204', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[01]|12)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[0-8]|1(?:[027]|6117)|2(?:12|3[0-24])|313|414|5(?:1[05]|5[15]|66|95)|6(?:1[167]|36|6[16])|7(?:0[07]|1[27-9]|22|33|65|7[017])|81[39])|[2-9]\\d{3}|1(?:1600|45)0|1(?:[2-4]9|78)9|1[2-4]0[47]', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '[2-9]\\d{3}', + 'ExampleNumber' => '2000', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BF.php b/lib/libphonenumber/data/ShortNumberMetadata_BF.php index 270cc13e..2ffa8d1f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BF.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BF.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BF', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BF', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BG.php b/lib/libphonenumber/data/ShortNumberMetadata_BG.php index 112ddf3e..53cfdf1f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BG.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6\\d{3})|50|6[06])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|50|6[06])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6(?:000|111))|50|6[06])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6\\d{3})|50|6[06])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|50|6[06])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6(?:000|111))|50|6[06])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BH.php b/lib/libphonenumber/data/ShortNumberMetadata_BH.php index b4b48097..00914688 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BH.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BH.php @@ -10,111 +10,84 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[0189]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '(?:0[167]|81)\\d{3}|[19]99', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '9[148]\\d{3}', - 'ExampleNumber' => '91000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '[19]99', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:[02]\\d|12|4[01]|51|8[18]|9[169])|99[02489]|(?:0[167]|8[158]|9[148])\\d{3}', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '0[67]\\d{3}|88000|98555', - 'ExampleNumber' => '06000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '88000|98555', - 'ExampleNumber' => '88000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BH', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[0189]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '(?:0[167]|81)\\d{3}|[19]99', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '9[148]\\d{3}', + 'ExampleNumber' => '91000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '[19]99', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:[02]\\d|12|4[01]|51|8[18]|9[169])|99[02489]|(?:0[167]|8[158]|9[148])\\d{3}', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '0[67]\\d{3}|88000|98555', + 'ExampleNumber' => '06000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '88000|98555', + 'ExampleNumber' => '88000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BH', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BI.php b/lib/libphonenumber/data/ShortNumberMetadata_BI.php index 7488be1b..6e97056d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BI.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[16-9]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[237]|611', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[237]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1\\d|5[2-9]|6[0-256])|611|7(?:10|77|979)|8[28]8|900', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '611|7(?:10|77)|888|900', - 'ExampleNumber' => '611', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:71|90)0', - 'ExampleNumber' => '710', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[16-9]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[237]|611', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[237]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1\\d|5[2-9]|6[0-256])|611|7(?:10|77|979)|8[28]8|900', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '611|7(?:10|77)|888|900', + 'ExampleNumber' => '611', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:71|90)0', + 'ExampleNumber' => '710', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BJ.php b/lib/libphonenumber/data/ShortNumberMetadata_BJ.php index 54395f7f..89b32f8f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BJ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BJ.php @@ -10,107 +10,80 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[17]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[78]|7[3-5]\\d\\d', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[78]', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[78]|2[02-5]|60)|7[0-5]\\d\\d', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '12[02-5]', - 'ExampleNumber' => '120', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BJ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[17]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[78]|7[3-5]\\d\\d', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[78]', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[78]|2[02-5]|60)|7[0-5]\\d\\d', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '12[02-5]', + 'ExampleNumber' => '120', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BJ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BL.php b/lib/libphonenumber/data/ShortNumberMetadata_BL.php index b954b213..4a43928d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BL.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BL.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '18', - 'ExampleNumber' => '18', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '18', - 'ExampleNumber' => '18', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '18', - 'ExampleNumber' => '18', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BL', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '18', + 'ExampleNumber' => '18', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '18', + 'ExampleNumber' => '18', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '18', + 'ExampleNumber' => '18', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BL', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BM.php b/lib/libphonenumber/data/ShortNumberMetadata_BM.php index 0181978d..4f672f5f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BM.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '176|911', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '176|911', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BN.php b/lib/libphonenumber/data/ShortNumberMetadata_BN.php index dd94947c..ada1e738 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BN.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '99[135]', - 'ExampleNumber' => '991', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '99[135]', - 'ExampleNumber' => '991', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '99[135]', - 'ExampleNumber' => '991', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '99[135]', + 'ExampleNumber' => '991', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '99[135]', + 'ExampleNumber' => '991', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '99[135]', + 'ExampleNumber' => '991', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BO.php b/lib/libphonenumber/data/ShortNumberMetadata_BO.php index 5df5e990..442fa5ee 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BO.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[089]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[089]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[089]|40404', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[089]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[089]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[089]|40404', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BQ.php b/lib/libphonenumber/data/ShortNumberMetadata_BQ.php index 1fb3c591..d112f258 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BQ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BQ.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|76)|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BQ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|76)|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BQ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BR.php b/lib/libphonenumber/data/ShortNumberMetadata_BR.php index 6f150e34..c7ccf131 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BR.php @@ -10,120 +10,93 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[124-69]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:00|12|28|8[015]|9[0-47-9])|4(?:57|82\\d)|911', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|28|9[023])|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0(?:[02]|3(?:1[2-579]|2[13-9]|3[124-9]|4[1-3578]|5[1-468]|6[139]|8[149]|9[168])|5[0-35-9]|6(?:0|1[0-35-8]?|2[0145]|3[0137]?|4[37-9]?|5[0-35]|6[016]?|7[137]?|8[5-8]|9[1359]))|1[25-8]|2[357-9]|3[024-68]|4[12568]|5\\d|6[0-8]|8[015]|9[0-47-9])|2(?:7(?:330|878)|85959?)|4(?:0404?|57|828)|55555|6(?:0\\d{4}|10000)|911|(?:133|411)[12]', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '102|273\\d\\d', - 'ExampleNumber' => '102', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '151|(?:278|555)\\d\\d|4(?:04\\d\\d?|11\\d|57)', - 'ExampleNumber' => '151', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '285\\d{2,3}|40404|(?:27[38]\\d|482)\\d|6(?:0\\d|10)\\d{3}', - 'ExampleNumber' => '4820', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[124-69]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:00|12|28|8[015]|9[0-47-9])|4(?:57|82\\d)|911', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|28|9[023])|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0(?:[02]|3(?:1[2-579]|2[13-9]|3[124-9]|4[1-3578]|5[1-468]|6[139]|8[149]|9[168])|5[0-35-9]|6(?:0|1[0-35-8]?|2[0145]|3[0137]?|4[37-9]?|5[0-35]|6[016]?|7[137]?|8[5-8]|9[1359]))|1[25-8]|2[357-9]|3[024-68]|4[12568]|5\\d|6[0-8]|8[015]|9[0-47-9])|2(?:7(?:330|878)|85959?)|4(?:0404?|57|828)|55555|6(?:0\\d{4}|10000)|911|(?:133|411)[12]', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '102|273\\d\\d', + 'ExampleNumber' => '102', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '151|(?:278|555)\\d\\d|4(?:04\\d\\d?|11\\d|57)', + 'ExampleNumber' => '151', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '285\\d{2,3}|40404|(?:27[38]\\d|482)\\d|6(?:0\\d|10)\\d{3}', + 'ExampleNumber' => '4820', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BS.php b/lib/libphonenumber/data/ShortNumberMetadata_BS.php index fe2153d8..916ff819 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BS.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BS.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '91[19]', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '91[19]', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '91[19]', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BS', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '91[19]', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '91[19]', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '91[19]', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BS', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BT.php b/lib/libphonenumber/data/ShortNumberMetadata_BT.php index 5eec3a54..f98ca027 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BT.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[023]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[023]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[0-6]|40404', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[023]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[023]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[0-6]|40404', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BW.php b/lib/libphonenumber/data/ShortNumberMetadata_BW.php index 51c5a39a..44da301e 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BW.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '99[7-9]', - 'ExampleNumber' => '997', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '99[7-9]', - 'ExampleNumber' => '997', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '13123|99[7-9]', - 'ExampleNumber' => '997', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '131\\d\\d', - 'ExampleNumber' => '13100', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '131\\d\\d', - 'ExampleNumber' => '13100', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '99[7-9]', + 'ExampleNumber' => '997', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '99[7-9]', + 'ExampleNumber' => '997', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '13123|99[7-9]', + 'ExampleNumber' => '997', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '131\\d\\d', + 'ExampleNumber' => '13100', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '131\\d\\d', + 'ExampleNumber' => '13100', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BY.php b/lib/libphonenumber/data/ShortNumberMetadata_BY.php index 63cac56f..79278a71 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BY.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BY.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[1-79]|1[246]|35|5[1-35]|6[89]|7[5-7]|8[58]|9[1-7])', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BY', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[1-79]|1[246]|35|5[1-35]|6[89]|7[5-7]|8[58]|9[1-7])', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BY', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_BZ.php b/lib/libphonenumber/data/ShortNumberMetadata_BZ.php index d3dc778d..b19ee900 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_BZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_BZ.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:0|11)', - 'ExampleNumber' => '90', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:0|11)', - 'ExampleNumber' => '90', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9(?:0|11)', - 'ExampleNumber' => '90', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'BZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:0|11)', + 'ExampleNumber' => '90', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:0|11)', + 'ExampleNumber' => '90', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9(?:0|11)', + 'ExampleNumber' => '90', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'BZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CA.php b/lib/libphonenumber/data/ShortNumberMetadata_CA.php index 42627728..f515fdbd 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CA.php @@ -10,114 +10,87 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d\\d(?:\\d\\d(?:\\d(?:\\d{2})?)?)?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - 2 => 6, - 3 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|[29]11', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112|30000\\d{3}|[1-35-9]\\d{4,5}|[2-9]11', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '[235-7]11', - 'ExampleNumber' => '211', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '300\\d{5}|[1-35-9]\\d{4,5}', - 'ExampleNumber' => '10000', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - 2 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d\\d(?:\\d\\d(?:\\d(?:\\d{2})?)?)?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + 2 => 6, + 3 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|[29]11', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112|30000\\d{3}|[1-35-9]\\d{4,5}|[2-9]11', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '[235-7]11', + 'ExampleNumber' => '211', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '300\\d{5}|[1-35-9]\\d{4,5}', + 'ExampleNumber' => '10000', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + 2 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CC.php b/lib/libphonenumber/data/ShortNumberMetadata_CC.php index 381f5b75..c20ead0a 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CC.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CC.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[01]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '000|112', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '000|112', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '000|112', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CC', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[01]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '000|112', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '000|112', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '000|112', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CC', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CD.php b/lib/libphonenumber/data/ShortNumberMetadata_CD.php index 6ccf8090..a5ce31bf 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CD.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CD.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[348]|77|88)', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[348]|77|88)', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[348]|23|77|88)|40404', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CD', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[348]|77|88)', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[348]|77|88)', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[348]|23|77|88)|40404', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CD', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CF.php b/lib/libphonenumber/data/ShortNumberMetadata_CF.php index d7a351f9..1e901abf 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CF.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CF.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[78]|22\\d)', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[78]|220)', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[478]|220)', - 'ExampleNumber' => '114', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CF', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[78]|22\\d)', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[78]|220)', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[478]|220)', + 'ExampleNumber' => '114', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CF', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CG.php b/lib/libphonenumber/data/ShortNumberMetadata_CG.php index 72854942..4bf2ab99 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CG.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[178]', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[78]', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[126-8]', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[178]', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[78]', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[126-8]', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CH.php b/lib/libphonenumber/data/ShortNumberMetadata_CH.php index a1fde4b1..450d46e8 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CH.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CH.php @@ -10,124 +10,97 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[278]|6\\d{3})|4[47])|5200', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1(?:14|8[01589])\\d|543|83111', - 'ExampleNumber' => '543', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[278]|44)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[78]\\d\\d|1(?:[278]|45|6(?:000|111))|4(?:[03-57]|1[45])|6(?:00|[1-46])|8(?:02|1[189]|50|7|8[08]|99))|[2-9]\\d{2,4}', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '1(?:4[035]|6[1-46])|1(?:41|60)\\d', - 'ExampleNumber' => '140', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '5(?:200|35)', - 'ExampleNumber' => '535', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '[2-9]\\d{2,4}', - 'ExampleNumber' => '200', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CH', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:[278]|6\\d{3})|4[47])|5200', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1(?:14|8[01589])\\d|543|83111', + 'ExampleNumber' => '543', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[278]|44)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[78]\\d\\d|1(?:[278]|45|6(?:000|111))|4(?:[03-57]|1[45])|6(?:00|[1-46])|8(?:02|1[189]|50|7|8[08]|99))|[2-9]\\d{2,4}', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '1(?:4[035]|6[1-46])|1(?:41|60)\\d', + 'ExampleNumber' => '140', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '5(?:200|35)', + 'ExampleNumber' => '535', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '[2-9]\\d{2,4}', + 'ExampleNumber' => '200', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CH', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CI.php b/lib/libphonenumber/data/ShortNumberMetadata_CI.php index 67333a9e..d840ac7c 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CI.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[01]|[78]0)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[01]|[78]0)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[01]|[78]0)|4443', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '444\\d', - 'ExampleNumber' => '4440', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '444\\d', - 'ExampleNumber' => '4440', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[01]|[78]0)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[01]|[78]0)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[01]|[78]0)|4443', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '444\\d', + 'ExampleNumber' => '4440', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '444\\d', + 'ExampleNumber' => '4440', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CK.php b/lib/libphonenumber/data/ShortNumberMetadata_CK.php index 2785e033..47ed1964 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CK.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CK.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '99[689]', - 'ExampleNumber' => '996', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '99[689]', - 'ExampleNumber' => '996', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '99[689]', - 'ExampleNumber' => '996', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CK', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '99[689]', + 'ExampleNumber' => '996', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '99[689]', + 'ExampleNumber' => '996', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '99[689]', + 'ExampleNumber' => '996', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CK', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CL.php b/lib/libphonenumber/data/ShortNumberMetadata_CL.php index 9cda2c4a..22b7d5d3 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CL.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CL.php @@ -10,116 +10,89 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:213|3[1-3])|434\\d|911', - 'ExampleNumber' => '131', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1(?:211|3(?:13|[348]0|5[01]))|(?:1(?:[05]6|[48]1|9[18])|2(?:01\\d|[23]2|77|88)|3(?:0[59]|13|3[279]|66)|4(?:[12]4|36\\d|4[017]|55)|5(?:00|41\\d|5[67]|99)|6(?:07\\d|13|22|3[06]|50|69)|787|8(?:[01]1|[48]8)|9(?:01|[12]0|33))\\d', - 'ExampleNumber' => '1060', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '13[1-3]|911', - 'ExampleNumber' => '131', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:00|21[13]|3(?:13|[348]0|5[01])|4(?:0[02-6]|17|[379])|818|919)|2(?:0(?:01|122)|22[47]|323|777|882)|3(?:0(?:51|99)|132|3(?:29|[37]7)|665)|43656|5(?:(?:00|415)4|5(?:66|77)|995)|6(?:131|222|366|699)|7878|8(?:011|11[28]|482|889)|9(?:01|1)1|13\\d|4(?:[13]42|243|4(?:02|15|77)|554)|(?:1(?:[05]6|98)|339|6(?:07|[35])0|9(?:[12]0|33))0', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '(?:200|333)\\d', - 'ExampleNumber' => '2000', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '13(?:13|[348]0|5[01])|(?:1(?:[05]6|[28]1|4[01]|9[18])|2(?:0(?:0|1\\d)|[23]2|77|88)|3(?:0[59]|13|3[2379]|66)|436\\d|5(?:00|41\\d|5[67]|99)|6(?:07\\d|13|22|3[06]|50|69)|787|8(?:[01]1|[48]8)|9(?:01|[12]0|33))\\d|4(?:[1-3]4|4[017]|55)\\d', - 'ExampleNumber' => '1060', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CL', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:213|3[1-3])|434\\d|911', + 'ExampleNumber' => '131', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1(?:211|3(?:13|[348]0|5[01]))|(?:1(?:[05]6|[48]1|9[18])|2(?:01\\d|[23]2|77|88)|3(?:0[59]|13|3[279]|66)|4(?:[12]4|36\\d|4[017]|55)|5(?:00|41\\d|5[67]|99)|6(?:07\\d|13|22|3[06]|50|69)|787|8(?:[01]1|[48]8)|9(?:01|[12]0|33))\\d', + 'ExampleNumber' => '1060', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '13[1-3]|911', + 'ExampleNumber' => '131', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:00|21[13]|3(?:13|[348]0|5[01])|4(?:0[02-6]|17|[379])|818|919)|2(?:0(?:01|122)|22[47]|323|777|882)|3(?:0(?:51|99)|132|3(?:29|[37]7)|665)|43656|5(?:(?:00|415)4|5(?:66|77)|995)|6(?:131|222|366|699)|7878|8(?:011|11[28]|482|889)|9(?:01|1)1|13\\d|4(?:[13]42|243|4(?:02|15|77)|554)|(?:1(?:[05]6|98)|339|6(?:07|[35])0|9(?:[12]0|33))0', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '(?:200|333)\\d', + 'ExampleNumber' => '2000', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '13(?:13|[348]0|5[01])|(?:1(?:[05]6|[28]1|4[01]|9[18])|2(?:0(?:0|1\\d)|[23]2|77|88)|3(?:0[59]|13|3[2379]|66)|436\\d|5(?:00|41\\d|5[67]|99)|6(?:07\\d|13|22|3[06]|50|69)|787|8(?:[01]1|[48]8)|9(?:01|[12]0|33))\\d|4(?:[1-3]4|4[017]|55)\\d', + 'ExampleNumber' => '1060', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CL', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CM.php b/lib/libphonenumber/data/ShortNumberMetadata_CM.php index b64d066d..5c531c4b 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CM.php @@ -10,113 +10,86 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[18]\\d{1,3}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[37]|[37])', - 'ExampleNumber' => '13', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[37]|[37])', - 'ExampleNumber' => '13', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[37]|[37])|8711', - 'ExampleNumber' => '13', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '871\\d', - 'ExampleNumber' => '8710', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '871\\d', - 'ExampleNumber' => '8710', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[18]\\d{1,3}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[37]|[37])', + 'ExampleNumber' => '13', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[37]|[37])', + 'ExampleNumber' => '13', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[37]|[37])|8711', + 'ExampleNumber' => '13', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '871\\d', + 'ExampleNumber' => '8710', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '871\\d', + 'ExampleNumber' => '8710', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CN.php b/lib/libphonenumber/data/ShortNumberMetadata_CN.php index 4026e775..b9815291 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CN.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d(?:\\d{2,3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[09]|20)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[09]|20)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:00\\d\\d|1[09]|20)|95\\d{3,4}', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '100\\d\\d|95\\d{3,4}', - 'ExampleNumber' => '10000', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d(?:\\d{2,3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[09]|20)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[09]|20)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:00\\d\\d|1[09]|20)|95\\d{3,4}', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '100\\d\\d|95\\d{3,4}', + 'ExampleNumber' => '10000', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CO.php b/lib/libphonenumber/data/ShortNumberMetadata_CO.php index 6250c0bc..767f278d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CO.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[148]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[29]|23|32|56)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[29]|23|32|56)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:06|1[2569]|2[357]|3[27]|4[467]|5[36]|6[45]|95)|40404|85432', - 'ExampleNumber' => '106', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '(?:40|85)4\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:40|85)4\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[148]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[29]|23|32|56)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[29]|23|32|56)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:06|1[2569]|2[357]|3[27]|4[467]|5[36]|6[45]|95)|40404|85432', + 'ExampleNumber' => '106', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '(?:40|85)4\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:40|85)4\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CR.php b/lib/libphonenumber/data/ShortNumberMetadata_CR.php index 7a3806b3..1cc066be 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CR.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1359]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0(?:00|15|2[2-4679])|1(?:1[0-35-9]|2|37|[46]6|7[57]|8[79]|9[0-379])|2(?:00|[12]2|34|55)|3(?:21|33)|4(?:0[06]|1[4-6])|5(?:15|5[15])|693|7(?:00|1[7-9]|2[02]|[67]7)|975)|3855|5(?:0(?:30|49)|510)|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:385|5(?:0[34]|51))\\d', - 'ExampleNumber' => '3850', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1359]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0(?:00|15|2[2-4679])|1(?:1[0-35-9]|2|37|[46]6|7[57]|8[79]|9[0-379])|2(?:00|[12]2|34|55)|3(?:21|33)|4(?:0[06]|1[4-6])|5(?:15|5[15])|693|7(?:00|1[7-9]|2[02]|[67]7)|975)|3855|5(?:0(?:30|49)|510)|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:385|5(?:0[34]|51))\\d', + 'ExampleNumber' => '3850', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CU.php b/lib/libphonenumber/data/ShortNumberMetadata_CU.php index 021ce370..7779f009 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CU.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CU.php @@ -10,106 +10,79 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[12]\\d\\d(?:\\d{3,4})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - 2 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '10[4-7]|(?:116|204\\d)\\d{3}', - 'ExampleNumber' => '104', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '10[4-6]', - 'ExampleNumber' => '104', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[4-7]|1(?:6111|8)|40)|2045252', - 'ExampleNumber' => '104', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CU', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[12]\\d\\d(?:\\d{3,4})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + 2 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '10[4-7]|(?:116|204\\d)\\d{3}', + 'ExampleNumber' => '104', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '10[4-6]', + 'ExampleNumber' => '104', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[4-7]|1(?:6111|8)|40)|2045252', + 'ExampleNumber' => '104', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CU', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CV.php b/lib/libphonenumber/data/ShortNumberMetadata_CV.php index 639bae6c..e2bb0243 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CV.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CV.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '13[0-2]', - 'ExampleNumber' => '130', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '13[0-2]', - 'ExampleNumber' => '130', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '13[0-2]', - 'ExampleNumber' => '130', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CV', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '13[0-2]', + 'ExampleNumber' => '130', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '13[0-2]', + 'ExampleNumber' => '130', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '13[0-2]', + 'ExampleNumber' => '130', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CV', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CW.php b/lib/libphonenumber/data/ShortNumberMetadata_CW.php index c671bcb9..c53f72ac 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CW.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|76)|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|76)|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CX.php b/lib/libphonenumber/data/ShortNumberMetadata_CX.php index d2fd7176..f73df957 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CX.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CX.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[01]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '000|112', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '000|112', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '000|112', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CX', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[01]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '000|112', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '000|112', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '000|112', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CX', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CY.php b/lib/libphonenumber/data/ShortNumberMetadata_CY.php index d4c2a9f2..67e8bbd4 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CY.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CY.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6\\d{3})|99)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|99)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6(?:000|111))|99)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CY', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6\\d{3})|99)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|99)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6(?:000|111))|99)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CY', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_CZ.php b/lib/libphonenumber/data/ShortNumberMetadata_CZ.php index 26f602dd..1cb8a0ce 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_CZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_CZ.php @@ -10,109 +10,82 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6(?:00[06]|1(?:11|23)))|5[0568])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|5[0568])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|8\\d)|(?:2|3\\d)\\d{2,3}|5[0568]|99)|1(?:16|4)\\d{3}', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'CZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6(?:00[06]|1(?:11|23)))|5[0568])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|5[0568])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:2|8\\d)|(?:2|3\\d)\\d{2,3}|5[0568]|99)|1(?:16|4)\\d{3}', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'CZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_DE.php b/lib/libphonenumber/data/ShortNumberMetadata_DE.php index e5a01510..8c97f8d8 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_DE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_DE.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:[02]|6\\d{3})', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[02]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11(?:[025]|6(?:00[06]|1(?:1[17]|23)))', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:[02]|6\\d{3})', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[02]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11(?:[025]|6(?:00[06]|1(?:1[17]|23)))', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_DJ.php b/lib/libphonenumber/data/ShortNumberMetadata_DJ.php index 5e028dda..3dabe214 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_DJ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_DJ.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DJ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DJ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_DK.php b/lib/libphonenumber/data/ShortNumberMetadata_DK.php index 1400b37e..f975f143 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_DK.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_DK.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d(?:\\d{2})?)?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:[24]|6\\d{3})', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[24]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[2-48]|6(?:00[06]|111))|8(?:[08]1|1[0238]|28|30|5[13]))', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DK', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d(?:\\d{2})?)?', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:[24]|6\\d{3})', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[24]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:[2-48]|6(?:00[06]|111))|8(?:[08]1|1[0238]|28|30|5[13]))', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DK', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_DM.php b/lib/libphonenumber/data/ShortNumberMetadata_DM.php index 7b866873..200b61bb 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_DM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_DM.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[39]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '333|9(?:11|99)', - 'ExampleNumber' => '333', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '333|9(?:11|99)', - 'ExampleNumber' => '333', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '333|9(?:11|99)', - 'ExampleNumber' => '333', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[39]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '333|9(?:11|99)', + 'ExampleNumber' => '333', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '333|9(?:11|99)', + 'ExampleNumber' => '333', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '333|9(?:11|99)', + 'ExampleNumber' => '333', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_DO.php b/lib/libphonenumber/data/ShortNumberMetadata_DO.php index bc82b5b1..9b173e09 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_DO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_DO.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_DZ.php b/lib/libphonenumber/data/ShortNumberMetadata_DZ.php index 4e40816e..ea223ca6 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_DZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_DZ.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[17]\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[47]', - 'ExampleNumber' => '14', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[47]', - 'ExampleNumber' => '14', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[47]|730', - 'ExampleNumber' => '14', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '730', - 'ExampleNumber' => '730', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '730', - 'ExampleNumber' => '730', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'DZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[17]\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[47]', + 'ExampleNumber' => '14', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[47]', + 'ExampleNumber' => '14', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[47]|730', + 'ExampleNumber' => '14', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '730', + 'ExampleNumber' => '730', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '730', + 'ExampleNumber' => '730', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'DZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_EC.php b/lib/libphonenumber/data/ShortNumberMetadata_EC.php index e1cc90e7..47600e5b 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_EC.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_EC.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[12]|12)|911', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[12]|12)|911', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[12]|12)|911', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'EC', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[12]|12)|911', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[12]|12)|911', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[12]|12)|911', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'EC', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_EE.php b/lib/libphonenumber/data/ShortNumberMetadata_EE.php index b717484e..6e269fca 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_EE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_EE.php @@ -10,115 +10,88 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[02]|6\\d{3})|2(?:05|28)|3(?:014|3(?:21|5\\d?)|660)|492|5(?:1[03]|410|501)|6(?:112|333|644)|7(?:012|127|89)|8(?:10|8[57])|9(?:0[134]|14))', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1(?:18(?:00|[12458]\\d?)|2(?:0(?:[02-46-8]\\d?|1[0-36])|1(?:[0-4]\\d?|6[06])|2(?:[0-4]\\d?|5[25])|[367]|4(?:0[04]|[12]\\d?|4[24]|54)|55[12457])|3(?:0(?:[02]\\d?|1[13578]|3[356])|1[1347]|2[02-5]|3(?:[01347]\\d?|2[023]|88)|4(?:[35]\\d?|4[34])|5(?:3[134]|5[035])|666)|4(?:2(?:00|4\\d?)|4(?:0[01358]|1[024]|50|7\\d?)|900)|5(?:0[0-35]|1(?:[1267]\\d?|5[0-7]|82)|2(?:[014-6]\\d?|22)|330|4(?:[35]\\d?|44)|5(?:00|[1-69]\\d?)|9(?:[159]\\d?|[38]0|77))|6(?:1(?:00|1[19]|[35-9]\\d?)|2(?:2[26]|[68]\\d?)|3(?:22|36|6[36])|5|6(?:[0-359]\\d?|6[0-26])|7(?:00|55|7\\d?|8[89])|9(?:00|1\\d?|69))|7(?:0(?:[023]\\d?|1[0578])|1(?:00|2[034]|[4-9]\\d?)|2(?:[07]\\d?|20|44)|7(?:[0-57]\\d?|9[79])|8(?:0[08]|2\\d?|8[0178])|9(?:00|97))|8(?:1[127]|8[1268]|9[269])|9(?:0(?:[02]\\d?|69|9[0269])|1[1-3689]|21))', - 'ExampleNumber' => '123', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[02]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[02-579]|6(?:000|111)|8(?:[09]\\d|[1-8]))|2[36-9]|3[7-9]|4[05-7]|5[6-8]|6[05]|7[3-6]|8[02-7]|9[3-9])|1(?:2[0-245]|3[0-6]|4[1-489]|5[0-59]|6[1-46-9]|7[0-27-9]|8[189]|9[0-2])\\d\\d?', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '1(?:18[1258]|2(?:0(?:1[036]|[46]\\d?)|166|21|4(?:0[04]|1\\d?|5[47])|[67])|3(?:0(?:1[13-578]|2\\d?|3[56])|1[15]|2[045]|3(?:[13]\\d?|2[13])|43|5(?:00|3[34]|53))|44(?:0[0135]|14|50|7\\d?)|5(?:05|1(?:[12]\\d?|5[1246]|8[12])|2(?:[01]\\d?|22)|3(?:00|3[03])|4(?:15|5\\d?)|500|9(?:5\\d?|77|80))|6(?:1[35-8]|226|3(?:22|3[36]|66)|644|7(?:00|7\\d?|89)|9(?:00|69))|7(?:01[258]|1(?:00|[15]\\d?)|2(?:44|7\\d?)|8(?:00|87|9\\d?))|8(?:1[128]|8[56]|9(?:[26]\\d?|77))|90(?:2\\d?|69|92))', - 'ExampleNumber' => '126', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'EE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:[02]|6\\d{3})|2(?:05|28)|3(?:014|3(?:21|5\\d?)|660)|492|5(?:1[03]|410|501)|6(?:112|333|644)|7(?:012|127|89)|8(?:10|8[57])|9(?:0[134]|14))', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1(?:18(?:00|[12458]\\d?)|2(?:0(?:[02-46-8]\\d?|1[0-36])|1(?:[0-4]\\d?|6[06])|2(?:[0-4]\\d?|5[25])|[367]|4(?:0[04]|[12]\\d?|4[24]|54)|55[12457])|3(?:0(?:[02]\\d?|1[13578]|3[356])|1[1347]|2[02-5]|3(?:[01347]\\d?|2[023]|88)|4(?:[35]\\d?|4[34])|5(?:3[134]|5[035])|666)|4(?:2(?:00|4\\d?)|4(?:0[01358]|1[024]|50|7\\d?)|900)|5(?:0[0-35]|1(?:[1267]\\d?|5[0-7]|82)|2(?:[014-6]\\d?|22)|330|4(?:[35]\\d?|44)|5(?:00|[1-69]\\d?)|9(?:[159]\\d?|[38]0|77))|6(?:1(?:00|1[19]|[35-9]\\d?)|2(?:2[26]|[68]\\d?)|3(?:22|36|6[36])|5|6(?:[0-359]\\d?|6[0-26])|7(?:00|55|7\\d?|8[89])|9(?:00|1\\d?|69))|7(?:0(?:[023]\\d?|1[0578])|1(?:00|2[034]|[4-9]\\d?)|2(?:[07]\\d?|20|44)|7(?:[0-57]\\d?|9[79])|8(?:0[08]|2\\d?|8[0178])|9(?:00|97))|8(?:1[127]|8[1268]|9[269])|9(?:0(?:[02]\\d?|69|9[0269])|1[1-3689]|21))', + 'ExampleNumber' => '123', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[02]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:[02-579]|6(?:000|111)|8(?:[09]\\d|[1-8]))|2[36-9]|3[7-9]|4[05-7]|5[6-8]|6[05]|7[3-6]|8[02-7]|9[3-9])|1(?:2[0-245]|3[0-6]|4[1-489]|5[0-59]|6[1-46-9]|7[0-27-9]|8[189]|9[0-2])\\d\\d?', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '1(?:18[1258]|2(?:0(?:1[036]|[46]\\d?)|166|21|4(?:0[04]|1\\d?|5[47])|[67])|3(?:0(?:1[13-578]|2\\d?|3[56])|1[15]|2[045]|3(?:[13]\\d?|2[13])|43|5(?:00|3[34]|53))|44(?:0[0135]|14|50|7\\d?)|5(?:05|1(?:[12]\\d?|5[1246]|8[12])|2(?:[01]\\d?|22)|3(?:00|3[03])|4(?:15|5\\d?)|500|9(?:5\\d?|77|80))|6(?:1[35-8]|226|3(?:22|3[36]|66)|644|7(?:00|7\\d?|89)|9(?:00|69))|7(?:01[258]|1(?:00|[15]\\d?)|2(?:44|7\\d?)|8(?:00|87|9\\d?))|8(?:1[128]|8[56]|9(?:[26]\\d?|77))|90(?:2\\d?|69|92))', + 'ExampleNumber' => '126', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'EE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_EG.php b/lib/libphonenumber/data/ShortNumberMetadata_EG.php index 00c7cec6..4e502204 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_EG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_EG.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[13]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:2[23]|80)', - 'ExampleNumber' => '122', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:2[23]|80)', - 'ExampleNumber' => '122', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:2[23]|[69]\\d{3}|80)|34400', - 'ExampleNumber' => '122', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '344\\d\\d', - 'ExampleNumber' => '34400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '344\\d\\d', - 'ExampleNumber' => '34400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'EG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[13]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:2[23]|80)', + 'ExampleNumber' => '122', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:2[23]|80)', + 'ExampleNumber' => '122', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:2[23]|[69]\\d{3}|80)|34400', + 'ExampleNumber' => '122', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '344\\d\\d', + 'ExampleNumber' => '34400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '344\\d\\d', + 'ExampleNumber' => '34400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'EG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_EH.php b/lib/libphonenumber/data/ShortNumberMetadata_EH.php index e561fe1f..651ce7d1 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_EH.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_EH.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:[59]|77)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:[59]|77)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:[59]|77)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'EH', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:[59]|77)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:[59]|77)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:[59]|77)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'EH', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ER.php b/lib/libphonenumber/data/ShortNumberMetadata_ER.php index 96003621..826d7753 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ER.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ER.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[12]\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[2-46]|(?:12[47]|20[12])\\d{3}', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[2-46]|24422)|20(?:1(?:606|917)|2914)|(?:1277|2020)99', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[2-6]|24422)|20(?:1(?:606|917)|2914)|(?:1277|2020)99', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ER', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[12]\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[2-46]|(?:12[47]|20[12])\\d{3}', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[2-46]|24422)|20(?:1(?:606|917)|2914)|(?:1277|2020)99', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[2-6]|24422)|20(?:1(?:606|917)|2914)|(?:1277|2020)99', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ER', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ES.php b/lib/libphonenumber/data/ShortNumberMetadata_ES.php index 13a22970..bdec8f56 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ES.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ES.php @@ -10,118 +10,91 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[0-379]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0(?:16|6[57]|8[58])|1(?:006|12|[3-7]\\d\\d)|(?:116|20\\d)\\d{3}', - 'ExampleNumber' => '016', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '[12]2\\d{1,4}|90(?:5\\d|7)|(?:118|2(?:[357]\\d|80)|3[357]\\d)\\d\\d|[79]9[57]\\d{3}', - 'ExampleNumber' => '120', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '08[58]|112', - 'ExampleNumber' => '085', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '0(?:1[0-26]|6[0-257]|8[058]|9[12])|1(?:0[03-57]\\d{1,3}|1(?:2|6(?:000|111)|8\\d\\d)|2\\d{1,4}|[3-9]\\d\\d)|2(?:2\\d{1,4}|80\\d\\d)|90(?:5[124578]|7)|1(?:3[34]|77)|(?:2[01]\\d|[79]9[57])\\d{3}|[23][357]\\d{3}', - 'ExampleNumber' => '010', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '0(?:[16][0-2]|80|9[12])|21\\d{4}', - 'ExampleNumber' => '010', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1(?:3[34]|77)|[12]2\\d{1,4}', - 'ExampleNumber' => '120', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:2[0-2]\\d|3[357]|[79]9[57])\\d{3}|2(?:[2357]\\d|80)\\d\\d', - 'ExampleNumber' => '22000', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ES', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[0-379]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0(?:16|6[57]|8[58])|1(?:006|12|[3-7]\\d\\d)|(?:116|20\\d)\\d{3}', + 'ExampleNumber' => '016', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '[12]2\\d{1,4}|90(?:5\\d|7)|(?:118|2(?:[357]\\d|80)|3[357]\\d)\\d\\d|[79]9[57]\\d{3}', + 'ExampleNumber' => '120', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '08[58]|112', + 'ExampleNumber' => '085', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '0(?:1[0-26]|6[0-257]|8[058]|9[12])|1(?:0[03-57]\\d{1,3}|1(?:2|6(?:000|111)|8\\d\\d)|2\\d{1,4}|[3-9]\\d\\d)|2(?:2\\d{1,4}|80\\d\\d)|90(?:5[124578]|7)|1(?:3[34]|77)|(?:2[01]\\d|[79]9[57])\\d{3}|[23][357]\\d{3}', + 'ExampleNumber' => '010', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '0(?:[16][0-2]|80|9[12])|21\\d{4}', + 'ExampleNumber' => '010', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1(?:3[34]|77)|[12]2\\d{1,4}', + 'ExampleNumber' => '120', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:2[0-2]\\d|3[357]|[79]9[57])\\d{3}|2(?:[2357]\\d|80)\\d\\d', + 'ExampleNumber' => '22000', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ES', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ET.php b/lib/libphonenumber/data/ShortNumberMetadata_ET.php index d0aa7e26..9168879c 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ET.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ET.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11?|[23]|9[17])', - 'ExampleNumber' => '91', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11?|[23]|9[17])', - 'ExampleNumber' => '91', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9(?:11?|[23]|9[17])', - 'ExampleNumber' => '91', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ET', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11?|[23]|9[17])', + 'ExampleNumber' => '91', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11?|[23]|9[17])', + 'ExampleNumber' => '91', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9(?:11?|[23]|9[17])', + 'ExampleNumber' => '91', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ET', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_FI.php b/lib/libphonenumber/data/ShortNumberMetadata_FI.php index e4682e5e..6ee49f98 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_FI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_FI.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[17]\\d\\d(?:\\d{2,3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:2|6\\d{3})', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11(?:2|6111)|75[12]\\d\\d', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[17]\\d\\d(?:\\d{2,3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:2|6\\d{3})', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11(?:2|6111)|75[12]\\d\\d', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_FJ.php b/lib/libphonenumber/data/ShortNumberMetadata_FJ.php index c64e05a1..29182e97 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_FJ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_FJ.php @@ -10,109 +10,82 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[0-579]\\d(?:\\d(?:\\d{2})?)?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '91[17]', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '91[17]', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '0(?:1[34]|8[1-4])|1(?:0[1-3]|[25]9)|2[289]|30|40404|91[137]|[45]4|75', - 'ExampleNumber' => '22', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FJ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[0-579]\\d(?:\\d(?:\\d{2})?)?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '91[17]', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '91[17]', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '0(?:1[34]|8[1-4])|1(?:0[1-3]|[25]9)|2[289]|30|40404|91[137]|[45]4|75', + 'ExampleNumber' => '22', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FJ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_FK.php b/lib/libphonenumber/data/ShortNumberMetadata_FK.php index ac9da407..8613bec4 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_FK.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_FK.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1\\d\\d|999', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FK', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1\\d\\d|999', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FK', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_FM.php b/lib/libphonenumber/data/ShortNumberMetadata_FM.php index d9c37e84..e0e7cc16 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_FM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_FM.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[39]\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '320\\d{3}|911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '(?:32022|91)1', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '(?:32022|91)1', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[39]\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '320\\d{3}|911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '(?:32022|91)1', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '(?:32022|91)1', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_FO.php b/lib/libphonenumber/data/ShortNumberMetadata_FO.php index 86cd54c7..9e56910e 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_FO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_FO.php @@ -10,106 +10,79 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[24]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[24]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[248]|1(?:4[124]|71|8[7-9])\\d', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[24]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[24]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[248]|1(?:4[124]|71|8[7-9])\\d', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_FR.php b/lib/libphonenumber/data/ShortNumberMetadata_FR.php index 673e911d..725b6f5f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_FR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_FR.php @@ -10,123 +10,96 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-8]\\d{1,5}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - 3 => 5, - 4 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0(?:07|[13]3)|1[02459]|[578]|9[167])|224|(?:3370|74)0|(?:116\\d|3[01])\\d\\d', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:118|[4-8]\\d)\\d{3}|36665', - 'ExampleNumber' => '36665', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0\\d\\d|1(?:[02459]|6(?:000|111)|8\\d{3})|[578]|9[167])|2(?:0(?:00|2)0|24)|[3-8]\\d{4}|3\\d{3}|6(?:1[14]|34)|7(?:0[06]|22|40)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '10(?:[134]4|2[23]|99)|202\\d|3(?:646|9[07]0)|634|70[06]|(?:106|61)[14]', - 'ExampleNumber' => '611', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '118777|224|6(?:1[14]|34)|7(?:0[06]|22|40)|20(?:0\\d|2)\\d', - 'ExampleNumber' => '224', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '114|[3-8]\\d{4}', - 'ExampleNumber' => '114', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'FR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-8]\\d{1,5}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + 3 => 5, + 4 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0(?:07|[13]3)|1[02459]|[578]|9[167])|224|(?:3370|74)0|(?:116\\d|3[01])\\d\\d', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:118|[4-8]\\d)\\d{3}|36665', + 'ExampleNumber' => '36665', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0\\d\\d|1(?:[02459]|6(?:000|111)|8\\d{3})|[578]|9[167])|2(?:0(?:00|2)0|24)|[3-8]\\d{4}|3\\d{3}|6(?:1[14]|34)|7(?:0[06]|22|40)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '10(?:[134]4|2[23]|99)|202\\d|3(?:646|9[07]0)|634|70[06]|(?:106|61)[14]', + 'ExampleNumber' => '611', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '118777|224|6(?:1[14]|34)|7(?:0[06]|22|40)|20(?:0\\d|2)\\d', + 'ExampleNumber' => '224', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '114|[3-8]\\d{4}', + 'ExampleNumber' => '114', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'FR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GA.php b/lib/libphonenumber/data/ShortNumberMetadata_GA.php index d529ec56..b3c11fee 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GA.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '18|1(?:3\\d|73)\\d', - 'ExampleNumber' => '18', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:3\\d\\d|730|8)', - 'ExampleNumber' => '18', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:3\\d\\d|730|8)', - 'ExampleNumber' => '18', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 2, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '18|1(?:3\\d|73)\\d', + 'ExampleNumber' => '18', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:3\\d\\d|730|8)', + 'ExampleNumber' => '18', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:3\\d\\d|730|8)', + 'ExampleNumber' => '18', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GB.php b/lib/libphonenumber/data/ShortNumberMetadata_GB.php index 9c794fe7..cc36f83f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GB.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GB.php @@ -10,114 +10,87 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-46-9]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:05|1(?:2|6\\d{3})|7[56]\\d|8000)|2(?:20\\d|48)|4444|999', - 'ExampleNumber' => '105', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[015]|1(?:[12]|6(?:000|1(?:11|23))|8\\d{3})|2(?:[1-3]|50)|33|4(?:1|7\\d)|571|7(?:0\\d|[56]0)|800\\d|9[15])|2(?:0202|1300|2(?:02|11)|3(?:02|336|45)|4(?:25|8))|3[13]3|4(?:0[02]|35[01]|44[45]|5\\d)|(?:[68]\\d|7[089])\\d{3}|15\\d|2[02]2|650|789|9(?:01|99)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1(?:(?:25|7[56])\\d|571)|2(?:02(?:\\d{2})?|[13]3\\d\\d|48)|4444|901', - 'ExampleNumber' => '202', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:125|2(?:020|13\\d)|(?:7[089]|8[01])\\d\\d)\\d', - 'ExampleNumber' => '1250', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GB', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-46-9]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:05|1(?:2|6\\d{3})|7[56]\\d|8000)|2(?:20\\d|48)|4444|999', + 'ExampleNumber' => '105', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[015]|1(?:[12]|6(?:000|1(?:11|23))|8\\d{3})|2(?:[1-3]|50)|33|4(?:1|7\\d)|571|7(?:0\\d|[56]0)|800\\d|9[15])|2(?:0202|1300|2(?:02|11)|3(?:02|336|45)|4(?:25|8))|3[13]3|4(?:0[02]|35[01]|44[45]|5\\d)|(?:[68]\\d|7[089])\\d{3}|15\\d|2[02]2|650|789|9(?:01|99)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1(?:(?:25|7[56])\\d|571)|2(?:02(?:\\d{2})?|[13]3\\d\\d|48)|4444|901', + 'ExampleNumber' => '202', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:125|2(?:020|13\\d)|(?:7[089]|8[01])\\d\\d)\\d', + 'ExampleNumber' => '1250', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GB', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GD.php b/lib/libphonenumber/data/ShortNumberMetadata_GD.php index 6f11990c..709688d0 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GD.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GD.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '176|911', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GD', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '176|911', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GD', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GE.php b/lib/libphonenumber/data/ShortNumberMetadata_GE.php index 6b51e2ac..448c202c 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GE.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[014]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0(?:11|33)|11[1-3]|[01]22', - 'ExampleNumber' => '011', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '0(?:11|33)|11[1-3]|[01]22', - 'ExampleNumber' => '011', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '0(?:11|33)|11[1-3]|40404|[01]22', - 'ExampleNumber' => '011', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[014]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0(?:11|33)|11[1-3]|[01]22', + 'ExampleNumber' => '011', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '0(?:11|33)|11[1-3]|[01]22', + 'ExampleNumber' => '011', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '0(?:11|33)|11[1-3]|40404|[01]22', + 'ExampleNumber' => '011', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GF.php b/lib/libphonenumber/data/ShortNumberMetadata_GF.php index 274f4d18..c2713ee1 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GF.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GF.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GF', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GF', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GG.php b/lib/libphonenumber/data/ShortNumberMetadata_GG.php index d4aac8f1..c8300d70 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GG.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[01]|1[12]|23|41|55|9[05])|999|1(?:1[68]\\d\\d|47|800)\\d', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[01]|1[12]|23|41|55|9[05])|999|1(?:1[68]\\d\\d|47|800)\\d', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GH.php b/lib/libphonenumber/data/ShortNumberMetadata_GH.php index 362e3dcc..5dc1c9a8 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GH.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GH.php @@ -10,113 +10,86 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14589]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '19[1-3]|999', - 'ExampleNumber' => '191', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '19[1-3]|999', - 'ExampleNumber' => '191', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '19[1-3]|40404|(?:54|83)00|999', - 'ExampleNumber' => '191', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d|(?:54|83)0\\d', - 'ExampleNumber' => '5400', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d|(?:54|83)0\\d', - 'ExampleNumber' => '5400', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GH', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14589]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '19[1-3]|999', + 'ExampleNumber' => '191', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '19[1-3]|999', + 'ExampleNumber' => '191', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '19[1-3]|40404|(?:54|83)00|999', + 'ExampleNumber' => '191', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d|(?:54|83)0\\d', + 'ExampleNumber' => '5400', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d|(?:54|83)0\\d', + 'ExampleNumber' => '5400', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GH', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GI.php b/lib/libphonenumber/data/ShortNumberMetadata_GI.php index 383a3456..0169285d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GI.php @@ -10,118 +10,91 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[158]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:00|1[25]|23|4(?:1|7\\d)|5[15]|9[02-49])|555|(?:116\\d|80)\\d\\d', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '8[1-69]\\d\\d', - 'ExampleNumber' => '8100', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|9[09])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:00|1(?:[25]|6(?:00[06]|1(?:1[17]|23))|8\\d\\d)|23|4(?:1|7[014])|5[015]|9[02-49])|555|8[0-79]\\d\\d|8(?:00|4[0-2]|8[0-589])', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '150|87\\d\\d', - 'ExampleNumber' => '150', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1(?:00|1(?:5|8\\d\\d)|23|51|9[2-4])|555|8(?:00|4[0-2]|8[0-589])', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[158]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:00|1[25]|23|4(?:1|7\\d)|5[15]|9[02-49])|555|(?:116\\d|80)\\d\\d', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '8[1-69]\\d\\d', + 'ExampleNumber' => '8100', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|9[09])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:00|1(?:[25]|6(?:00[06]|1(?:1[17]|23))|8\\d\\d)|23|4(?:1|7[014])|5[015]|9[02-49])|555|8[0-79]\\d\\d|8(?:00|4[0-2]|8[0-589])', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '150|87\\d\\d', + 'ExampleNumber' => '150', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1(?:00|1(?:5|8\\d\\d)|23|51|9[2-4])|555|8(?:00|4[0-2]|8[0-589])', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GL.php b/lib/libphonenumber/data/ShortNumberMetadata_GL.php index 10a42ba2..b75d8348 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GL.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GL.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GL', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GL', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GM.php b/lib/libphonenumber/data/ShortNumberMetadata_GM.php index f7bd77a8..b4ef23ff 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GM.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[6-8]|[6-8])', - 'ExampleNumber' => '16', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[6-8]|[6-8])', - 'ExampleNumber' => '16', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[6-8]|[6-8])', - 'ExampleNumber' => '16', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[6-8]|[6-8])', + 'ExampleNumber' => '16', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[6-8]|[6-8])', + 'ExampleNumber' => '16', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[6-8]|[6-8])', + 'ExampleNumber' => '16', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GN.php b/lib/libphonenumber/data/ShortNumberMetadata_GN.php index 7bdd8acb..0161e6f2 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GN.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '4\\d{4}', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '40404', - 'ExampleNumber' => '40404', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '4\\d{4}', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '40404', + 'ExampleNumber' => '40404', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GP.php b/lib/libphonenumber/data/ShortNumberMetadata_GP.php index fbe82eee..933ec06a 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GP.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GP.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GP', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GP', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GR.php b/lib/libphonenumber/data/ShortNumberMetadata_GR.php index 585db81a..21ec7840 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GR.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:00|1(?:2|6\\d{3})|66|99)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:00|12|66|99)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:00|1(?:2|6(?:000|1(?:11|23)))|66|99)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:00|1(?:2|6\\d{3})|66|99)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:00|12|66|99)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:00|1(?:2|6(?:000|1(?:11|23)))|66|99)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GT.php b/lib/libphonenumber/data/ShortNumberMetadata_GT.php index 02408bea..d09ea723 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GT.php @@ -10,111 +10,84 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:10|2[03])', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:10|2[03])', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '110|40404|1(?:2|[57]\\d)\\d', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:10|2[03])', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:10|2[03])', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '110|40404|1(?:2|[57]\\d)\\d', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GU.php b/lib/libphonenumber/data/ShortNumberMetadata_GU.php index 4973f3f7..4a7a60b8 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GU.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GU.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GU', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GU', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GW.php b/lib/libphonenumber/data/ShortNumberMetadata_GW.php index f76a1d92..70f6097b 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GW.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[378]', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[378]', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[378]', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[378]', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[378]', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[378]', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_GY.php b/lib/libphonenumber/data/ShortNumberMetadata_GY.php index 84b2a557..fd911c6d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_GY.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_GY.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[019]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '91[1-3]', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '91[1-3]', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '0(?:02|(?:17|80)1|444|7(?:[67]7|9)|9(?:0[78]|[2-47]))|1(?:443|5[568])|91[1-3]', - 'ExampleNumber' => '002', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '144\\d', - 'ExampleNumber' => '1440', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '144\\d', - 'ExampleNumber' => '1440', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'GY', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[019]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '91[1-3]', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '91[1-3]', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '0(?:02|(?:17|80)1|444|7(?:[67]7|9)|9(?:0[78]|[2-47]))|1(?:443|5[568])|91[1-3]', + 'ExampleNumber' => '002', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '144\\d', + 'ExampleNumber' => '1440', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '144\\d', + 'ExampleNumber' => '1440', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'GY', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_HK.php b/lib/libphonenumber/data/ShortNumberMetadata_HK.php index 91f7f98a..afb1ab08 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_HK.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_HK.php @@ -10,115 +10,88 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{2,6}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - 4 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|99[29]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|99[29]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0(?:(?:[0136]\\d|2[14])\\d{0,3}|8[138])|12|2(?:[0-3]\\d{0,4}|(?:58|8[13])\\d{0,3})|7(?:[135-9]\\d{0,4}|219\\d{0,2})|8(?:0(?:(?:[13]|60\\d)\\d|8)|1(?:0\\d|[2-8])|2(?:0[5-9]|(?:18|2)2|3|8[128])|(?:(?:3[0-689]\\d|7(?:2[1-389]|8[0235-9]|93))\\d|8)\\d|50[138]|6(?:1(?:11|86)|8)))|99[29]|10[0139]', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '109|1(?:08|85\\d)\\d', - 'ExampleNumber' => '109', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '992', - 'ExampleNumber' => '992', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HK', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{2,6}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + 4 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|99[29]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|99[29]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0(?:(?:[0136]\\d|2[14])\\d{0,3}|8[138])|12|2(?:[0-3]\\d{0,4}|(?:58|8[13])\\d{0,3})|7(?:[135-9]\\d{0,4}|219\\d{0,2})|8(?:0(?:(?:[13]|60\\d)\\d|8)|1(?:0\\d|[2-8])|2(?:0[5-9]|(?:18|2)2|3|8[128])|(?:(?:3[0-689]\\d|7(?:2[1-389]|8[0235-9]|93))\\d|8)\\d|50[138]|6(?:1(?:11|86)|8)))|99[29]|10[0139]', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '109|1(?:08|85\\d)\\d', + 'ExampleNumber' => '109', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '992', + 'ExampleNumber' => '992', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HK', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_HN.php b/lib/libphonenumber/data/ShortNumberMetadata_HN.php index 933deeab..687cb306 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_HN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_HN.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '199', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '199', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '199|40404', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '199', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '199', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '199|40404', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_HR.php b/lib/libphonenumber/data/ShortNumberMetadata_HR.php index 3ebb54a7..e87af398 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_HR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_HR.php @@ -10,119 +10,92 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{1,5}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - 3 => 5, - 4 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|9[2-4])|9[34]|1(?:16\\d|39)\\d\\d', - 'ExampleNumber' => '93', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '118\\d\\d', - 'ExampleNumber' => '11800', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|9[2-4])|9[34]', - 'ExampleNumber' => '93', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6(?:00[06]|1(?:1[17]|23))|8\\d\\d)|3977|9(?:[2-5]|87))|9[34]', - 'ExampleNumber' => '93', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '139\\d\\d', - 'ExampleNumber' => '13900', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '139\\d\\d', - 'ExampleNumber' => '13900', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{1,5}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + 3 => 5, + 4 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|9[2-4])|9[34]|1(?:16\\d|39)\\d\\d', + 'ExampleNumber' => '93', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '118\\d\\d', + 'ExampleNumber' => '11800', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|9[2-4])|9[34]', + 'ExampleNumber' => '93', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6(?:00[06]|1(?:1[17]|23))|8\\d\\d)|3977|9(?:[2-5]|87))|9[34]', + 'ExampleNumber' => '93', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '139\\d\\d', + 'ExampleNumber' => '13900', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '139\\d\\d', + 'ExampleNumber' => '13900', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_HT.php b/lib/libphonenumber/data/ShortNumberMetadata_HT.php index d2d3fbc5..5f52b01f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_HT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_HT.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[48]', - 'ExampleNumber' => '114', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[48]', - 'ExampleNumber' => '114', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[48]|40404', - 'ExampleNumber' => '114', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[48]', + 'ExampleNumber' => '114', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[48]', + 'ExampleNumber' => '114', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[48]|40404', + 'ExampleNumber' => '114', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_HU.php b/lib/libphonenumber/data/ShortNumberMetadata_HU.php index b48f1b52..ebcc3f3e 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_HU.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_HU.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[457]|1(?:2|6\\d{3}))', - 'ExampleNumber' => '104', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[457]|12)', - 'ExampleNumber' => '104', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[457]|1(?:2|6(?:000|1(?:11|23))))', - 'ExampleNumber' => '104', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'HU', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[457]|1(?:2|6\\d{3}))', + 'ExampleNumber' => '104', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[457]|12)', + 'ExampleNumber' => '104', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[457]|1(?:2|6(?:000|1(?:11|23))))', + 'ExampleNumber' => '104', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'HU', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ID.php b/lib/libphonenumber/data/ShortNumberMetadata_ID.php index affd3b8f..a9e724b6 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ID.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ID.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[178]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[02389]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[02389]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[02389]|40\\d\\d)|71400|89887', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '(?:714|898)\\d\\d', - 'ExampleNumber' => '71400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '714\\d\\d', - 'ExampleNumber' => '71400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ID', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[178]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[02389]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[02389]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[02389]|40\\d\\d)|71400|89887', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '(?:714|898)\\d\\d', + 'ExampleNumber' => '71400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '714\\d\\d', + 'ExampleNumber' => '71400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ID', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_IE.php b/lib/libphonenumber/data/ShortNumberMetadata_IE.php index 4033342d..956596eb 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_IE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_IE.php @@ -10,117 +10,90 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[159]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:2|6\\d{3})|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '5[37]\\d{3}', - 'ExampleNumber' => '53000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11(?:2|6(?:00[06]|1(?:1[17]|23)))|999|(?:1(?:18|9)|5[0137]\\d)\\d\\d', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '51\\d{3}', - 'ExampleNumber' => '51000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '51210', - 'ExampleNumber' => '51210', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '51210|(?:118|5[037]\\d)\\d\\d', - 'ExampleNumber' => '11800', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[159]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:2|6\\d{3})|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '5[37]\\d{3}', + 'ExampleNumber' => '53000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11(?:2|6(?:00[06]|1(?:1[17]|23)))|999|(?:1(?:18|9)|5[0137]\\d)\\d\\d', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '51\\d{3}', + 'ExampleNumber' => '51000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '51210', + 'ExampleNumber' => '51210', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '51210|(?:118|5[037]\\d)\\d\\d', + 'ExampleNumber' => '11800', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_IL.php b/lib/libphonenumber/data/ShortNumberMetadata_IL.php index aa0fa814..f8ce42e8 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_IL.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_IL.php @@ -10,111 +10,84 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[0-2]|12)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[0-2]|12)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0(?:[0-2]|400)|1(?:[013-9]\\d|2)|[2-9]\\d\\d)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '104\\d\\d', - 'ExampleNumber' => '10400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '104\\d\\d', - 'ExampleNumber' => '10400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IL', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[0-2]|12)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[0-2]|12)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0(?:[0-2]|400)|1(?:[013-9]\\d|2)|[2-9]\\d\\d)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '104\\d\\d', + 'ExampleNumber' => '10400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '104\\d\\d', + 'ExampleNumber' => '10400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IL', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_IM.php b/lib/libphonenumber/data/ShortNumberMetadata_IM.php index 62a3dfa2..7e9d7f24 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_IM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_IM.php @@ -10,109 +10,82 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[189]\\d\\d(?:\\d{2,3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?|8(?:6444|9887)|999', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '8(?:64|98)\\d\\d', - 'ExampleNumber' => '86400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[189]\\d\\d(?:\\d{2,3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?|8(?:6444|9887)|999', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '8(?:64|98)\\d\\d', + 'ExampleNumber' => '86400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_IN.php b/lib/libphonenumber/data/ShortNumberMetadata_IN.php index 270b0be6..335af3c2 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_IN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_IN.php @@ -10,134 +10,107 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[12578]\\d{2,8}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - 4 => 7, - 5 => 8, - 6 => 9, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[0-248]|1[289]|21|[39][89]|4[01]|6(?:1|6\\d?)|8[12])|777|800|1[05]5\\d|1(?:07|51|94)\\d\\d?|(?:1(?:[05]5\\d|70)\\d|261)\\d|1(?:0[369]|10|29|3[126]|9[0-256])\\d', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '11[67]\\d{4}|56161561', - 'ExampleNumber' => '1160000', - 'PossibleLength' => - array ( - 0 => 7, - 1 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[0-28]|12|298)|2611', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0(?:[0-248]|3[39]|5(?:010|6)|6[3468]|7(?:[01357]|[28]0?|4[01])|9[0135-9])|1(?:00|[289])|2(?:1|98)|3(?:11|2[0-2]|63|[89])|4[01]|5(?:1(?:0[0-36]|[127])|54)|6(?:1|6[01]?)|7000|8[12]|9(?:0[013-59]|12|25|4[4-9]\\d?|50|6[1347]|[89]))|2611|5(?:0(?:0(?:0\\d|1|20?)|325|5[2-79]\\d{3,5})|1(?:234|555|717|818|96[49])|2(?:0(?:0[01]|[14]0)|151|555|666|888|9(?:06|99\\d?))|3(?:0[01]0|131|553|(?:66|77)6)|(?:464|55[05])\\d{1,3}|6(?:070|3[68]|43)|717\\d)|777|800|5(?:05(?:0|1\\d)|221|3(?:03|3[23]))\\d{1,4}|5(?:(?:04|88)0|2(?:2[0267]|3[16])|4(?:1[04]|20|3[02])|5(?:3[16]|67)|6(?:06|[67]\\d)|787|9(?:64|90))\\d\\d?|(?:1(?:05[79]|(?:1[67][0-2]|802)\\d|55[23])\\d|5(?:(?:00(?:0\\d|1)|(?:304|616)\\d\\d)\\d|1(?:0[12]|4[2-4])|2(?:2[3589]|3(?:1\\d{3}|2)|4[04]|7[78])|4(?:[02]4|32\\d{4}|4[04]|99)|5(?:1[25]|[36]5|4[45]|93)|7(?:(?:17\\d|57)\\d\\d|[27]7|88)|8(?:3[4-69]|4[01]|5[58]|88(?:8\\d\\d|9)|99)|9(?:0(?:0|2\\d{3})|55|6[67]|77|88)))\\d', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '5(?:14(?:2[5-9]|[34]\\d)|757555)', - 'ExampleNumber' => '51425', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1(?:(?:1[67]\\d\\d|70)\\d\\d|55330|909)|5(?:300\\d|6161(?:17[89]|561))|1(?:[19][89]|21|4[01])', - 'ExampleNumber' => '118', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - 4 => 7, - 5 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '1(?:39|90[019])|5(?:14(?:2[5-9]|[34]\\d)|6161(?:17[89]|561)|757555)', - 'ExampleNumber' => '139', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 7, - 4 => 8, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[12578]\\d{2,8}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + 4 => 7, + 5 => 8, + 6 => 9, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[0-248]|1[289]|21|[39][89]|4[01]|6(?:1|6\\d?)|8[12])|777|800|1[05]5\\d|1(?:07|51|94)\\d\\d?|(?:1(?:[05]5\\d|70)\\d|261)\\d|1(?:0[369]|10|29|3[126]|9[0-256])\\d', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '11[67]\\d{4}|56161561', + 'ExampleNumber' => '1160000', + 'PossibleLength' => [ + 0 => 7, + 1 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[0-28]|12|298)|2611', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0(?:[0-248]|3[39]|5(?:010|6)|6[3468]|7(?:[01357]|[28]0?|4[01])|9[0135-9])|1(?:00|[289])|2(?:1|98)|3(?:11|2[0-2]|63|[89])|4[01]|5(?:1(?:0[0-36]|[127])|54)|6(?:1|6[01]?)|7000|8[12]|9(?:0[013-59]|12|25|4[4-9]\\d?|50|6[1347]|[89]))|2611|5(?:0(?:0(?:0\\d|1|20?)|325|5[2-79]\\d{3,5})|1(?:234|555|717|818|96[49])|2(?:0(?:0[01]|[14]0)|151|555|666|888|9(?:06|99\\d?))|3(?:0[01]0|131|553|(?:66|77)6)|(?:464|55[05])\\d{1,3}|6(?:070|3[68]|43)|717\\d)|777|800|5(?:05(?:0|1\\d)|221|3(?:03|3[23]))\\d{1,4}|5(?:(?:04|88)0|2(?:2[0267]|3[16])|4(?:1[04]|20|3[02])|5(?:3[16]|67)|6(?:06|[67]\\d)|787|9(?:64|90))\\d\\d?|(?:1(?:05[79]|(?:1[67][0-2]|802)\\d|55[23])\\d|5(?:(?:00(?:0\\d|1)|(?:304|616)\\d\\d)\\d|1(?:0[12]|4[2-4])|2(?:2[3589]|3(?:1\\d{3}|2)|4[04]|7[78])|4(?:[02]4|32\\d{4}|4[04]|99)|5(?:1[25]|[36]5|4[45]|93)|7(?:(?:17\\d|57)\\d\\d|[27]7|88)|8(?:3[4-69]|4[01]|5[58]|88(?:8\\d\\d|9)|99)|9(?:0(?:0|2\\d{3})|55|6[67]|77|88)))\\d', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '5(?:14(?:2[5-9]|[34]\\d)|757555)', + 'ExampleNumber' => '51425', + 'PossibleLength' => [ + 0 => 5, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1(?:(?:1[67]\\d\\d|70)\\d\\d|55330|909)|5(?:300\\d|6161(?:17[89]|561))|1(?:[19][89]|21|4[01])', + 'ExampleNumber' => '118', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + 4 => 7, + 5 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '1(?:39|90[019])|5(?:14(?:2[5-9]|[34]\\d)|6161(?:17[89]|561)|757555)', + 'ExampleNumber' => '139', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 7, + 4 => 8, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_IQ.php b/lib/libphonenumber/data/ShortNumberMetadata_IQ.php index 29d3cb2e..8e7b4969 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_IQ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_IQ.php @@ -10,113 +10,86 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1479]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[04]|15|22)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[04]|15|22)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[04]|15|22)|4432|71117|9988', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '(?:443|711\\d|998)\\d', - 'ExampleNumber' => '4430', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:443|711\\d|998)\\d', - 'ExampleNumber' => '4430', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IQ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1479]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[04]|15|22)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[04]|15|22)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[04]|15|22)|4432|71117|9988', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '(?:443|711\\d|998)\\d', + 'ExampleNumber' => '4430', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:443|711\\d|998)\\d', + 'ExampleNumber' => '4430', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IQ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_IR.php b/lib/libphonenumber/data/ShortNumberMetadata_IR.php index fe8a6a2d..fb7482e0 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_IR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_IR.php @@ -10,115 +10,88 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[129]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[0-68]|2[0-59]|9[0-579])|911', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[025]|25)|911', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[0-68]|2[0-59]|3[346-8]|4(?:[0147]|[289]0)|5(?:0[14]|1[02479]|2[0-3]|39|[49]0|65)|6(?:[16]6|[27]|90)|8(?:03|1[18]|22|3[37]|4[28]|88|99)|9[0-579])|20(?:[09]0|1(?:[038]|1[079]|26|9[69])|2[01])|9(?:11|9(?:0009|90))', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '1(?:5[0-469]|8[0-489])\\d', - 'ExampleNumber' => '1500', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '(?:1(?:5[0-469]|8[0-489])|99(?:0\\d\\d|9))\\d', - 'ExampleNumber' => '1500', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '990\\d{3}', - 'ExampleNumber' => '990000', - 'PossibleLength' => - array ( - 0 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[129]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[0-68]|2[0-59]|9[0-579])|911', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[025]|25)|911', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[0-68]|2[0-59]|3[346-8]|4(?:[0147]|[289]0)|5(?:0[14]|1[02479]|2[0-3]|39|[49]0|65)|6(?:[16]6|[27]|90)|8(?:03|1[18]|22|3[37]|4[28]|88|99)|9[0-579])|20(?:[09]0|1(?:[038]|1[079]|26|9[69])|2[01])|9(?:11|9(?:0009|90))', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '1(?:5[0-469]|8[0-489])\\d', + 'ExampleNumber' => '1500', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '(?:1(?:5[0-469]|8[0-489])|99(?:0\\d\\d|9))\\d', + 'ExampleNumber' => '1500', + 'PossibleLength' => [ + 0 => 4, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '990\\d{3}', + 'ExampleNumber' => '990000', + 'PossibleLength' => [ + 0 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_IS.php b/lib/libphonenumber/data/ShortNumberMetadata_IS.php index 73139a0e..a778076d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_IS.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_IS.php @@ -10,112 +10,85 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d(?:\\d{2})?)?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|71\\d)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[28]|61(?:16|23))|4(?:00|1[145]|4[0146])|55|7(?:00|17|7[07-9])|8(?:[02]0|1[16-9]|88)|900)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '14(?:0\\d|41)', - 'ExampleNumber' => '1400', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '1(?:415|90\\d)', - 'ExampleNumber' => '1415', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IS', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d(?:\\d{2})?)?', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|71\\d)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:[28]|61(?:16|23))|4(?:00|1[145]|4[0146])|55|7(?:00|17|7[07-9])|8(?:[02]0|1[16-9]|88)|900)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '14(?:0\\d|41)', + 'ExampleNumber' => '1400', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '1(?:415|90\\d)', + 'ExampleNumber' => '1415', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IS', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_IT.php b/lib/libphonenumber/data/ShortNumberMetadata_IT.php index 91761cdc..fa3d8fe7 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_IT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_IT.php @@ -10,117 +10,90 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d{2,6}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - 4 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[2358]|6\\d{3})|87)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:12|4(?:[478](?:[0-4]|[5-9]\\d\\d)|55))\\d\\d', - 'ExampleNumber' => '1200', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[2358]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0\\d{2,3}|1(?:[2-57-9]|6(?:000|111))|3[39]|4(?:82|9\\d{1,3})|5(?:00|1[58]|2[25]|3[03]|44|[59])|60|8[67]|9(?:[01]|2[2-9]|4\\d|696))|4(?:2323|5045)|(?:1(?:2|92[01])|4(?:3(?:[01]|[45]\\d\\d)|[478](?:[0-4]|[5-9]\\d\\d)|55))\\d\\d', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '4(?:3(?:[01]|[45]\\d\\d)|[478](?:[0-4]|[5-9]\\d\\d)|5[05])\\d\\d', - 'ExampleNumber' => '43000', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'IT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d{2,6}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + 4 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:[2358]|6\\d{3})|87)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:12|4(?:[478](?:[0-4]|[5-9]\\d\\d)|55))\\d\\d', + 'ExampleNumber' => '1200', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[2358]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0\\d{2,3}|1(?:[2-57-9]|6(?:000|111))|3[39]|4(?:82|9\\d{1,3})|5(?:00|1[58]|2[25]|3[03]|44|[59])|60|8[67]|9(?:[01]|2[2-9]|4\\d|696))|4(?:2323|5045)|(?:1(?:2|92[01])|4(?:3(?:[01]|[45]\\d\\d)|[478](?:[0-4]|[5-9]\\d\\d)|55))\\d\\d', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '4(?:3(?:[01]|[45]\\d\\d)|[478](?:[0-4]|[5-9]\\d\\d)|5[05])\\d\\d', + 'ExampleNumber' => '43000', + 'PossibleLength' => [ + 0 => 5, + 1 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'IT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_JE.php b/lib/libphonenumber/data/ShortNumberMetadata_JE.php index 061569ab..14cb6773 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_JE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_JE.php @@ -10,107 +10,80 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[129]\\d\\d(?:\\d(?:\\d{2})?)?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:00|1(?:2|8\\d{3})|23|4(?:[14]|28|7\\d)|5\\d|7(?:0[12]|[128]|35?)|808|9[0135])|23[2-4]|999', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'JE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[129]\\d\\d(?:\\d(?:\\d{2})?)?', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:00|1(?:2|8\\d{3})|23|4(?:[14]|28|7\\d)|5\\d|7(?:0[12]|[128]|35?)|808|9[0135])|23[2-4]|999', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'JE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_JM.php b/lib/libphonenumber/data/ShortNumberMetadata_JM.php index e87b2071..99bbc66a 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_JM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_JM.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[029]|911', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[029]|911', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[029]|76)|911', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '176', - 'ExampleNumber' => '176', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'JM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[029]|911', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[029]|911', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[029]|76)|911', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '176', + 'ExampleNumber' => '176', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'JM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_JO.php b/lib/libphonenumber/data/ShortNumberMetadata_JO.php index a23ac04a..0d0d936a 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_JO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_JO.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|9[127])|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|9[127])|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:09|1[0-2]|9[0-24-79])|9(?:0903|11|8788)', - 'ExampleNumber' => '109', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '9(?:09|87)\\d\\d', - 'ExampleNumber' => '90900', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '9(?:09|87)\\d\\d', - 'ExampleNumber' => '90900', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'JO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|9[127])|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|9[127])|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:09|1[0-2]|9[0-24-79])|9(?:0903|11|8788)', + 'ExampleNumber' => '109', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '9(?:09|87)\\d\\d', + 'ExampleNumber' => '90900', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '9(?:09|87)\\d\\d', + 'ExampleNumber' => '90900', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'JO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_JP.php b/lib/libphonenumber/data/ShortNumberMetadata_JP.php index 99220fd0..3a9806de 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_JP.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_JP.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[09]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[09]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[09]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'JP', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[09]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[09]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[09]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'JP', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KE.php b/lib/libphonenumber/data/ShortNumberMetadata_KE.php index 3eb68f3f..b081a77e 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KE.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[246]|9\\d)|5(?:01|2[127]|6[26]\\d))|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '909\\d\\d', - 'ExampleNumber' => '90900', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[24]|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0(?:[07-9]|1[0-25]|400)|1(?:[024-6]|9[0-579])|2[1-3]|3[01]|4[14]|5(?:[01][01]|2[0-24-79]|33|4[05]|5[59]|6(?:00|29|6[67]))|(?:6[035]\\d|[78])\\d|9(?:[02-9]\\d\\d|19))|(?:(?:2[0-79]|[37][0-29]|4[0-4]|6[2357]|8\\d)\\d|5(?:[0-7]\\d|99))\\d\\d|9(?:09\\d\\d|99)|8988', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1(?:(?:04|6[35])\\d\\d|3[01]|4[14]|5(?:1\\d|2[25]))|(?:(?:2[0-79]|[37][0-29]|4[0-4]|6[2357]|8\\d)\\d|5(?:[0-7]\\d|99)|909)\\d\\d|898\\d', - 'ExampleNumber' => '130', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '1(?:(?:04|6[035])\\d\\d|4[14]|5(?:01|55|6[26]\\d))|40404|8988|909\\d\\d', - 'ExampleNumber' => '141', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:[246]|9\\d)|5(?:01|2[127]|6[26]\\d))|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '909\\d\\d', + 'ExampleNumber' => '90900', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[24]|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0(?:[07-9]|1[0-25]|400)|1(?:[024-6]|9[0-579])|2[1-3]|3[01]|4[14]|5(?:[01][01]|2[0-24-79]|33|4[05]|5[59]|6(?:00|29|6[67]))|(?:6[035]\\d|[78])\\d|9(?:[02-9]\\d\\d|19))|(?:(?:2[0-79]|[37][0-29]|4[0-4]|6[2357]|8\\d)\\d|5(?:[0-7]\\d|99))\\d\\d|9(?:09\\d\\d|99)|8988', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1(?:(?:04|6[35])\\d\\d|3[01]|4[14]|5(?:1\\d|2[25]))|(?:(?:2[0-79]|[37][0-29]|4[0-4]|6[2357]|8\\d)\\d|5(?:[0-7]\\d|99)|909)\\d\\d|898\\d', + 'ExampleNumber' => '130', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '1(?:(?:04|6[035])\\d\\d|4[14]|5(?:01|55|6[26]\\d))|40404|8988|909\\d\\d', + 'ExampleNumber' => '141', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KG.php b/lib/libphonenumber/data/ShortNumberMetadata_KG.php index 9080f4cc..632c291f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KG.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '10[1-3]', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '10[1-3]', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '10[1-3]|4040', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d', - 'ExampleNumber' => '4040', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d', - 'ExampleNumber' => '4040', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '10[1-3]', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '10[1-3]', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '10[1-3]|4040', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d', + 'ExampleNumber' => '4040', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d', + 'ExampleNumber' => '4040', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KH.php b/lib/libphonenumber/data/ShortNumberMetadata_KH.php index 2a1cf253..4c9fae23 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KH.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KH.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[146]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[7-9]|666', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[7-9]|666', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[7-9]|40404|666', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KH', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[146]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[7-9]|666', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[7-9]|666', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[7-9]|40404|666', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KH', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KI.php b/lib/libphonenumber/data/ShortNumberMetadata_KI.php index 1861d77f..958db3ec 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KI.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[17]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '19[2-5]', - 'ExampleNumber' => '192', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '19[2-5]', - 'ExampleNumber' => '192', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:05[0-259]|88|9[2-5])|777|10[0-8]', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '103', - 'ExampleNumber' => '103', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[17]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '19[2-5]', + 'ExampleNumber' => '192', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '19[2-5]', + 'ExampleNumber' => '192', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:05[0-259]|88|9[2-5])|777|10[0-8]', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '103', + 'ExampleNumber' => '103', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KM.php b/lib/libphonenumber/data/ShortNumberMetadata_KM.php index 9ad7ac3e..5fe4b2eb 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KM.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KN.php b/lib/libphonenumber/data/ShortNumberMetadata_KN.php index 0718c4cf..cc7edd6c 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KN.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[39]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '333|9(?:11|99)', - 'ExampleNumber' => '333', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '333|9(?:11|99)', - 'ExampleNumber' => '333', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '333|9(?:11|99)', - 'ExampleNumber' => '333', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[39]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '333|9(?:11|99)', + 'ExampleNumber' => '333', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '333|9(?:11|99)', + 'ExampleNumber' => '333', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '333|9(?:11|99)', + 'ExampleNumber' => '333', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KP.php b/lib/libphonenumber/data/ShortNumberMetadata_KP.php index 9d7ce615..8dbe94a9 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KP.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KP.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[18]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[29]|819', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[29]|819', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[29]|819', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KP', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[18]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[29]|819', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[29]|819', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[29]|819', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KP', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KR.php b/lib/libphonenumber/data/ShortNumberMetadata_KR.php index 6e4ab6f7..4c308088 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KR.php @@ -10,111 +10,84 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[27-9]|28|330|82)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[29]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:[016-9]114|3(?:2|3[039]|45|66|88|9[18]))|1(?:0[01]|1[0247-9]|2[01389]|82)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1[016-9]1\\d\\d|1(?:0[01]|14)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[27-9]|28|330|82)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[29]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:[016-9]114|3(?:2|3[039]|45|66|88|9[18]))|1(?:0[01]|1[0247-9]|2[01389]|82)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1[016-9]1\\d\\d|1(?:0[01]|14)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KW.php b/lib/libphonenumber/data/ShortNumberMetadata_KW.php index 9832419a..fe53a01b 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KW.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[18]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[0-7]\\d|89887', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '898\\d\\d', - 'ExampleNumber' => '89800', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[18]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[0-7]\\d|89887', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '898\\d\\d', + 'ExampleNumber' => '89800', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KY.php b/lib/libphonenumber/data/ShortNumberMetadata_KY.php index 475e12ac..e57de56d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KY.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KY.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KY', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KY', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_KZ.php b/lib/libphonenumber/data/ShortNumberMetadata_KZ.php index 9ca9ee34..8a1517b0 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_KZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_KZ.php @@ -10,113 +10,86 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[134]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[1-4]|12)|(?:3040|404)0', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '(?:304\\d|404)\\d', - 'ExampleNumber' => '4040', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:304\\d|404)\\d', - 'ExampleNumber' => '4040', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'KZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[134]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[1-4]|12)|(?:3040|404)0', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '(?:304\\d|404)\\d', + 'ExampleNumber' => '4040', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:304\\d|404)\\d', + 'ExampleNumber' => '4040', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'KZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LA.php b/lib/libphonenumber/data/ShortNumberMetadata_LA.php index e1a90ad6..0c08fd5d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LA.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '19[015]', - 'ExampleNumber' => '190', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '19[015]', - 'ExampleNumber' => '190', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '19[015]', - 'ExampleNumber' => '190', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '19[015]', + 'ExampleNumber' => '190', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '19[015]', + 'ExampleNumber' => '190', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '19[015]', + 'ExampleNumber' => '190', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LB.php b/lib/libphonenumber/data/ShortNumberMetadata_LB.php index e8354c2d..67becca6 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LB.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LB.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|40|75)|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|40|75)|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|40|75)|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LB', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|40|75)|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|40|75)|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|40|75)|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LB', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LC.php b/lib/libphonenumber/data/ShortNumberMetadata_LC.php index e5a0da6c..8b8a2e88 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LC.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LC.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LC', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LC', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LI.php b/lib/libphonenumber/data/ShortNumberMetadata_LI.php index b4922de3..e2963a25 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LI.php @@ -10,106 +10,79 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[278]|44)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[278]|44)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[278]|45)|4[3-57]|50|75|81[18])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[278]|44)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[278]|44)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:[278]|45)|4[3-57]|50|75|81[18])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LK.php b/lib/libphonenumber/data/ShortNumberMetadata_LK.php index 0969c9b7..77242e46 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LK.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LK.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[02689]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[02689]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[024-9]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LK', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[02689]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[02689]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[024-9]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LK', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LR.php b/lib/libphonenumber/data/ShortNumberMetadata_LR.php index 38ad97ac..842a09ed 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LR.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[3489]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '355|911', - 'ExampleNumber' => '355', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '355|911', - 'ExampleNumber' => '355', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '355|4040|8(?:400|933)|911', - 'ExampleNumber' => '355', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '(?:404|8(?:40|93))\\d', - 'ExampleNumber' => '4040', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:404|8(?:40|93))\\d', - 'ExampleNumber' => '4040', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[3489]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '355|911', + 'ExampleNumber' => '355', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '355|911', + 'ExampleNumber' => '355', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '355|4040|8(?:400|933)|911', + 'ExampleNumber' => '355', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '(?:404|8(?:40|93))\\d', + 'ExampleNumber' => '4040', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:404|8(?:40|93))\\d', + 'ExampleNumber' => '4040', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LS.php b/lib/libphonenumber/data/ShortNumberMetadata_LS.php index 322453fc..29ae674a 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LS.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LS.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[257]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[257]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[257]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LS', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[257]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[257]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[257]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LS', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LT.php b/lib/libphonenumber/data/ShortNumberMetadata_LT.php index cd13d887..cd12ac18 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LT.php @@ -10,107 +10,80 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[01]\\d(?:\\d(?:\\d{3})?)?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0(?:11?|22?|33?)|1(?:0[1-3]|1(?:2|6\\d{3}))', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '0(?:11?|22?|33?)|1(?:0[1-3]|12)', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '0(?:11?|22?|33?)|1(?:0[1-3]|1(?:2|6(?:000|1(?:11|23))))', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[01]\\d(?:\\d(?:\\d{3})?)?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0(?:11?|22?|33?)|1(?:0[1-3]|1(?:2|6\\d{3}))', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '0(?:11?|22?|33?)|1(?:0[1-3]|12)', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '0(?:11?|22?|33?)|1(?:0[1-3]|1(?:2|6(?:000|1(?:11|23))))', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LU.php b/lib/libphonenumber/data/ShortNumberMetadata_LU.php index df7b5b96..d8da1b12 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LU.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LU.php @@ -10,109 +10,82 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:[23]|6\\d{3})', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[23]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11(?:[23]|6(?:000|111))|1(?:18|[25]\\d|3)\\d\\d', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LU', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:[23]|6\\d{3})', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[23]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11(?:[23]|6(?:000|111))|1(?:18|[25]\\d|3)\\d\\d', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LU', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LV.php b/lib/libphonenumber/data/ShortNumberMetadata_LV.php index c22b184a..014a4387 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LV.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LV.php @@ -10,119 +10,92 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[018]\\d{1,5}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - 3 => 5, - 4 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0[1-3]|11(?:[023]|6\\d{3})', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1180|821\\d\\d', - 'ExampleNumber' => '1180', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '0[1-3]|11[023]', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '0[1-4]|1(?:1(?:[02-4]|6(?:000|111)|8[0189])|(?:5|65)5|77)|821[57]4', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '1181', - 'ExampleNumber' => '1181', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '165\\d', - 'ExampleNumber' => '1650', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LV', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[018]\\d{1,5}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + 3 => 5, + 4 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0[1-3]|11(?:[023]|6\\d{3})', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1180|821\\d\\d', + 'ExampleNumber' => '1180', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '0[1-3]|11[023]', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '0[1-4]|1(?:1(?:[02-4]|6(?:000|111)|8[0189])|(?:5|65)5|77)|821[57]4', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '1181', + 'ExampleNumber' => '1181', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '165\\d', + 'ExampleNumber' => '1650', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LV', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_LY.php b/lib/libphonenumber/data/ShortNumberMetadata_LY.php index 96f8f683..dc4ba042 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_LY.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_LY.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '19[013]', - 'ExampleNumber' => '190', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '19[013]', - 'ExampleNumber' => '190', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '19[013]', - 'ExampleNumber' => '190', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'LY', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '19[013]', + 'ExampleNumber' => '190', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '19[013]', + 'ExampleNumber' => '190', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '19[013]', + 'ExampleNumber' => '190', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'LY', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MA.php b/lib/libphonenumber/data/ShortNumberMetadata_MA.php index 838eb769..9c1d8416 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MA.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:[59]|77)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:[59]|77)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:[59]|77)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:[59]|77)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:[59]|77)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:[59]|77)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MC.php b/lib/libphonenumber/data/ShortNumberMetadata_MC.php index c1b47288..ae6fa9d4 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MC.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MC.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|41|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MC', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|41|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MC', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MD.php b/lib/libphonenumber/data/ShortNumberMetadata_MD.php index 2e7686e5..78ef69c0 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MD.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MD.php @@ -10,109 +10,82 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:2|6\\d{3})|90[1-3]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|90[1-3]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6(?:000|1(?:11|23))|8\\d\\d?|99)|90[04-9])|90[1-3]|1(?:4\\d\\d|6[0-389]|9[1-4])\\d', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MD', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:2|6\\d{3})|90[1-3]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|90[1-3]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6(?:000|1(?:11|23))|8\\d\\d?|99)|90[04-9])|90[1-3]|1(?:4\\d\\d|6[0-389]|9[1-4])\\d', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MD', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ME.php b/lib/libphonenumber/data/ShortNumberMetadata_ME.php index fcfa7d68..c202b426 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ME.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ME.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|2[2-4])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|2[2-4])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:(?:[013-57-9]|6\\d\\d)\\d|2)|[249]\\d{3}|5999|8(?:0[089]|1[0-8]|888))|1(?:[02-5]\\d\\d|60[06]|700)|12\\d', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ME', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|2[2-4])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|2[2-4])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:(?:[013-57-9]|6\\d\\d)\\d|2)|[249]\\d{3}|5999|8(?:0[089]|1[0-8]|888))|1(?:[02-5]\\d\\d|60[06]|700)|12\\d', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ME', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MF.php b/lib/libphonenumber/data/ShortNumberMetadata_MF.php index 0c165ddd..837ca056 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MF.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MF.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MF', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MF', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MG.php b/lib/libphonenumber/data/ShortNumberMetadata_MG.php index 49f0a8b6..760719ea 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MG.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[78]|[78])', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[78]|[78])', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[78]|[78])', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[78]|[78])', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[78]|[78])', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[78]|[78])', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MH.php b/lib/libphonenumber/data/ShortNumberMetadata_MH.php index 0fda4177..01005464 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MH.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MH.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MH', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MH', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MK.php b/lib/libphonenumber/data/ShortNumberMetadata_MK.php index ff1566a5..4b031dd7 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MK.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MK.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|9[2-4])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|9[2-4])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|9[2-4])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MK', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|9[2-4])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|9[2-4])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|9[2-4])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MK', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ML.php b/lib/libphonenumber/data/ShortNumberMetadata_ML.php index d85b519d..23882d6f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ML.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ML.php @@ -10,121 +10,94 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[136-8]\\d{1,4}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - 3 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[578]|(?:352|67)00|7402|(?:677|744|8000)\\d', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:12|800)2\\d|3(?:52(?:11|2[02]|3[04-6]|99)|7574)', - 'ExampleNumber' => '1220', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[013-9]\\d|2)|2(?:1[02-469]|2[13])|[578])|350(?:35|57)|67(?:0[09]|[59]9|77|8[89])|74(?:0[02]|44|55)|800[0-2][12]|3(?:52|[67]\\d)\\d\\d', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '37(?:433|575)|7400|8001\\d', - 'ExampleNumber' => '7400', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '3503\\d|(?:3[67]\\d|800)\\d\\d', - 'ExampleNumber' => '35030', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '374(?:0[24-9]|[1-9]\\d)|7400|3(?:6\\d|75)\\d\\d', - 'ExampleNumber' => '7400', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ML', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[136-8]\\d{1,4}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + 3 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[578]|(?:352|67)00|7402|(?:677|744|8000)\\d', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + 0 => 2, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:12|800)2\\d|3(?:52(?:11|2[02]|3[04-6]|99)|7574)', + 'ExampleNumber' => '1220', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:[013-9]\\d|2)|2(?:1[02-469]|2[13])|[578])|350(?:35|57)|67(?:0[09]|[59]9|77|8[89])|74(?:0[02]|44|55)|800[0-2][12]|3(?:52|[67]\\d)\\d\\d', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '37(?:433|575)|7400|8001\\d', + 'ExampleNumber' => '7400', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '3503\\d|(?:3[67]\\d|800)\\d\\d', + 'ExampleNumber' => '35030', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '374(?:0[24-9]|[1-9]\\d)|7400|3(?:6\\d|75)\\d\\d', + 'ExampleNumber' => '7400', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ML', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MM.php b/lib/libphonenumber/data/ShortNumberMetadata_MM.php index 790b008a..de4761c7 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MM.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '199', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '199', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '199', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '199', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '199', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '199', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MN.php b/lib/libphonenumber/data/ShortNumberMetadata_MN.php index 03836613..b3f3f6a7 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MN.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '10[0-3]', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '10[0-3]', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '10[0-3]', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '10[0-3]', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '10[0-3]', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '10[0-3]', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MO.php b/lib/libphonenumber/data/ShortNumberMetadata_MO.php index 37674922..11ff9d30 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MO.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MP.php b/lib/libphonenumber/data/ShortNumberMetadata_MP.php index 481023ed..d8a47c4d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MP.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MP.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MP', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MP', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MQ.php b/lib/libphonenumber/data/ShortNumberMetadata_MQ.php index 4d9e00f5..2d604ef9 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MQ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MQ.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MQ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MQ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MR.php b/lib/libphonenumber/data/ShortNumberMetadata_MR.php index 818848b2..f02c9db2 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MR.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MS.php b/lib/libphonenumber/data/ShortNumberMetadata_MS.php index ccc9f0cc..46a6759c 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MS.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MS.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MS', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MS', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MT.php b/lib/libphonenumber/data/ShortNumberMetadata_MT.php index 8e202311..dc8b7e83 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MT.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:2|6\\d{3})', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11(?:2|6(?:000|1(?:11|23)))', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:2|6\\d{3})', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11(?:2|6(?:000|1(?:11|23)))', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MU.php b/lib/libphonenumber/data/ShortNumberMetadata_MU.php index 25820901..f7b77d82 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MU.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MU.php @@ -10,107 +10,80 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[189]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[45]|99[59]', - 'ExampleNumber' => '114', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[45]|99[59]', - 'ExampleNumber' => '114', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1\\d{2,4}|(?:8\\d\\d|99)\\d', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MU', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[189]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[45]|99[59]', + 'ExampleNumber' => '114', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[45]|99[59]', + 'ExampleNumber' => '114', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1\\d{2,4}|(?:8\\d\\d|99)\\d', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MU', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MV.php b/lib/libphonenumber/data/ShortNumberMetadata_MV.php index 1310ae66..9454d3ca 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MV.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MV.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:02|1[89])', - 'ExampleNumber' => '102', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:02|1[89])', - 'ExampleNumber' => '102', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:[0-37-9]|[4-6]\\d)\\d|4040|1[45]1', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1[45]1', - 'ExampleNumber' => '141', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MV', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:02|1[89])', + 'ExampleNumber' => '102', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:02|1[89])', + 'ExampleNumber' => '102', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:[0-37-9]|[4-6]\\d)\\d|4040|1[45]1', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1[45]1', + 'ExampleNumber' => '141', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MV', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MW.php b/lib/libphonenumber/data/ShortNumberMetadata_MW.php index f33bb833..37dcac6a 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MW.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[189]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '199|99[7-9]', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '199|99[7-9]', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '199|80400|99[7-9]', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '804\\d\\d', - 'ExampleNumber' => '80400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '804\\d\\d', - 'ExampleNumber' => '80400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[189]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '199|99[7-9]', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '199|99[7-9]', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '199|80400|99[7-9]', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '804\\d\\d', + 'ExampleNumber' => '80400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '804\\d\\d', + 'ExampleNumber' => '80400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MX.php b/lib/libphonenumber/data/ShortNumberMetadata_MX.php index 500870d8..0130ae99 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MX.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MX.php @@ -10,112 +10,85 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[0579]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0(?:6[0568]|80)|911', - 'ExampleNumber' => '060', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:530\\d|776)\\d', - 'ExampleNumber' => '7760', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '0(?:6[0568]|80)|911', - 'ExampleNumber' => '060', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '0[1-9]\\d|53053|7766|911', - 'ExampleNumber' => '010', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '0(?:[249]0|[35][01])', - 'ExampleNumber' => '020', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MX', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[0579]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0(?:6[0568]|80)|911', + 'ExampleNumber' => '060', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:530\\d|776)\\d', + 'ExampleNumber' => '7760', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '0(?:6[0568]|80)|911', + 'ExampleNumber' => '060', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '0[1-9]\\d|53053|7766|911', + 'ExampleNumber' => '010', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '0(?:[249]0|[35][01])', + 'ExampleNumber' => '020', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MX', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MY.php b/lib/libphonenumber/data/ShortNumberMetadata_MY.php index ffcfb797..13a0c128 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MY.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MY.php @@ -10,111 +10,84 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1369]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|999', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[01348]|1(?:[02]|1[128]|311)|2(?:0[125]|[13-6]|2\\d{0,2})|(?:3[1-35-79]|7[45])\\d\\d?|5(?:454|5\\d\\d?|77|888|999?)|8(?:18?|2|8[18])|9(?:[124]\\d?|68|71|9[0679]))|66628|99[1-469]|13[5-7]|(?:1(?:0[569]|309|5[12]|7[136-9]|9[03])|3[23679]\\d\\d)\\d', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '666\\d\\d', - 'ExampleNumber' => '66600', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:3[23679]\\d|666)\\d\\d', - 'ExampleNumber' => '32000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MY', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1369]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|999', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[01348]|1(?:[02]|1[128]|311)|2(?:0[125]|[13-6]|2\\d{0,2})|(?:3[1-35-79]|7[45])\\d\\d?|5(?:454|5\\d\\d?|77|888|999?)|8(?:18?|2|8[18])|9(?:[124]\\d?|68|71|9[0679]))|66628|99[1-469]|13[5-7]|(?:1(?:0[569]|309|5[12]|7[136-9]|9[03])|3[23679]\\d\\d)\\d', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '666\\d\\d', + 'ExampleNumber' => '66600', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:3[23679]\\d|666)\\d\\d', + 'ExampleNumber' => '32000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MY', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_MZ.php b/lib/libphonenumber/data/ShortNumberMetadata_MZ.php index 6c566ca9..79161327 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_MZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_MZ.php @@ -10,106 +10,79 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[79]|9[78])', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[79]|9[78])', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:[02-5]\\d\\d|1[79]|9[78])', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'MZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[79]|9[78])', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[79]|9[78])', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:[02-5]\\d\\d|1[79]|9[78])', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'MZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NA.php b/lib/libphonenumber/data/ShortNumberMetadata_NA.php index 24955d1b..e78da4d5 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NA.php @@ -10,107 +10,80 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '10111', - 'ExampleNumber' => '10111', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '10111', - 'ExampleNumber' => '10111', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '(?:10|93)111|(?:1\\d|9)\\d\\d', - 'ExampleNumber' => '900', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '10111', + 'ExampleNumber' => '10111', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '10111', + 'ExampleNumber' => '10111', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '(?:10|93)111|(?:1\\d|9)\\d\\d', + 'ExampleNumber' => '900', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NC.php b/lib/libphonenumber/data/ShortNumberMetadata_NC.php index 7e63c168..01b6cf12 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NC.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NC.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[135]\\d{1,3}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0(?:00|1[23]|3[0-2]|8\\d)|[5-8])|363\\d|577', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[5-8]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0(?:0[06]|1[02-46]|20|3[0-25]|42|5[058]|77|88)|[5-8])|3631|5[6-8]\\d', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '5(?:67|88)', - 'ExampleNumber' => '567', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NC', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[135]\\d{1,3}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0(?:00|1[23]|3[0-2]|8\\d)|[5-8])|363\\d|577', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[5-8]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0(?:0[06]|1[02-46]|20|3[0-25]|42|5[058]|77|88)|[5-8])|3631|5[6-8]\\d', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '5(?:67|88)', + 'ExampleNumber' => '567', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NC', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NE.php b/lib/libphonenumber/data/ShortNumberMetadata_NE.php index 49595592..09d58a8c 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NE.php @@ -10,111 +10,84 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-3578]\\d(?:\\d(?:\\d{3})?)?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[578]|723\\d{3}', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[578]|723141', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[01]|1[12]|2[034]|3[013]|[46]0|55?|[78])|222|333|555|723141|888', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1(?:0[01]|1[12]|2[034]|3[013]|[46]0|55)|222|333|555|888', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-3578]\\d(?:\\d(?:\\d{3})?)?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[578]|723\\d{3}', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + 0 => 2, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[578]|723141', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + 0 => 2, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[01]|1[12]|2[034]|3[013]|[46]0|55?|[78])|222|333|555|723141|888', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1(?:0[01]|1[12]|2[034]|3[013]|[46]0|55)|222|333|555|888', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NF.php b/lib/libphonenumber/data/ShortNumberMetadata_NF.php index 98c9e017..e43a0cfb 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NF.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NF.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|55|77)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|55|77)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9(?:11|55|77)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NF', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|55|77)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|55|77)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9(?:11|55|77)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NF', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NG.php b/lib/libphonenumber/data/ShortNumberMetadata_NG.php index fb5433b1..083e19a3 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NG.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '199', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '199', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '199|40700', - 'ExampleNumber' => '199', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '407\\d\\d', - 'ExampleNumber' => '40700', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '407\\d\\d', - 'ExampleNumber' => '40700', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[14]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '199', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '199', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '199|40700', + 'ExampleNumber' => '199', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '407\\d\\d', + 'ExampleNumber' => '40700', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '407\\d\\d', + 'ExampleNumber' => '40700', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NI.php b/lib/libphonenumber/data/ShortNumberMetadata_NI.php index 94c98dfb..e1aa7b01 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NI.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[12467]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[58]|2[08])|737\\d', - 'ExampleNumber' => '115', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[58]|2[08])', - 'ExampleNumber' => '115', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[58]|200)|4878|7(?:010|373)|12[0158]|(?:19|[267]1)00', - 'ExampleNumber' => '115', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[12467]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[58]|2[08])|737\\d', + 'ExampleNumber' => '115', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[58]|2[08])', + 'ExampleNumber' => '115', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[58]|200)|4878|7(?:010|373)|12[0158]|(?:19|[267]1)00', + 'ExampleNumber' => '115', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NL.php b/lib/libphonenumber/data/ShortNumberMetadata_NL.php index 3813817f..46144a46 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NL.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NL.php @@ -10,112 +10,85 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1349]\\d\\d(?:\\d(?:\\d{2})?)?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:2|6\\d{3})|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6(?:00[06]|1(?:11|23)))|2(?:0[0-4]|3[34]|44)|3[03-9]\\d|400|8(?:[02-9]\\d|1[0-79]))|[34]000|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '120\\d', - 'ExampleNumber' => '1200', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '[34]00\\d', - 'ExampleNumber' => '3000', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NL', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1349]\\d\\d(?:\\d(?:\\d{2})?)?', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:2|6\\d{3})|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6(?:00[06]|1(?:11|23)))|2(?:0[0-4]|3[34]|44)|3[03-9]\\d|400|8(?:[02-9]\\d|1[0-79]))|[34]000|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '120\\d', + 'ExampleNumber' => '1200', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '[34]00\\d', + 'ExampleNumber' => '3000', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NL', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NO.php b/lib/libphonenumber/data/ShortNumberMetadata_NO.php index 7eff4abc..c76fe61f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NO.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d(?:\\d{2})?)?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:[023]|6\\d{3})', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[023]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[0239]|61(?:1[17]|23))|2[048]|4(?:12|[59])|7[57]|90)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d(?:\\d{2})?)?', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:[023]|6\\d{3})', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[023]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:[0239]|61(?:1[17]|23))|2[048]|4(?:12|[59])|7[57]|90)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NP.php b/lib/libphonenumber/data/ShortNumberMetadata_NP.php index d2c205d0..ef90a260 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NP.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NP.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[0-3]|12)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[0-3]|12)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[0-3]|12)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NP', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[0-3]|12)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[0-3]|12)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[0-3]|12)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NP', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NR.php b/lib/libphonenumber/data/ShortNumberMetadata_NR.php index e5acd004..c6a613a6 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NR.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[0-2]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[0-2]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[0-2]|23|92)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[0-2]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[0-2]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[0-2]|23|92)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NU.php b/lib/libphonenumber/data/ShortNumberMetadata_NU.php index 36239373..b82ceea9 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NU.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NU.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[019]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '01[05]|101|999', - 'ExampleNumber' => '010', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '010', - 'ExampleNumber' => '010', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NU', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[019]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '01[05]|101|999', + 'ExampleNumber' => '010', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '010', + 'ExampleNumber' => '010', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NU', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_NZ.php b/lib/libphonenumber/data/ShortNumberMetadata_NZ.php index b5f47142..ebd79638 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_NZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_NZ.php @@ -10,109 +10,82 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '\\d{3,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '111', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '018', - 'ExampleNumber' => '018', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '111', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '018|1(?:(?:1|37)1|(?:23|94)4|7[03]7)|[2-57-9]\\d{2,3}|6(?:161|26[0-3]|742)', - 'ExampleNumber' => '018', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '018|(?:1(?:23|37|7[03]|94)|6(?:[12]6|74))\\d|[2-57-9]\\d{2,3}', - 'ExampleNumber' => '018', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'NZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '\\d{3,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '111', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '018', + 'ExampleNumber' => '018', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '111', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '018|1(?:(?:1|37)1|(?:23|94)4|7[03]7)|[2-57-9]\\d{2,3}|6(?:161|26[0-3]|742)', + 'ExampleNumber' => '018', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '018|(?:1(?:23|37|7[03]|94)|6(?:[12]6|74))\\d|[2-57-9]\\d{2,3}', + 'ExampleNumber' => '018', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'NZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_OM.php b/lib/libphonenumber/data/ShortNumberMetadata_OM.php index 627b1dbb..d08e7e6a 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_OM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_OM.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d{3}', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999\\d', - 'ExampleNumber' => '9990', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9999', - 'ExampleNumber' => '9999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9999', - 'ExampleNumber' => '9999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'OM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d{3}', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999\\d', + 'ExampleNumber' => '9990', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9999', + 'ExampleNumber' => '9999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9999', + 'ExampleNumber' => '9999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'OM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PA.php b/lib/libphonenumber/data/ShortNumberMetadata_PA.php index 0543502f..2983d635 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PA.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '10[2-4]|911', - 'ExampleNumber' => '102', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '10[2-4]|911', + 'ExampleNumber' => '102', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PE.php b/lib/libphonenumber/data/ShortNumberMetadata_PE.php index a57a8e62..a57a5197 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PE.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:05|1[67])', - 'ExampleNumber' => '105', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:05|1[67])', - 'ExampleNumber' => '105', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:05|1[67])', - 'ExampleNumber' => '105', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:05|1[67])', + 'ExampleNumber' => '105', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:05|1[67])', + 'ExampleNumber' => '105', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:05|1[67])', + 'ExampleNumber' => '105', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PF.php b/lib/libphonenumber/data/ShortNumberMetadata_PF.php index dc9c808e..888b44e9 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PF.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PF.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PF', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PF', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PG.php b/lib/libphonenumber/data/ShortNumberMetadata_PG.php index ddb22f61..9386b700 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PG.php @@ -10,114 +10,87 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[01]\\d{2,6}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - 4 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '000|11[01]', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '000|11[01]', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '000|1(?:1[01]|5\\d\\d|6\\d{2,5})', - 'ExampleNumber' => '000', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '16\\d{2,5}', - 'ExampleNumber' => '1600', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - 2 => 6, - 3 => 7, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[01]\\d{2,6}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + 4 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '000|11[01]', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '000|11[01]', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '000|1(?:1[01]|5\\d\\d|6\\d{2,5})', + 'ExampleNumber' => '000', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '16\\d{2,5}', + 'ExampleNumber' => '1600', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + 2 => 6, + 3 => 7, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PH.php b/lib/libphonenumber/data/ShortNumberMetadata_PH.php index 326486d8..bc8d7a53 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PH.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PH.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[27]|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[27]|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[27]|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PH', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[27]|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[27]|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[27]|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PH', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PK.php b/lib/libphonenumber/data/ShortNumberMetadata_PK.php index 9f954cd3..3d00ecbd 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PK.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PK.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{1,3}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2\\d?|5)|[56])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1(?:22?|5)|[56])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:22?|5)|[56])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PK', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{1,3}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:2\\d?|5)|[56])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1(?:22?|5)|[56])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:22?|5)|[56])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PK', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PL.php b/lib/libphonenumber/data/ShortNumberMetadata_PL.php index 2072c234..83c31600 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PL.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PL.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d(?:\\d{2,3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:2|6\\d{3})|99[7-9]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|99[7-9]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|61(?:11|23)|891[23])|9\\d{3})|9(?:8[4-7]|9[1-9])|11[68]000', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PL', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d(?:\\d{2,3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:2|6\\d{3})|99[7-9]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|99[7-9]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:2|61(?:11|23)|891[23])|9\\d{3})|9(?:8[4-7]|9[1-9])|11[68]000', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PL', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PM.php b/lib/libphonenumber/data/ShortNumberMetadata_PM.php index 02d3ab62..5a952669 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PM.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[13]\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[578]|3103', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '310\\d', - 'ExampleNumber' => '3100', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[13]\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 2, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[578]|3103', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '310\\d', + 'ExampleNumber' => '3100', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PR.php b/lib/libphonenumber/data/ShortNumberMetadata_PR.php index 1a1ba41f..139c2ada 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PR.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PS.php b/lib/libphonenumber/data/ShortNumberMetadata_PS.php index 5d4af53b..23a0f502 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PS.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PS.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[0-2]|66)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '10[0-2]', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[0-2]|44|66|99)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PS', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[0-2]|66)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '10[0-2]', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[0-2]|44|66|99)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PS', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PT.php b/lib/libphonenumber/data/ShortNumberMetadata_PT.php index 9fb5714c..84f0aa27 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PT.php @@ -10,105 +10,78 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:[25]|6\\d{3})', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[25]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11(?:[2578]|6(?:000|111))', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d(?:\\d{3})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:[25]|6\\d{3})', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[25]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11(?:[2578]|6(?:000|111))', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PW.php b/lib/libphonenumber/data/ShortNumberMetadata_PW.php index 4ebbeeeb..97e8ec60 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PW.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_PY.php b/lib/libphonenumber/data/ShortNumberMetadata_PY.php index 752bacbc..78673744 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_PY.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_PY.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '128|911', - 'ExampleNumber' => '128', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '128|911', - 'ExampleNumber' => '128', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[1-4]\\d|911', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'PY', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '128|911', + 'ExampleNumber' => '128', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '128|911', + 'ExampleNumber' => '128', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[1-4]\\d|911', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'PY', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_QA.php b/lib/libphonenumber/data/ShortNumberMetadata_QA.php index f4da5052..976b75dd 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_QA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_QA.php @@ -10,107 +10,80 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[129]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '999|(?:1|20|9[27]\\d)\\d\\d', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'QA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[129]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '999|(?:1|20|9[27]\\d)\\d\\d', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'QA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_RE.php b/lib/libphonenumber/data/ShortNumberMetadata_RE.php index 2a061cc0..a02067d5 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_RE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_RE.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|[578])', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|[578])', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_RO.php b/lib/libphonenumber/data/ShortNumberMetadata_RO.php index 76e0e086..efda3d61 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_RO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_RO.php @@ -10,113 +10,86 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[18]\\d\\d(?:\\d(?:\\d{2})?)?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:2|6\\d{3})', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '(?:1(?:18\\d|[24])|8[48])\\d\\d', - 'ExampleNumber' => '1200', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6111|8932)|[24]\\d\\d|9(?:21|3[02]|5[178]))|8[48]\\d\\d|11(?:60|83)00', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '(?:1[24]|8[48])\\d\\d', - 'ExampleNumber' => '1200', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[18]\\d\\d(?:\\d(?:\\d{2})?)?', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:2|6\\d{3})', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '(?:1(?:18\\d|[24])|8[48])\\d\\d', + 'ExampleNumber' => '1200', + 'PossibleLength' => [ + 0 => 4, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6111|8932)|[24]\\d\\d|9(?:21|3[02]|5[178]))|8[48]\\d\\d|11(?:60|83)00', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '(?:1[24]|8[48])\\d\\d', + 'ExampleNumber' => '1200', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_RS.php b/lib/libphonenumber/data/ShortNumberMetadata_RS.php index 5c233ccd..202b7f2a 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_RS.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_RS.php @@ -10,111 +10,84 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{1,5}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - 3 => 5, - 4 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|9[2-4]', - 'ExampleNumber' => '92', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|9[2-4]', - 'ExampleNumber' => '92', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[189]\\d{1,4}|9[2-4]', - 'ExampleNumber' => '92', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RS', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{1,5}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + 3 => 5, + 4 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|9[2-4]', + 'ExampleNumber' => '92', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|9[2-4]', + 'ExampleNumber' => '92', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[189]\\d{1,4}|9[2-4]', + 'ExampleNumber' => '92', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RS', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_RU.php b/lib/libphonenumber/data/ShortNumberMetadata_RU.php index 55a4d5cd..4ad471cf 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_RU.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_RU.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[01]\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|(?:0|10)[1-3]', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|(?:0|10)[1-3]', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112|(?:0|10)[1-4]', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RU', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[01]\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|(?:0|10)[1-3]', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|(?:0|10)[1-3]', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112|(?:0|10)[1-4]', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RU', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_RW.php b/lib/libphonenumber/data/ShortNumberMetadata_RW.php index b030a7d4..f7d88e6f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_RW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_RW.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'RW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'RW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SA.php b/lib/libphonenumber/data/ShortNumberMetadata_SA.php index 485783dc..b878241f 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SA.php @@ -10,114 +10,87 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:2|6\\d{3})|9(?:11|37|9[7-9])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|9(?:11|9[79])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:00|2|6111)|410|9(?:00|1[89]|9(?:099|22|91)))|9(?:0[24-79]|11|3[379]|40|66|8[5-9]|9[02-9])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '141\\d', - 'ExampleNumber' => '1410', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1(?:10|41)\\d|90[24679]', - 'ExampleNumber' => '902', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:2|6\\d{3})|9(?:11|37|9[7-9])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|9(?:11|9[79])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:00|2|6111)|410|9(?:00|1[89]|9(?:099|22|91)))|9(?:0[24-79]|11|3[379]|40|66|8[5-9]|9[02-9])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '141\\d', + 'ExampleNumber' => '1410', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1(?:10|41)\\d|90[24679]', + 'ExampleNumber' => '902', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SB.php b/lib/libphonenumber/data/ShortNumberMetadata_SB.php index 26e6c478..7a852207 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SB.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SB.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[127-9]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:[02]\\d|1[12]|[35][01]|[49][1-9]|6[2-9]|7[7-9]|8[0-8])|269|777|835|9(?:[01]1|22|33|55|77|88|99)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SB', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[127-9]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:[02]\\d|1[12]|[35][01]|[49][1-9]|6[2-9]|7[7-9]|8[0-8])|269|777|835|9(?:[01]1|22|33|55|77|88|99)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SB', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SC.php b/lib/libphonenumber/data/ShortNumberMetadata_SC.php index c9e922b9..61023b5d 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SC.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SC.php @@ -10,106 +10,79 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0\\d|1[027]|2[0-8]|3[13]|4[0-2]|[59][15]|6[1-9]|7[124-6]|8[158])|9(?:6\\d\\d|99)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SC', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0\\d|1[027]|2[0-8]|3[13]|4[0-2]|[59][15]|6[1-9]|7[124-6]|8[158])|9(?:6\\d\\d|99)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SC', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SD.php b/lib/libphonenumber/data/ShortNumberMetadata_SD.php index 23030627..175589b6 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SD.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SD.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SD', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SD', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SE.php b/lib/libphonenumber/data/ShortNumberMetadata_SE.php index 298679f6..62e6ed20 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SE.php @@ -10,118 +10,91 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-37-9]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|(?:116\\d|900)\\d\\d', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - 2 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '11811[89]|72\\d{3}', - 'ExampleNumber' => '72000', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|90000', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11(?:[25]|313|6(?:00[06]|1(?:1[17]|23))|7[0-8])|2(?:2[02358]|33|4[01]|50|6[1-4])|32[13]|8(?:22|88)|9(?:0(?:00|51)0|12)|(?:11(?:4|8[02-46-9])|7\\d\\d|90[2-4])\\d\\d|(?:118|90)1(?:[02-9]\\d|1[013-9])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '2(?:2[02358]|33|4[01]|50|6[1-4])|32[13]|8(?:22|88)|912', - 'ExampleNumber' => '220', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '7\\d{4}', - 'ExampleNumber' => '70000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-37-9]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|(?:116\\d|900)\\d\\d', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + 2 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '11811[89]|72\\d{3}', + 'ExampleNumber' => '72000', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|90000', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11(?:[25]|313|6(?:00[06]|1(?:1[17]|23))|7[0-8])|2(?:2[02358]|33|4[01]|50|6[1-4])|32[13]|8(?:22|88)|9(?:0(?:00|51)0|12)|(?:11(?:4|8[02-46-9])|7\\d\\d|90[2-4])\\d\\d|(?:118|90)1(?:[02-9]\\d|1[013-9])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '2(?:2[02358]|33|4[01]|50|6[1-4])|32[13]|8(?:22|88)|912', + 'ExampleNumber' => '220', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '7\\d{4}', + 'ExampleNumber' => '70000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SG.php b/lib/libphonenumber/data/ShortNumberMetadata_SG.php index 46623880..c29bc745 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SG.php @@ -10,109 +10,82 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[179]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '99[359]', - 'ExampleNumber' => '993', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '99[359]', - 'ExampleNumber' => '993', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:[0136]\\d\\d|[57]\\d{2,3}|[89](?:0[1-9]|[1-9]\\d))|77222|99[02-9]', - 'ExampleNumber' => '990', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '772\\d\\d', - 'ExampleNumber' => '77200', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[179]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '99[359]', + 'ExampleNumber' => '993', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '99[359]', + 'ExampleNumber' => '993', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:[0136]\\d\\d|[57]\\d{2,3}|[89](?:0[1-9]|[1-9]\\d))|77222|99[02-9]', + 'ExampleNumber' => '990', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '772\\d\\d', + 'ExampleNumber' => '77200', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SH.php b/lib/libphonenumber/data/ShortNumberMetadata_SH.php index 72fad227..3710b299 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SH.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SH.php @@ -10,106 +10,79 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}|9(?:11|99)', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SH', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1\\d{2,3}|9(?:11|99)', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SH', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SI.php b/lib/libphonenumber/data/ShortNumberMetadata_SI.php index c08bcfc6..5434baa2 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SI.php @@ -10,107 +10,80 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11(?:(?:0|6\\d)\\d\\d|[23]|8\\d\\d?)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[23]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:00[146]|[23]|6(?:000|1(?:11|23))|8(?:[08]|99))|9(?:059|1(?:0[12]|16)|5|70|87|9(?:00|[149])))|19(?:08|81)[09]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11(?:(?:0|6\\d)\\d\\d|[23]|8\\d\\d?)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[23]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:00[146]|[23]|6(?:000|1(?:11|23))|8(?:[08]|99))|9(?:059|1(?:0[12]|16)|5|70|87|9(?:00|[149])))|19(?:08|81)[09]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SJ.php b/lib/libphonenumber/data/ShortNumberMetadata_SJ.php index ad76b6a9..98a8f047 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SJ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SJ.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[023]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[023]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[023]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SJ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[023]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[023]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[023]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SJ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SK.php b/lib/libphonenumber/data/ShortNumberMetadata_SK.php index af4ba142..fe0b7f41 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SK.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SK.php @@ -10,109 +10,82 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6\\d{3})|5[058])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|5[058])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:2|6(?:000|111)|8[0-8])|[248]\\d{3}|5[0589])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SK', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6\\d{3})|5[058])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|5[058])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:2|6(?:000|111)|8[0-8])|[248]\\d{3}|5[0589])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SK', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SL.php b/lib/libphonenumber/data/ShortNumberMetadata_SL.php index e9712f7a..2e5fad20 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SL.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SL.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[069]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '(?:01|99)9', - 'ExampleNumber' => '019', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '(?:01|99)9', - 'ExampleNumber' => '019', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '(?:01|99)9|60400', - 'ExampleNumber' => '019', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '604\\d\\d', - 'ExampleNumber' => '60400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '604\\d\\d', - 'ExampleNumber' => '60400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SL', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[069]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '(?:01|99)9', + 'ExampleNumber' => '019', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '(?:01|99)9', + 'ExampleNumber' => '019', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '(?:01|99)9|60400', + 'ExampleNumber' => '019', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '604\\d\\d', + 'ExampleNumber' => '60400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '604\\d\\d', + 'ExampleNumber' => '60400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SL', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SM.php b/lib/libphonenumber/data/ShortNumberMetadata_SM.php index b3b51289..86b51a29 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SM.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[358]', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[358]', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[358]', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[358]', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[358]', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[358]', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SN.php b/lib/libphonenumber/data/ShortNumberMetadata_SN.php index 3d7a524a..4817a47c 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SN.php @@ -10,122 +10,95 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[12]\\d{1,5}', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 4, - 3 => 5, - 4 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:515|[78])|2(?:00|1)\\d{3}', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '2(?:0[246]|[468])\\d{3}', - 'ExampleNumber' => '24000', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[69]|(?:[246]\\d|51)\\d)|2(?:0[0-246]|[12468])\\d{3}|1[278]', - 'ExampleNumber' => '12', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '2(?:01|2)\\d{3}', - 'ExampleNumber' => '22000', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '1[46]\\d\\d', - 'ExampleNumber' => '1400', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '2[468]\\d{3}', - 'ExampleNumber' => '24000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[12]\\d{1,5}', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 4, + 3 => 5, + 4 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:515|[78])|2(?:00|1)\\d{3}', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + 0 => 2, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '2(?:0[246]|[468])\\d{3}', + 'ExampleNumber' => '24000', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[69]|(?:[246]\\d|51)\\d)|2(?:0[0-246]|[12468])\\d{3}|1[278]', + 'ExampleNumber' => '12', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '2(?:01|2)\\d{3}', + 'ExampleNumber' => '22000', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '1[46]\\d\\d', + 'ExampleNumber' => '1400', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '2[468]\\d{3}', + 'ExampleNumber' => '24000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SO.php b/lib/libphonenumber/data/ShortNumberMetadata_SO.php index 82103247..3a8e7d43 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SO.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[57-9]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '555|888|999', - 'ExampleNumber' => '555', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '555|888|999', - 'ExampleNumber' => '555', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '555|777|888|999', - 'ExampleNumber' => '555', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[57-9]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '555|888|999', + 'ExampleNumber' => '555', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '555|888|999', + 'ExampleNumber' => '555', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '555|777|888|999', + 'ExampleNumber' => '555', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SR.php b/lib/libphonenumber/data/ShortNumberMetadata_SR.php index d3376cda..81f0d8c7 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SR.php @@ -10,106 +10,79 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '115', - 'ExampleNumber' => '115', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '115', - 'ExampleNumber' => '115', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '115', + 'ExampleNumber' => '115', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '115', + 'ExampleNumber' => '115', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1\\d{2,3}', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ST.php b/lib/libphonenumber/data/ShortNumberMetadata_ST.php index 4a8abbf1..80efba77 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ST.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ST.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ST', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ST', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SV.php b/lib/libphonenumber/data/ShortNumberMetadata_SV.php index 847c5f7c..b99f51af 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SV.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SV.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[49]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '40404|911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '404\\d\\d', - 'ExampleNumber' => '40400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SV', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[49]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '40404|911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '404\\d\\d', + 'ExampleNumber' => '40400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SV', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SX.php b/lib/libphonenumber/data/ShortNumberMetadata_SX.php index f46aff13..15c49288 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SX.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SX.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '919', - 'ExampleNumber' => '919', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '919', - 'ExampleNumber' => '919', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '919', - 'ExampleNumber' => '919', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SX', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '919', + 'ExampleNumber' => '919', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '919', + 'ExampleNumber' => '919', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '919', + 'ExampleNumber' => '919', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SX', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SY.php b/lib/libphonenumber/data/ShortNumberMetadata_SY.php index db38cc3c..5bdae53e 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SY.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SY.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[023]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[023]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[023]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SY', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[023]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[023]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[023]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SY', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_SZ.php b/lib/libphonenumber/data/ShortNumberMetadata_SZ.php index 1fb29320..21f0c1cd 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_SZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_SZ.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'SZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'SZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TC.php b/lib/libphonenumber/data/ShortNumberMetadata_TC.php index 7dfdac0f..b1ca198c 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TC.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TC.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TC', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TC', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TD.php b/lib/libphonenumber/data/ShortNumberMetadata_TD.php index 1f768880..9594661e 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TD.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TD.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[78]', - 'ExampleNumber' => '17', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TD', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[78]', + 'ExampleNumber' => '17', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TD', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TG.php b/lib/libphonenumber/data/ShortNumberMetadata_TG.php index 87b93b4e..757f37b2 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TG.php @@ -10,106 +10,79 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[78]|7[127])', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[78]|7[127])', - 'ExampleNumber' => '117', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:011|1[078]|7[127])', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[78]|7[127])', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[78]|7[127])', + 'ExampleNumber' => '117', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:011|1[078]|7[127])', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TH.php b/lib/libphonenumber/data/ShortNumberMetadata_TH.php index f5c76924..82b081d4 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TH.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TH.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1(?:00|2[03]|3[3479]|7[67]|9[0246])|578|6(?:44|6[79]|88|9[16])|88\\d|9[19])|1[15]55', - 'ExampleNumber' => '191', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '1(?:113|2[23]\\d|5(?:09|56))', - 'ExampleNumber' => '1113', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:669|9[19])', - 'ExampleNumber' => '191', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[0-2]|1(?:0[03]|1[1-35]|2[0358]|3[03-79]|4[02-489]|5[04-9]|6[04-79]|7[03-9]|8[027-9]|9[02-79])|2(?:22|3[89])|3(?:18|2[23]|3[013]|5[56]|6[45]|73)|477|5(?:0\\d|4[0-37-9]|5[1-8]|6[01679]|7[12568]|8[0-24589]|9[013589])|6(?:0[0-29]|2[03]|4[3-6]|6[1-9]|7[0257-9]|8[0158]|9[014-9])|7(?:[14]9|7[27]|90)|888|9[19])', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '1(?:1(?:03|1[15]|2[58]|3[056]|4[02-49]|5[046-9]|7[03-589]|9[579])|5(?:0[0-8]|4[0-378]|5[1-478]|7[156])|6(?:20|4[356]|6[1-68]|7[057-9]|8[015]|9[0457-9]))|1(?:1[68]|3[1-35]|5[689]|60|7[17])\\d', - 'ExampleNumber' => '1103', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '114[89]', - 'ExampleNumber' => '1148', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TH', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1(?:00|2[03]|3[3479]|7[67]|9[0246])|578|6(?:44|6[79]|88|9[16])|88\\d|9[19])|1[15]55', + 'ExampleNumber' => '191', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '1(?:113|2[23]\\d|5(?:09|56))', + 'ExampleNumber' => '1113', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:669|9[19])', + 'ExampleNumber' => '191', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[0-2]|1(?:0[03]|1[1-35]|2[0358]|3[03-79]|4[02-489]|5[04-9]|6[04-79]|7[03-9]|8[027-9]|9[02-79])|2(?:22|3[89])|3(?:18|2[23]|3[013]|5[56]|6[45]|73)|477|5(?:0\\d|4[0-37-9]|5[1-8]|6[01679]|7[12568]|8[0-24589]|9[013589])|6(?:0[0-29]|2[03]|4[3-6]|6[1-9]|7[0257-9]|8[0158]|9[014-9])|7(?:[14]9|7[27]|90)|888|9[19])', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '1(?:1(?:03|1[15]|2[58]|3[056]|4[02-49]|5[046-9]|7[03-589]|9[579])|5(?:0[0-8]|4[0-378]|5[1-478]|7[156])|6(?:20|4[356]|6[1-68]|7[057-9]|8[015]|9[0457-9]))|1(?:1[68]|3[1-35]|5[689]|60|7[17])\\d', + 'ExampleNumber' => '1103', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '114[89]', + 'ExampleNumber' => '1148', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TH', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TJ.php b/lib/libphonenumber/data/ShortNumberMetadata_TJ.php index eeb6164d..42cdefd6 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TJ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TJ.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TJ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TJ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TL.php b/lib/libphonenumber/data/ShortNumberMetadata_TL.php index a8b0578a..8e099593 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TL.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TL.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[25]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[25]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[02]|1[25]|2[0138]|72|9[07])', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TL', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[25]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[25]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[02]|1[25]|2[0138]|72|9[07])', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TL', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TM.php b/lib/libphonenumber/data/ShortNumberMetadata_TM.php index 63c17df3..ab9b41ad 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TM.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '0\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0[1-3]', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '0[1-3]', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '0[1-3]', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '0\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0[1-3]', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '0[1-3]', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '0[1-3]', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TN.php b/lib/libphonenumber/data/ShortNumberMetadata_TN.php index 6f9f58aa..77560935 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TN.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '19[078]', - 'ExampleNumber' => '190', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '19[078]', - 'ExampleNumber' => '190', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '19[078]', - 'ExampleNumber' => '190', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '19[078]', + 'ExampleNumber' => '190', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '19[078]', + 'ExampleNumber' => '190', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '19[078]', + 'ExampleNumber' => '190', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TO.php b/lib/libphonenumber/data/ShortNumberMetadata_TO.php index 0973905f..a91a67e7 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TO.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TO.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|22|33|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|22|33|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9(?:11|22|33|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TO', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|22|33|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|22|33|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9(?:11|22|33|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TO', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TR.php b/lib/libphonenumber/data/ShortNumberMetadata_TR.php index d4b9bbdd..698c6a7a 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TR.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TR.php @@ -10,112 +10,85 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[02]|22|3[126]|4[04]|5[15-9]|6[18]|77|83)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:1[02]|55)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1(?:[0239]|811)|2[126]|3(?:[12]|37?|[58]6|65?)|4(?:[014]|71)|5(?:07|[135689]|78?)|6(?:[02]6|[138]|99?)|7[0-79]|8(?:[0-578]|63?|95?))|2(?:077|268|4(?:17|23)|5(?:7[26]|82)|6[14]4|8\\d\\d|9(?:30|89))|3(?:0(?:05|72)|353|4(?:06|30|64)|502|674|747|851|9(?:1[29]|60))|4(?:0(?:25|3[12]|[47]2)|3(?:3[13]|[89]1)|439|5(?:43|55)|717|832)|5(?:145|290|[4-6]\\d\\d|772|833|9(?:[06]1|92))|6(?:236|6(?:12|39|8[59])|769)|7890|8(?:688|7(?:28|65)|85[06])|9(?:159|290)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '(?:285|542)0', - 'ExampleNumber' => '2850', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '1(?:3(?:37|65)|44|578|699|8(?:3|63|95))|(?:1(?:3[58]|47|50|6[02])|2(?:07|26|4[12]|5[78]|6[14]|8\\d|9[38])|3(?:0[07]|[38]5|4[036]|50|67|74|9[16])|4(?:0[2-47]|3[389]|[48]3|5[45]|71)|5(?:14|29|[4-6]\\d|77|83|9[069])|6(?:23|6[138]|76)|789|8(?:68|7[26]|85)|9(?:15|29))\\d', - 'ExampleNumber' => '144', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TR', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[02]|22|3[126]|4[04]|5[15-9]|6[18]|77|83)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:1[02]|55)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1(?:[0239]|811)|2[126]|3(?:[12]|37?|[58]6|65?)|4(?:[014]|71)|5(?:07|[135689]|78?)|6(?:[02]6|[138]|99?)|7[0-79]|8(?:[0-578]|63?|95?))|2(?:077|268|4(?:17|23)|5(?:7[26]|82)|6[14]4|8\\d\\d|9(?:30|89))|3(?:0(?:05|72)|353|4(?:06|30|64)|502|674|747|851|9(?:1[29]|60))|4(?:0(?:25|3[12]|[47]2)|3(?:3[13]|[89]1)|439|5(?:43|55)|717|832)|5(?:145|290|[4-6]\\d\\d|772|833|9(?:[06]1|92))|6(?:236|6(?:12|39|8[59])|769)|7890|8(?:688|7(?:28|65)|85[06])|9(?:159|290)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '(?:285|542)0', + 'ExampleNumber' => '2850', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '1(?:3(?:37|65)|44|578|699|8(?:3|63|95))|(?:1(?:3[58]|47|50|6[02])|2(?:07|26|4[12]|5[78]|6[14]|8\\d|9[38])|3(?:0[07]|[38]5|4[036]|50|67|74|9[16])|4(?:0[2-47]|3[389]|[48]3|5[45]|71)|5(?:14|29|[4-6]\\d|77|83|9[069])|6(?:23|6[138]|76)|789|8(?:68|7[26]|85)|9(?:15|29))\\d', + 'ExampleNumber' => '144', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TR', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TT.php b/lib/libphonenumber/data/ShortNumberMetadata_TT.php index 5370d9b2..5a326306 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TT.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '99[09]', - 'ExampleNumber' => '990', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '99[09]', - 'ExampleNumber' => '990', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '99[09]', - 'ExampleNumber' => '990', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '99[09]', + 'ExampleNumber' => '990', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '99[09]', + 'ExampleNumber' => '990', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '99[09]', + 'ExampleNumber' => '990', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TV.php b/lib/libphonenumber/data/ShortNumberMetadata_TV.php index be4247b7..6aa5f6fc 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TV.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TV.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1\\d\\d|911', - 'ExampleNumber' => '100', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TV', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1\\d\\d|911', + 'ExampleNumber' => '100', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TV', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TW.php b/lib/libphonenumber/data/ShortNumberMetadata_TW.php index bfceec16..fee7cdc9 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TW.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:1[0289]|92\\d)', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '10[56]', - 'ExampleNumber' => '105', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[029]', - 'ExampleNumber' => '110', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[4-6]|1[02389]|6[5-8]|9(?:1[0-29]|22|5[057]|68|8[05]|9[15689]))', - 'ExampleNumber' => '104', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '1(?:65|9(?:19|50|85|98))', - 'ExampleNumber' => '165', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:1[0289]|92\\d)', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '10[56]', + 'ExampleNumber' => '105', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[029]', + 'ExampleNumber' => '110', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[4-6]|1[02389]|6[5-8]|9(?:1[0-29]|22|5[057]|68|8[05]|9[15689]))', + 'ExampleNumber' => '104', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '1(?:65|9(?:19|50|85|98))', + 'ExampleNumber' => '165', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_TZ.php b/lib/libphonenumber/data/ShortNumberMetadata_TZ.php index ce0f8e6b..6e685149 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_TZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_TZ.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[149]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[12]|999', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[12]|999', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[12]|46400|999', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '464\\d\\d', - 'ExampleNumber' => '46400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '464\\d\\d', - 'ExampleNumber' => '46400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'TZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[149]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[12]|999', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[12]|999', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[12]|46400|999', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '464\\d\\d', + 'ExampleNumber' => '46400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '464\\d\\d', + 'ExampleNumber' => '46400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'TZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_UA.php b/lib/libphonenumber/data/ShortNumberMetadata_UA.php index c0c50bd6..fa33c060 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_UA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_UA.php @@ -10,112 +10,85 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[189]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|1(?:2|6\\d{3}))', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:0[1-3]|12)', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[1-49]|1(?:2|6(?:000|1(?:11|23))|8\\d\\d?)|(?:[278]|5\\d)\\d)|[89]00\\d\\d?|151|1(?:06|4\\d|6)\\d\\d', - 'ExampleNumber' => '101', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '(?:118|[89]00)\\d\\d?', - 'ExampleNumber' => '1180', - 'PossibleLength' => - array ( - 0 => 4, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'UA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[189]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|1(?:2|6\\d{3}))', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:0[1-3]|12)', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[1-49]|1(?:2|6(?:000|1(?:11|23))|8\\d\\d?)|(?:[278]|5\\d)\\d)|[89]00\\d\\d?|151|1(?:06|4\\d|6)\\d\\d', + 'ExampleNumber' => '101', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '(?:118|[89]00)\\d\\d?', + 'ExampleNumber' => '1180', + 'PossibleLength' => [ + 0 => 4, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'UA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_UG.php b/lib/libphonenumber/data/ShortNumberMetadata_UG.php index ed9ee9f8..b6026df8 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_UG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_UG.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '999', - 'ExampleNumber' => '999', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'UG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '999', + 'ExampleNumber' => '999', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'UG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_US.php b/lib/libphonenumber/data/ShortNumberMetadata_US.php index 5048f170..c903786b 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_US.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_US.php @@ -10,120 +10,93 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[1-9]\\d{2,5}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - 3 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|[69]11', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '24280|(?:381|968)35|4(?:3355|7553|8221)|5(?:(?:489|934)2|5928)|72078|(?:323|960)40|(?:276|414)63|(?:2(?:520|744)|7390|9968)9|(?:693|732|976)88|(?:3(?:556|825)|5294|8623|9729)4|(?:3378|4136|7642|8961|9979)6|(?:4(?:6(?:15|32)|827)|(?:591|720)8|9529)7', - 'ExampleNumber' => '24280', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11(?:2|5[1-47]|[68]\\d|7[0-57]|98)|[2-9]\\d{3,5}|[2-9]11', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '2(?:3333|(?:4224|7562|900)2|56447|6688)|3(?:1010|2665|7404)|40404|560560|6(?:0060|22639|5246|7622)|7(?:0701|3822|4666)|8(?:(?:3825|7226)5|4816)|99099', - 'ExampleNumber' => '23333', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '336\\d\\d|[2-9]\\d{3}|[2356]11', - 'ExampleNumber' => '211', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '[2-9]\\d{4,5}', - 'ExampleNumber' => '20000', - 'PossibleLength' => - array ( - 0 => 5, - 1 => 6, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'US', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[1-9]\\d{2,5}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + 3 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|[69]11', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '24280|(?:381|968)35|4(?:3355|7553|8221)|5(?:(?:489|934)2|5928)|72078|(?:323|960)40|(?:276|414)63|(?:2(?:520|744)|7390|9968)9|(?:693|732|976)88|(?:3(?:556|825)|5294|8623|9729)4|(?:3378|4136|7642|8961|9979)6|(?:4(?:6(?:15|32)|827)|(?:591|720)8|9529)7', + 'ExampleNumber' => '24280', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11(?:2|5[1-47]|[68]\\d|7[0-57]|98)|[2-9]\\d{3,5}|[2-9]11', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '2(?:3333|(?:4224|7562|900)2|56447|6688)|3(?:1010|2665|7404)|40404|560560|6(?:0060|22639|5246|7622)|7(?:0701|3822|4666)|8(?:(?:3825|7226)5|4816)|99099', + 'ExampleNumber' => '23333', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '336\\d\\d|[2-9]\\d{3}|[2356]11', + 'ExampleNumber' => '211', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '[2-9]\\d{4,5}', + 'ExampleNumber' => '20000', + 'PossibleLength' => [ + 0 => 5, + 1 => 6, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'US', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_UY.php b/lib/libphonenumber/data/ShortNumberMetadata_UY.php index e9271676..4069ebfb 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_UY.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_UY.php @@ -10,108 +10,81 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d{2,3}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '128|911', - 'ExampleNumber' => '128', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '128|911', - 'ExampleNumber' => '128', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0[4-9]|1[2368]|2[0-3568]|787)|911', - 'ExampleNumber' => '104', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '178\\d', - 'ExampleNumber' => '1780', - 'PossibleLength' => - array ( - 0 => 4, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'UY', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d{2,3}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '128|911', + 'ExampleNumber' => '128', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '128|911', + 'ExampleNumber' => '128', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0[4-9]|1[2368]|2[0-3568]|787)|911', + 'ExampleNumber' => '104', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '178\\d', + 'ExampleNumber' => '1780', + 'PossibleLength' => [ + 0 => 4, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'UY', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_UZ.php b/lib/libphonenumber/data/ShortNumberMetadata_UZ.php index b06d616f..8e122377 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_UZ.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_UZ.php @@ -10,113 +10,86 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[04]\\d(?:\\d(?:\\d{2})?)?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '0(?:0[1-3]|[1-3]|50)', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '0(?:0[1-3]|[1-3]|50)', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '0(?:0[1-3]|[1-3]|50)|45400', - 'ExampleNumber' => '01', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '454\\d\\d', - 'ExampleNumber' => '45400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '454\\d\\d', - 'ExampleNumber' => '45400', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'UZ', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[04]\\d(?:\\d(?:\\d{2})?)?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '0(?:0[1-3]|[1-3]|50)', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '0(?:0[1-3]|[1-3]|50)', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '0(?:0[1-3]|[1-3]|50)|45400', + 'ExampleNumber' => '01', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '454\\d\\d', + 'ExampleNumber' => '45400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '454\\d\\d', + 'ExampleNumber' => '45400', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'UZ', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_VA.php b/lib/libphonenumber/data/ShortNumberMetadata_VA.php index c149cabf..8d98db28 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_VA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_VA.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[2358]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[2358]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[2358]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[2358]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[2358]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[2358]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_VC.php b/lib/libphonenumber/data/ShortNumberMetadata_VC.php index 0a342d56..41383a39 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_VC.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_VC.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VC', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VC', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_VE.php b/lib/libphonenumber/data/ShortNumberMetadata_VE.php index ac675ec3..0f15f6f1 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_VE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_VE.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|71)|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|71)|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|71)|911', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|71)|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|71)|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|71)|911', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_VG.php b/lib/libphonenumber/data/ShortNumberMetadata_VG.php index 94e6fd8c..e89eca57 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_VG.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_VG.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '9(?:11|99)', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VG', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '9(?:11|99)', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VG', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_VI.php b/lib/libphonenumber/data/ShortNumberMetadata_VI.php index 02581e95..3870777e 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_VI.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_VI.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '9\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '911', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VI', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '9\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '911', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VI', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_VN.php b/lib/libphonenumber/data/ShortNumberMetadata_VN.php index ca7dfd5e..3516d5a4 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_VN.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_VN.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '11[3-5]', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '11[3-5]', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[3-5]', - 'ExampleNumber' => '113', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VN', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '11[3-5]', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '11[3-5]', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[3-5]', + 'ExampleNumber' => '113', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VN', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_VU.php b/lib/libphonenumber/data/ShortNumberMetadata_VU.php index 3ce447c9..c49aac07 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_VU.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_VU.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'VU', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'VU', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_WF.php b/lib/libphonenumber/data/ShortNumberMetadata_WF.php index e0b8e6f0..26d1814b 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_WF.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_WF.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d', - 'PossibleLength' => - array ( - 0 => 2, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1[578]', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'WF', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d', + 'PossibleLength' => [ + 0 => 2, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1[578]', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'WF', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_WS.php b/lib/libphonenumber/data/ShortNumberMetadata_WS.php index f1952525..23826f4b 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_WS.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_WS.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '9(?:11|9[4-69])', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '9(?:11|9[4-69])', - 'ExampleNumber' => '911', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:1[12]|2[0-6])|9(?:11|9[4-79])', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '12[0-6]', - 'ExampleNumber' => '120', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'WS', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '9(?:11|9[4-69])', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '9(?:11|9[4-69])', + 'ExampleNumber' => '911', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:1[12]|2[0-6])|9(?:11|9[4-79])', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '12[0-6]', + 'ExampleNumber' => '120', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'WS', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_XK.php b/lib/libphonenumber/data/ShortNumberMetadata_XK.php index bb1f6bf0..4a8707ac 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_XK.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_XK.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|9[2-4])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|9[2-4])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|9[2-4])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'XK', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|9[2-4])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|9[2-4])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|9[2-4])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'XK', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_YE.php b/lib/libphonenumber/data/ShortNumberMetadata_YE.php index 88022b80..d06c91bc 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_YE.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_YE.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '19[1459]', - 'ExampleNumber' => '191', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '19[1459]', - 'ExampleNumber' => '191', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '19[1459]', - 'ExampleNumber' => '191', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'YE', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '19[1459]', + 'ExampleNumber' => '191', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '19[1459]', + 'ExampleNumber' => '191', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '19[1459]', + 'ExampleNumber' => '191', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'YE', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_YT.php b/lib/libphonenumber/data/ShortNumberMetadata_YT.php index 58965a03..7a2cd739 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_YT.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_YT.php @@ -10,104 +10,77 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '1\\d\\d?', - 'PossibleLength' => - array ( - 0 => 2, - 1 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:12|5)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:12|5)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:12|5)', - 'ExampleNumber' => '15', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'YT', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '1\\d\\d?', + 'PossibleLength' => [ + 0 => 2, + 1 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:12|5)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:12|5)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:12|5)', + 'ExampleNumber' => '15', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'YT', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ZA.php b/lib/libphonenumber/data/ShortNumberMetadata_ZA.php index 7fa461a8..7c4ae713 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ZA.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ZA.php @@ -10,117 +10,90 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[134]\\d{2,4}', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 4, - 2 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '1(?:01\\d\\d|12)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '41(?:348|851)', - 'ExampleNumber' => '41348', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '1(?:01(?:11|77)|12)', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '1(?:0(?:1(?:11|77)|20|7)|1[12]|77(?:3[237]|[45]7|6[279]|9[26]))|[34]\\d{4}', - 'ExampleNumber' => '107', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'NationalNumberPattern' => '3(?:078[23]|7(?:064|567)|8126)|4(?:394[16]|7751|8837)|4[23]699', - 'ExampleNumber' => '30782', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '111', - 'ExampleNumber' => '111', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'NationalNumberPattern' => '[34]\\d{4}', - 'ExampleNumber' => '30000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ZA', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[134]\\d{2,4}', + 'PossibleLength' => [ + 0 => 3, + 1 => 4, + 2 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '1(?:01\\d\\d|12)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '41(?:348|851)', + 'ExampleNumber' => '41348', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '1(?:01(?:11|77)|12)', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '1(?:0(?:1(?:11|77)|20|7)|1[12]|77(?:3[237]|[45]7|6[279]|9[26]))|[34]\\d{4}', + 'ExampleNumber' => '107', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'NationalNumberPattern' => '3(?:078[23]|7(?:064|567)|8126)|4(?:394[16]|7751|8837)|4[23]699', + 'ExampleNumber' => '30782', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '111', + 'ExampleNumber' => '111', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'NationalNumberPattern' => '[34]\\d{4}', + 'ExampleNumber' => '30000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ZA', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ZM.php b/lib/libphonenumber/data/ShortNumberMetadata_ZM.php index 3821b3f6..3cc882e4 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ZM.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ZM.php @@ -10,103 +10,76 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[19]\\d\\d', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|99[139]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|99[139]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '112|99[139]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ZM', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[19]\\d\\d', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|99[139]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|99[139]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '112|99[139]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ZM', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/lib/libphonenumber/data/ShortNumberMetadata_ZW.php b/lib/libphonenumber/data/ShortNumberMetadata_ZW.php index 558db32e..d5e40808 100755 --- a/lib/libphonenumber/data/ShortNumberMetadata_ZW.php +++ b/lib/libphonenumber/data/ShortNumberMetadata_ZW.php @@ -10,110 +10,83 @@ * Do not modify this file directly! */ - -return array ( - 'generalDesc' => - array ( - 'NationalNumberPattern' => '[139]\\d\\d(?:\\d{2})?', - 'PossibleLength' => - array ( - 0 => 3, - 1 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'tollFree' => - array ( - 'NationalNumberPattern' => '112|9(?:5[023]|61|9[3-59])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'premiumRate' => - array ( - 'NationalNumberPattern' => '3[013-57-9]\\d{3}', - 'ExampleNumber' => '30000', - 'PossibleLength' => - array ( - 0 => 5, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'emergency' => - array ( - 'NationalNumberPattern' => '112|99[3-59]', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'shortCode' => - array ( - 'NationalNumberPattern' => '11[2469]|3[013-57-9]\\d{3}|9(?:5[023]|6[0-25]|9[3-59])', - 'ExampleNumber' => '112', - 'PossibleLength' => - array ( - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'standardRate' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'carrierSpecific' => - array ( - 'NationalNumberPattern' => '114|9(?:5[023]|6[0-25])', - 'ExampleNumber' => '114', - 'PossibleLength' => - array ( - 0 => 3, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'smsServices' => - array ( - 'PossibleLength' => - array ( - 0 => -1, - ), - 'PossibleLengthLocalOnly' => - array ( - ), - ), - 'id' => 'ZW', - 'countryCode' => 0, - 'internationalPrefix' => '', - 'sameMobileAndFixedLinePattern' => false, - 'numberFormat' => - array ( - ), - 'intlNumberFormat' => - array ( - ), - 'mainCountryForCode' => false, - 'leadingZeroPossible' => false, - 'mobileNumberPortableRegion' => false, -); +return [ + 'generalDesc' => [ + 'NationalNumberPattern' => '[139]\\d\\d(?:\\d{2})?', + 'PossibleLength' => [ + 0 => 3, + 1 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'tollFree' => [ + 'NationalNumberPattern' => '112|9(?:5[023]|61|9[3-59])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'premiumRate' => [ + 'NationalNumberPattern' => '3[013-57-9]\\d{3}', + 'ExampleNumber' => '30000', + 'PossibleLength' => [ + 0 => 5, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'emergency' => [ + 'NationalNumberPattern' => '112|99[3-59]', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'shortCode' => [ + 'NationalNumberPattern' => '11[2469]|3[013-57-9]\\d{3}|9(?:5[023]|6[0-25]|9[3-59])', + 'ExampleNumber' => '112', + 'PossibleLength' => [ + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'standardRate' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'carrierSpecific' => [ + 'NationalNumberPattern' => '114|9(?:5[023]|6[0-25])', + 'ExampleNumber' => '114', + 'PossibleLength' => [ + 0 => 3, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'smsServices' => [ + 'PossibleLength' => [ + 0 => -1, + ], + 'PossibleLengthLocalOnly' => [ + ], + ], + 'id' => 'ZW', + 'countryCode' => 0, + 'internationalPrefix' => '', + 'sameMobileAndFixedLinePattern' => false, + 'numberFormat' => [ + ], + 'intlNumberFormat' => [ + ], + 'mainCountryForCode' => false, + 'leadingZeroPossible' => false, + 'mobileNumberPortableRegion' => false, +]; diff --git a/payplug-config.php b/payplug-config.php index d55a1835..d5cc3834 100644 --- a/payplug-config.php +++ b/payplug-config.php @@ -1,14 +1,11 @@ import_from_file($path); + // parse the English translation file + $path = WP_PLUGIN_DIR . '/' . plugin_basename(dirname(__FILE__)) . '/languages/payplug-en_US.mo'; + $GLOBALS['mo']->import_from_file($path); } -function create_lock_table(){ - init(); - \Payplug\PayplugWoocommerce\Model\Lock::create_lock_table(); +function create_lock_table() +{ + init(); + \Payplug\PayplugWoocommerce\Model\Lock::create_lock_table(); } -add_action( 'upgrader_process_complete', __NAMESPACE__ . '\\create_lock_table', 10, 2 ); -add_action( 'activated_plugin', __NAMESPACE__ . '\\create_lock_table', 10, 2 ); -add_action( 'plugins_loaded', __NAMESPACE__ . '\\init' ); +add_action('upgrader_process_complete', __NAMESPACE__ . '\\create_lock_table', 10, 2); +add_action('activated_plugin', __NAMESPACE__ . '\\create_lock_table', 10, 2); +add_action('plugins_loaded', __NAMESPACE__ . '\\init'); -add_action( 'before_woocommerce_init', function() { - if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { - \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); - } -} ); +add_action('before_woocommerce_init', function () { + if (class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true); + } +}); -register_deactivation_hook( __FILE__, __NAMESPACE__ .'\\PayplugWoocommerceHelper::plugin_deactivation' ); +register_deactivation_hook(__FILE__, __NAMESPACE__ . '\\PayplugWoocommerceHelper::plugin_deactivation'); /** - * A fail-safe in case a transltion does not exist shows the default translation (English) + * A fail-safe in case a transltion does not exist shows the default translation (English). * * @param $msgstr string Translated text (Usually starts with "payplug_") * @param $msgid string Text to translate (irrelevant because it is equal to $msgstr in this case) @@ -85,16 +83,14 @@ function create_lock_table(){ */ function wpdocs_translate_text($msgstr, $msgid, $domain) { - $pattern = '/^payplug_.+/'; + $pattern = '/^payplug_.+/'; - if (preg_match($pattern, $msgstr) === 1) { - if(isset($GLOBALS["mo"]->entries[$msgstr])) - return $GLOBALS["mo"]->entries[$msgstr]->translations[0]; - } + if (1 === preg_match($pattern, $msgstr)) { + if (isset($GLOBALS['mo']->entries[$msgstr])) { + return $GLOBALS['mo']->entries[$msgstr]->translations[0]; + } + } - return $msgstr; + return $msgstr; } add_filter('gettext_payplug', __NAMESPACE__ . '\\wpdocs_translate_text', 10, 3); - - - diff --git a/src/Admin/Ajax.php b/src/Admin/Ajax.php index 931739c2..d9f1f950 100644 --- a/src/Admin/Ajax.php +++ b/src/Admin/Ajax.php @@ -3,9 +3,10 @@ namespace Payplug\PayplugWoocommerce\Admin; // Exit if accessed directly +use Payplug\Authentication; use Payplug\Exception\HttpException; +use Payplug\Exception\PayplugException; use Payplug\Payplug; -use Payplug\Authentication; use Payplug\PayplugWoocommerce\Controller\ApplePay; use Payplug\PayplugWoocommerce\Gateway\AmericanExpress; use Payplug\PayplugWoocommerce\Gateway\Bancontact; @@ -15,626 +16,622 @@ use Payplug\PayplugWoocommerce\Gateway\PPRO\Mybank; use Payplug\PayplugWoocommerce\Gateway\PPRO\Satispay; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -use Payplug\Exception\PayplugException; use WP_REST_Request; -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } /** * PayPlug admin ajax handler. - * - * @package Payplug\PayplugWoocommerce\Admin */ -class Ajax { - - public function __construct() { - $permission = ( current_user_can('editor') || current_user_can('administrator') ); - - add_action( 'rest_api_init', function () use ($permission) { - //Path to REST route and the callback function - register_rest_route( 'payplug_api', '/save/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'payplug_save_data' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/init/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'payplug_init' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/login/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'payplug_login' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/logout/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'payplug_logout' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/refresh_keys/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'refresh_keys' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/check_requirements/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'payplug_check_requirements' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/bancontact_permissions/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'api_check_bancontact_permissions' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/applepay_permissions/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'api_check_applepay_permissions' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/american_express_permissions/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'api_check_american_express_permissions' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/oney_permissions/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'api_check_oney_permissions' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/one_click_permissions/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'api_check_one_click_permission' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/satispay_permissions/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'api_check_satispay_permissions' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/mybank_permissions/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'api_check_mybank_permissions' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/ideal_permissions/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'api_check_ideal_permissions' ], - 'permission_callback' => function () use ($permission) {return $permission ;}, - 'show_in_index' => false - ) ); - register_rest_route( 'payplug_api', '/integrated_permissions/', array( - 'methods' => 'POST', - 'callback' => [ $this, 'api_check_integrated_payment' ], - 'permission_callback' => function () use ($permission) { return $permission ; } - ) ); - - }); - } - - public function refresh_keys(WP_REST_Request $request) { - $data = $request->get_params(); - $email = sanitize_text_field( wp_unslash( $data['payplug_email'] ) ); - $password = base64_decode(wp_unslash($data['payplug_password'])); - - if ( empty( $email ) || empty( $password ) ) { - wp_send_json_error( - array( - 'message' => __( 'Invalid request.', 'payplug' ), - ) - ); - } - - if ( ! WC()->payment_gateways() ) { - wp_send_json_error( - array( - 'message' => __( 'An error occured with PayPlug gateway. Please make sure PayPlug settings are correct.', 'payplug' ), - ) - ); - } - - $payment_gateways = WC()->payment_gateways()->payment_gateways(); - if ( empty( $payment_gateways ) || ! isset( $payment_gateways['payplug'] ) ) { - wp_send_json_error( - array( - 'message' => __( 'An error occured with PayPlug gateway. Please make sure PayPlug settings are correct.', 'payplug' ), - ) - ); - } - - /* @var PayplugGateway $payplug_gateway */ - $payplug_gateway = $payment_gateways['payplug']; - $keys = $payplug_gateway->retrieve_user_api_keys( $email, $password ); - if ( is_wp_error( $keys ) ) { - wp_send_json_error( - array( - 'message' => $keys->get_error_message(), - ) - ); - } - - $success = $this->update_api_keys( $keys, $payplug_gateway ); - - if ( empty( $keys['live'] ) ) { - wp_send_json_error( - array( - 'message' => __( 'Your account does not support LIVE mode at the moment, it must be validated first. If your account has already been validated, please log out and log in again.', 'payplug' ), - 'still_inactive' => true - ) - ); - } - - if ( ! $success ) { - wp_send_json_error( - array( - 'message' => __( 'Something went wrong.', 'payplug' ), - ) - ); - } - - wp_send_json_success( - array( - 'message' => __( 'Your API keys has successfully been updated.', 'payplug' ) - ) - ); - } - - public function api_check_one_click_permission(WP_REST_Request $request){ - wp_send_json_success(true); - } - - public function api_check_bancontact_permissions(WP_REST_Request $request) { - $account = $this->generic_get_account($request, Bancontact::ENABLE_ON_TEST_MODE); - - if(isset($account['httpResponse']['payment_methods']['bancontact']['enabled']) && $account['httpResponse']['payment_methods']['bancontact']['enabled']){ - wp_send_json_success(true); - } - - wp_send_json_error(array( - "title" => __( 'payplug_enable_feature', 'payplug' ), - "msg" => __( 'payplug_bancontact_access_error', 'payplug' ), - "close" => __( 'payplug_ok', 'payplug' ) - )); - - } - - public function api_check_applepay_permissions(WP_REST_Request $request) { - $account = $this->generic_get_account($request, ApplePay::ENABLE_ON_TEST_MODE); - - if ($account['httpResponse']['payment_methods']['apple_pay']['enabled']) { - if (in_array($_SERVER['HTTP_HOST'], $account['httpResponse']['payment_methods']['apple_pay']['allowed_domain_names'])) { - wp_send_json_success(true); - } - - } - - wp_send_json_error(array( - "title" => __( 'payplug_enable_feature', 'payplug' ), - "msg" => __( 'payplug_applepay_access_error', 'payplug' ), - "close" => __( 'payplug_ok', 'payplug' ) - )); - - } - - public function api_check_american_express_permissions(WP_REST_Request $request) { - $account = $this->generic_get_account($request, AmericanExpress::ENABLE_ON_TEST_MODE); - - if(isset($account['httpResponse']['payment_methods']['american_express']['enabled']) && $account['httpResponse']['payment_methods']['american_express']['enabled']){ - wp_send_json_success(true); - } - - wp_send_json_error(array( - "title" => __( 'payplug_enable_feature', 'payplug' ), - "msg" => __( 'payplug_amex_access_error', 'payplug' ), - "close" => __( 'payplug_ok', 'payplug' ) - )); - - } - - public function api_check_oney_permissions(WP_REST_Request $request) { - $account = $this->generic_get_account($request, PayplugGatewayOney3x::ENABLE_ON_TEST_MODE); - - if(isset($account['httpResponse']['permissions']['can_use_oney']) && $account['httpResponse']['permissions']['can_use_oney']){ - wp_send_json_success(true); - } - - $oney = isset($account['httpResponse']['permissions']['can_use_oney']) ? $account['httpResponse']['permissions']['can_use_oney']: false; - - if(!$oney){ - $anchor_text = __( 'payplug_oney_error_link', 'payplug' ); - $anchor_url = "https://portal.payplug.com/login"; - $anchor = sprintf( ' %s', $anchor_url, $anchor_text ); - $message = __( 'payplug_oney_error_description', 'payplug' ) . $anchor; - wp_send_json_error(array( - "title" => __( 'payplug_oney_error_title', 'payplug' ), - "msg" => $message, - "close" => __( 'payplug_ok', 'payplug' ) - )); - } - - wp_send_json_success(true); - } - - public function api_check_satispay_permissions(WP_REST_Request $request) { - $account = $this->generic_get_account($request, Satispay::ENABLE_ON_TEST_MODE); - - $enabled = isset($account['httpResponse']['payment_methods']['satispay']['enabled']) ? $account['httpResponse']['payment_methods']['satispay']['enabled']: false; - if(!$enabled){ - wp_send_json_error(array( - "title" => __( 'payplug_enable_feature', 'payplug' ), - "msg" => __( 'payplug_satispay_access_error', 'payplug' ), - "close" => __( 'payplug_ok', 'payplug' ) - )); - } - - wp_send_json_success($enabled); - } - - public function api_check_mybank_permissions(WP_REST_Request $request) { - $account = $this->generic_get_account($request, Mybank::ENABLE_ON_TEST_MODE); - - $enabled = isset($account['httpResponse']['payment_methods']['mybank']['enabled']) ? $account['httpResponse']['payment_methods']['mybank']['enabled']: false; - if(!$enabled){ - wp_send_json_error(array( - "title" => __( 'payplug_enable_feature', 'payplug' ), - "msg" => __( 'payplug_mybank_access_error', 'payplug' ), - "close" => __( 'payplug_ok', 'payplug' ) - )); - } - - wp_send_json_success($enabled); - } - - public function api_check_ideal_permissions(WP_REST_Request $request) { - $account = $this->generic_get_account($request, Ideal::ENABLE_ON_TEST_MODE); - - $enabled = isset($account['httpResponse']['payment_methods']['ideal']['enabled']) ? $account['httpResponse']['payment_methods']['ideal']['enabled']: false; - if(!$enabled){ - wp_send_json_error(array( - "title" => __( 'payplug_enable_feature', 'payplug' ), - "msg" => __( 'payplug_ideal_access_error', 'payplug' ), - "close" => __( 'payplug_ok', 'payplug' ) - )); - } - - wp_send_json_success($enabled); - } - - private function generic_get_account($request, $enable_on_test_mode){ - - $data = $request->get_params(); - - if( isset($data['env']) && $data['env'] ) { - if($enable_on_test_mode){ - wp_send_json_success(true); - }else{ - $this->optionUnnavailableInTestMode(); - } - } - - $this->accountIsNotValid(); - - $live_key = PayplugWoocommerceHelper::get_live_key(); - - if(empty($live_key)){ - return false; - } - - try{ - $account = Authentication::getAccount(new Payplug($live_key)); - - } catch (PayplugException $e){ - PayplugGateway::log('Error while saving account : ' . $e->getMessage(), 'error'); - return false; - } - - return $account; - - } - - /** - * Update PayPlug api keys - *& - - * @param array $keys - * @param PayplugGateway $payplug_gateway - * - * @return bool - */ - protected function update_api_keys( $keys, $payplug_gateway ) { - if ( empty( $payplug_gateway->settings ) ) { - $payplug_gateway->init_settings(); - } - - $payplug_gateway->settings['payplug_test_key'] = $keys['test']; - $payplug_gateway->settings['payplug_live_key'] = $keys['live']; - if ( ! empty( $keys['live'] ) ) { - $payplug_gateway->settings['mode'] = 'yes'; - } - - return update_option( - $payplug_gateway->get_option_key(), - apply_filters( - 'woocommerce_settings_api_sanitized_fields_' . $payplug_gateway->id, - $payplug_gateway->settings - ), - 'yes' - ); - } - - /** - * - * Ajax paypal login - * - * @return void - */ - public function payplug_login() { - - $data = json_decode(file_get_contents('php://input'), true); - $email = sanitize_email($data['payplug_email']); - $password = base64_decode(wp_unslash($data['payplug_password'])); - $wp_nonce = !empty($data['_wpnonce']) ? $data['_wpnonce'] : null; - - delete_option( 'woocommerce_payplug_settings' ); - delete_site_option( 'woocommerce_payplug_settings' ); - - try { - - $payplug = new PayplugGateway(); - $api_keys = $payplug->retrieve_user_api_keys($email, $password); - if ( is_wp_error( $api_keys ) ) { - $this->login_wrong_credentials_error(); - } - - $form_fields = $payplug->get_form_fields(); - $merchant_id = isset($api_keys['test']) ? $payplug->retrieve_merchant_id($api_keys['test']) : ''; - - foreach ($form_fields as $key => $field) { - if (in_array($field['type'], ['title', 'login'])) { - continue; - } - - switch ($key) { - case 'enabled': - $val = 'yes'; - break; - case 'mode': - $val = 'no'; - break; - case 'payplug_test_key': - $val = !empty($api_keys['test']) ? esc_attr($api_keys['test']) : null; - break; - case 'payplug_live_key': - $val = !empty($api_keys['live']) ? esc_attr($api_keys['live']) : null; - break; - case 'payplug_merchant_id': - $val = esc_attr($merchant_id); - break; - case 'email': - $val = esc_html($email); - break; - default: - $val = $payplug->get_option($key); - } - - $data[$key] = $val; - } - - $payplug->set_post_data($data); - update_option( - $payplug->get_option_key(), - apply_filters('woocommerce_settings_api_sanitized_fields_' . $payplug->id, $data) - ); - - $user = [ - "logged" => true, - "email" => $email, - "mode" => PayplugWoocommerceHelper::check_mode() ? 0 : 1 - ]; - $wp = [ - "WP" => [ - "_wpnonce" => $wp_nonce, - ] - ]; - - wp_send_json_success( ["settings" => $user + $wp] + ( new Vue )->init() ); - } catch (HttpException $e) { - $this->login_wrong_credentials_error(); - - } - } - - /** - * Response Json Error WP Format for wrong credentials - * @return void - */ - private function login_wrong_credentials_error(){ - wp_send_json_error( array( 'message' => __("payplug_error_wrong_credentials", "payplug") ) ); - } - - /** - * - * Ajax payplug initialisation - * - * @return JSON - */ - public function payplug_init() { - - $wp_nonce = wp_create_nonce(); - - $wp = [ - "logged" => PayplugWoocommerceHelper::user_logged_in(), - "mode" => PayplugWoocommerceHelper::check_mode() ? 0 : 1, - "WP" => [ - "_wpnonce" => $wp_nonce, - ] - ]; - - return wp_send_json_success([ - "settings" => $wp - ] + ( new Vue )->init() ); - - } - - /** - * @return bool|null - */ - public function payplug_logout() { - - PayplugWoocommerceHelper::payplug_logout(); - $wp = [ - "logged" => PayplugWoocommerceHelper::user_logged_in(), - "mode" => PayplugWoocommerceHelper::check_mode() ? 0 : 1 - ]; - - http_response_code(200); - wp_send_json_success(array( - "message" => __('Successfully logged out.', 'payplug'), - "status" => ( new Vue )->payplug_section_status(), - "settings" => $wp, - "subscribe" => ( new Vue )->payplug_section_subscribe() // When Logging out the Status Block needs to be updated - )); - - } - - - private function accountIsNotValid(){ - $live_key = PayplugWoocommerceHelper::get_live_key(); - if(empty($live_key)){ - wp_send_json_error(array( - "title" => __( 'payplug_enable_feature', 'payplug' ), - "msg" => __('Your account does not support LIVE mode at the moment, it must be validated first. If your account has already been validated, please log out and log in again.', 'payplug'), - "close" => __( 'payplug_ok', 'payplug' ) - )); - } - } - - private function optionUnnavailableInTestMode(){ - wp_send_json_error(array( - "title" => __( 'payplug_enable_feature', 'payplug' ), - "msg" => __( 'payplug_unavailable_testmode_description', 'payplug' ) - )); - } - - /** - * - * Save data from request - * - * @return null - */ - public function payplug_save_data( WP_REST_Request $request ) { - - $payplug = new PayplugGateway(); - $options = $payplug->settings; - if (PayplugWoocommerceHelper::user_logged_in()) { - - $data = json_decode(file_get_contents('php://input'), true); - - - - $options['enabled'] = Validator::enabled($data['payplug_enable']); - $options['mode'] = Validator::mode($data['payplug_sandbox']); - - $test_mode = $options['mode'] === 'yes' ? false : true; - - $options['title'] = trim(wp_strip_all_tags($data['standard_payment_title'])); - $options['description'] = trim(wp_strip_all_tags($data['standard_payment_description'])); - $options['payment_method'] = (Validator::payment_method($data['payplug_embeded'])) ? $data['payplug_embeded'] : $options['payplug_embeded']; - $options['oneclick'] = Validator::oneclick($data['enable_one_click']); - - $options['oney'] = Validator::oney($data['enable_oney']); - $options['payplug'] = Validator::genericPaymentGateway($data['enable_standard'], "Payplug", false); - $options['bancontact'] = Validator::genericPaymentGateway($data['enable_bancontact'], "Bancontact", $test_mode); - - $options['apple_pay'] = Validator::genericPaymentGateway($data['enable_applepay'], "Apple Pay", $test_mode); - $options['applepay_carriers'] = (!empty($data['applepay_carriers'])) ? $data['applepay_carriers'] : []; - $options['applepay_checkout'] = Validator::genericPaymentGateway($data['enable_applepay_checkout'], "Apple Pay Checkout", $test_mode); - $options['applepay_cart'] = Validator::genericPaymentGateway($data['enable_applepay_cart'], "Apple Pay Cart", $test_mode); - $options['applepay_product'] = Validator::genericPaymentGateway($data['enable_applepay_product'], "Apple Pay Product", $test_mode); - - Validator::applePayPaymentGatewayOptions($options['apple_pay'], $options['applepay_cart'], $options['applepay_product'], $options['applepay_checkout'], $options['applepay_carriers']); - if (($options['apple_pay'] === 'yes') && ($options['applepay_checkout'] === 'no') && ($options['applepay_cart'] === 'no') && ($options['applepay_product'] === 'no')) { - $options['applepay_checkout'] = 'yes'; - } - - - $options['american_express'] = Validator::genericPaymentGateway($data['enable_american_express'],"American Express", $test_mode); - $options['satispay'] = Validator::genericPaymentGateway($data['enable_satispay'], "Satispay", $test_mode); - $options['ideal'] = Validator::genericPaymentGateway($data['enable_ideal'], "iDEAL", $test_mode); - $options['mybank'] = Validator::genericPaymentGateway($data['enable_mybank'], "Mybank", $test_mode); - $options['oney_type'] = (Validator::oney_type($data['payplug_oney'])) ? $data['payplug_oney'] : 'with_fees'; - $thresholds = (Validator::oney_thresholds($data['oney_min_amounts'], $data['oney_max_amounts'])); - $options['oney_thresholds_min'] = $thresholds['min']; - $options['oney_thresholds_max'] = $thresholds['max']; - $options['oney_product_animation'] = Validator::oney_product_animation($data['enable_oney_product_animation']); - $options['debug'] = Validator::debug($data['enable_debug']); - - //force save - if( update_option( 'woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options), false ) ){ - - //delete the transient, so it refresh the permissions on the init - $transient_key = PayplugWoocommerceHelper::get_transient_key($options); - delete_transient($transient_key); - - http_response_code(200); - wp_send_json_success( array( - "title" => null, - "msg" => __( 'payplug_save_success_message', 'payplug' ), - "close" => __( 'payplug_ok', 'payplug' ), - )); - }else{ - http_response_code(200); - wp_send_json_error([ - "title" => null, - "close" => __( 'payplug_ok', 'payplug' ), - "msg" => "These settings are already saved !"]); - } - - } else { - http_response_code(403); - wp_send_json_error("You are not logged in !"); - } - - - } - - public function payplug_check_requirements() { - wp_send_json_success(array( - "status" => ( new Vue )->payplug_section_status() - )); - } - - public function api_check_integrated_payment(WP_REST_Request $request) - { - - $account = $this->generic_get_account($request, true); - - if( ! isset($account['httpResponse']['permissions']['can_use_integrated_payments']) - || ! $account['httpResponse']['permissions']['can_use_integrated_payments'] ) { - wp_send_json_error(array( - "title" => __( 'payplug_enable_feature', 'payplug' ), - "msg" => __( 'payplug_integrated_access_error', 'payplug' ), - "close" => __( 'payplug_ok', 'payplug' ) - )); - } - - wp_send_json_success(true); - return true; - - } +class Ajax +{ + public function __construct() + { + $permission = (current_user_can('editor') || current_user_can('administrator')); + + add_action('rest_api_init', function () use ($permission) { + //Path to REST route and the callback function + register_rest_route('payplug_api', '/save/', [ + 'methods' => 'POST', + 'callback' => [$this, 'payplug_save_data'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/init/', [ + 'methods' => 'POST', + 'callback' => [$this, 'payplug_init'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/login/', [ + 'methods' => 'POST', + 'callback' => [$this, 'payplug_login'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/logout/', [ + 'methods' => 'POST', + 'callback' => [$this, 'payplug_logout'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/refresh_keys/', [ + 'methods' => 'POST', + 'callback' => [$this, 'refresh_keys'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/check_requirements/', [ + 'methods' => 'POST', + 'callback' => [$this, 'payplug_check_requirements'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/bancontact_permissions/', [ + 'methods' => 'POST', + 'callback' => [$this, 'api_check_bancontact_permissions'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/applepay_permissions/', [ + 'methods' => 'POST', + 'callback' => [$this, 'api_check_applepay_permissions'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/american_express_permissions/', [ + 'methods' => 'POST', + 'callback' => [$this, 'api_check_american_express_permissions'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/oney_permissions/', [ + 'methods' => 'POST', + 'callback' => [$this, 'api_check_oney_permissions'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/one_click_permissions/', [ + 'methods' => 'POST', + 'callback' => [$this, 'api_check_one_click_permission'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/satispay_permissions/', [ + 'methods' => 'POST', + 'callback' => [$this, 'api_check_satispay_permissions'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/mybank_permissions/', [ + 'methods' => 'POST', + 'callback' => [$this, 'api_check_mybank_permissions'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/ideal_permissions/', [ + 'methods' => 'POST', + 'callback' => [$this, 'api_check_ideal_permissions'], + 'permission_callback' => function () use ($permission) {return $permission; }, + 'show_in_index' => false, + ]); + register_rest_route('payplug_api', '/integrated_permissions/', [ + 'methods' => 'POST', + 'callback' => [$this, 'api_check_integrated_payment'], + 'permission_callback' => function () use ($permission) { return $permission; }, + ]); + }); + } + + public function refresh_keys(WP_REST_Request $request) + { + $data = $request->get_params(); + $email = sanitize_text_field(wp_unslash($data['payplug_email'])); + $password = base64_decode(wp_unslash($data['payplug_password'])); + + if (empty($email) || empty($password)) { + wp_send_json_error( + [ + 'message' => __('Invalid request.', 'payplug'), + ] + ); + } + + if (!WC()->payment_gateways()) { + wp_send_json_error( + [ + 'message' => __('An error occured with PayPlug gateway. Please make sure PayPlug settings are correct.', 'payplug'), + ] + ); + } + + $payment_gateways = WC()->payment_gateways()->payment_gateways(); + if (empty($payment_gateways) || !isset($payment_gateways['payplug'])) { + wp_send_json_error( + [ + 'message' => __('An error occured with PayPlug gateway. Please make sure PayPlug settings are correct.', 'payplug'), + ] + ); + } + + // @var PayplugGateway $payplug_gateway + $payplug_gateway = $payment_gateways['payplug']; + $keys = $payplug_gateway->retrieve_user_api_keys($email, $password); + if (is_wp_error($keys)) { + wp_send_json_error( + [ + 'message' => $keys->get_error_message(), + ] + ); + } + + $success = $this->update_api_keys($keys, $payplug_gateway); + + if (empty($keys['live'])) { + wp_send_json_error( + [ + 'message' => __('Your account does not support LIVE mode at the moment, it must be validated first. If your account has already been validated, please log out and log in again.', 'payplug'), + 'still_inactive' => true, + ] + ); + } + + if (!$success) { + wp_send_json_error( + [ + 'message' => __('Something went wrong.', 'payplug'), + ] + ); + } + + wp_send_json_success( + [ + 'message' => __('Your API keys has successfully been updated.', 'payplug'), + ] + ); + } + + public function api_check_one_click_permission(WP_REST_Request $request) + { + wp_send_json_success(true); + } + + public function api_check_bancontact_permissions(WP_REST_Request $request) + { + $account = $this->generic_get_account($request, Bancontact::ENABLE_ON_TEST_MODE); + + if (isset($account['httpResponse']['payment_methods']['bancontact']['enabled']) && $account['httpResponse']['payment_methods']['bancontact']['enabled']) { + wp_send_json_success(true); + } + + wp_send_json_error([ + 'title' => __('payplug_enable_feature', 'payplug'), + 'msg' => __('payplug_bancontact_access_error', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]); + } + + public function api_check_applepay_permissions(WP_REST_Request $request) + { + $account = $this->generic_get_account($request, ApplePay::ENABLE_ON_TEST_MODE); + + if ($account['httpResponse']['payment_methods']['apple_pay']['enabled']) { + if (in_array($_SERVER['HTTP_HOST'], $account['httpResponse']['payment_methods']['apple_pay']['allowed_domain_names'])) { + wp_send_json_success(true); + } + } + + wp_send_json_error([ + 'title' => __('payplug_enable_feature', 'payplug'), + 'msg' => __('payplug_applepay_access_error', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]); + } + + public function api_check_american_express_permissions(WP_REST_Request $request) + { + $account = $this->generic_get_account($request, AmericanExpress::ENABLE_ON_TEST_MODE); + + if (isset($account['httpResponse']['payment_methods']['american_express']['enabled']) && $account['httpResponse']['payment_methods']['american_express']['enabled']) { + wp_send_json_success(true); + } + + wp_send_json_error([ + 'title' => __('payplug_enable_feature', 'payplug'), + 'msg' => __('payplug_amex_access_error', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]); + } + + public function api_check_oney_permissions(WP_REST_Request $request) + { + $account = $this->generic_get_account($request, PayplugGatewayOney3x::ENABLE_ON_TEST_MODE); + + if (isset($account['httpResponse']['permissions']['can_use_oney']) && $account['httpResponse']['permissions']['can_use_oney']) { + wp_send_json_success(true); + } + + $oney = isset($account['httpResponse']['permissions']['can_use_oney']) ? $account['httpResponse']['permissions']['can_use_oney'] : false; + + if (!$oney) { + $anchor_text = __('payplug_oney_error_link', 'payplug'); + $anchor_url = 'https://portal.payplug.com/login'; + $anchor = sprintf(' %s', $anchor_url, $anchor_text); + $message = __('payplug_oney_error_description', 'payplug') . $anchor; + wp_send_json_error([ + 'title' => __('payplug_oney_error_title', 'payplug'), + 'msg' => $message, + 'close' => __('payplug_ok', 'payplug'), + ]); + } + + wp_send_json_success(true); + } + + public function api_check_satispay_permissions(WP_REST_Request $request) + { + $account = $this->generic_get_account($request, Satispay::ENABLE_ON_TEST_MODE); + + $enabled = isset($account['httpResponse']['payment_methods']['satispay']['enabled']) ? $account['httpResponse']['payment_methods']['satispay']['enabled'] : false; + if (!$enabled) { + wp_send_json_error([ + 'title' => __('payplug_enable_feature', 'payplug'), + 'msg' => __('payplug_satispay_access_error', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]); + } + + wp_send_json_success($enabled); + } + + public function api_check_mybank_permissions(WP_REST_Request $request) + { + $account = $this->generic_get_account($request, Mybank::ENABLE_ON_TEST_MODE); + + $enabled = isset($account['httpResponse']['payment_methods']['mybank']['enabled']) ? $account['httpResponse']['payment_methods']['mybank']['enabled'] : false; + if (!$enabled) { + wp_send_json_error([ + 'title' => __('payplug_enable_feature', 'payplug'), + 'msg' => __('payplug_mybank_access_error', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]); + } + + wp_send_json_success($enabled); + } + + public function api_check_ideal_permissions(WP_REST_Request $request) + { + $account = $this->generic_get_account($request, Ideal::ENABLE_ON_TEST_MODE); + + $enabled = isset($account['httpResponse']['payment_methods']['ideal']['enabled']) ? $account['httpResponse']['payment_methods']['ideal']['enabled'] : false; + if (!$enabled) { + wp_send_json_error([ + 'title' => __('payplug_enable_feature', 'payplug'), + 'msg' => __('payplug_ideal_access_error', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]); + } + + wp_send_json_success($enabled); + } + + /** + * Ajax paypal login. + */ + public function payplug_login() + { + $data = json_decode(file_get_contents('php://input'), true); + $email = sanitize_email($data['payplug_email']); + $password = base64_decode(wp_unslash($data['payplug_password'])); + $wp_nonce = !empty($data['_wpnonce']) ? $data['_wpnonce'] : null; + + delete_option('woocommerce_payplug_settings'); + delete_site_option('woocommerce_payplug_settings'); + + try { + $payplug = new PayplugGateway(); + $api_keys = $payplug->retrieve_user_api_keys($email, $password); + if (is_wp_error($api_keys)) { + $this->login_wrong_credentials_error(); + } + + $form_fields = $payplug->get_form_fields(); + $merchant_id = isset($api_keys['test']) ? $payplug->retrieve_merchant_id($api_keys['test']) : ''; + + foreach ($form_fields as $key => $field) { + if (in_array($field['type'], ['title', 'login'])) { + continue; + } + + switch ($key) { + case 'enabled': + $val = 'yes'; + + break; + + case 'mode': + $val = 'no'; + + break; + + case 'payplug_test_key': + $val = !empty($api_keys['test']) ? esc_attr($api_keys['test']) : null; + + break; + + case 'payplug_live_key': + $val = !empty($api_keys['live']) ? esc_attr($api_keys['live']) : null; + + break; + + case 'payplug_merchant_id': + $val = esc_attr($merchant_id); + + break; + + case 'email': + $val = esc_html($email); + + break; + + default: + $val = $payplug->get_option($key); + } + + $data[$key] = $val; + } + + $payplug->set_post_data($data); + update_option( + $payplug->get_option_key(), + apply_filters('woocommerce_settings_api_sanitized_fields_' . $payplug->id, $data) + ); + + $user = [ + 'logged' => true, + 'email' => $email, + 'mode' => PayplugWoocommerceHelper::check_mode() ? 0 : 1, + ]; + $wp = [ + 'WP' => [ + '_wpnonce' => $wp_nonce, + ], + ]; + + wp_send_json_success(['settings' => $user + $wp] + ( new Vue() )->init()); + } catch (HttpException $e) { + $this->login_wrong_credentials_error(); + } + } + + /** + * Ajax payplug initialisation. + * + * @return JSON + */ + public function payplug_init() + { + $wp_nonce = wp_create_nonce(); + + $wp = [ + 'logged' => PayplugWoocommerceHelper::user_logged_in(), + 'mode' => PayplugWoocommerceHelper::check_mode() ? 0 : 1, + 'WP' => [ + '_wpnonce' => $wp_nonce, + ], + ]; + + return wp_send_json_success([ + 'settings' => $wp, + ] + ( new Vue() )->init()); + } + + /** + * @return bool|null + */ + public function payplug_logout() + { + PayplugWoocommerceHelper::payplug_logout(); + $wp = [ + 'logged' => PayplugWoocommerceHelper::user_logged_in(), + 'mode' => PayplugWoocommerceHelper::check_mode() ? 0 : 1, + ]; + + http_response_code(200); + wp_send_json_success([ + 'message' => __('Successfully logged out.', 'payplug'), + 'status' => ( new Vue() )->payplug_section_status(), + 'settings' => $wp, + 'subscribe' => ( new Vue() )->payplug_section_subscribe(), // When Logging out the Status Block needs to be updated + ]); + } + + /** + * Save data from request. + */ + public function payplug_save_data(WP_REST_Request $request) + { + $payplug = new PayplugGateway(); + $options = $payplug->settings; + if (PayplugWoocommerceHelper::user_logged_in()) { + $data = json_decode(file_get_contents('php://input'), true); + + $options['enabled'] = Validator::enabled($data['payplug_enable']); + $options['mode'] = Validator::mode($data['payplug_sandbox']); + + $test_mode = 'yes' === $options['mode'] ? false : true; + + $options['title'] = trim(wp_strip_all_tags($data['standard_payment_title'])); + $options['description'] = trim(wp_strip_all_tags($data['standard_payment_description'])); + $options['payment_method'] = (Validator::payment_method($data['payplug_embeded'])) ? $data['payplug_embeded'] : $options['payplug_embeded']; + $options['oneclick'] = Validator::oneclick($data['enable_one_click']); + + $options['oney'] = Validator::oney($data['enable_oney']); + $options['payplug'] = Validator::genericPaymentGateway($data['enable_standard'], 'Payplug', false); + $options['bancontact'] = Validator::genericPaymentGateway($data['enable_bancontact'], 'Bancontact', $test_mode); + + $options['apple_pay'] = Validator::genericPaymentGateway($data['enable_applepay'], 'Apple Pay', $test_mode); + $options['applepay_carriers'] = (!empty($data['applepay_carriers'])) ? $data['applepay_carriers'] : []; + $options['applepay_checkout'] = Validator::genericPaymentGateway($data['enable_applepay_checkout'], 'Apple Pay Checkout', $test_mode); + $options['applepay_cart'] = Validator::genericPaymentGateway($data['enable_applepay_cart'], 'Apple Pay Cart', $test_mode); + $options['applepay_product'] = Validator::genericPaymentGateway($data['enable_applepay_product'], 'Apple Pay Product', $test_mode); + + Validator::applePayPaymentGatewayOptions($options['apple_pay'], $options['applepay_cart'], $options['applepay_product'], $options['applepay_checkout'], $options['applepay_carriers']); + if (('yes' === $options['apple_pay']) && ('no' === $options['applepay_checkout']) && ('no' === $options['applepay_cart']) && ('no' === $options['applepay_product'])) { + $options['applepay_checkout'] = 'yes'; + } + + $options['american_express'] = Validator::genericPaymentGateway($data['enable_american_express'], 'American Express', $test_mode); + $options['satispay'] = Validator::genericPaymentGateway($data['enable_satispay'], 'Satispay', $test_mode); + $options['ideal'] = Validator::genericPaymentGateway($data['enable_ideal'], 'iDEAL', $test_mode); + $options['mybank'] = Validator::genericPaymentGateway($data['enable_mybank'], 'Mybank', $test_mode); + $options['oney_type'] = (Validator::oney_type($data['payplug_oney'])) ? $data['payplug_oney'] : 'with_fees'; + $thresholds = (Validator::oney_thresholds($data['oney_min_amounts'], $data['oney_max_amounts'])); + $options['oney_thresholds_min'] = $thresholds['min']; + $options['oney_thresholds_max'] = $thresholds['max']; + $options['oney_product_animation'] = Validator::oney_product_animation($data['enable_oney_product_animation']); + $options['debug'] = Validator::debug($data['enable_debug']); + + //force save + if (update_option('woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options), false)) { + //delete the transient, so it refresh the permissions on the init + $transient_key = PayplugWoocommerceHelper::get_transient_key($options); + delete_transient($transient_key); + + http_response_code(200); + wp_send_json_success([ + 'title' => null, + 'msg' => __('payplug_save_success_message', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]); + } else { + http_response_code(200); + wp_send_json_error([ + 'title' => null, + 'close' => __('payplug_ok', 'payplug'), + 'msg' => 'These settings are already saved !', ]); + } + } else { + http_response_code(403); + wp_send_json_error('You are not logged in !'); + } + } + + public function payplug_check_requirements() + { + wp_send_json_success([ + 'status' => ( new Vue() )->payplug_section_status(), + ]); + } + + public function api_check_integrated_payment(WP_REST_Request $request) + { + $account = $this->generic_get_account($request, true); + + if (!isset($account['httpResponse']['permissions']['can_use_integrated_payments']) + || !$account['httpResponse']['permissions']['can_use_integrated_payments']) { + wp_send_json_error([ + 'title' => __('payplug_enable_feature', 'payplug'), + 'msg' => __('payplug_integrated_access_error', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]); + } + + wp_send_json_success(true); + + return true; + } + + /** + * Update PayPlug api keys + *&. + * + * @param array $keys + * @param PayplugGateway $payplug_gateway + * + * @return bool + */ + protected function update_api_keys($keys, $payplug_gateway) + { + if (empty($payplug_gateway->settings)) { + $payplug_gateway->init_settings(); + } + + $payplug_gateway->settings['payplug_test_key'] = $keys['test']; + $payplug_gateway->settings['payplug_live_key'] = $keys['live']; + if (!empty($keys['live'])) { + $payplug_gateway->settings['mode'] = 'yes'; + } + + return update_option( + $payplug_gateway->get_option_key(), + apply_filters( + 'woocommerce_settings_api_sanitized_fields_' . $payplug_gateway->id, + $payplug_gateway->settings + ), + 'yes' + ); + } + + private function generic_get_account($request, $enable_on_test_mode) + { + $data = $request->get_params(); + + if (isset($data['env']) && $data['env']) { + if ($enable_on_test_mode) { + wp_send_json_success(true); + } else { + $this->optionUnnavailableInTestMode(); + } + } + + $this->accountIsNotValid(); + + $live_key = PayplugWoocommerceHelper::get_live_key(); + + if (empty($live_key)) { + return false; + } + + try { + $account = Authentication::getAccount(new Payplug($live_key)); + } catch (PayplugException $e) { + PayplugGateway::log('Error while saving account : ' . $e->getMessage(), 'error'); + + return false; + } + + return $account; + } + + /** + * Response Json Error WP Format for wrong credentials. + */ + private function login_wrong_credentials_error() + { + wp_send_json_error(['message' => __('payplug_error_wrong_credentials', 'payplug')]); + } + + private function accountIsNotValid() + { + $live_key = PayplugWoocommerceHelper::get_live_key(); + if (empty($live_key)) { + wp_send_json_error([ + 'title' => __('payplug_enable_feature', 'payplug'), + 'msg' => __('Your account does not support LIVE mode at the moment, it must be validated first. If your account has already been validated, please log out and log in again.', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]); + } + } + + private function optionUnnavailableInTestMode() + { + wp_send_json_error([ + 'title' => __('payplug_enable_feature', 'payplug'), + 'msg' => __('payplug_unavailable_testmode_description', 'payplug'), + ]); + } } diff --git a/src/Admin/Metabox.php b/src/Admin/Metabox.php index 7718020a..5faa0981 100644 --- a/src/Admin/Metabox.php +++ b/src/Admin/Metabox.php @@ -3,8 +3,8 @@ namespace Payplug\PayplugWoocommerce\Admin; // Exit if accessed directly -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; @@ -13,109 +13,117 @@ /** * PayPlug metadata metabox. - * - * @package Payplug\PayplugWoocommerce\Admin */ -class Metabox { - - /** - * Metabox constructor. - */ - public function __construct() { - add_action( 'add_meta_boxes', [ $this, 'register_payplug_metabox' ], 100 ); - } - - /** - * Register a custom metabox to display metadata for the current order. - * - * This metabox is only register if the current order has been paid via PayPlug. - */ - public function register_payplug_metabox() { - global $post; - - $screen = class_exists( '\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' ) && wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() - ? function_exists("wc_get_page_screen_id") ? wc_get_page_screen_id( 'shop-order' ) : "shop_order" - : 'shop_order'; - - add_meta_box( - 'payplug-transaction-details', - __( 'PayPlug payment details', 'payplug' ), - [ $this, 'render' ], - $screen, - 'side' - ); - } - - /** - * Render the metabox content. - * - * @param WP_Post $post - */ - public function render( $post ) { - - $order = ( $post instanceof WP_Post ) ? wc_get_order( $post->ID ) : $post; - - if ( false === $order ) { - return; - } - - if( !in_array($order->get_payment_method(), ['payplug', 'oney_x3_with_fees', 'oney_x4_with_fees', 'oney_x3_without_fees', 'oney_x4_without_fees','bancontact', 'apple_pay', 'american_express', 'satispay', 'sofort', 'ideal', 'mybank'])){ - return; - } - - $metadata = PayplugWoocommerceHelper::get_transaction_metadata( $order ); - $date_format = get_option( 'date_format', 'j F Y' ); - $time_format = get_option( 'time_format', 'G \h i \m\i\n' ); - if ( empty( $metadata ) ) : ?> -

    - +class Metabox +{ + /** + * Metabox constructor. + */ + public function __construct() + { + add_action('add_meta_boxes', [$this, 'register_payplug_metabox'], 100); + } + + /** + * Register a custom metabox to display metadata for the current order. + * + * This metabox is only register if the current order has been paid via PayPlug. + */ + public function register_payplug_metabox() + { + global $post; + + $screen = class_exists('\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController') && wc_get_container()->get(CustomOrdersTableController::class)->custom_orders_table_usage_is_enabled() + ? function_exists('wc_get_page_screen_id') ? wc_get_page_screen_id('shop-order') : 'shop_order' + : 'shop_order'; + + add_meta_box( + 'payplug-transaction-details', + __('PayPlug payment details', 'payplug'), + [$this, 'render'], + $screen, + 'side' + ); + } + + /** + * Render the metabox content. + * + * @param WP_Post $post + */ + public function render($post) + { + $order = ($post instanceof WP_Post) ? wc_get_order($post->ID) : $post; + + if (false === $order) { + return; + } + + if (!in_array($order->get_payment_method(), ['payplug', 'oney_x3_with_fees', 'oney_x4_with_fees', 'oney_x3_without_fees', 'oney_x4_without_fees', 'bancontact', 'apple_pay', 'american_express', 'satispay', 'sofort', 'ideal', 'mybank'])) { + return; + } + + $metadata = PayplugWoocommerceHelper::get_transaction_metadata($order); + $date_format = get_option('date_format', 'j F Y'); + $time_format = get_option('time_format', 'G \h i \m\i\n'); + if (empty($metadata)) { ?> +

    + - options = PayplugWoocommerceHelper::get_payplug_options(); + //add_action( 'admin_notices', [ $this, 'admin_notices' ] ); + //add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] ); + } - public function __construct() { - $this->options = PayplugWoocommerceHelper::get_payplug_options(); - //add_action( 'admin_notices', [ $this, 'admin_notices' ] ); - //add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] ); - } - - /** + /** * Enqueue PayPlug notice style. - * - * @return void - */ - public function admin_enqueue_scripts() { - - $payplug_test_key = ! empty( $this->options['payplug_test_key'] ) ? $this->options['payplug_test_key'] : ''; - $payplug_live_key = ! empty( $this->options['payplug_live_key'] ) ? $this->options['payplug_live_key'] : ''; - if ( empty( $payplug_test_key ) && empty( $payplug_live_key ) ) { - wp_enqueue_style( - 'payplug-notice', - PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/notice.css', - [], - PAYPLUG_GATEWAY_VERSION - ); - } - } + */ + public function admin_enqueue_scripts() + { + $payplug_test_key = !empty($this->options['payplug_test_key']) ? $this->options['payplug_test_key'] : ''; + $payplug_live_key = !empty($this->options['payplug_live_key']) ? $this->options['payplug_live_key'] : ''; + if (empty($payplug_test_key) && empty($payplug_live_key)) { + wp_enqueue_style( + 'payplug-notice', + PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/notice.css', + [], + PAYPLUG_GATEWAY_VERSION + ); + } + } - /** - * Display admin notices. - * - * @return void - */ - public function admin_notices() { - if ( ! current_user_can( 'manage_woocommerce' ) ) { - return; - } + /** + * Display admin notices. + */ + public function admin_notices() + { + if (!current_user_can('manage_woocommerce')) { + return; + } - /* - * Before Woocommerce 3.2.x, settings were saved just before displaying the page - * which cause the admin_notice to display old data. - * - * This condition check if we are on the PayPlug gateway settings page and if we - * have new settings to save. If true we hook the notice to a hook which will run after the new - * settings have been saved. - */ - $screen = get_current_screen(); - $wc = function_exists( 'WC' ) ? WC() : $GLOBALS['woocommerce']; + /* + * Before Woocommerce 3.2.x, settings were saved just before displaying the page + * which cause the admin_notice to display old data. + * + * This condition check if we are on the PayPlug gateway settings page and if we + * have new settings to save. If true we hook the notice to a hook which will run after the new + * settings have been saved. + */ + $screen = get_current_screen(); + $wc = function_exists('WC') ? WC() : $GLOBALS['woocommerce']; - if ( - version_compare( $wc->version, '3.2.0', '<' ) - && ! empty( $_POST ) - && 'woocommerce_page_wc-settings' === $screen->id - && isset( $_GET['section'] ) - && 'payplug' === $_GET['section'] - ) { - add_action( 'woocommerce_settings_saved', [ $this, 'display_notice' ] ); + if ( + version_compare($wc->version, '3.2.0', '<') + && !empty($_POST) + && 'woocommerce_page_wc-settings' === $screen->id + && isset($_GET['section']) + && 'payplug' === $_GET['section'] + ) { + add_action('woocommerce_settings_saved', [$this, 'display_notice']); - return; - } + return; + } - $this->display_notice(); - } + $this->display_notice(); + } - public function display_notice() { - $testmode = ( isset( $this->options['mode'] ) && 'no' === $this->options['mode'] ) ? true : false; - $payplug_test_key = ! empty( $this->options['payplug_test_key'] ) ? $this->options['payplug_test_key'] : ''; - $payplug_live_key = ! empty( $this->options['payplug_live_key'] ) ? $this->options['payplug_live_key'] : ''; + public function display_notice() + { + $testmode = (isset($this->options['mode']) && 'no' === $this->options['mode']) ? true : false; + $payplug_test_key = !empty($this->options['payplug_test_key']) ? $this->options['payplug_test_key'] : ''; + $payplug_live_key = !empty($this->options['payplug_live_key']) ? $this->options['payplug_live_key'] : ''; - if ( empty( $payplug_test_key ) && empty( $payplug_live_key ) ) { - ?> + if (empty($payplug_test_key) && empty($payplug_live_key)) { + ?>
    -

    +


    - +

    - + PayPlug logo
    + } elseif (!empty($payplug_test_key) && empty($payplug_live_key)) { + ?>
    -

    -

    +

    +

    + } elseif (!empty($payplug_live_key) && $testmode) { + ?>
    -

    +

    is_payplug_settings_page()) { - return; - } - - // Check if we have the client_id and company_id parameters - if (isset($_GET['client_id']) && isset($_GET['company_id'])) { - - $client_id = sanitize_text_field($_GET['client_id']); - $company_id = sanitize_text_field($_GET['company_id']); - - $this->process_setup_credentials($client_id, $company_id); - - try { - // Generate a code verifier - $code_verifier = bin2hex(openssl_random_pseudo_bytes(50)); - - set_transient('payplug_code_verifier', $code_verifier, 3600); // Expires in 1 hour - - $oauth_callback_uri = admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug'); - - // Store the redirect URI in a transient for the callback - set_transient('payplug_oauth_callback_uri', $oauth_callback_uri, 3600); - - // Initiate OAuth flow using the PayPlug library - Authentication::initiateOAuth($client_id, $oauth_callback_uri, $code_verifier); - - // This function will perform the redirect and exit - - } catch (Exception $e) { - PayplugGateway::log(sprintf('OAuth initiation error: %s', $e->getMessage()), 'error'); - // Redirect back to settings page with error - wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug')); - exit; - } - } - - // Display success message if setup was successful - if (isset($_GET['setup_success']) && $_GET['setup_success'] == '1') { - add_action('admin_notices', function() { - echo '
    ' . - '

    ' . esc_html__('PayPlug account successfully connected!', 'payplug') . '

    ' . - '
    '; - }); - } - - // Display error message if setup failed - if (isset($_GET['setup_error'])) { - add_action('admin_notices', function() { - $error_type = sanitize_text_field($_GET['setup_error']); - $error_message = ''; - - switch ($error_type) { - case 'oauth_init': - $error_message = __('Failed to initiate OAuth authentication. Please try again.', 'payplug'); - break; - case 'token_exchange': - $error_message = __('Failed to exchange authorization code for access token.', 'payplug'); - break; - default: - $error_message = __('An error occurred during authentication.', 'payplug'); - } - - echo '
    ' . - '

    ' . esc_html($error_message) . '

    ' . - '
    '; - }); - } - } - - /** - * Handle the OAuth callback - */ - public function handle_oauth_callback() { - if (!isset($_GET['code'])) { - return; - } - $authorization_code = sanitize_text_field($_GET['code']); - - $code_verifier = get_transient('payplug_code_verifier'); - $callback_uri = get_transient('payplug_oauth_callback_uri'); - - $settings = PayplugWoocommerceHelper::get_payplug_options(); - $client_id = isset($settings['client_data']['client_id']) ? $settings['client_data']['client_id'] : ''; - - if (empty($code_verifier) || empty($callback_uri) || empty($client_id)) { - PayplugGateway::log('Missing OAuth parameters for token exchange', 'error'); - wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug')); - exit; - } - - try { - $jwt_response = Authentication::generateJWTOneShot( - $authorization_code, - $callback_uri, - $client_id, - $code_verifier - ); - - - if (empty($jwt_response) || !isset($jwt_response['httpResponse']) || !isset($jwt_response['httpResponse']['access_token'])) { - PayplugGateway::log('Failed to obtain access token from authorization code', 'error'); - wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug&setup_error=token_exchange')); - exit; - } - - // Get the tokens from the response - $access_token = $jwt_response['httpResponse']['access_token']; - - // Update settings with tokens - $settings = PayplugWoocommerceHelper::get_payplug_options(); - - $id_token = $jwt_response['httpResponse']['id_token']; - $id_token_split = explode('.', $id_token); - $payload = base64_decode($id_token_split[1]); - $payload_decode = json_decode($payload, true); - - $email = isset($payload_decode['email']) ? $payload_decode['email'] : ''; - - Payplug::init(['secretKey' => $access_token]); - - $company_id = PayplugWooCommerceHelper::get_payplug_options()['client_data']['company_id']; - - $auth_live = Authentication::createClientIdAndSecret($company_id, "WooCommerce", "live"); - $auth_test = Authentication::createClientIdAndSecret($company_id, "WooCommerce", "test"); - - if (!empty($auth_live['httpResponse']) ) { - $settings['client_data']['live']['client_secret'] = $auth_live['httpResponse']['client_secret']; - $settings['client_data']['live']['client_id'] = $auth_live['httpResponse']['client_id']; - } - - if (!empty($auth_test['httpResponse']) ) { - $settings['client_data']['test']['client_secret'] = $auth_test['httpResponse']['client_secret']; - $settings['client_data']['test']['client_id'] = $auth_test['httpResponse']['client_id']; - } - - - $payplug = new PayplugGateway(); - - update_option( - $payplug->get_option_key(), - apply_filters('woocommerce_settings_api_sanitized_fields_' . $payplug->id, $settings) - ); - - $payplug->tmp_generate_jwt(); - - $settings = PayplugWoocommerceHelper::get_payplug_options(); - $merchant_id = $payplug->retrieve_merchant_id($settings['client_data']['jwt']['test']['access_token']); - - // Save settings - $form_fields = $payplug->get_form_fields(); - - foreach ($form_fields as $key => $field) { - if (in_array($field['type'], ['title', 'login'])) { - continue; - } - - switch ($key) { - case 'enabled': - $val = 'yes'; - break; - case 'mode': - $val = 'no'; - break; - case 'payplug_test_key': - $val = !empty($api_keys['test']) ? esc_attr($api_keys['test']) : null; - break; - case 'payplug_live_key': - $val = !empty($api_keys['live']) ? esc_attr($api_keys['live']) : null; - break; - case 'email': - $val = esc_html($email); - break; - case 'payplug_merchant_id': - $val = esc_attr($merchant_id); - break; - default: - $val = $payplug->get_option($key); - } - - $settings[$key] = $val; - } - - - $payplug->set_post_data($settings); - update_option( - $payplug->get_option_key(), - apply_filters('woocommerce_settings_api_sanitized_fields_' . $payplug->id, $settings) - ); - - // Clean up transients - delete_transient('payplug_code_verifier'); - delete_transient('payplug_oauth_callback_uri'); - - PayplugGateway::log('Successfully obtained and stored access token'); - - // Redirect to success page - wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug')); - exit; - - } catch (Exception $e) { - PayplugGateway::log(sprintf('Token exchange error: %s', $e->getMessage()), 'error'); - wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug')); - exit; - } - } - - /** - * Check if we're on the PayPlug settings page - */ - private function is_payplug_settings_page() { - return is_admin() && - isset($_GET['page']) && $_GET['page'] === 'wc-settings' && - isset($_GET['tab']) && $_GET['tab'] === 'checkout' && - isset($_GET['section']) && $_GET['section'] === 'payplug'; - } - - /** - * Process the setup credentials - */ - private function process_setup_credentials($client_id, $company_id) { - // Get the current PayPlug settings - $settings = PayplugWoocommerceHelper::get_payplug_options(); - - // Initialize auth array if it doesn't exist - if (!isset($settings['client_data'])) { - $settings['client_data'] = array(); - } - - // Update the settings with the new credentials - $settings['client_data']['client_id'] = $client_id; - $settings['client_data']['company_id'] = $company_id; - - // Save the updated settings - update_option('woocommerce_payplug_settings', $settings); - - // Log the successful connection - PayplugGateway::log(sprintf('PayPlug Setup: Received client_id %s and company_id %s', - substr($client_id, 0, 6) . '***', - substr($company_id, 0, 6) . '***' - )); - } +class SetupCallback +{ + /** + * Initialize the handler. + */ + public function __construct() + { + add_action('admin_init', [$this, 'handle_setup_callback'], 5); + add_action('admin_init', [$this, 'handle_oauth_callback'], 5); + } + + /** + * Handle the setup callback from PayPlug Portal. + */ + public function handle_setup_callback() + { + // Check if we're on the PayPlug settings page + if (!$this->is_payplug_settings_page()) { + return; + } + + // Check if we have the client_id and company_id parameters + if (isset($_GET['client_id'], $_GET['company_id'])) { + $client_id = sanitize_text_field($_GET['client_id']); + $company_id = sanitize_text_field($_GET['company_id']); + + $this->process_setup_credentials($client_id, $company_id); + + try { + // Generate a code verifier + $code_verifier = bin2hex(openssl_random_pseudo_bytes(50)); + + set_transient('payplug_code_verifier', $code_verifier, 3600); // Expires in 1 hour + + $oauth_callback_uri = admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug'); + + // Store the redirect URI in a transient for the callback + set_transient('payplug_oauth_callback_uri', $oauth_callback_uri, 3600); + + // Initiate OAuth flow using the PayPlug library + Authentication::initiateOAuth($client_id, $oauth_callback_uri, $code_verifier); + + // This function will perform the redirect and exit + } catch (Exception $e) { + PayplugGateway::log(sprintf('OAuth initiation error: %s', $e->getMessage()), 'error'); + // Redirect back to settings page with error + wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug')); + + exit; + } + } + + // Display success message if setup was successful + if (isset($_GET['setup_success']) && '1' == $_GET['setup_success']) { + add_action('admin_notices', function () { + echo '
    ' . + '

    ' . esc_html__('PayPlug account successfully connected!', 'payplug') . '

    ' . + '
    '; + }); + } + + // Display error message if setup failed + if (isset($_GET['setup_error'])) { + add_action('admin_notices', function () { + $error_type = sanitize_text_field($_GET['setup_error']); + $error_message = ''; + + switch ($error_type) { + case 'oauth_init': + $error_message = __('Failed to initiate OAuth authentication. Please try again.', 'payplug'); + + break; + + case 'token_exchange': + $error_message = __('Failed to exchange authorization code for access token.', 'payplug'); + + break; + + default: + $error_message = __('An error occurred during authentication.', 'payplug'); + } + + echo '
    ' . + '

    ' . esc_html($error_message) . '

    ' . + '
    '; + }); + } + } + + /** + * Handle the OAuth callback. + */ + public function handle_oauth_callback() + { + if (!isset($_GET['code'])) { + return; + } + $authorization_code = sanitize_text_field($_GET['code']); + + $code_verifier = get_transient('payplug_code_verifier'); + $callback_uri = get_transient('payplug_oauth_callback_uri'); + + $settings = PayplugWoocommerceHelper::get_payplug_options(); + $client_id = isset($settings['client_data']['client_id']) ? $settings['client_data']['client_id'] : ''; + + if (empty($code_verifier) || empty($callback_uri) || empty($client_id)) { + PayplugGateway::log('Missing OAuth parameters for token exchange', 'error'); + wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug')); + + exit; + } + + try { + $jwt_response = Authentication::generateJWTOneShot( + $authorization_code, + $callback_uri, + $client_id, + $code_verifier + ); + + if (empty($jwt_response) || !isset($jwt_response['httpResponse']) || !isset($jwt_response['httpResponse']['access_token'])) { + PayplugGateway::log('Failed to obtain access token from authorization code', 'error'); + wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug&setup_error=token_exchange')); + + exit; + } + + // Get the tokens from the response + $access_token = $jwt_response['httpResponse']['access_token']; + + // Update settings with tokens + $settings = PayplugWoocommerceHelper::get_payplug_options(); + + $id_token = $jwt_response['httpResponse']['id_token']; + $id_token_split = explode('.', $id_token); + $payload = base64_decode($id_token_split[1]); + $payload_decode = json_decode($payload, true); + + $email = isset($payload_decode['email']) ? $payload_decode['email'] : ''; + + Payplug::init(['secretKey' => $access_token]); + + $company_id = PayplugWooCommerceHelper::get_payplug_options()['client_data']['company_id']; + + $auth_live = Authentication::createClientIdAndSecret($company_id, 'WooCommerce', 'live'); + $auth_test = Authentication::createClientIdAndSecret($company_id, 'WooCommerce', 'test'); + + if (!empty($auth_live['httpResponse'])) { + $settings['client_data']['live']['client_secret'] = $auth_live['httpResponse']['client_secret']; + $settings['client_data']['live']['client_id'] = $auth_live['httpResponse']['client_id']; + } + + if (!empty($auth_test['httpResponse'])) { + $settings['client_data']['test']['client_secret'] = $auth_test['httpResponse']['client_secret']; + $settings['client_data']['test']['client_id'] = $auth_test['httpResponse']['client_id']; + } + + $payplug = new PayplugGateway(); + + update_option( + $payplug->get_option_key(), + apply_filters('woocommerce_settings_api_sanitized_fields_' . $payplug->id, $settings) + ); + + $payplug->tmp_generate_jwt(); + + $settings = PayplugWoocommerceHelper::get_payplug_options(); + $merchant_id = $payplug->retrieve_merchant_id($settings['client_data']['jwt']['test']['access_token']); + + // Save settings + $form_fields = $payplug->get_form_fields(); + + foreach ($form_fields as $key => $field) { + if (in_array($field['type'], ['title', 'login'])) { + continue; + } + + switch ($key) { + case 'enabled': + $val = 'yes'; + + break; + + case 'mode': + $val = 'no'; + + break; + + case 'payplug_test_key': + $val = !empty($api_keys['test']) ? esc_attr($api_keys['test']) : null; + + break; + + case 'payplug_live_key': + $val = !empty($api_keys['live']) ? esc_attr($api_keys['live']) : null; + + break; + + case 'email': + $val = esc_html($email); + + break; + + case 'payplug_merchant_id': + $val = esc_attr($merchant_id); + + break; + + default: + $val = $payplug->get_option($key); + } + + $settings[$key] = $val; + } + + $payplug->set_post_data($settings); + update_option( + $payplug->get_option_key(), + apply_filters('woocommerce_settings_api_sanitized_fields_' . $payplug->id, $settings) + ); + + // Clean up transients + delete_transient('payplug_code_verifier'); + delete_transient('payplug_oauth_callback_uri'); + + PayplugGateway::log('Successfully obtained and stored access token'); + + // Redirect to success page + wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug')); + + exit; + } catch (Exception $e) { + PayplugGateway::log(sprintf('Token exchange error: %s', $e->getMessage()), 'error'); + wp_safe_redirect(admin_url('admin.php?page=wc-settings&tab=checkout§ion=payplug')); + + exit; + } + } + + /** + * Check if we're on the PayPlug settings page. + */ + private function is_payplug_settings_page() + { + return is_admin() + && isset($_GET['page']) && 'wc-settings' === $_GET['page'] + && isset($_GET['tab']) && 'checkout' === $_GET['tab'] + && isset($_GET['section']) && 'payplug' === $_GET['section']; + } + + /** + * Process the setup credentials. + * + * @param mixed $client_id + * @param mixed $company_id + */ + private function process_setup_credentials($client_id, $company_id) + { + // Get the current PayPlug settings + $settings = PayplugWoocommerceHelper::get_payplug_options(); + + // Initialize auth array if it doesn't exist + if (!isset($settings['client_data'])) { + $settings['client_data'] = []; + } + + // Update the settings with the new credentials + $settings['client_data']['client_id'] = $client_id; + $settings['client_data']['company_id'] = $company_id; + + // Save the updated settings + update_option('woocommerce_payplug_settings', $settings); + + // Log the successful connection + PayplugGateway::log(sprintf( + 'PayPlug Setup: Received client_id %s and company_id %s', + substr($client_id, 0, 6) . '***', + substr($company_id, 0, 6) . '***' + )); + } } diff --git a/src/Admin/Validator.php b/src/Admin/Validator.php index f6190a63..246a6e98 100644 --- a/src/Admin/Validator.php +++ b/src/Admin/Validator.php @@ -2,175 +2,178 @@ namespace Payplug\PayplugWoocommerce\Admin; -class Validator { - - public static function enabled($value) { - - if ($value == 1){ - return "yes"; - } - - if ($value == 0){ - return "no"; - } - - http_response_code(400); - wp_send_json_error(['error' => 'enabled is missing']); - } - - public static function mode($value) { - if ($value == 1){ - return "no"; - } - - if ($value == 0){ - return "yes"; - } - - http_response_code(400); - wp_send_json_error(['error' => 'mode is missing']); - } - - public static function payment_method($value) { - - if ( !empty($value) && in_array($value, ['redirect', 'popup', 'integrated']) ) { - return true; - } - - http_response_code(400); - wp_send_json_error(['error' => 'payment_method is missing']); - } - - public static function debug($value) { - - if ($value == 1){ - return "yes"; - } - - if ($value == 0){ - return "no"; - } - - http_response_code(400); - wp_send_json_error(['error' => 'mode is missing']); - - return "no"; - } - - public static function oneclick($value) { - - if ($value == 1){ - return "yes"; - } - - if ($value == 0){ - return "no"; - } - - http_response_code(400); - wp_send_json_error(['error' => 'oneclick is missing']); - } - - public static function genericPaymentGateway($value, $payment, $test_mode) { - - if($test_mode){ - return "no"; - } - - if ($value == 1 || $value){ - return "yes"; - } - - return "no"; - } - - /** - * prevent saving when neither cart and checkout is enabled - * - * @param $cart - * @param $product - * @param $checkout - * @return true - */ - public static function applePayPaymentGatewayOptions($apple_pay, $cart, $product, $checkout, $carriers){ - - if($apple_pay === "no"){ - return true; - } - - if( $cart === "no" && $product === "no" && $checkout === "no" ){ - http_response_code(200); - - $arr = [ - "msg"=>__( 'applepay_cart_checkout_option_validation', 'payplug' ), - "class"=>"error", - "title"=>__( 'applepay_cart_checkout_option_validation_title', 'payplug' ), - "close"=> __( 'payplug_ok', 'payplug' ) - ]; - - wp_send_json_error($arr); - } - - if( ($cart === "yes" || $product === "yes") && empty($carriers)){ - http_response_code(200); - - $arr = [ - "msg"=>__( 'applepay_cart_carrier_enabled', 'payplug' ), - "class"=>"error", - "title"=>__( 'applepay_cart_checkout_option_validation_title', 'payplug' ), - "close"=> __( 'payplug_ok', 'payplug' ) - ]; - - wp_send_json_error($arr); - } - - return true; - - } - - public static function oney($value) { - - if ($value == 1){ - return "yes"; - } - - return "no"; - - http_response_code(400); - wp_send_json_error(['error' => 'oney is missing']); - } - - public static function oney_type($value) { - if (isset($value) && !empty($value)) { - if (in_array($value, ['with_fees', 'without_fees'])) { - return true; - } - } - return false; - } - - public static function oney_thresholds($min, $max) { - - $rmin = 100; - $rmax = 3000; - if( $min > 99 && $min<$max){ - $rmin = $min; - } - - if( $max <= 3000 && $max>$min ){ - $rmax = $max; - } - - return array("min"=>$rmin, "max"=>$rmax); - } - - public static function oney_product_animation($status){ - - if($status){ - return "yes"; - }else{ - return "no"; - } - - } +class Validator +{ + public static function enabled($value) + { + if (1 == $value) { + return 'yes'; + } + + if (0 == $value) { + return 'no'; + } + + http_response_code(400); + wp_send_json_error(['error' => 'enabled is missing']); + } + + public static function mode($value) + { + if (1 == $value) { + return 'no'; + } + + if (0 == $value) { + return 'yes'; + } + + http_response_code(400); + wp_send_json_error(['error' => 'mode is missing']); + } + + public static function payment_method($value) + { + if (!empty($value) && in_array($value, ['redirect', 'popup', 'integrated'])) { + return true; + } + + http_response_code(400); + wp_send_json_error(['error' => 'payment_method is missing']); + } + + public static function debug($value) + { + if (1 == $value) { + return 'yes'; + } + + if (0 == $value) { + return 'no'; + } + + http_response_code(400); + wp_send_json_error(['error' => 'mode is missing']); + + return 'no'; + } + + public static function oneclick($value) + { + if (1 == $value) { + return 'yes'; + } + + if (0 == $value) { + return 'no'; + } + + http_response_code(400); + wp_send_json_error(['error' => 'oneclick is missing']); + } + + public static function genericPaymentGateway($value, $payment, $test_mode) + { + if ($test_mode) { + return 'no'; + } + + if (1 == $value || $value) { + return 'yes'; + } + + return 'no'; + } + + /** + * prevent saving when neither cart and checkout is enabled. + * + * @param $cart + * @param $product + * @param $checkout + * @param mixed $apple_pay + * @param mixed $carriers + * + * @return true + */ + public static function applePayPaymentGatewayOptions($apple_pay, $cart, $product, $checkout, $carriers) + { + if ('no' === $apple_pay) { + return true; + } + + if ('no' === $cart && 'no' === $product && 'no' === $checkout) { + http_response_code(200); + + $arr = [ + 'msg' => __('applepay_cart_checkout_option_validation', 'payplug'), + 'class' => 'error', + 'title' => __('applepay_cart_checkout_option_validation_title', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]; + + wp_send_json_error($arr); + } + + if (('yes' === $cart || 'yes' === $product) && empty($carriers)) { + http_response_code(200); + + $arr = [ + 'msg' => __('applepay_cart_carrier_enabled', 'payplug'), + 'class' => 'error', + 'title' => __('applepay_cart_checkout_option_validation_title', 'payplug'), + 'close' => __('payplug_ok', 'payplug'), + ]; + + wp_send_json_error($arr); + } + + return true; + } + + public static function oney($value) + { + if (1 == $value) { + return 'yes'; + } + + return 'no'; + http_response_code(400); + wp_send_json_error(['error' => 'oney is missing']); + } + + public static function oney_type($value) + { + if (isset($value) && !empty($value)) { + if (in_array($value, ['with_fees', 'without_fees'])) { + return true; + } + } + + return false; + } + + public static function oney_thresholds($min, $max) + { + $rmin = 100; + $rmax = 3000; + if ($min > 99 && $min < $max) { + $rmin = $min; + } + + if ($max <= 3000 && $max > $min) { + $rmax = $max; + } + + return ['min' => $rmin, 'max' => $rmax]; + } + + public static function oney_product_animation($status) + { + if ($status) { + return 'yes'; + } + + return 'no'; + } } diff --git a/src/Admin/Vue.php b/src/Admin/Vue.php index 6bfed287..9a872efd 100644 --- a/src/Admin/Vue.php +++ b/src/Admin/Vue.php @@ -2,10 +2,8 @@ namespace Payplug\PayplugWoocommerce\Admin; - use Payplug\PayplugWoocommerce\Admin\Vue\Component; use Payplug\PayplugWoocommerce\Admin\Vue\PaymentMethods; -use Payplug\PayplugWoocommerce\Controller\ApplePay; use Payplug\PayplugWoocommerce\Gateway\PayplugApi; use Payplug\PayplugWoocommerce\Gateway\PayplugGateway; use Payplug\PayplugWoocommerce\Gateway\PayplugGatewayRequirements; @@ -13,570 +11,561 @@ /** * PayPlug admin Vue.js dashboard handler. - * - * @package Payplug\PayplugWoocommerce\Admin */ -class Vue { - - private $options; - - public function __construct() { - $payplug = (new PayplugGateway()); - $this->options = $payplug->settings; - - if ((empty($this->options['oney_thresholds_default_min'])) && (empty($this->options['oney_thresholds_default_max']))) { - $this->options['oney_thresholds_default_min'] = $payplug->min_oney_price; - $this->options['oney_thresholds_default_max'] = $payplug->max_oney_price; - } - } - - /** - * @return array - */ - public function init() { - - if ( PayplugWoocommerceHelper::user_logged_in() ) { - $header = $this->payplug_section_header(); - $logged = $this->payplug_section_logged(); - - - - unset($this->options["payplug_live_key"]); - unset($this->options["payplug_test_key"]); - unset($this->options["payplug_password"]); - unset($this->options["payplug_merchant_id"]); - unset($this->options["client_data"]); - - return [ - "payplug_wooc_settings" => $this->options, - "header" => $header, - "oauth_login" => $this->payplug_section_oauth_login(), - "logged" => $logged, - "payment_methods" => $this->payplug_section_payment_methods($this->options), - "payment_paylater" => $this->payplug_section_paylater(), - "status" => $this->payplug_section_status($this->options), - "footer" => $this->payplug_section_footer(), - ]; - } - - return [ - "header" => $this->payplug_section_header(), - "oauth_login" => $this->payplug_section_oauth_login(), - "subscribe" => $this->payplug_section_subscribe(), - "payment_methods" => $this->payplug_section_payment_methods(), - "payment_paylater" => $this->payplug_section_paylater(), - "status" => $this->payplug_section_status(), - "footer" => $this->payplug_section_footer(), - ]; - } - - /** - * @return array - */ - public function payplug_section_logged() { - - $inactive = false; - if( empty(PayplugWoocommerceHelper::get_live_key()) ){ - $inactive = true; - } - $this->api = new PayplugApi($this); - $callback_uri = get_admin_url( null, '/admin.php?page=wc-settings&tab=checkout§ion=payplug'); - $register_url = $this->api->retrieve_register_url($callback_uri); - - return [ - "title" => __( 'payplug_section_logged_title', 'payplug' ), - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_logged_description', 'payplug' ), - "logout" => __( 'payplug_section_logged_logout', 'payplug' ), - "mode" => __( 'payplug_section_logged_mode', 'payplug' ), - "mode_description" => __( 'payplug_section_logged_live_description', 'payplug' ), - "link_learn_more" => [ - "text" => __( 'payplug_learn_more', 'payplug' ), - "url" => __( 'payplug_mode_learn_more_url', 'payplug' ), - "target" => "_blank" - ], - "link_access_portal" => [ - "text" => __( 'payplug_section_logged_link_access_portal', 'payplug' ), - "url" => "https://portal.payplug.com/", - "target" => "_blank" - ], - ], - "sandbox" => [ - "description" => __( 'payplug_section_logged_description', 'payplug' ), - "logout" => __( 'payplug_section_logged_logout', 'payplug' ), - "mode" => __( 'payplug_section_logged_mode', 'payplug' ), - "mode_description" => __( 'payplug_section_logged_test_description', 'payplug' ), - "link_learn_more" => [ - "text" => __( 'payplug_learn_more', 'payplug' ), - "url" => __( 'payplug_mode_learn_more_url', 'payplug' ), - "target" => "_blank" - ], - "link_access_portal" => [ - "text" => __( 'payplug_section_logged_link_access_portal', 'payplug' ), - "url" => "https://portal.payplug.com/", - "target" => "_blank" - ], - ] - ], - "options" => [ - [ - "name" => "payplug_sandbox", - "label" => "Test", - "value" => 1, //test - "checked" => !PayplugWoocommerceHelper::check_mode() - ], - [ - "name" => "payplug_sandbox", - "label" => "Live", - "value" => 0, //live - "checked" => PayplugWoocommerceHelper::check_mode() - ] - ], - "inactive_modal" => [ - "inactive" => $inactive, - "title" => __( 'payplug_live_mode', 'payplug' ), - "description" => __( 'payplug_section_logged_modal_description', 'payplug' ), - "description_1" => __( 'payplug_section_logged_modal_description_1_uauth', 'payplug' ), - "description_2" => __( 'payplug_section_logged_modal_description_2_uauth', 'payplug' ), - "password_label" => __( 'payplug_section_login_password_label', 'payplug' ), - "cancel" => __( 'payplug_cancel', 'payplug' ), - "ok" => __( 'payplug_ok', 'payplug' ), - "oauth" => __( 'payplug_reconnect', 'payplug' ), - "oauth_url" => $register_url - ], - "inactive_account" => [ - "warning" => [ - "title" => __( 'payplug_inactive_account_warning_title', 'payplug' ), - "description" => __( 'payplug_inactive_account_warning_description1', 'payplug' ) . - __( 'payplug_inactive_account_warning_description2', 'payplug' ) . - __( 'payplug_inactive_account_warning_description3', 'payplug' ), - ], - "error" => [ - "title" => __( 'payplug_inactive_account_error_title', 'payplug' ), - "description" => __( 'payplug_inactive_account_error_description', 'payplug' ), - ] - ], - ]; - } - - - - /** - * @return array[] - */ - public function payplug_section_login() { - - $login = [ - "name" => "generalLogin", - "title" => __( 'payplug_section_logged_title', 'payplug' ), - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_login_description', 'payplug' ), - "not_registered" => __( 'payplug_section_login_not_registered', 'payplug' ), - "connect" => __( 'payplug_section_login_connect', 'payplug' ), - "email_label" => __( 'payplug_section_login_email_label', 'payplug' ), - "email_placeholder" => __( 'payplug_section_login_email_label', 'payplug' ), - "password_label" => __( 'payplug_section_login_password_label', 'payplug' ), - "password_placeholder" => __( 'payplug_section_login_password_label', 'payplug' ), - "link_forgot_password" => [ - "text" => __( 'payplug_section_login_forgot_password', 'payplug' ), - "url" => "https://portal.payplug.com/forgot_password", - "target" => "_blank" - ], - ], - "sandbox" => [ - "description" => __( 'payplug_section_login_description', 'payplug' ), - "not_registered" => __( 'payplug_section_login_not_registered', 'payplug' ), - "connect" => __( 'payplug_section_login_connect', 'payplug' ), - "email_label" => __( 'payplug_section_login_email_label', 'payplug' ), - "email_placeholder" => __( 'payplug_section_login_email_label', 'payplug' ), - "password_label" => __( 'payplug_section_login_password_label', 'payplug' ), - "password_placeholder" => __( 'payplug_section_login_password_label', 'payplug' ), - "link_forgot_password" => [ - "text" => __( 'payplug_section_login_forgot_password', 'payplug' ), - "url" => "https://portal.payplug.com/forgot_password", - "target" => "_blank" - ], - ] - ] - ]; - - return $login; - } - - /** - * @return array[] - */ - public function payplug_section_oauth_login() { - $this->api = new PayplugApi($this); - $callback_uri = get_admin_url( null, '/admin.php?page=wc-settings&tab=checkout§ion=payplug'); - $register_url = $this->api->retrieve_register_url($callback_uri); - - $oauth_login = [ - "name" => "oauthLogin", - "title" => __( 'payplug_section_logged_title', 'payplug' ), - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_oauth_login_description', 'payplug' ), - "form" => [ - "email" => [ - "label" => __( 'payplug_section_login_email_label', 'payplug' ), - "placeholder" => __( 'payplug_section_login_email_label', 'payplug' ) - ], - "password" => [ - "label" => __( 'payplug_section_login_password_label', 'payplug' ), - "placeholder" => __( 'payplug_section_login_password_label', 'payplug' ) - ], - "connexion" => __( 'payplug_section_login_connect', 'payplug' ), - "create_account" => __( 'payplug_section_login_not_registered', 'payplug' ), - "forgot_password" => __( 'payplug_section_login_forgot_password', 'payplug' ), - "error" => __( 'payplug_section_login_error', 'payplug' ), - "create_account_url" => "https://portal.payplug.com/auth/signup", - "forgot_password_url" => "https://portal.payplug.com/forgot_password" - ], - "sso" => [ - "title" => __( 'payplug_section_oauth_login_title', 'payplug' ), - "description" => __( 'payplug_section_oauth_login_description', 'payplug' ), - "information" => __( 'payplug_section_oauth_info', 'payplug' ), - "button" => __( 'payplug_section_oauth_login_btn_connect', 'payplug' ), - "button_url" => $register_url - ] - ], - "sandbox" => [ - "description" => __( 'payplug_section_oauth_login_description', 'payplug' ), - "form" => [ - "email" => [ - "label" => __( 'payplug_section_login_email_label', 'payplug' ), - "placeholder" => __( 'payplug_section_login_email_label', 'payplug' ) - ], - "password" => [ - "label" => __( 'payplug_section_login_password_label', 'payplug' ), - "placeholder" => __( 'payplug_section_login_password_label', 'payplug' ) - ], - "connexion" => __( 'payplug_section_login_connect', 'payplug' ), - "create_account" => __( 'payplug_section_login_not_registered', 'payplug' ), - "forgot_password" => __( 'payplug_section_login_forgot_password', 'payplug' ), - "error" => __( 'payplug_section_login_error', 'payplug' ), - "create_account_url" => "https://portal.payplug.com/auth/signup", - "forgot_password_url" => "https://portal.payplug.com/forgot_password" - ], - "sso" => [ - "title" => __( 'payplug_section_oauth_login_title', 'payplug' ), - "description" => __( 'payplug_section_oauth_login_description', 'payplug' ), - "information" => __( 'payplug_section_oauth_info', 'payplug' ), - "button" => __( 'payplug_section_oauth_login_btn_connect', 'payplug' ), - "button_url" => $register_url - ] - ] - ], - ]; - - return $oauth_login; - } - - /** - * @return array - */ - public function payplug_section_subscribe() { - return [ - "name" => "generalSubscribe", - "title" => __( 'payplug_section_logged_title', 'payplug' ), - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_subscribe_description', 'payplug' ), - "link_create_account" => [ - "text" => __( 'payplug_section_subscribe_link_create_account', 'payplug' ), - "url" => "https://portal.payplug.com/auth/signup", - "target" => "_blank" - ], - "content_description" => __( 'payplug_section_subscribe_content_description', 'payplug' ), - "already_have_account" => __( 'payplug_section_subscribe_already_have_account', 'payplug' ), - ], - "sandbox" => [ - "description" => __( 'payplug_section_subscribe_description', 'payplug' ), - "link_create_account" => [ - "text" => __( 'payplug_section_subscribe_link_create_account', 'payplug' ), - "url" => "https://portal.payplug.com/signup", - "target" => "_blank" - ], - "content_description" => __( 'payplug_section_subscribe_content_description', 'payplug' ), - "already_have_account" => __( 'payplug_section_subscribe_already_have_account', 'payplug' ), - ] - ] - ]; - } - - /** - * @return array - */ - public function payplug_section_header() { - $enable = ( !empty( $this->options['enabled'] ) && $this->options['enabled'] === "yes") ? true : false; - $enable = $enable && $this->payplug_requirements(); - $disabled = !$this->payplug_requirements(); - - return [ - "title" => __( 'payplug_section_header_title', 'payplug' ), - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_header_live_description', 'payplug' ), - "plugin_version" => PAYPLUG_GATEWAY_VERSION - ], - "sandbox" => [ - "description" => __( 'payplug_section_header_test_description', 'payplug' ), - "plugin_version" => PAYPLUG_GATEWAY_VERSION - ], - ], - "options" => [ - "type" => "select", - "name" => "payplug_enable", - "disabled" => $disabled, - "options" => [ - [ - "value" => 1, - "label" => __( 'payplug_section_header_enable_label', 'payplug' ), - "checked" => $enable === true ? true : false - ], - [ - "value" => 0, - "label" => __( 'payplug_section_header_disable_label', 'payplug' ), - "checked" => $enable === false ? true : false - ] - ] - ] - ]; - - } - - /** - * @return array - */ - public function payplug_section_payment_methods($options = array()) { - - $carriers = (!empty($this->options) && !empty($this->options['applepay_carriers'])) ? $this->options['applepay_carriers'] : []; - - $section = [ - "name" => "paymentMethodsBlock", - "title" => __( 'payplug_section_payment_methods_title', 'payplug' ), - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_payment_methods_description', 'payplug' ), - ], - "sandbox" => [ - "description" => __( 'payplug_section_payment_methods_description', 'payplug' ), - ] - ], - "options" => [ - (new PaymentMethods($this->options))->payment_method_standard(), - PaymentMethods::payment_method_amex(!empty($this->options) && $this->options['american_express'] === 'yes'), - PaymentMethods::payment_method_applepay(!empty($this->options) && $this->options['apple_pay'] === 'yes', $this->options, $carriers), - PaymentMethods::payment_method_bancontact(!empty($this->options) && $this->options['bancontact'] === 'yes'), - PaymentMethods::payment_method_satispay(!empty($this->options) && !empty($this->options['satispay']) && $this->options['satispay'] === 'yes'), - PaymentMethods::payment_method_mybank(!empty($options) && !empty($options['mybank']) && $this->options['mybank'] === 'yes'), - PaymentMethods::payment_method_ideal(!empty($this->options) && !empty($this->options['ideal']) && $this->options['ideal'] === 'yes'), - - ] - ]; - - return $section; - } - - /** - * @param $active - * - * @return array - */ - public function payplug_section_paylater() { - - $max = !empty($this->options['oney_thresholds_max']) ? $this->options['oney_thresholds_max'] : 3000; - $min = !empty($this->options['oney_thresholds_min']) ? $this->options['oney_thresholds_min'] : 100; - $product_page = !empty($this->options['oney_product_animation']) && $this->options['oney_product_animation'] === 'yes' ? true : false; - - $section = [ - "name" => "paymentMethodsBlock", - "title" => __( 'payplug_section_paylater_title', 'payplug' ), - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_paylater_description', 'payplug' ), - ], - "sandbox" => [ - "description" => __( 'payplug_section_paylater_description', 'payplug' ), - ] - ], - "options" => [ - "name" => "oney", - "title" => __( 'payplug_section_oney_title', 'payplug' ), - "image" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/lg-oney.png' ), - "checked" => !empty($this->options) && $this->options['oney'] === 'yes', - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_paylater_description_oney', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), "https://support.payplug.com/hc/fr/articles/4408142346002", "_blank"), - ], - "sandbox" => [ - "description" => __( 'payplug_section_paylater_description_oney', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), "https://support.payplug.com/hc/fr/articles/4408142346002", "_blank"), - ], - "advanced" => [ - "description" => __( 'payplug_advanced_settings', 'payplug' ),"" - ] - ], - "options" => [ - [ - "name" => "payplug_oney_type", - "className" => "_paylaterLabel", - "label" => __( 'payplug_label_with_fees', 'payplug' ), - "subText" => __( 'payplug_text_with_fees', 'payplug' ), - "value" => "with_fees", - "checked" => !empty($this->options) && $this->options['oney_type'] === 'with_fees', - ], - [ - "name" => "payplug_oney_type", - "className" => "_paylaterLabel", - "label" => __( 'payplug_label_without_fees', 'payplug' ), - "subText" => __( 'payplug_text_without_fees', 'payplug' ), - "value" => "without_fees", - "checked" => !empty($this->options) && $this->options['oney_type'] === 'without_fees', - ] - ], - "advanced_options" => [ - $this->thresholds_option($max, $min), - $this->show_oney_popup_product($product_page) - ] - ] - ]; - - return $section; - } - - /** - * @return array - */ - public function thresholds_option($max, $min) { - - $thresholds = [ - "name" => "thresholds", - "image_url" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/thresholds.svg' ), - "title" => __( 'payplug_thresholds_oney_title', 'payplug' ), - "descriptions" => [ - "description" => __( 'payplug_thresholds_oney_description', 'payplug' ), - "min_amount" => [ - "name" => "oney_min_amounts", - "value" => $min, - "placeholder" => $min, - "default" => !empty($this->options['oney_thresholds_default_min']) ? $this->options['oney_thresholds_default_min'] : 100 - ], - "inter" => __( 'and', 'payplug' ), - "max_amount" => [ - "name" => "oney_max_amounts", - "value" => $max, - "placeholder" => $max, - "default" => !empty($this->options['oney_thresholds_default_max']) ? $this->options['oney_thresholds_default_max'] : 3000 - ], - "error" => [ - "text" => __( 'payplug_thresholds_error_msg', 'payplug' ), - "maxtext" => __('payplug_thresholds_error_maxtext_msg', 'payplug'), - "mintext" => __('payplug_thresholds_error_mintext_msg', 'payplug'), - ] - ], - "switch" => false - ]; - - return $thresholds; - } - - /** - * @param $active - * - * @return array - */ - public function show_oney_popup_product($active = false) { - return [ - "name" => "oney_product_animation", - "image_url" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/product.svg' ), - "title" => __( 'display_the_oney_installments_pop_up_on_the_product_page', 'payplug' ), - "descriptions" => [[ - "description" => __( 'payplug_oney_product_page_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), "https://support.payplug.com/hc/fr/articles/4408142346002", "_blank") - ]], - "switch" => true, - "checked" => $active - ]; - } - - - /** - * @return array - */ - public function payplug_section_status( $options = [] ) { - $payplug_requirements = new PayplugGatewayRequirements(new PayplugGateway()); - $checked = !empty($options['debug']) && $options['debug'] === 'yes' ? true : false; - - $status = [ - "error" => !$this->payplug_requirements(), - "title" => __("payplug_section_status_title", "payplug"), - "descriptions" => [ - "live" => [ - "description" => __("payplug_section_status_description", "payplug"), - "errorMessage" => __("payplug_section_status_errorMessage", "payplug"), - "check" => __("payplug_section_status_check", "payplug"), - "check_success" => __("payplug_section_status_check_success", "payplug"), - ], - "sandbox" => [ - "description" => __("payplug_section_status_description", "payplug"), - "errorMessage" => __("payplug_section_status_errorMessage", "payplug"), - "check" => __("payplug_section_status_check", "payplug"), - "check_success" => __("payplug_section_status_check_success", "payplug"), - ] - ], - "requirements" => [ - $payplug_requirements->curl_requirement(), - $payplug_requirements->php_requirement(), - $payplug_requirements->openssl_requirement(), - $payplug_requirements->currency_requirement(), //MISSING THIS MESSAGES - $payplug_requirements->account_requirement(), - ], - "debug" => [ - "live" => [ - "title" => __("payplug_section_status_debug_label", "payplug"), - "description" => __("payplug_section_status_debug_description", "payplug"), - ], - "sandbox" => [ - "title" => __("payplug_section_status_debug_label", "payplug"), - "description" => __("payplug_section_status_debug_description", "payplug"), - ] - ], - "enable_debug_check" => $checked - ]; - - return $status; - } - - /** - * check if there's any requirement missing - * @return bool - */ - private function payplug_requirements() { - $payplug_requirements = new PayplugGatewayRequirements(new PayplugGateway()); - return $payplug_requirements->satisfy_requirements(); - } - - /** - * @return array - */ - public function payplug_section_footer( ) { - return [ - "save_changes_text" => __("payplug_save_changes_text", "payplug"), - "description" => [ - __("payplug_section_help_description1", "payplug"), - __("payplug_section_help_description2", "payplug") - ], - "link_help" => Component::link( - __( 'payplug_section_help_link_help_text', 'payplug' ), - __( 'payplug_section_help_link_help_url', 'payplug' ), - "_blank" - ), - ]; - } - +class Vue +{ + private $options; + + public function __construct() + { + $payplug = (new PayplugGateway()); + $this->options = $payplug->settings; + + if ((empty($this->options['oney_thresholds_default_min'])) && (empty($this->options['oney_thresholds_default_max']))) { + $this->options['oney_thresholds_default_min'] = $payplug->min_oney_price; + $this->options['oney_thresholds_default_max'] = $payplug->max_oney_price; + } + } + + /** + * @return array + */ + public function init() + { + if (PayplugWoocommerceHelper::user_logged_in()) { + $header = $this->payplug_section_header(); + $logged = $this->payplug_section_logged(); + + unset($this->options['payplug_live_key'], $this->options['payplug_test_key'], $this->options['payplug_password'], $this->options['payplug_merchant_id'], $this->options['client_data']); + + return [ + 'payplug_wooc_settings' => $this->options, + 'header' => $header, + 'oauth_login' => $this->payplug_section_oauth_login(), + 'logged' => $logged, + 'payment_methods' => $this->payplug_section_payment_methods($this->options), + 'payment_paylater' => $this->payplug_section_paylater(), + 'status' => $this->payplug_section_status($this->options), + 'footer' => $this->payplug_section_footer(), + ]; + } + + return [ + 'header' => $this->payplug_section_header(), + 'oauth_login' => $this->payplug_section_oauth_login(), + 'subscribe' => $this->payplug_section_subscribe(), + 'payment_methods' => $this->payplug_section_payment_methods(), + 'payment_paylater' => $this->payplug_section_paylater(), + 'status' => $this->payplug_section_status(), + 'footer' => $this->payplug_section_footer(), + ]; + } + + /** + * @return array + */ + public function payplug_section_logged() + { + $inactive = false; + if (empty(PayplugWoocommerceHelper::get_live_key())) { + $inactive = true; + } + $this->api = new PayplugApi($this); + $callback_uri = get_admin_url(null, '/admin.php?page=wc-settings&tab=checkout§ion=payplug'); + $register_url = $this->api->retrieve_register_url($callback_uri); + + return [ + 'title' => __('payplug_section_logged_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_logged_description', 'payplug'), + 'logout' => __('payplug_section_logged_logout', 'payplug'), + 'mode' => __('payplug_section_logged_mode', 'payplug'), + 'mode_description' => __('payplug_section_logged_live_description', 'payplug'), + 'link_learn_more' => [ + 'text' => __('payplug_learn_more', 'payplug'), + 'url' => __('payplug_mode_learn_more_url', 'payplug'), + 'target' => '_blank', + ], + 'link_access_portal' => [ + 'text' => __('payplug_section_logged_link_access_portal', 'payplug'), + 'url' => 'https://portal.payplug.com/', + 'target' => '_blank', + ], + ], + 'sandbox' => [ + 'description' => __('payplug_section_logged_description', 'payplug'), + 'logout' => __('payplug_section_logged_logout', 'payplug'), + 'mode' => __('payplug_section_logged_mode', 'payplug'), + 'mode_description' => __('payplug_section_logged_test_description', 'payplug'), + 'link_learn_more' => [ + 'text' => __('payplug_learn_more', 'payplug'), + 'url' => __('payplug_mode_learn_more_url', 'payplug'), + 'target' => '_blank', + ], + 'link_access_portal' => [ + 'text' => __('payplug_section_logged_link_access_portal', 'payplug'), + 'url' => 'https://portal.payplug.com/', + 'target' => '_blank', + ], + ], + ], + 'options' => [ + [ + 'name' => 'payplug_sandbox', + 'label' => 'Test', + 'value' => 1, //test + 'checked' => !PayplugWoocommerceHelper::check_mode(), + ], + [ + 'name' => 'payplug_sandbox', + 'label' => 'Live', + 'value' => 0, //live + 'checked' => PayplugWoocommerceHelper::check_mode(), + ], + ], + 'inactive_modal' => [ + 'inactive' => $inactive, + 'title' => __('payplug_live_mode', 'payplug'), + 'description' => __('payplug_section_logged_modal_description', 'payplug'), + 'description_1' => __('payplug_section_logged_modal_description_1_uauth', 'payplug'), + 'description_2' => __('payplug_section_logged_modal_description_2_uauth', 'payplug'), + 'password_label' => __('payplug_section_login_password_label', 'payplug'), + 'cancel' => __('payplug_cancel', 'payplug'), + 'ok' => __('payplug_ok', 'payplug'), + 'oauth' => __('payplug_reconnect', 'payplug'), + 'oauth_url' => $register_url, + ], + 'inactive_account' => [ + 'warning' => [ + 'title' => __('payplug_inactive_account_warning_title', 'payplug'), + 'description' => __('payplug_inactive_account_warning_description1', 'payplug') . + __('payplug_inactive_account_warning_description2', 'payplug') . + __('payplug_inactive_account_warning_description3', 'payplug'), + ], + 'error' => [ + 'title' => __('payplug_inactive_account_error_title', 'payplug'), + 'description' => __('payplug_inactive_account_error_description', 'payplug'), + ], + ], + ]; + } + + /** + * @return array[] + */ + public function payplug_section_login() + { + return [ + 'name' => 'generalLogin', + 'title' => __('payplug_section_logged_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_login_description', 'payplug'), + 'not_registered' => __('payplug_section_login_not_registered', 'payplug'), + 'connect' => __('payplug_section_login_connect', 'payplug'), + 'email_label' => __('payplug_section_login_email_label', 'payplug'), + 'email_placeholder' => __('payplug_section_login_email_label', 'payplug'), + 'password_label' => __('payplug_section_login_password_label', 'payplug'), + 'password_placeholder' => __('payplug_section_login_password_label', 'payplug'), + 'link_forgot_password' => [ + 'text' => __('payplug_section_login_forgot_password', 'payplug'), + 'url' => 'https://portal.payplug.com/forgot_password', + 'target' => '_blank', + ], + ], + 'sandbox' => [ + 'description' => __('payplug_section_login_description', 'payplug'), + 'not_registered' => __('payplug_section_login_not_registered', 'payplug'), + 'connect' => __('payplug_section_login_connect', 'payplug'), + 'email_label' => __('payplug_section_login_email_label', 'payplug'), + 'email_placeholder' => __('payplug_section_login_email_label', 'payplug'), + 'password_label' => __('payplug_section_login_password_label', 'payplug'), + 'password_placeholder' => __('payplug_section_login_password_label', 'payplug'), + 'link_forgot_password' => [ + 'text' => __('payplug_section_login_forgot_password', 'payplug'), + 'url' => 'https://portal.payplug.com/forgot_password', + 'target' => '_blank', + ], + ], + ], + ]; + } + + /** + * @return array[] + */ + public function payplug_section_oauth_login() + { + $this->api = new PayplugApi($this); + $callback_uri = get_admin_url(null, '/admin.php?page=wc-settings&tab=checkout§ion=payplug'); + $register_url = $this->api->retrieve_register_url($callback_uri); + + return [ + 'name' => 'oauthLogin', + 'title' => __('payplug_section_logged_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_oauth_login_description', 'payplug'), + 'form' => [ + 'email' => [ + 'label' => __('payplug_section_login_email_label', 'payplug'), + 'placeholder' => __('payplug_section_login_email_label', 'payplug'), + ], + 'password' => [ + 'label' => __('payplug_section_login_password_label', 'payplug'), + 'placeholder' => __('payplug_section_login_password_label', 'payplug'), + ], + 'connexion' => __('payplug_section_login_connect', 'payplug'), + 'create_account' => __('payplug_section_login_not_registered', 'payplug'), + 'forgot_password' => __('payplug_section_login_forgot_password', 'payplug'), + 'error' => __('payplug_section_login_error', 'payplug'), + 'create_account_url' => 'https://portal.payplug.com/auth/signup', + 'forgot_password_url' => 'https://portal.payplug.com/forgot_password', + ], + 'sso' => [ + 'title' => __('payplug_section_oauth_login_title', 'payplug'), + 'description' => __('payplug_section_oauth_login_description', 'payplug'), + 'information' => __('payplug_section_oauth_info', 'payplug'), + 'button' => __('payplug_section_oauth_login_btn_connect', 'payplug'), + 'button_url' => $register_url, + ], + ], + 'sandbox' => [ + 'description' => __('payplug_section_oauth_login_description', 'payplug'), + 'form' => [ + 'email' => [ + 'label' => __('payplug_section_login_email_label', 'payplug'), + 'placeholder' => __('payplug_section_login_email_label', 'payplug'), + ], + 'password' => [ + 'label' => __('payplug_section_login_password_label', 'payplug'), + 'placeholder' => __('payplug_section_login_password_label', 'payplug'), + ], + 'connexion' => __('payplug_section_login_connect', 'payplug'), + 'create_account' => __('payplug_section_login_not_registered', 'payplug'), + 'forgot_password' => __('payplug_section_login_forgot_password', 'payplug'), + 'error' => __('payplug_section_login_error', 'payplug'), + 'create_account_url' => 'https://portal.payplug.com/auth/signup', + 'forgot_password_url' => 'https://portal.payplug.com/forgot_password', + ], + 'sso' => [ + 'title' => __('payplug_section_oauth_login_title', 'payplug'), + 'description' => __('payplug_section_oauth_login_description', 'payplug'), + 'information' => __('payplug_section_oauth_info', 'payplug'), + 'button' => __('payplug_section_oauth_login_btn_connect', 'payplug'), + 'button_url' => $register_url, + ], + ], + ], + ]; + } + + /** + * @return array + */ + public function payplug_section_subscribe() + { + return [ + 'name' => 'generalSubscribe', + 'title' => __('payplug_section_logged_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_subscribe_description', 'payplug'), + 'link_create_account' => [ + 'text' => __('payplug_section_subscribe_link_create_account', 'payplug'), + 'url' => 'https://portal.payplug.com/auth/signup', + 'target' => '_blank', + ], + 'content_description' => __('payplug_section_subscribe_content_description', 'payplug'), + 'already_have_account' => __('payplug_section_subscribe_already_have_account', 'payplug'), + ], + 'sandbox' => [ + 'description' => __('payplug_section_subscribe_description', 'payplug'), + 'link_create_account' => [ + 'text' => __('payplug_section_subscribe_link_create_account', 'payplug'), + 'url' => 'https://portal.payplug.com/signup', + 'target' => '_blank', + ], + 'content_description' => __('payplug_section_subscribe_content_description', 'payplug'), + 'already_have_account' => __('payplug_section_subscribe_already_have_account', 'payplug'), + ], + ], + ]; + } + + /** + * @return array + */ + public function payplug_section_header() + { + $enable = (!empty($this->options['enabled']) && 'yes' === $this->options['enabled']) ? true : false; + $enable = $enable && $this->payplug_requirements(); + $disabled = !$this->payplug_requirements(); + + return [ + 'title' => __('payplug_section_header_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_header_live_description', 'payplug'), + 'plugin_version' => PAYPLUG_GATEWAY_VERSION, + ], + 'sandbox' => [ + 'description' => __('payplug_section_header_test_description', 'payplug'), + 'plugin_version' => PAYPLUG_GATEWAY_VERSION, + ], + ], + 'options' => [ + 'type' => 'select', + 'name' => 'payplug_enable', + 'disabled' => $disabled, + 'options' => [ + [ + 'value' => 1, + 'label' => __('payplug_section_header_enable_label', 'payplug'), + 'checked' => true === $enable ? true : false, + ], + [ + 'value' => 0, + 'label' => __('payplug_section_header_disable_label', 'payplug'), + 'checked' => false === $enable ? true : false, + ], + ], + ], + ]; + } + + /** + * @param mixed $options + * + * @return array + */ + public function payplug_section_payment_methods($options = []) + { + $carriers = (!empty($this->options) && !empty($this->options['applepay_carriers'])) ? $this->options['applepay_carriers'] : []; + + return [ + 'name' => 'paymentMethodsBlock', + 'title' => __('payplug_section_payment_methods_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_payment_methods_description', 'payplug'), + ], + 'sandbox' => [ + 'description' => __('payplug_section_payment_methods_description', 'payplug'), + ], + ], + 'options' => [ + (new PaymentMethods($this->options))->payment_method_standard(), + PaymentMethods::payment_method_amex(!empty($this->options) && 'yes' === $this->options['american_express']), + PaymentMethods::payment_method_applepay(!empty($this->options) && 'yes' === $this->options['apple_pay'], $this->options, $carriers), + PaymentMethods::payment_method_bancontact(!empty($this->options) && 'yes' === $this->options['bancontact']), + PaymentMethods::payment_method_satispay(!empty($this->options) && !empty($this->options['satispay']) && 'yes' === $this->options['satispay']), + PaymentMethods::payment_method_mybank(!empty($options) && !empty($options['mybank']) && 'yes' === $this->options['mybank']), + PaymentMethods::payment_method_ideal(!empty($this->options) && !empty($this->options['ideal']) && 'yes' === $this->options['ideal']), + ], + ]; + } + + /** + * @param $active + * + * @return array + */ + public function payplug_section_paylater() + { + $max = !empty($this->options['oney_thresholds_max']) ? $this->options['oney_thresholds_max'] : 3000; + $min = !empty($this->options['oney_thresholds_min']) ? $this->options['oney_thresholds_min'] : 100; + $product_page = !empty($this->options['oney_product_animation']) && 'yes' === $this->options['oney_product_animation'] ? true : false; + + return [ + 'name' => 'paymentMethodsBlock', + 'title' => __('payplug_section_paylater_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_paylater_description', 'payplug'), + ], + 'sandbox' => [ + 'description' => __('payplug_section_paylater_description', 'payplug'), + ], + ], + 'options' => [ + 'name' => 'oney', + 'title' => __('payplug_section_oney_title', 'payplug'), + 'image' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/lg-oney.png'), + 'checked' => !empty($this->options) && 'yes' === $this->options['oney'], + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_paylater_description_oney', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), 'https://support.payplug.com/hc/fr/articles/4408142346002', '_blank'), + ], + 'sandbox' => [ + 'description' => __('payplug_section_paylater_description_oney', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), 'https://support.payplug.com/hc/fr/articles/4408142346002', '_blank'), + ], + 'advanced' => [ + 'description' => __('payplug_advanced_settings', 'payplug'), '', + ], + ], + 'options' => [ + [ + 'name' => 'payplug_oney_type', + 'className' => '_paylaterLabel', + 'label' => __('payplug_label_with_fees', 'payplug'), + 'subText' => __('payplug_text_with_fees', 'payplug'), + 'value' => 'with_fees', + 'checked' => !empty($this->options) && 'with_fees' === $this->options['oney_type'], + ], + [ + 'name' => 'payplug_oney_type', + 'className' => '_paylaterLabel', + 'label' => __('payplug_label_without_fees', 'payplug'), + 'subText' => __('payplug_text_without_fees', 'payplug'), + 'value' => 'without_fees', + 'checked' => !empty($this->options) && 'without_fees' === $this->options['oney_type'], + ], + ], + 'advanced_options' => [ + $this->thresholds_option($max, $min), + $this->show_oney_popup_product($product_page), + ], + ], + ]; + } + + /** + * @param mixed $max + * @param mixed $min + * + * @return array + */ + public function thresholds_option($max, $min) + { + return [ + 'name' => 'thresholds', + 'image_url' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/thresholds.svg'), + 'title' => __('payplug_thresholds_oney_title', 'payplug'), + 'descriptions' => [ + 'description' => __('payplug_thresholds_oney_description', 'payplug'), + 'min_amount' => [ + 'name' => 'oney_min_amounts', + 'value' => $min, + 'placeholder' => $min, + 'default' => !empty($this->options['oney_thresholds_default_min']) ? $this->options['oney_thresholds_default_min'] : 100, + ], + 'inter' => __('and', 'payplug'), + 'max_amount' => [ + 'name' => 'oney_max_amounts', + 'value' => $max, + 'placeholder' => $max, + 'default' => !empty($this->options['oney_thresholds_default_max']) ? $this->options['oney_thresholds_default_max'] : 3000, + ], + 'error' => [ + 'text' => __('payplug_thresholds_error_msg', 'payplug'), + 'maxtext' => __('payplug_thresholds_error_maxtext_msg', 'payplug'), + 'mintext' => __('payplug_thresholds_error_mintext_msg', 'payplug'), + ], + ], + 'switch' => false, + ]; + } + + /** + * @param $active + * + * @return array + */ + public function show_oney_popup_product($active = false) + { + return [ + 'name' => 'oney_product_animation', + 'image_url' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/product.svg'), + 'title' => __('display_the_oney_installments_pop_up_on_the_product_page', 'payplug'), + 'descriptions' => [[ + 'description' => __('payplug_oney_product_page_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), 'https://support.payplug.com/hc/fr/articles/4408142346002', '_blank'), + ]], + 'switch' => true, + 'checked' => $active, + ]; + } + + /** + * @param mixed $options + * + * @return array + */ + public function payplug_section_status($options = []) + { + $payplug_requirements = new PayplugGatewayRequirements(new PayplugGateway()); + $checked = !empty($options['debug']) && 'yes' === $options['debug'] ? true : false; + + return [ + 'error' => !$this->payplug_requirements(), + 'title' => __('payplug_section_status_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_status_description', 'payplug'), + 'errorMessage' => __('payplug_section_status_errorMessage', 'payplug'), + 'check' => __('payplug_section_status_check', 'payplug'), + 'check_success' => __('payplug_section_status_check_success', 'payplug'), + ], + 'sandbox' => [ + 'description' => __('payplug_section_status_description', 'payplug'), + 'errorMessage' => __('payplug_section_status_errorMessage', 'payplug'), + 'check' => __('payplug_section_status_check', 'payplug'), + 'check_success' => __('payplug_section_status_check_success', 'payplug'), + ], + ], + 'requirements' => [ + $payplug_requirements->curl_requirement(), + $payplug_requirements->php_requirement(), + $payplug_requirements->openssl_requirement(), + $payplug_requirements->currency_requirement(), //MISSING THIS MESSAGES + $payplug_requirements->account_requirement(), + ], + 'debug' => [ + 'live' => [ + 'title' => __('payplug_section_status_debug_label', 'payplug'), + 'description' => __('payplug_section_status_debug_description', 'payplug'), + ], + 'sandbox' => [ + 'title' => __('payplug_section_status_debug_label', 'payplug'), + 'description' => __('payplug_section_status_debug_description', 'payplug'), + ], + ], + 'enable_debug_check' => $checked, + ]; + } + + /** + * @return array + */ + public function payplug_section_footer() + { + return [ + 'save_changes_text' => __('payplug_save_changes_text', 'payplug'), + 'description' => [ + __('payplug_section_help_description1', 'payplug'), + __('payplug_section_help_description2', 'payplug'), + ], + 'link_help' => Component::link( + __('payplug_section_help_link_help_text', 'payplug'), + __('payplug_section_help_link_help_url', 'payplug'), + '_blank' + ), + ]; + } + + /** + * check if there's any requirement missing. + * + * @return bool + */ + private function payplug_requirements() + { + $payplug_requirements = new PayplugGatewayRequirements(new PayplugGateway()); + + return $payplug_requirements->satisfy_requirements(); + } } diff --git a/src/Admin/Vue/Component.php b/src/Admin/Vue/Component.php index be76847f..600390fd 100644 --- a/src/Admin/Vue/Component.php +++ b/src/Admin/Vue/Component.php @@ -2,21 +2,21 @@ namespace Payplug\PayplugWoocommerce\Admin\Vue; -class Component { - - /** - * @param $text - * @param $url - * @param $target - * - * @return array - */ - public static function link( $text, $url, $target ) { - return [ - "text" => $text, - "url" => $url, - "target" => $target - ]; - } - +class Component +{ + /** + * @param $text + * @param $url + * @param $target + * + * @return array + */ + public static function link($text, $url, $target) + { + return [ + 'text' => $text, + 'url' => $url, + 'target' => $target, + ]; + } } diff --git a/src/Admin/Vue/PaymentMethods.php b/src/Admin/Vue/PaymentMethods.php index 67583868..782ae289 100644 --- a/src/Admin/Vue/PaymentMethods.php +++ b/src/Admin/Vue/PaymentMethods.php @@ -4,485 +4,504 @@ use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -class PaymentMethods { - - private $options; - - public function __construct( $options ) { - - if ( empty( $options )) { - $this->options = PayplugWoocommerceHelper::get_payplug_options(); - } else { - $this->options = $options; - } - } - - /** - * @param $active - * - * @return array - */ - public function payment_method_standard() { - - $options = !empty(get_option( 'woocommerce_payplug_settings', [] )) ? get_option( 'woocommerce_payplug_settings', [] ) : ""; - - $method = [ - "redirect" => false, - "popup" => false, - "integrated" => false, - ]; - - $payment_method = !empty( $options ) ? $options['payment_method'] : ""; - switch($payment_method){ - case "popup" : $method["popup"] = true;break; - case "integrated" : $method["integrated"] = true;break; - default: $method["redirect"] = true;break; - } - - $active = (empty($options['payplug'])) || ( $options['payplug'] === 'yes' ) ; - return [ - "type" => "payment_method", - "name" => "standard", - "title" => __( 'payplug_section_standard_payment_title', 'payplug' ), - "image" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/standard.svg' ), - "checked" => $active, - "available_test_mode" => true, - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_standard_payment_description', 'payplug' ), - "advanced_options" => __( 'payplug_section_standard_payment_advanced_options_label', 'payplug' ), - ], - "sandbox" => [ - "description" => __( 'payplug_section_standard_payment_description', 'payplug' ), - "advanced_options" => __( 'payplug_section_standard_payment_advanced_options_label', 'payplug' ), - ] - ], - "options" => [ - $this->title_field(), - $this->description_field(), - $this->embeded_option($method), - $this->standard_warning_message(), - $this->one_click_option() - ], - ]; - } - - private function description_field(){ - $description = !empty($this->options['description']) ? $this->options['description'] : null; - return array( - "type" => "payment_option", - "sub_type" => "input", - "name" => "standard_payment_description", - "title" => __("payplug_standard_payment_description_title", "payplug"), - "value" => $description, - "descriptions" => [ - "live" => [ - "description" => __("payplug_standard_payment_description_description", "payplug"), - "placeholder" => __("payplug_standard_payment_description_placeholder", "payplug"), - ], - "sandbox" => [ - "description" => __("payplug_standard_payment_description_description", "payplug"), - "placeholder" => __("payplug_standard_payment_description_placeholder", "payplug"), - ] - ] - ); - } - private function title_field(){ - $title = !empty( $this->options['title'] ) ? $this->options['title'] : __("payplug_standard_payment_title_placeholder", "payplug"); - - return array( - "type" => "payment_option", - "sub_type" => "input", - "name" => "standard_payment_title", - "title" => __("payplug_standard_payment_title_title", "payplug"), - "value" => $title, - "descriptions" => [ - "live" => [ - "description" => __("payplug_standard_payment_title_description", "payplug"), - "placeholder" => __("payplug_standard_payment_title_placeholder", "payplug"), - ], - "sandbox" => [ - "description" => __("payplug_standard_payment_title_description", "payplug"), - "placeholder" => __("payplug_standard_payment_title_placeholder", "payplug"), - ] - ], - ); - } - - /** - * @param $active - * - * @return array|bool[]|false[] - */ - public function standard_warning_message( $active = null ) { - $arr = [ - "type" => "warning_message", - "sub_type" => "warning", - "name" => "warning_message", - "payment_method" => "integrated", - "description" => __( 'payplug_section_standard_ip_warning', 'payplug' ) - ]; - - return $arr; - } - - /** - * @param $active - * - * @return array|bool[]|false[] - */ - public function one_click_option( $active = null ) { - - $option = []; - - if (isset($this->options['oneclick'])) { - if ($this->options['oneclick'] != 'no') { - $option = $option + ["checked" => true]; - } elseif ($this->options['oneclick'] == 'no') { - $option = $option + ["checked" => false]; - } - - }; - - $option = $option + [ - "type" => "payment_option", - "sub_type" => "switch", - "name" => "one_click", - "title" => __( 'payplug_section_one_click_option_title', 'payplug' ), - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_one_click_option_description', 'payplug' ), - "link_know_more" => Component::link( - __( 'payplug_know_more_label', 'payplug' ), - "https://support.payplug.com/hc/en-gb/articles/4409698334098", - "_blank" ), - ], - "sandbox" => [ - "description" => __( 'payplug_section_one_click_option_description', 'payplug' ), - "link_know_more" => Component::link( - __( 'payplug_know_more_label', 'payplug' ), - "https://support.payplug.com/hc/en-gb/articles/4409698334098", - "_blank" ), - ] - ] - ]; - - return $option; - } - - /** - * @return array - */ - public function embeded_option($method) { - - $options = Array( - array( - "name" => "payplug_embedded", - "label" => __( 'payplug_section_standard_payment_option_integrated_label', 'payplug' ), - "value" => "integrated", - "checked" => $method['integrated'] - ), - array( - "name" => "payplug_embedded", - "label" => __( 'payplug_section_standard_payment_option_popup_label', 'payplug' ), - "value" => "popup", - "checked" => $method['popup'] - ), - array( - "name" => "payplug_embedded", - "label" => __( 'payplug_section_standard_payment_option_redirected_label', 'payplug' ), - "value" => "redirect", - "checked" => $method['redirect'] - ) - ); - - return [ - "type" => "payment_option", - "sub_type" => "IOptions", - "name" => "embeded", - "title" => __( 'payplug_section_standard_payment_option_title', 'payplug' ), - "descriptions" => [ - "live" => [ - "description_redirect" => __( 'payplug_section_standard_payment_redirected_description', 'payplug' ), - "description_popup" => __( 'payplug_section_standard_payment_popup_description', 'payplug' ), - "description_integrated" => __( 'payplug_section_standard_payment_integrated_description', 'payplug' ), - "link_know_more" => Component::link( - __( 'payplug_know_more_label', 'payplug' ), - __( 'payplug_embeded_option_url', 'payplug' ), - "_blank" ), - ], - "sandbox" => [ - "description_redirect" => __( 'payplug_section_standard_payment_redirected_description', 'payplug' ), - "description_popup" => __( 'payplug_section_standard_payment_popup_description', 'payplug' ), - "description_integrated" => __( 'payplug_section_standard_payment_integrated_description', 'payplug' ), - "link_know_more" => Component::link( - __( 'payplug_know_more_label', 'payplug' ), - __( 'payplug_embeded_option_url', 'payplug' ), - "_blank" ), - ] - ], - "options" => $options - ]; - } - - /** - * @param $active - * - * @return array - */ - public static function payment_method_applepay( $active, $options, $carriers = [] ) { - - $checkout = $cart = $product = false; - - if( !empty($options['applepay_checkout']) && ($options['applepay_checkout'] == "yes" ) ){ - $checkout = true; - } - - if( !empty($options['applepay_cart']) && ($options['applepay_cart'] == "yes" ) ){ - $cart = true; - } - - if( !empty($options['applepay_product']) && ($options['applepay_product'] == "yes" ) ){ - $product = true; - } - - if( $active === true && !$checkout && !$cart ){ - $checkout = true; - } - - return [ - "type" => "payment_method", - "name" => "applepay", - "title" => __( 'payplug_section_applepay_payment_title', 'payplug' ), - "image" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/applepay.svg' ), - "checked" => $active, - "available_test_mode" => false, - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_applepay_payment_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_applepay_more_url', 'payplug' ), "_blank"), - ], - "sandbox" => [ - "description" => __( 'payplug_applepay_unavailable_testmode_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_applepay_more_url', 'payplug' ), "_blank"), - ] - ], - "options" => - [ - [ - "type" => "payment_option", - "sub_type" => "IOptions", - "name" => "applepay_display", - "title" => __( 'applepay_display_choice_title', 'payplug' ), - "options" => - [ - [ - "name" => "applepay_checkout", - "title" => __( 'applepay_display_checkout', 'payplug' ), - "image_url" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/cart/applepay_checkout.svg' ), - "label" => __( 'applepay_display_checkout', 'payplug' ), - "value" => "checkout", - "switch" => true, - "checked" => $checkout || ($active && !$cart) - ], - [ - "name" => "applepay_cart", - "title" => __( 'applepay_display_cart', 'payplug' ), - "image_url" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/cart/applepay_cart.svg' ), - "label" => __( 'applepay_display_cart', 'payplug' ), - "value" => "cart", - "switch" => true, - "checked" => $cart - ], - [ - "name" => "applepay_product", - "title" => __( 'applepay_display_product', 'payplug' ), - "image_url" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/cart/applepay_cart.svg' ), - "label" => __( 'applepay_display_product', 'payplug' ), - "value" => "product", - "switch" => true, - "checked" => $product - ] - ], - "carriers" => - [ - "title" => __( 'applepay_active_carriers_title', 'payplug' ), - "alert" => __( 'applepay_active_carriers_alert', 'payplug' ), - "descriptions" => [ - "live" => [ - "description" => __( 'applepay_active_carriers_description', 'payplug' ), - "description_bold" => __( 'applepay_active_carriers_description_bold', 'payplug' ), - "description_warning" => __( 'applepay_active_carriers_description_warning', 'payplug' ), - ], - "sandbox" => [] - ], - "instructions" => __( 'applepay_active_carriers_instructions', 'payplug' ), - "carriers_list" => PayplugWoocommerceHelper::available_shipping_methods($carriers), - - ] - ] - ] - ]; - } - - /** - * @param $active - * - * @return array - */ - public static function payment_method_bancontact( $active = false ) { - return [ - "type" => "payment_method", - "name" => "bancontact", - "title" => __( 'payplug_section_bancontact_payment_title', 'payplug' ), - "image" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/bancontact.svg' ), - "checked" => $active, - "available_test_mode" => false, - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_bancontact_payment_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_bancontact_more_url', 'payplug' ), "_blank"), - ], - "sandbox" => [ - "description" => __( 'payplug_bancontact_unavailable_testmode_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_bancontact_more_url', 'payplug' ), "_blank"), - ] - ], - ]; - } - - /** - * @param $active - * - * @return array - */ - public static function payment_method_amex( $active = false ) { - return [ - "type" => "payment_method", - "name" => "american_express", - "title" => __( 'payplug_section_american_express_payment_title', 'payplug' ), - "image" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/Amex_logo_color.svg' ), - "checked" => $active, - "available_test_mode" => false, - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_american_express_payment_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_amex_more_url', 'payplug' ), "_blank"), - ], - "sandbox" => [ - "description" => __( 'payplug_amex_unavailable_testmode_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_amex_more_url', 'payplug' ), "_blank"), - ] - ], - ]; - } - - /** - * @param $active - * @return array - */ - public static function payment_method_satispay( $active = false ) { - return [ - "type" => "payment_method", - "name" => "satispay", - "title" => __( 'payplug_satispay_activate', 'payplug' ), - "image" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/satispay.svg' ), - "checked" => $active, - "available_test_mode" => false, - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_satispay_payment_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_satispay_more_url', 'payplug' ), "_blank"), - ], - "sandbox" => [ - "description" => __( 'payplug_satispay_unavailable_testmode_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_satispay_more_url', 'payplug' ), "_blank"), - ] - ], - "options" => [ - self::get_allowed_countries("satispay") - ], - ]; - } - - /** - * @param $active - * @return array - */ - public static function payment_method_mybank( $active = false ) { - return [ - "type" => "payment_method", - "name" => "mybank", - "title" => __( 'payplug_mybank_activate', 'payplug' ), - "image" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/mybank.svg' ), - "checked" => $active, - "available_test_mode" => false, - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_mybank_payment_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_mybank_more_url', 'payplug' ), "_blank"), - ], - "sandbox" => [ - "description" => __( 'payplug_mybank_unavailable_testmode_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_mybank_more_url', 'payplug' ), "_blank"), - ] - ], - "options" => [ - self::get_allowed_countries("mybank") - ], - ]; - } - - /** - * @param $active - * @return array - */ - public static function payment_method_ideal( $active = false ) { - return [ - "type" => "payment_method", - "name" => "ideal", - "title" => __( 'payplug_ideal_activate', 'payplug' ), - "image" => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/ideal.svg' ), - "checked" => $active, - "available_test_mode" => false, - "descriptions" => [ - "live" => [ - "description" => __( 'payplug_section_ideal_payment_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_ideal_more_url', 'payplug' ), "_blank"), - ], - "sandbox" => [ - "description" => __( 'payplug_ideal_unavailable_testmode_description', 'payplug' ), - "link_know_more" => Component::link(__( 'payplug_know_more_label', 'payplug' ), __( 'payplug_ideal_more_url', 'payplug' ), "_blank"), - ] - ], - "options" => [ - self::get_allowed_countries("ideal") - ], - ]; - } - - /** - * @param $id - * @return false|string - */ - private static function get_allowed_countries($id){ - $account = PayplugWoocommerceHelper::get_account_data_from_options(); - - if(empty($account['payment_methods'][$id])){ - return false; - } - - $arr = [ - "type" => "info_message", - "sub_type" => "text", - "name" => "allowed_countries", - "payment_method" => $id, - "description" => trim(sprintf(__("payplug_payment_gateways_country_permissions", "payplug"), ucfirst($id))) . implode(", ", $account['payment_methods'][$id]['allowed_countries']) . "." - ]; - - return $arr; - - } - - +class PaymentMethods +{ + private $options; + + public function __construct($options) + { + if (empty($options)) { + $this->options = PayplugWoocommerceHelper::get_payplug_options(); + } else { + $this->options = $options; + } + } + + /** + * @param $active + * + * @return array + */ + public function payment_method_standard() + { + $options = !empty(get_option('woocommerce_payplug_settings', [])) ? get_option('woocommerce_payplug_settings', []) : ''; + + $method = [ + 'redirect' => false, + 'popup' => false, + 'integrated' => false, + ]; + + $payment_method = !empty($options) ? $options['payment_method'] : ''; + + switch ($payment_method) { + case 'popup' : $method['popup'] = true; + +break; + + case 'integrated' : $method['integrated'] = true; + +break; + + default: $method['redirect'] = true; + +break; + } + + $active = (empty($options['payplug'])) || ('yes' === $options['payplug']); + + return [ + 'type' => 'payment_method', + 'name' => 'standard', + 'title' => __('payplug_section_standard_payment_title', 'payplug'), + 'image' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/standard.svg'), + 'checked' => $active, + 'available_test_mode' => true, + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_standard_payment_description', 'payplug'), + 'advanced_options' => __('payplug_section_standard_payment_advanced_options_label', 'payplug'), + ], + 'sandbox' => [ + 'description' => __('payplug_section_standard_payment_description', 'payplug'), + 'advanced_options' => __('payplug_section_standard_payment_advanced_options_label', 'payplug'), + ], + ], + 'options' => [ + $this->title_field(), + $this->description_field(), + $this->embeded_option($method), + $this->standard_warning_message(), + $this->one_click_option(), + ], + ]; + } + + /** + * @param $active + * + * @return array|bool[]|false[] + */ + public function standard_warning_message($active = null) + { + return [ + 'type' => 'warning_message', + 'sub_type' => 'warning', + 'name' => 'warning_message', + 'payment_method' => 'integrated', + 'description' => __('payplug_section_standard_ip_warning', 'payplug'), + ]; + } + + /** + * @param $active + * + * @return array|bool[]|false[] + */ + public function one_click_option($active = null) + { + $option = []; + + if (isset($this->options['oneclick'])) { + if ('no' != $this->options['oneclick']) { + $option = $option + ['checked' => true]; + } elseif ('no' == $this->options['oneclick']) { + $option = $option + ['checked' => false]; + } + } + + return $option + [ + 'type' => 'payment_option', + 'sub_type' => 'switch', + 'name' => 'one_click', + 'title' => __('payplug_section_one_click_option_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_one_click_option_description', 'payplug'), + 'link_know_more' => Component::link( + __('payplug_know_more_label', 'payplug'), + 'https://support.payplug.com/hc/en-gb/articles/4409698334098', + '_blank' + ), + ], + 'sandbox' => [ + 'description' => __('payplug_section_one_click_option_description', 'payplug'), + 'link_know_more' => Component::link( + __('payplug_know_more_label', 'payplug'), + 'https://support.payplug.com/hc/en-gb/articles/4409698334098', + '_blank' + ), + ], + ], + ]; + } + + /** + * @param mixed $method + * + * @return array + */ + public function embeded_option($method) + { + $options = [ + [ + 'name' => 'payplug_embedded', + 'label' => __('payplug_section_standard_payment_option_integrated_label', 'payplug'), + 'value' => 'integrated', + 'checked' => $method['integrated'], + ], + [ + 'name' => 'payplug_embedded', + 'label' => __('payplug_section_standard_payment_option_popup_label', 'payplug'), + 'value' => 'popup', + 'checked' => $method['popup'], + ], + [ + 'name' => 'payplug_embedded', + 'label' => __('payplug_section_standard_payment_option_redirected_label', 'payplug'), + 'value' => 'redirect', + 'checked' => $method['redirect'], + ], + ]; + + return [ + 'type' => 'payment_option', + 'sub_type' => 'IOptions', + 'name' => 'embeded', + 'title' => __('payplug_section_standard_payment_option_title', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description_redirect' => __('payplug_section_standard_payment_redirected_description', 'payplug'), + 'description_popup' => __('payplug_section_standard_payment_popup_description', 'payplug'), + 'description_integrated' => __('payplug_section_standard_payment_integrated_description', 'payplug'), + 'link_know_more' => Component::link( + __('payplug_know_more_label', 'payplug'), + __('payplug_embeded_option_url', 'payplug'), + '_blank' + ), + ], + 'sandbox' => [ + 'description_redirect' => __('payplug_section_standard_payment_redirected_description', 'payplug'), + 'description_popup' => __('payplug_section_standard_payment_popup_description', 'payplug'), + 'description_integrated' => __('payplug_section_standard_payment_integrated_description', 'payplug'), + 'link_know_more' => Component::link( + __('payplug_know_more_label', 'payplug'), + __('payplug_embeded_option_url', 'payplug'), + '_blank' + ), + ], + ], + 'options' => $options, + ]; + } + + /** + * @param $active + * @param mixed $options + * @param mixed $carriers + * + * @return array + */ + public static function payment_method_applepay($active, $options, $carriers = []) + { + $checkout = $cart = $product = false; + + if (!empty($options['applepay_checkout']) && ('yes' == $options['applepay_checkout'])) { + $checkout = true; + } + + if (!empty($options['applepay_cart']) && ('yes' == $options['applepay_cart'])) { + $cart = true; + } + + if (!empty($options['applepay_product']) && ('yes' == $options['applepay_product'])) { + $product = true; + } + + if (true === $active && !$checkout && !$cart) { + $checkout = true; + } + + return [ + 'type' => 'payment_method', + 'name' => 'applepay', + 'title' => __('payplug_section_applepay_payment_title', 'payplug'), + 'image' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/applepay.svg'), + 'checked' => $active, + 'available_test_mode' => false, + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_applepay_payment_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_applepay_more_url', 'payplug'), '_blank'), + ], + 'sandbox' => [ + 'description' => __('payplug_applepay_unavailable_testmode_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_applepay_more_url', 'payplug'), '_blank'), + ], + ], + 'options' => [ + [ + 'type' => 'payment_option', + 'sub_type' => 'IOptions', + 'name' => 'applepay_display', + 'title' => __('applepay_display_choice_title', 'payplug'), + 'options' => [ + [ + 'name' => 'applepay_checkout', + 'title' => __('applepay_display_checkout', 'payplug'), + 'image_url' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/cart/applepay_checkout.svg'), + 'label' => __('applepay_display_checkout', 'payplug'), + 'value' => 'checkout', + 'switch' => true, + 'checked' => $checkout || ($active && !$cart), + ], + [ + 'name' => 'applepay_cart', + 'title' => __('applepay_display_cart', 'payplug'), + 'image_url' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/cart/applepay_cart.svg'), + 'label' => __('applepay_display_cart', 'payplug'), + 'value' => 'cart', + 'switch' => true, + 'checked' => $cart, + ], + [ + 'name' => 'applepay_product', + 'title' => __('applepay_display_product', 'payplug'), + 'image_url' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/cart/applepay_cart.svg'), + 'label' => __('applepay_display_product', 'payplug'), + 'value' => 'product', + 'switch' => true, + 'checked' => $product, + ], + ], + 'carriers' => [ + 'title' => __('applepay_active_carriers_title', 'payplug'), + 'alert' => __('applepay_active_carriers_alert', 'payplug'), + 'descriptions' => [ + 'live' => [ + 'description' => __('applepay_active_carriers_description', 'payplug'), + 'description_bold' => __('applepay_active_carriers_description_bold', 'payplug'), + 'description_warning' => __('applepay_active_carriers_description_warning', 'payplug'), + ], + 'sandbox' => [], + ], + 'instructions' => __('applepay_active_carriers_instructions', 'payplug'), + 'carriers_list' => PayplugWoocommerceHelper::available_shipping_methods($carriers), + ], + ], + ], + ]; + } + + /** + * @param $active + * + * @return array + */ + public static function payment_method_bancontact($active = false) + { + return [ + 'type' => 'payment_method', + 'name' => 'bancontact', + 'title' => __('payplug_section_bancontact_payment_title', 'payplug'), + 'image' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/bancontact.svg'), + 'checked' => $active, + 'available_test_mode' => false, + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_bancontact_payment_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_bancontact_more_url', 'payplug'), '_blank'), + ], + 'sandbox' => [ + 'description' => __('payplug_bancontact_unavailable_testmode_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_bancontact_more_url', 'payplug'), '_blank'), + ], + ], + ]; + } + + /** + * @param $active + * + * @return array + */ + public static function payment_method_amex($active = false) + { + return [ + 'type' => 'payment_method', + 'name' => 'american_express', + 'title' => __('payplug_section_american_express_payment_title', 'payplug'), + 'image' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/Amex_logo_color.svg'), + 'checked' => $active, + 'available_test_mode' => false, + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_american_express_payment_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_amex_more_url', 'payplug'), '_blank'), + ], + 'sandbox' => [ + 'description' => __('payplug_amex_unavailable_testmode_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_amex_more_url', 'payplug'), '_blank'), + ], + ], + ]; + } + + /** + * @param $active + * + * @return array + */ + public static function payment_method_satispay($active = false) + { + return [ + 'type' => 'payment_method', + 'name' => 'satispay', + 'title' => __('payplug_satispay_activate', 'payplug'), + 'image' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/satispay.svg'), + 'checked' => $active, + 'available_test_mode' => false, + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_satispay_payment_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_satispay_more_url', 'payplug'), '_blank'), + ], + 'sandbox' => [ + 'description' => __('payplug_satispay_unavailable_testmode_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_satispay_more_url', 'payplug'), '_blank'), + ], + ], + 'options' => [ + self::get_allowed_countries('satispay'), + ], + ]; + } + + /** + * @param $active + * + * @return array + */ + public static function payment_method_mybank($active = false) + { + return [ + 'type' => 'payment_method', + 'name' => 'mybank', + 'title' => __('payplug_mybank_activate', 'payplug'), + 'image' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/mybank.svg'), + 'checked' => $active, + 'available_test_mode' => false, + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_mybank_payment_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_mybank_more_url', 'payplug'), '_blank'), + ], + 'sandbox' => [ + 'description' => __('payplug_mybank_unavailable_testmode_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_mybank_more_url', 'payplug'), '_blank'), + ], + ], + 'options' => [ + self::get_allowed_countries('mybank'), + ], + ]; + } + + /** + * @param $active + * + * @return array + */ + public static function payment_method_ideal($active = false) + { + return [ + 'type' => 'payment_method', + 'name' => 'ideal', + 'title' => __('payplug_ideal_activate', 'payplug'), + 'image' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/ideal.svg'), + 'checked' => $active, + 'available_test_mode' => false, + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_section_ideal_payment_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_ideal_more_url', 'payplug'), '_blank'), + ], + 'sandbox' => [ + 'description' => __('payplug_ideal_unavailable_testmode_description', 'payplug'), + 'link_know_more' => Component::link(__('payplug_know_more_label', 'payplug'), __('payplug_ideal_more_url', 'payplug'), '_blank'), + ], + ], + 'options' => [ + self::get_allowed_countries('ideal'), + ], + ]; + } + + private function description_field() + { + $description = !empty($this->options['description']) ? $this->options['description'] : null; + + return [ + 'type' => 'payment_option', + 'sub_type' => 'input', + 'name' => 'standard_payment_description', + 'title' => __('payplug_standard_payment_description_title', 'payplug'), + 'value' => $description, + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_standard_payment_description_description', 'payplug'), + 'placeholder' => __('payplug_standard_payment_description_placeholder', 'payplug'), + ], + 'sandbox' => [ + 'description' => __('payplug_standard_payment_description_description', 'payplug'), + 'placeholder' => __('payplug_standard_payment_description_placeholder', 'payplug'), + ], + ], + ]; + } + + private function title_field() + { + $title = !empty($this->options['title']) ? $this->options['title'] : __('payplug_standard_payment_title_placeholder', 'payplug'); + + return [ + 'type' => 'payment_option', + 'sub_type' => 'input', + 'name' => 'standard_payment_title', + 'title' => __('payplug_standard_payment_title_title', 'payplug'), + 'value' => $title, + 'descriptions' => [ + 'live' => [ + 'description' => __('payplug_standard_payment_title_description', 'payplug'), + 'placeholder' => __('payplug_standard_payment_title_placeholder', 'payplug'), + ], + 'sandbox' => [ + 'description' => __('payplug_standard_payment_title_description', 'payplug'), + 'placeholder' => __('payplug_standard_payment_title_placeholder', 'payplug'), + ], + ], + ]; + } + + /** + * @param $id + * + * @return false|string + */ + private static function get_allowed_countries($id) + { + $account = PayplugWoocommerceHelper::get_account_data_from_options(); + + if (empty($account['payment_methods'][$id])) { + return false; + } + + return [ + 'type' => 'info_message', + 'sub_type' => 'text', + 'name' => 'allowed_countries', + 'payment_method' => $id, + 'description' => trim(sprintf(__('payplug_payment_gateways_country_permissions', 'payplug'), ucfirst($id))) . implode(', ', $account['payment_methods'][$id]['allowed_countries']) . '.', + ]; + } } diff --git a/src/Admin/WoocommerceActions.php b/src/Admin/WoocommerceActions.php index 6f213742..f2e8a3b1 100644 --- a/src/Admin/WoocommerceActions.php +++ b/src/Admin/WoocommerceActions.php @@ -1,114 +1,130 @@ id : $theorder->get_id(); - $transaction_id = PayplugWoocommerceHelper::is_pre_30() ? get_post_meta( $order_id, '_transaction_id', true ) : $theorder->get_transaction_id(); - $payment_method = PayplugWoocommerceHelper::is_pre_30() ? $theorder->payment_method : $theorder->get_payment_method(); - if (!in_array($payment_method, ['oney_x3_with_fees', 'oney_x4_with_fees', 'payplug', 'american_express', 'bancontact', 'apple_pay']) || empty($transaction_id)) { - return $actions; - } - $actions[ self::WC_PAYPLUG_RETRIEVE_ACTION ] = __( 'Update PayPlug transaction data', 'payplug' ); - return $actions; - } - /** - * Handle PayPlug custom action. - * - * Retrieve transaction data from PayPlug for the order. - * - * @param \WC_Order $order - * - * @return void - * @throws \WC_Data_Exception - */ - public function handle_payment_retrieve_action( $order ) { - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - $payment_method = PayplugWoocommerceHelper::is_pre_30() ? $order->payment_method : $order->get_payment_method(); - if (!in_array($payment_method, ['oney_x3_with_fees', 'oney_x4_with_fees', 'payplug', 'american_express', 'bancontact', 'apple_pay'])) { - return; - } - PayplugGateway::log( sprintf( 'Order #%s : Starting retrieve action process.', $order_id ), 'info' ); - $transaction_id = PayplugWoocommerceHelper::is_pre_30() ? get_post_meta( $order_id, '_transaction_id', true ) : $order->get_transaction_id(); - if ( empty( $transaction_id ) ) { - PayplugGateway::log( sprintf( 'Order #%s : Missing transaction id.', $order_id ), 'error' ); - \WC_Admin_Meta_Boxes::add_error( __( 'No transaction ID was found for this order.', 'payplug' ) ); - return; - } - /* @var PayplugGateway $gateway */ - $gateway = wc_get_payment_gateway_by_order( $order ); - if ( - ! $gateway - || ! $gateway->is_available() - || ! ( $gateway->response instanceof PayplugResponse ) - ) { - PayplugGateway::log( sprintf( 'Order #%s : Error with PayPlug gateway. PayPlug gateway not found or PayPlugResponse class not available.', $order_id ), 'error' ); - \WC_Admin_Meta_Boxes::add_error( __( 'An error occured with PayPlug gateway. Please make sure PayPlug settings are correct.', 'payplug' ) ); - return; - } - try { - PayplugGateway::log( sprintf( 'Order #%s : Retrieve payment data for transaction %s.', $order_id, $transaction_id ), 'info' ); - $payment = $gateway->api->payment_retrieve( $transaction_id ); - PayplugGateway::log( sprintf( 'Order #%s : Process payment data.', $order_id ), 'info' ); - $gateway->response->process_payment( $payment ); - } catch ( \Exception $e ) { - PayplugGateway::log( - sprintf( 'Order #%s : An error occurred while retrieving the payment data with the message : %s', - $order_id, - $e->getMessage() - ) - ); - \WC_Admin_Meta_Boxes::add_error( __( 'An error occurred while collecting payment information from PayPlug.', 'payplug' ) ); - return; - } - PayplugGateway::log( sprintf( 'Order #%s : Payment data updated.', $order_id ), 'info' ); - try { - PayplugGateway::log( sprintf( 'Order #%s : Retrieve refunds for transaction %s', $order_id, $transaction_id ), 'info' ); - $refunds = $gateway->api->refund_list( $transaction_id ); - if ( ! empty( $refunds ) ) { - PayplugGateway::log( sprintf( 'Order #%s : Found %d refund(s) for the transaction.', $order_id, count( $refunds ) ), 'info' ); - foreach ( $refunds as $refund ) { - $gateway->response->process_refund( $refund, false ); - } - } - } catch ( \Exception $e ) { - PayplugGateway::log( - sprintf( 'Order #%s : An error occurred while retrieving the refund data with the message : %s', - $order_id, - $e->getMessage() - ) - ); - \WC_Admin_Meta_Boxes::add_error( __( 'An error occurred while collecting refund information from PayPlug.', 'payplug' ) ); - return; - } - PayplugGateway::log( sprintf( 'Order #%s : Refunds data updated.', $order_id ), 'info' ); - } +class WoocommerceActions +{ + const WC_PAYPLUG_RETRIEVE_ACTION = 'retrieve_payplug_transaction'; + + public function __construct() + { + add_filter('woocommerce_order_actions', [$this, 'add_payment_retrieve_action']); + add_action('woocommerce_order_action_' . self::WC_PAYPLUG_RETRIEVE_ACTION, [ + $this, + 'handle_payment_retrieve_action', + ]); + } + + /** + * Add custom PayPlug action. + * + * @param array $actions + * + * @return array + */ + public function add_payment_retrieve_action($actions = []) + { + // @var \WC_Order $theorder + global $theorder; + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $theorder->id : $theorder->get_id(); + $transaction_id = PayplugWoocommerceHelper::is_pre_30() ? get_post_meta($order_id, '_transaction_id', true) : $theorder->get_transaction_id(); + $payment_method = PayplugWoocommerceHelper::is_pre_30() ? $theorder->payment_method : $theorder->get_payment_method(); + if (!in_array($payment_method, ['oney_x3_with_fees', 'oney_x4_with_fees', 'payplug', 'american_express', 'bancontact', 'apple_pay']) || empty($transaction_id)) { + return $actions; + } + $actions[self::WC_PAYPLUG_RETRIEVE_ACTION] = __('Update PayPlug transaction data', 'payplug'); + + return $actions; + } + + /** + * Handle PayPlug custom action. + * + * Retrieve transaction data from PayPlug for the order. + * + * @param \WC_Order $order + * + * @throws \WC_Data_Exception + */ + public function handle_payment_retrieve_action($order) + { + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + $payment_method = PayplugWoocommerceHelper::is_pre_30() ? $order->payment_method : $order->get_payment_method(); + if (!in_array($payment_method, ['oney_x3_with_fees', 'oney_x4_with_fees', 'payplug', 'american_express', 'bancontact', 'apple_pay'])) { + return; + } + PayplugGateway::log(sprintf('Order #%s : Starting retrieve action process.', $order_id), 'info'); + $transaction_id = PayplugWoocommerceHelper::is_pre_30() ? get_post_meta($order_id, '_transaction_id', true) : $order->get_transaction_id(); + if (empty($transaction_id)) { + PayplugGateway::log(sprintf('Order #%s : Missing transaction id.', $order_id), 'error'); + \WC_Admin_Meta_Boxes::add_error(__('No transaction ID was found for this order.', 'payplug')); + + return; + } + // @var PayplugGateway $gateway + $gateway = wc_get_payment_gateway_by_order($order); + if ( + !$gateway + || !$gateway->is_available() + || !($gateway->response instanceof PayplugResponse) + ) { + PayplugGateway::log(sprintf('Order #%s : Error with PayPlug gateway. PayPlug gateway not found or PayPlugResponse class not available.', $order_id), 'error'); + \WC_Admin_Meta_Boxes::add_error(__('An error occured with PayPlug gateway. Please make sure PayPlug settings are correct.', 'payplug')); + + return; + } + + try { + PayplugGateway::log(sprintf('Order #%s : Retrieve payment data for transaction %s.', $order_id, $transaction_id), 'info'); + $payment = $gateway->api->payment_retrieve($transaction_id); + PayplugGateway::log(sprintf('Order #%s : Process payment data.', $order_id), 'info'); + $gateway->response->process_payment($payment); + } catch (\Exception $e) { + PayplugGateway::log( + sprintf( + 'Order #%s : An error occurred while retrieving the payment data with the message : %s', + $order_id, + $e->getMessage() + ) + ); + \WC_Admin_Meta_Boxes::add_error(__('An error occurred while collecting payment information from PayPlug.', 'payplug')); + + return; + } + PayplugGateway::log(sprintf('Order #%s : Payment data updated.', $order_id), 'info'); + + try { + PayplugGateway::log(sprintf('Order #%s : Retrieve refunds for transaction %s', $order_id, $transaction_id), 'info'); + $refunds = $gateway->api->refund_list($transaction_id); + if (!empty($refunds)) { + PayplugGateway::log(sprintf('Order #%s : Found %d refund(s) for the transaction.', $order_id, count($refunds)), 'info'); + foreach ($refunds as $refund) { + $gateway->response->process_refund($refund, false); + } + } + } catch (\Exception $e) { + PayplugGateway::log( + sprintf( + 'Order #%s : An error occurred while retrieving the refund data with the message : %s', + $order_id, + $e->getMessage() + ) + ); + \WC_Admin_Meta_Boxes::add_error(__('An error occurred while collecting refund information from PayPlug.', 'payplug')); + + return; + } + PayplugGateway::log(sprintf('Order #%s : Refunds data updated.', $order_id), 'info'); + } } diff --git a/src/Controller/ApplePay.php b/src/Controller/ApplePay.php index 4a916b87..c45f2aa5 100644 --- a/src/Controller/ApplePay.php +++ b/src/Controller/ApplePay.php @@ -2,660 +2,662 @@ namespace Payplug\PayplugWoocommerce\Controller; +use function is_cart; +use function is_product; use Payplug\Exception\HttpException; use Payplug\PayplugWoocommerce\Gateway\PayplugAddressData; -use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; use Payplug\PayplugWoocommerce\Gateway\PayplugGateway; +use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; use Payplug\Resource\Payment as PaymentResource; -use function is_cart; -use function is_product; /** * ApplePay controller for handling Apple Pay payment logic in WooCommerce. */ class ApplePay extends PayplugGateway { + const ENABLE_ON_TEST_MODE = false; - public $domain_name = ""; - - protected $cart = false; - - protected $checkout = false; - - protected $carriers = []; + public $domain_name = ''; - const ENABLE_ON_TEST_MODE = false; + public $image = 'apple-pay-checkout.svg'; - public $image = "apple-pay-checkout.svg"; + protected $cart = false; - protected $product = false; + protected $checkout = false; - public function __construct() - { + protected $carriers = []; - parent::__construct(); + protected $product = false; - /** @var \WC_Settings_API override $id */ - $this->id = 'apple_pay'; + public function __construct() + { + parent::__construct(); - /** @var \WC_Payment_Gateway overwrite for apple pay settings */ - $this->method_title = __('payplug_apple_pay_title', 'payplug'); - $this->method_description = ""; - $this->has_fields = false; + // @var \WC_Settings_API override $id + $this->id = 'apple_pay'; - $this->title = __('payplug_apple_pay_title', 'payplug'); - $this->description = '
    '; - $this->domain_name = $_SERVER['HTTP_HOST']; - $this->enabled = "no"; + // @var \WC_Payment_Gateway overwrite for apple pay settings + $this->method_title = __('payplug_apple_pay_title', 'payplug'); + $this->method_description = ''; + $this->has_fields = false; + $this->title = __('payplug_apple_pay_title', 'payplug'); + $this->description = '
    '; + $this->domain_name = $_SERVER['HTTP_HOST']; + $this->enabled = 'no'; - if( $this->checkApplePay() && is_admin()){ - $this->enabled = "yes"; + if ($this->checkApplePay() && is_admin()) { + $this->enabled = 'yes'; + } elseif ($this->checkApplePay() && $this->isSSL()) { + if (!is_admin() && $this->get_button_checkout()) { + $this->enabled = 'yes'; + } - }else if( $this->checkApplePay() && $this->isSSL() ){ + if (!is_admin()) { + if (!PayplugWoocommerceHelper::is_checkout_block() && $this->get_button_checkout()) { + $this->add_apple_pay_css(); + add_action('wp_enqueue_scripts', [$this, 'add_apple_pay_js']); + } - if (!is_admin() && $this->get_button_checkout()) { - $this->enabled = 'yes'; - } + if ($this->get_button_cart() && !PayplugWoocommerceHelper::is_cart_block() && !PayplugWoocommerceHelper::is_subscription()) { + $this->enabled = 'yes'; + $this->add_apple_pay_css(); + add_action('woocommerce_proceed_to_checkout', [$this, 'add_apple_pay_cart_js'], 15); + } + if ($this->get_button_product() && !PayplugWoocommerceHelper::is_product_block()) { + $this->enabled = 'yes'; + $this->add_apple_pay_css(); + add_action('woocommerce_after_add_to_cart_button', [$this, 'add_apple_pay_product_js'], 15); + } + } + } + } - if( !is_admin() ){ - - if (!PayplugWoocommerceHelper::is_checkout_block() && $this->get_button_checkout()) { - $this->add_apple_pay_css(); - add_action('wp_enqueue_scripts', [$this, 'add_apple_pay_js']); - } - - if ( $this->get_button_cart() && !PayplugWoocommerceHelper::is_cart_block() && !PayplugWoocommerceHelper::is_subscription() ) { - $this->enabled = 'yes'; - $this->add_apple_pay_css(); - add_action('woocommerce_proceed_to_checkout', [$this, "add_apple_pay_cart_js"], 15); - } - - if ($this->get_button_product() && !PayplugWoocommerceHelper::is_product_block()) { - $this->enabled ='yes'; - $this->add_apple_pay_css(); - add_action('woocommerce_after_add_to_cart_button', [$this, "add_apple_pay_product_js"], 15); - } - } - } - - } - - /** + /** * Processes admin options for Apple Pay settings. * * @return bool|void */ - public function process_admin_options() { - $data = $this->get_post_data(); - if (isset($data['woocommerce_payplug_mode'])) { - if ( $this->get_post_data()['woocommerce_payplug_mode'] === '0' ) { - $options = get_option( 'woocommerce_payplug_settings', [] ); - $options['apple_pay'] = 'no'; - update_option( 'woocommerce_payplug_settings', apply_filters( 'woocommerce_settings_api_sanitized_fields_payplug', $options ) ); - } - } - if (isset($data['woocommerce_payplug_apple_pay'])) { - if (($data['woocommerce_payplug_apple_pay'] == 1) && (!$this->checkApplePay())) { - add_action( 'admin_notices', [$this ,"display_notice"] ); - } - } - - } - - /** + public function process_admin_options() + { + $data = $this->get_post_data(); + if (isset($data['woocommerce_payplug_mode'])) { + if ('0' === $this->get_post_data()['woocommerce_payplug_mode']) { + $options = get_option('woocommerce_payplug_settings', []); + $options['apple_pay'] = 'no'; + update_option('woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options)); + } + } + if (isset($data['woocommerce_payplug_apple_pay'])) { + if ((1 == $data['woocommerce_payplug_apple_pay']) && (!$this->checkApplePay())) { + add_action('admin_notices', [$this, 'display_notice']); + } + } + } + + /** * Checks if Apple Pay is authorized and available. * * @return bool */ - public function checkApplePay(){ - $options = $this->settings; - - - //check if module is enabled - if(!empty($options['enabled']) && 'no' === $options['enabled']){ - return false; - } - - //it's disabled - if(isset($options['apple_pay']) && $options['apple_pay'] === "no"){ - return false; - } - - //Amount validations - if ( is_cart() && !empty( WC()->cart ) ) { - $order_amount = (float) WC()->cart->total; - if ($order_amount < self::MIN_AMOUNT || $order_amount > self::MAX_AMOUNT) { - return false; - } - } - - //support legacy applepay - if( !isset($options['applepay_checkout']) && !isset($options['applepay_cart']) && !isset($options['applepay_product']) && isset($options['apple_pay']) && $options['apple_pay'] ==="yes"){ - $this->set_button_checkout(true); - } - - if(isset($options['applepay_checkout']) && $options['applepay_checkout'] === "yes"){ - $this->set_button_checkout(true); - } - - if(isset($options['applepay_cart']) && $options['applepay_cart'] === "yes"){ - $this->set_button_cart(true); - } - - if(isset($options['applepay_product']) && $options['applepay_product'] === "yes"){ - $this->set_button_product(true); - } - - if(isset($options['applepay_carriers']) ){ - $this->set_carriers($options['applepay_carriers']); - } - - $account = PayplugWoocommerceHelper::generic_get_account_data_from_options($this->id); - //no auth - if(!isset($account['payment_methods']['apple_pay']) || !isset($account['payment_methods']['apple_pay']['allowed_domain_names']) ){ - return false; - } - - //$account has permissions to use apple_pay - $auth = isset($account['payment_methods']['apple_pay']['enabled']) && $account['payment_methods']['apple_pay']['enabled']; - $domain = parse_url(get_site_url()); - $auth_domains = in_array($domain["host"], $account['payment_methods']['apple_pay']['allowed_domain_names']); - - //lost auth - if(!($auth && $auth_domains)){ - return false; - } - - return true; - } - - /** + public function checkApplePay() + { + $options = $this->settings; + + //check if module is enabled + if (!empty($options['enabled']) && 'no' === $options['enabled']) { + return false; + } + + //it's disabled + if (isset($options['apple_pay']) && 'no' === $options['apple_pay']) { + return false; + } + + //Amount validations + if (is_cart() && !empty(WC()->cart)) { + $order_amount = (float) WC()->cart->total; + if ($order_amount < self::MIN_AMOUNT || $order_amount > self::MAX_AMOUNT) { + return false; + } + } + + //support legacy applepay + if (!isset($options['applepay_checkout']) && !isset($options['applepay_cart']) && !isset($options['applepay_product']) && isset($options['apple_pay']) && 'yes' === $options['apple_pay']) { + $this->set_button_checkout(true); + } + + if (isset($options['applepay_checkout']) && 'yes' === $options['applepay_checkout']) { + $this->set_button_checkout(true); + } + + if (isset($options['applepay_cart']) && 'yes' === $options['applepay_cart']) { + $this->set_button_cart(true); + } + + if (isset($options['applepay_product']) && 'yes' === $options['applepay_product']) { + $this->set_button_product(true); + } + + if (isset($options['applepay_carriers'])) { + $this->set_carriers($options['applepay_carriers']); + } + + $account = PayplugWoocommerceHelper::generic_get_account_data_from_options($this->id); + //no auth + if (!isset($account['payment_methods']['apple_pay']) || !isset($account['payment_methods']['apple_pay']['allowed_domain_names'])) { + return false; + } + + //$account has permissions to use apple_pay + $auth = isset($account['payment_methods']['apple_pay']['enabled']) && $account['payment_methods']['apple_pay']['enabled']; + $domain = parse_url(get_site_url()); + $auth_domains = in_array($domain['host'], $account['payment_methods']['apple_pay']['allowed_domain_names']); + + //lost auth + if (!($auth && $auth_domains)) { + return false; + } + + return true; + } + + /** * Outputs the payment fields on the checkout page. + */ + public function payment_fields() + { + $description = $this->get_description(); + + if (!empty($description)) { + echo wpautop(wptexturize($description)); + } + } + + /** + * extend the woocommmerce get description to include personalized html. * - * @return void + * @return mixed|string|null */ - public function payment_fields() - { - $description = $this->get_description(); - - if (!empty($description)) { - echo wpautop(wptexturize($description)); - } - } - - /** - * extend the woocommmerce get description to include personalized html - * - * @return mixed|string|null - */ - public function get_description() - { - return apply_filters('woocommerce_gateway_description', $this->description, $this->id); - } - - /** + public function get_description() + { + return apply_filters('woocommerce_gateway_description', $this->description, $this->id); + } + + /** * Enqueues Apple Pay scripts for the cart page. - * - * @return void */ - public function add_apple_pay_cart_js(){ - wp_enqueue_script( 'apple-pay-sdk', 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', array(), false, true ); - wp_enqueue_script('payplug-apple-pay-cart', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-apple-pay-cart.js', ['jquery', 'apple-pay-sdk'], PAYPLUG_GATEWAY_VERSION, true); - wp_localize_script( 'payplug-apple-pay-cart', 'apple_pay_params', - array( - 'ajax_url_applepay_get_shippings' => \WC_AJAX::get_endpoint('applepay_get_shippings'), - 'ajax_url_place_order_with_dummy_data' => \WC_AJAX::get_endpoint('place_order_with_dummy_data'), - 'ajax_url_update_applepay_order' => \WC_AJAX::get_endpoint('update_applepay_order'), - 'ajax_url_update_applepay_payment' => \WC_AJAX::get_endpoint('update_applepay_payment'), - 'ajax_url_applepay_get_order_totals' => \WC_AJAX::get_endpoint('applepay_get_order_totals'), - 'ajax_url_applepay_cancel_order' => \WC_AJAX::get_endpoint('applepay_cancel_order'), - 'is_cart' => is_cart(), - 'countryCode' => WC()->customer->get_billing_country(), - 'currencyCode' => get_woocommerce_currency(), - 'apple_pay_domain' => $_SERVER['HTTP_HOST'] - ) - ); - - if($this->checkButtonVisibility()){ - echo $this->get_description(); - } - } - - /** + public function add_apple_pay_cart_js() + { + wp_enqueue_script('apple-pay-sdk', 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', [], false, true); + wp_enqueue_script('payplug-apple-pay-cart', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-apple-pay-cart.js', ['jquery', 'apple-pay-sdk'], PAYPLUG_GATEWAY_VERSION, true); + wp_localize_script( + 'payplug-apple-pay-cart', + 'apple_pay_params', + [ + 'ajax_url_applepay_get_shippings' => \WC_AJAX::get_endpoint('applepay_get_shippings'), + 'ajax_url_place_order_with_dummy_data' => \WC_AJAX::get_endpoint('place_order_with_dummy_data'), + 'ajax_url_update_applepay_order' => \WC_AJAX::get_endpoint('update_applepay_order'), + 'ajax_url_update_applepay_payment' => \WC_AJAX::get_endpoint('update_applepay_payment'), + 'ajax_url_applepay_get_order_totals' => \WC_AJAX::get_endpoint('applepay_get_order_totals'), + 'ajax_url_applepay_cancel_order' => \WC_AJAX::get_endpoint('applepay_cancel_order'), + 'is_cart' => is_cart(), + 'countryCode' => WC()->customer->get_billing_country(), + 'currencyCode' => get_woocommerce_currency(), + 'apple_pay_domain' => $_SERVER['HTTP_HOST'], + ] + ); + + if ($this->checkButtonVisibility()) { + echo $this->get_description(); + } + } + + /** * Enqueues Apple Pay scripts for the product page. + */ + public function add_apple_pay_product_js() + { + global $product; + // Only dispay ApplePay on product page for simple and variable products + if ('simple' != $product->get_type() && 'variable' != $product->get_type()) { + return; + } + + wp_enqueue_script('apple-pay-sdk', 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', [], false, true); + wp_enqueue_script('payplug-apple-pay-product', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-apple-pay-product.js', ['jquery', 'apple-pay-sdk'], PAYPLUG_GATEWAY_VERSION, true); + wp_localize_script( + 'payplug-apple-pay-product', + 'apple_pay_params', + [ + 'ajax_url_applepay_get_shippings' => \WC_AJAX::get_endpoint('applepay_get_shippings'), + 'ajax_url_place_order_with_dummy_data' => \WC_AJAX::get_endpoint('place_order_with_dummy_data'), + 'ajax_url_update_applepay_order' => \WC_AJAX::get_endpoint('update_applepay_order'), + 'ajax_url_update_applepay_payment' => \WC_AJAX::get_endpoint('update_applepay_payment'), + 'ajax_url_applepay_get_order_totals' => \WC_AJAX::get_endpoint('applepay_get_order_totals'), + 'ajax_url_applepay_cancel_order' => \WC_AJAX::get_endpoint('applepay_cancel_order'), + 'ajax_url_applepay_empty_cart' => \WC_AJAX::get_endpoint('applepay_empty_cart'), + 'ajax_url_applepay_add_to_cart' => \WC_AJAX::get_endpoint('applepay_add_to_cart'), + 'is_product' => is_product(), + 'cart_shipping' => WC()->cart->get_shipping_total(), + 'countryCode' => WC()->customer->get_billing_country(), + 'currencyCode' => get_woocommerce_currency(), + 'apple_pay_domain' => $_SERVER['HTTP_HOST'], + ] + ); + + if ($this->checkButtonVisibility()) { + echo $this->get_description(); + } + } + + /** + * check if the shipping is required or not. * - * @return void + * @return bool + */ + public function is_shipping_required() + { + $cart = WC()->cart->get_cart(); + + $required = true; + foreach ($cart as $cart_item) { + if (!empty($cart_item['product_id'])) { + $product = wc_get_product($cart_item['product_id']); + + //not required if it enters here + if (!$product->is_virtual() && !$product->is_downloadable()) { + return true; + } + + $required = false; + } + } + + return $required; + } + + /** + * Display unauthorized error. */ - public function add_apple_pay_product_js(){ - global $product; - // Only dispay ApplePay on product page for simple and variable products - if ($product->get_type() != "simple" && $product->get_type() != "variable") { - return; - } - - wp_enqueue_script( 'apple-pay-sdk', 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', array(), false, true ); - wp_enqueue_script('payplug-apple-pay-product', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-apple-pay-product.js', ['jquery', 'apple-pay-sdk'], PAYPLUG_GATEWAY_VERSION, true); - wp_localize_script( 'payplug-apple-pay-product', 'apple_pay_params', - array( - 'ajax_url_applepay_get_shippings' => \WC_AJAX::get_endpoint('applepay_get_shippings'), - 'ajax_url_place_order_with_dummy_data' => \WC_AJAX::get_endpoint('place_order_with_dummy_data'), - 'ajax_url_update_applepay_order' => \WC_AJAX::get_endpoint('update_applepay_order'), - 'ajax_url_update_applepay_payment' => \WC_AJAX::get_endpoint('update_applepay_payment'), - 'ajax_url_applepay_get_order_totals' => \WC_AJAX::get_endpoint('applepay_get_order_totals'), - 'ajax_url_applepay_cancel_order' => \WC_AJAX::get_endpoint('applepay_cancel_order'), - 'ajax_url_applepay_empty_cart' => \WC_AJAX::get_endpoint('applepay_empty_cart'), - 'ajax_url_applepay_add_to_cart' => \WC_AJAX::get_endpoint('applepay_add_to_cart'), - 'is_product' => is_product(), - 'cart_shipping' => WC()->cart->get_shipping_total(), - 'countryCode' => WC()->customer->get_billing_country(), - 'currencyCode' => get_woocommerce_currency(), - 'apple_pay_domain' => $_SERVER['HTTP_HOST'] - ) - ); - - if($this->checkButtonVisibility()){ - echo $this->get_description(); - } - } - - /** - * Check if the shipping address is a carrier - * - * @return bool - */ - private function checkButtonVisibility(){ - $apple_carriers = $this->get_carriers(); - $allowed = false; - $post = $this->get_post_data(); - $chosen_method = isset($post["shipping_method"][0]) ? $post["shipping_method"][0] : null; - - if( empty($chosen_method) ){ - $chosen_method = !empty(WC()->session->chosen_shipping_methods[0]) ? WC()->session->chosen_shipping_methods[0] : null; - } - - if(!$this->is_shipping_required() || is_product()){ - return true; - } - - foreach ( WC()->shipping()->get_packages() as $i => $package ) { - $available_rates = !empty($package['rates']) ? $package['rates'] : []; - if(!empty($available_rates)){ - foreach($available_rates as $method){ - if(in_array($method->get_method_id(), $apple_carriers) ){ - if($chosen_method === $method->get_method_id() . ":" . $method->get_instance_id()){ - $allowed = true; - } - } - } - } - } - - return $allowed; - } - - /** - * - * check if the shipping is required or not - * @return bool - */ - public function is_shipping_required(){ - $cart = WC()->cart->get_cart(); - - $required = true; - foreach ($cart as $cart_item){ - if(!empty($cart_item['product_id']) ){ - $product = wc_get_product( $cart_item['product_id'] ); - - //not required if it enters here - if(!$product->is_virtual() && !$product->is_downloadable()){ - return true; - } - - $required = false; - } - } - - return $required; - - } - - - /** - * Display unauthorized error - * - * @return void - */ - - public static function display_notice() { - ?> + public static function display_notice() + { + ?>
    -

    +

    \WC_AJAX::get_endpoint('payplug_create_order'), - 'ajax_url_applepay_update_payment' => \WC_AJAX::get_endpoint('applepay_update_payment'), - 'ajax_url_applepay_get_order_totals' => \WC_AJAX::get_endpoint('applepay_get_order_totals'), - 'countryCode' => WC()->customer->get_billing_country(), - 'currencyCode' => get_woocommerce_currency(), - 'total' => WC()->cart->total, - "is_checkout" => is_checkout(), - 'apple_pay_domain' => $this->domain_name - ) - ); - } - - /** + public function add_apple_pay_js() + { + wp_enqueue_script('apple-pay-sdk', 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', [], false, true); + wp_enqueue_script( + 'payplug-apple-pay', + PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-apple-pay.js', + [ + 'jquery', + 'apple-pay-sdk', + ], + PAYPLUG_GATEWAY_VERSION, + true + ); + wp_localize_script( + 'payplug-apple-pay', + 'apple_pay_params', + [ + 'ajax_url_payplug_create_order' => \WC_AJAX::get_endpoint('payplug_create_order'), + 'ajax_url_applepay_update_payment' => \WC_AJAX::get_endpoint('applepay_update_payment'), + 'ajax_url_applepay_get_order_totals' => \WC_AJAX::get_endpoint('applepay_get_order_totals'), + 'countryCode' => WC()->customer->get_billing_country(), + 'currencyCode' => get_woocommerce_currency(), + 'total' => WC()->cart->total, + 'is_checkout' => is_checkout(), + 'apple_pay_domain' => $this->domain_name, + ] + ); + } + + /** * Gets the Apple Pay payment icon HTML. * * @return string */ - public function get_icon() - { - $available_img = 'apple-pay-checkout.svg'; - $icons = apply_filters('payplug_payment_icons', [ - 'payplug' => sprintf('Apple Pay', esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $available_img)), - ]); - $icons_str = ''; - foreach ($icons as $icon) { - $icons_str .= $icon; - } - return $icons_str; - } - - /** - * Processes a payment if it was already generated by an intent. - * @param $order - * @return array|null - * @throws \Exception - */ - private function process_standard_intent_payment($order){ - - if ( !is_wc_endpoint_url('order-pay') && - PayplugWoocommerceHelper::is_checkout_block() && - !empty($order->get_transaction_id()) ) { - - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - - try { - $payment = $this->api->payment_retrieve($order->get_transaction_id()); - if (ob_get_length() > 0) { - ob_clean(); - } - - $return_url = esc_url_raw($order->get_checkout_order_received_url()); - - wp_send_json_success( - array( - 'payment_id' => $payment->id, - 'result' => 'success', - 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, - 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null - ) - ); - - return array("stt" => "OK"); - - } catch (HttpException $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } catch (\Exception $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } - } - - return null; - } - - - /** + public function get_icon() + { + $available_img = 'apple-pay-checkout.svg'; + $icons = apply_filters('payplug_payment_icons', [ + 'payplug' => sprintf('Apple Pay', esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $available_img)), + ]); + $icons_str = ''; + foreach ($icons as $icon) { + $icons_str .= $icon; + } + + return $icons_str; + } + + /** * Processes a standard Apple Pay payment. * - * @param \WC_Order $order - * @param int $amount - * @param int $customer_id + * @param \WC_Order $order + * @param int $amount + * @param int $customer_id * @param string $workflow - * - * @return array - * @throws \Exception - */ - public function process_standard_payment($order, $amount, $customer_id, $workflow = 'checkout') - { - - $intent = $this->process_standard_intent_payment($order); - if( !empty($intent) ){ - return $intent; - } - - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - try { - $address_data = PayplugAddressData::from_order($order); - - $return_url = esc_url_raw($order->get_checkout_order_received_url()); - - if (!(substr( $return_url, 0, 4 ) === "http")) { - $return_url = get_site_url().$return_url; - } - - // delivery_type must be removed in Apple Pay - $billing = $address_data->get_billing(); - unset($billing['delivery_type']); - $shipping = $address_data->get_shipping(); - unset($shipping['delivery_type']); - - $payment_data = [ - 'amount' => $amount, - 'currency' => get_woocommerce_currency(), - 'payment_method' => $this->id, - 'payment_context' => array( - 'apple_pay' => array( - 'domain_name' => $this->domain_name, - 'application_data' => base64_encode(json_encode(array( - 'apple_pay_domain' => $this->domain_name, - ))) - ) - ), - 'billing' => $billing, - 'shipping' => $shipping, - 'hosted_payment' => [ - 'return_url' => $return_url, - 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), - ], - 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), - 'metadata' => [ - 'order_id' => $order_id, - 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', - 'domain' => $this->domain_name, - 'applepay_workflow' => $workflow - ] - ]; - - if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { - $payment_data['metadata']['woocommerce_block'] = "CHECKOUT"; - - } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { - $payment_data['metadata']['woocommerce_block'] = "CART"; - } - - - /** - * Filter the payment data before it's used - * - * @param array $payment_data - * @param int $order_id - * @param array $customer_details - * @param PayplugAddressData $address_data - */ - $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); - $payment = $this->api->payment_create($payment_data); - - // Save transaction id for the order - PayplugWoocommerceHelper::is_pre_30() - ? update_post_meta($order_id, '_transaction_id', $payment->id) - : $order->set_transaction_id($payment->id); - - if (is_callable([$order, 'save'])) { - $order->save(); - } - - /** - * Fires once a payment has been created. - * - * @param int $order_id Order ID - * @param PaymentResource $payment Payment resource - */ - \do_action('payplug_gateway_payment_created', $order_id, $payment); - - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); - PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); - - PayplugGateway::log(sprintf('Payment creation complete for order #%s', $order_id)); - - return [ - 'result' => 'success', - 'merchant_session' => $payment->payment_method["merchant_session"], - 'payment_id' => $payment->id, - 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), - 'return_url' => $return_url, - ]; - - } catch (HttpException $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); - if($workflow === "cart"){ - wp_send_json_error(["code" => $e->getCode(), "msg" => __('Payment processing failed. Please retry.', 'payplug'), "order_id" => $order_id ]); - } - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } catch (\Exception $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); - if($workflow === "cart"){ - wp_send_json_error(["code" => $e->getCode(), "msg" => __('Payment processing failed. Please retry.', 'payplug'), "order_id" => $order_id ]); - } - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } - - } - - /** - * Sets the checkout button status. * - * @param bool $status - * @return void + * @throws \Exception + * + * @return array */ - private function set_button_checkout($status){ - $this->checkout = $status; - } + public function process_standard_payment($order, $amount, $customer_id, $workflow = 'checkout') + { + $intent = $this->process_standard_intent_payment($order); + if (!empty($intent)) { + return $intent; + } + + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + + try { + $address_data = PayplugAddressData::from_order($order); + + $return_url = esc_url_raw($order->get_checkout_order_received_url()); + + if (!('http' === substr($return_url, 0, 4))) { + $return_url = get_site_url() . $return_url; + } + + // delivery_type must be removed in Apple Pay + $billing = $address_data->get_billing(); + unset($billing['delivery_type']); + $shipping = $address_data->get_shipping(); + unset($shipping['delivery_type']); + + $payment_data = [ + 'amount' => $amount, + 'currency' => get_woocommerce_currency(), + 'payment_method' => $this->id, + 'payment_context' => [ + 'apple_pay' => [ + 'domain_name' => $this->domain_name, + 'application_data' => base64_encode(json_encode([ + 'apple_pay_domain' => $this->domain_name, + ])), + ], + ], + 'billing' => $billing, + 'shipping' => $shipping, + 'hosted_payment' => [ + 'return_url' => $return_url, + 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), + ], + 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), + 'metadata' => [ + 'order_id' => $order_id, + 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', + 'domain' => $this->domain_name, + 'applepay_workflow' => $workflow, + ], + ]; + + if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { + $payment_data['metadata']['woocommerce_block'] = 'CHECKOUT'; + } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { + $payment_data['metadata']['woocommerce_block'] = 'CART'; + } + + /** + * Filter the payment data before it's used. + * + * @param array $payment_data + * @param int $order_id + * @param array $customer_details + * @param PayplugAddressData $address_data + */ + $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); + $payment = $this->api->payment_create($payment_data); + + // Save transaction id for the order + PayplugWoocommerceHelper::is_pre_30() + ? update_post_meta($order_id, '_transaction_id', $payment->id) + : $order->set_transaction_id($payment->id); + + if (is_callable([$order, 'save'])) { + $order->save(); + } + + /* + * Fires once a payment has been created. + * + * @param int $order_id Order ID + * @param PaymentResource $payment Payment resource + */ + \do_action('payplug_gateway_payment_created', $order_id, $payment); + + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); + + PayplugGateway::log(sprintf('Payment creation complete for order #%s', $order_id)); + + return [ + 'result' => 'success', + 'merchant_session' => $payment->payment_method['merchant_session'], + 'payment_id' => $payment->id, + 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), + 'return_url' => $return_url, + ]; + } catch (HttpException $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); + if ('cart' === $workflow) { + wp_send_json_error(['code' => $e->getCode(), 'msg' => __('Payment processing failed. Please retry.', 'payplug'), 'order_id' => $order_id]); + } + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } catch (\Exception $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); + if ('cart' === $workflow) { + wp_send_json_error(['code' => $e->getCode(), 'msg' => __('Payment processing failed. Please retry.', 'payplug'), 'order_id' => $order_id]); + } + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } + } + + /** + * Gets the cart button status. + * + * @return bool + */ + public function get_button_cart() + { + return $this->cart; + } - /** - * Sets the cart button status. + /** + * Gets the product button status. * - * @param bool $status - * @return void + * @return bool */ - private function set_button_cart($status){ - $this->cart = $status; - } + public function get_button_product() + { + return $this->product; + } - /** - * Sets the product button status. + /** + * Gets the list of allowed carriers for Apple Pay. * - * @param bool $status - * @return void + * @return array */ - private function set_button_product($status){ - $this->product = $status; - } + public function get_carriers() + { + return $this->carriers; + } - /** - * Gets the checkout button status. + /** + * Check if the shipping address is a carrier. * * @return bool */ - private function get_button_checkout(){ - return $this->checkout; - } + private function checkButtonVisibility() + { + $apple_carriers = $this->get_carriers(); + $allowed = false; + $post = $this->get_post_data(); + $chosen_method = isset($post['shipping_method'][0]) ? $post['shipping_method'][0] : null; + + if (empty($chosen_method)) { + $chosen_method = !empty(WC()->session->chosen_shipping_methods[0]) ? WC()->session->chosen_shipping_methods[0] : null; + } + + if (!$this->is_shipping_required() || is_product()) { + return true; + } + + foreach (WC()->shipping()->get_packages() as $i => $package) { + $available_rates = !empty($package['rates']) ? $package['rates'] : []; + if (!empty($available_rates)) { + foreach ($available_rates as $method) { + if (in_array($method->get_method_id(), $apple_carriers)) { + if ($chosen_method === $method->get_method_id() . ':' . $method->get_instance_id()) { + $allowed = true; + } + } + } + } + } + + return $allowed; + } + + /** + * Processes a payment if it was already generated by an intent. + * + * @param $order + * + * @throws \Exception + * + * @return array|null + */ + private function process_standard_intent_payment($order) + { + if (!is_wc_endpoint_url('order-pay') + && PayplugWoocommerceHelper::is_checkout_block() + && !empty($order->get_transaction_id())) { + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + + try { + $payment = $this->api->payment_retrieve($order->get_transaction_id()); + if (ob_get_length() > 0) { + ob_clean(); + } + + $return_url = esc_url_raw($order->get_checkout_order_received_url()); + + wp_send_json_success( + [ + 'payment_id' => $payment->id, + 'result' => 'success', + 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, + 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null, + ] + ); + + return ['stt' => 'OK']; + } catch (HttpException $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } catch (\Exception $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } + } + + return null; + } + + /** + * Sets the checkout button status. + * + * @param bool $status + */ + private function set_button_checkout($status) + { + $this->checkout = $status; + } - /** - * Gets the cart button status. + /** + * Sets the cart button status. * - * @return bool + * @param bool $status */ - public function get_button_cart(){ - return $this->cart; - } + private function set_button_cart($status) + { + $this->cart = $status; + } - /** - * Gets the product button status. + /** + * Sets the product button status. * - * @return bool + * @param bool $status */ - public function get_button_product(){ - return $this->product; - } + private function set_button_product($status) + { + $this->product = $status; + } - /** - * Gets the list of allowed carriers for Apple Pay. + /** + * Gets the checkout button status. * - * @return array + * @return bool */ - public function get_carriers(){ - return $this->carriers; - } + private function get_button_checkout() + { + return $this->checkout; + } - /** + /** * Sets the list of allowed carriers for Apple Pay. * * @param array $carriers - * @return void */ - private function set_carriers($carriers){ - $this->carriers = $carriers; - } - + private function set_carriers($carriers) + { + $this->carriers = $carriers; + } } diff --git a/src/Controller/IntegratedPayment.php b/src/Controller/IntegratedPayment.php index ad349edb..ca206688 100644 --- a/src/Controller/IntegratedPayment.php +++ b/src/Controller/IntegratedPayment.php @@ -2,42 +2,35 @@ namespace Payplug\PayplugWoocommerce\Controller; -use Payplug\Payplug; -use Payplug\Authentication; -use Payplug\PayplugWoocommerce\Gateway\PayplugGateway; -use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -use Payplug\Exception\ForbiddenException; - class IntegratedPayment { - protected $options; - - public function __construct($options) - { - $this->options = $options; - } + protected $options; - static public function template_form($oneClick){ + public function __construct($options) + { + $this->options = $options; + } - $logo = PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/integrated/logo-payplug.png'; - $lock = PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/integrated/lock.svg'; - $privacy_policy_url = __("payplug_integrated_payment_privacy_policy_url", "payplug"); - $f = function ($fn) { - return $fn; - }; + public static function template_form($oneClick) + { + $logo = PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/integrated/logo-payplug.png'; + $lock = PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/integrated/lock.svg'; + $privacy_policy_url = __('payplug_integrated_payment_privacy_policy_url', 'payplug'); + $f = function ($fn) { + return $fn; + }; - if($oneClick) { - $saved = << HTML; - } else { - $saved = ""; - } + } else { + $saved = ''; + } - - return <<
    @@ -75,13 +68,12 @@ static public function template_form($oneClick){
    - +
    HTML; - } - + } } diff --git a/src/Controller/PayplugGenericGateway.php b/src/Controller/PayplugGenericGateway.php index 81e84f4e..50b204d4 100644 --- a/src/Controller/PayplugGenericGateway.php +++ b/src/Controller/PayplugGenericGateway.php @@ -2,533 +2,520 @@ namespace Payplug\PayplugWoocommerce\Controller; +use Automattic\WooCommerce\Utilities\OrderUtil; +use Payplug\Exception\HttpException; +use Payplug\Payplug; use Payplug\PayplugWoocommerce\Gateway\PayplugAddressData; use Payplug\PayplugWoocommerce\Gateway\PayplugGateway; use Payplug\PayplugWoocommerce\Interfaces\PayplugGatewayBuilder; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -use Automattic\WooCommerce\Utilities\OrderUtil; - - -use Payplug\Authentication; -use Payplug\Exception\ConfigurationException; -use Payplug\Exception\HttpException; -use Payplug\Exception\ForbiddenException; -use Payplug\Payplug; use Payplug\Resource\Payment as PaymentResource; use Payplug\Resource\Refund as RefundResource; class PayplugGenericGateway extends PayplugGateway implements PayplugGatewayBuilder { - - /** - * @var string - */ - public $image; - - /** - * @var array - */ - protected $allowed_country_codes; - - public function __construct() - { - parent::__construct(); - add_action('woocommerce_after_order_itemmeta', [$this, 'hide_wc_refund_button']); - } - - /** - * Generic code to fetch payment gateway specific image - * @return string - */ - public function get_icon() - { - - //get object $image - $icons = apply_filters('payplug_payment_icons', [ - 'payplug' => sprintf('%s', esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->image), $this->id . " Icon"), - ]); - - $icons_str = ''; - foreach ($icons as $icon) { - $icons_str .= $icon; - } - - return $icons_str; - } - - /** - * @return void - */ - public function display_notice() - { - $error_message = 'payplug_' . $this->id . '_unauthorized_message'; - ?> + /** + * @var string + */ + public $image; + + /** + * @var array + */ + protected $allowed_country_codes; + + public function __construct() + { + parent::__construct(); + add_action('woocommerce_after_order_itemmeta', [$this, 'hide_wc_refund_button']); + } + + /** + * Generic code to fetch payment gateway specific image. + * + * @return string + */ + public function get_icon() + { + //get object $image + $icons = apply_filters('payplug_payment_icons', [ + 'payplug' => sprintf('%s', esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->image), $this->id . ' Icon'), + ]); + + $icons_str = ''; + foreach ($icons as $icon) { + $icons_str .= $icon; + } + + return $icons_str; + } + + public function display_notice() + { + $error_message = 'payplug_' . $this->id . '_unauthorized_message'; ?>
    -

    +

    settings['enabled']) && 'no' === $this->settings['enabled']){ - return false; - } - - $account = PayplugWoocommerceHelper::generic_get_account_data_from_options( $this->id ); - $options = PayplugWoocommerceHelper::get_payplug_options(); - - if( !$this->check_api_gateway_enable($account)){ - return false; - } - - if (empty($options) || empty($options[$this->id]) || $options[$this->id] === 'no') { - return false; - } - - - if(!is_admin() && !PayplugWoocommerceHelper::is_checkout_block()){ - if (empty(WC()->cart) && !is_admin()) { - return false; - } - - //for backend orders - if (!empty(get_query_var('order-pay'))) { - $order = wc_get_order( (int) get_query_var('order-pay')); - $items = $order->get_items(); - $country_code_shipping = $order->get_shipping_country(); - $country_code_billing = $order->get_billing_country(); - $this->order_items_to_cart(WC()->cart, $items); - } - - if ( empty( $country_code_billing ) || empty( $country_code_shipping ) ) { - $country_code_shipping = method_exists(WC()->customer, "get_shipping_country") ? WC()->customer->get_shipping_country() : null; - $country_code_billing = method_exists(WC()->customer, "get_billing_country") ? WC()->customer->get_billing_country() : null;; - } - - if( !$this->check_billing_country_permissions($account, $country_code_billing) ){ - return false; - } - } - - return true; - } - - /** - * check if payment is enable and customer has permissions - * @param $account - * @return bool - */ - protected function check_api_gateway_enable($account){ - - if ( - isset( $account["payment_methods"] ) && - empty( $account["payment_methods"][ $this->id ] ) && - !$account["payment_methods"][ $this->id ]['enabled'] - ) { - return false; - } - - return true; - } - - - /** - * Check if billing country can use this payment method - * @param $account - * @param $billing_code - * @return bool - */ - public function check_billing_country_permissions($account, $billing_code){ - $this->allowed_country_codes = !empty($account["payment_methods"][ $this->id ]['allowed_countries']) ? $account["payment_methods"][ $this->id ]['allowed_countries'] : null; - - if (is_array($this->allowed_country_codes)) { - if ( in_array( "ALL", $this->allowed_country_codes) || empty( $this->allowed_country_codes ) ) { - return true; - } - - //check if country is allowed - if ( in_array( $billing_code, $this->allowed_country_codes ) ) { - return true; - - } else { - return false; - } - } - - return true; - } - - - /** - * if payment was generated by an intend, we shouldn't generate another one and try to pay it, this would generate duplications - * @param $order - * @return array|null - * @throws \Exception - */ - private function process_standard_intent_payment($order){ - - if ( !is_wc_endpoint_url('order-pay') && - empty($_POST["payplug_non_blocks"]) && - PayplugWoocommerceHelper::is_checkout_block() && - ( - ( $this->id === "payplug" && ($this->payment_method === 'integrated'|| $this->payment_method === 'popup') ) || - ( $this->id === "american_express" && $this->payment_method === 'popup') - ) && - !empty($order->get_transaction_id()) ) { - - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - - try { - $payment = $this->api->payment_retrieve($order->get_transaction_id()); - if (ob_get_length() > 0) { - ob_clean(); - } - - - // Save transaction id for the order - PayplugWoocommerceHelper::is_pre_30() - ? update_post_meta($order_id, '_transaction_id', $payment->id) - : $order->set_transaction_id($payment->id); - - if (is_callable([$order, 'save'])) { - $order->save(); - } - - /** - * Fires once a payment has been created. - * - * @param int $order_id Order ID - * @param PaymentResource $payment Payment resource - */ - \do_action('payplug_gateway_payment_created', $order_id, $payment); - - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); - PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); - - PayplugGateway::log(sprintf('Payment intent created for order #%s', $order_id)); - - $return_url = esc_url_raw($order->get_checkout_order_received_url()); - - wp_send_json_success( - array( - 'payment_id' => $payment->id, - 'result' => 'success', - 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, - 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null - ) - ); - - return array("stt" => "OK"); - - } catch (HttpException $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } catch (\Exception $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } - } - - return null; - } - - public function process_standard_payment($order, $amount, $customer_id) - { - - $intent = $this->process_standard_intent_payment($order); - if( !empty($intent) ){ - return $intent; - } - - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - try { - - //if there's no auth to process payment - if ( !$this->checkGateway() ){ - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } - - $address_data = PayplugAddressData::from_order($order); - - $return_url = esc_url_raw($order->get_checkout_order_received_url()); - - if (!(substr( $return_url, 0, 4 ) === "http")) { - $return_url = get_site_url().$return_url; - } - - $payment_data = [ - 'amount' => $amount, - 'currency' => get_woocommerce_currency(), - 'payment_method' => $this->id, - 'billing' => $address_data->get_billing(), - 'shipping' => $address_data->get_shipping(), - 'hosted_payment' => [ - 'return_url' => $return_url, - 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), - ], - 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), - 'metadata' => [ - 'order_id' => $order_id, - 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', - 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), - ], - "save_card"=> false, - "force_3ds"=> false - ]; - - if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { - $payment_data['metadata']['woocommerce_block'] = "CHECKOUT"; - - } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { - $payment_data['metadata']['woocommerce_block'] = "CART"; - } - - /** - * Filter the payment data before it's used - * - * @param array $payment_data - * @param int $order_id - * @param array $customer_details - * @param PayplugAddressData $address_data - */ - $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); - $payment = $this->api->payment_create($payment_data); - - // Save transaction id for the order - PayplugWoocommerceHelper::is_pre_30() - ? update_post_meta($order_id, '_transaction_id', $payment->id) - : $order->set_transaction_id($payment->id); - - $order->set_payment_method( $this->id ); - $order->set_payment_method_title($this->method_title); - - if (is_callable([$order, 'save'])) { - $order->save(); - } - - /** - * Fires once a payment has been created. - * - * @param int $order_id Order ID - * @param PaymentResource $payment Payment resource - */ - \do_action('payplug_gateway_payment_created', $order_id, $payment); - - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); - PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); - - PayplugGateway::log(sprintf('Payment creation complete for order #%s', $order_id)); - - return [ - 'result' => 'success', - 'redirect' => $payment->hosted_payment->payment_url, - 'cancel' => $payment->hosted_payment->cancel_url, - ]; - - } catch (HttpException $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } catch (\Exception $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } - - } - - /** - * Process refund for an order paid with PayPlug gateway. - * - * @param int $order_id - * @param null $amount - * @param string $reason - * - * @return bool|\WP_Error - */ - public function process_refund($order_id, $amount = null, $reason = ''){ - - PayplugGateway::log(sprintf('Processing refund for order #%s', $order_id)); - - if( !$this->user_logged_in()){ - PayplugGateway::log(__('You must be logged in with your PayPlug account.', 'payplug'), 'error'); - return new \WP_Error('process_refund_error', __('You must be logged in with your PayPlug account.', 'payplug')); - } - - $order = wc_get_order($order_id); - if (!$order instanceof \WC_Order) { - PayplugGateway::log(sprintf('The order #%s does not exist.', $order_id), 'error'); - return new \WP_Error('process_refund_error', sprintf(__('The order %s does not exist.', 'payplug'), $order_id)); - } - - if ($order->get_status() === "cancelled") { - PayplugGateway::log(sprintf('The order #%s cannot be refund.', $order_id), 'error'); - return new \WP_Error('process_refund_error', sprintf(__('The order %s cannot be refund.', 'payplug'), $order_id)); - } - - $transaction_id = PayplugWoocommerceHelper::is_pre_30() ? get_post_meta($order_id, '_transaction_id', true) : $order->get_transaction_id(); - if (empty($transaction_id)) { - PayplugGateway::log(sprintf('The order #%s does not have PayPlug transaction ID associated with it.', $order_id), 'error'); - return new \WP_Error('process_refund_error', __('No PayPlug transaction was found for this order. The refund could not be processed.', 'payplug')); - } - - /** - * PPRO gateways feature! - */ - if( isset($this->enable_refund) && $this->enable_refund === false){ - add_action('admin_head', [$this, 'hide_wc_refund_button'] ); - PayplugGateway::log(__('payplug_refund_disabled_error', 'payplug'), 'error'); - return new \WP_Error('process_refund_error', __('payplug_refund_disabled_error', 'payplug')); - } - - $customer_id = PayplugWoocommerceHelper::is_pre_30() ? $order->customer_user : $order->get_customer_id(); - $data = [ - 'metadata' => [ - 'order_id' => $order_id, - 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', - 'refund_from' => 'woocommerce', - ] - ]; - - if (!is_null($amount)) { - $data['amount'] = PayplugWoocommerceHelper::get_payplug_amount($amount); - } - - if (!empty($reason)) { - $data['metadata']['reason'] = $reason; - } - - /** - * Filter the refund data before it's used. - * - * @param array $data - * @param int $order_id - * @param string $transaction_id - */ - $data = apply_filters('payplug_gateway_refund_data', $data, $order_id, $transaction_id); - - try { - $refund = $this->api->refund_create($transaction_id, $data); - - if($refund->object === "error"){ - PayplugGateway::log(__('payplug_ppro_flag_error', 'payplug'), 'error'); - return new \WP_Error('process_refund_error', __('payplug_ppro_flag_error', 'payplug')); - } - - /** - * Fires once a refund has been created. - * - * @param int $order_id Order ID - * @param RefundResource $refund Refund resource - * @param string $transaction_id Transaction id - */ - \do_action('payplug_gateway_refund_created', $order_id, $refund, $transaction_id); - - $refund_meta_key = sprintf('_pr_%s', wc_clean($refund->id)); - if (PayplugWoocommerceHelper::is_pre_30()) { - update_post_meta($order_id, $refund_meta_key, $refund->id); - } else { - $order->add_meta_data($refund_meta_key, $refund->id, true); - $order->save(); - } - - $note = sprintf(__('Refund %s : Refunded %s', 'payplug'), wc_clean($refund->id), wc_price(((int) $refund->amount) / 100)); - if (!empty($refund->metadata['reason'])) { - $note .= sprintf(' (%s)', esc_html($refund->metadata['reason'])); - } - $order->add_order_note($note); - - try { - $payment = $this->api->payment_retrieve($transaction_id); - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); - PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); - } catch (\Exception $e) { - } - - PayplugGateway::log('Refund process complete for the order.'); - - return true; - } catch (HttpException $e) { - PayplugGateway::log(sprintf('Refund request error for the order %s from PayPlug API : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); - - return new \WP_Error('process_refund_error', __('The transaction could not be refunded. Please try again.', 'payplug')); - } catch (\Exception $e) { - PayplugGateway::log(sprintf('Refund request error for the order %s : %s', $order_id, wc_clean($e->getMessage())), 'error'); - - return new \WP_Error('process_refund_error', __('The transaction could not be refunded. Please try again.', 'payplug')); - } - - - - } - - - /** - * Avoid usage of button refund on the BO - * @return false|void - */ - public function hide_wc_refund_button(){ - global $post; - - $payment_methods = []; - - if ( class_exists("OrderUtil") && OrderUtil::custom_orders_table_usage_is_enabled() ) { - $order_id = !empty($_GET["id"]) ? $_GET["id"] : null; - - }else{ - - if(!empty($post->ID)){ - $order_id = $post->ID; - - }else if( !empty($_GET["id"]) ){ - $order_id = $_GET["id"]; - - }else{ - $order_id = null; - - } - } - - if(empty($order_id)){ - return false; - } - - $order = new \WC_Order($order_id); - if (in_array($order->get_payment_method(), $payment_methods)) { - ?> + } + + public function checkGateway() + { + //check if module is enabled + if (!empty($this->settings['enabled']) && 'no' === $this->settings['enabled']) { + return false; + } + + $account = PayplugWoocommerceHelper::generic_get_account_data_from_options($this->id); + $options = PayplugWoocommerceHelper::get_payplug_options(); + + if (!$this->check_api_gateway_enable($account)) { + return false; + } + + if (empty($options) || empty($options[$this->id]) || 'no' === $options[$this->id]) { + return false; + } + + if (!is_admin() && !PayplugWoocommerceHelper::is_checkout_block()) { + if (empty(WC()->cart) && !is_admin()) { + return false; + } + + //for backend orders + if (!empty(get_query_var('order-pay'))) { + $order = wc_get_order((int) get_query_var('order-pay')); + $items = $order->get_items(); + $country_code_shipping = $order->get_shipping_country(); + $country_code_billing = $order->get_billing_country(); + $this->order_items_to_cart(WC()->cart, $items); + } + + if (empty($country_code_billing) || empty($country_code_shipping)) { + $country_code_shipping = method_exists(WC()->customer, 'get_shipping_country') ? WC()->customer->get_shipping_country() : null; + $country_code_billing = method_exists(WC()->customer, 'get_billing_country') ? WC()->customer->get_billing_country() : null; + } + + if (!$this->check_billing_country_permissions($account, $country_code_billing)) { + return false; + } + } + + return true; + } + + /** + * Check if billing country can use this payment method. + * + * @param $account + * @param $billing_code + * + * @return bool + */ + public function check_billing_country_permissions($account, $billing_code) + { + $this->allowed_country_codes = !empty($account['payment_methods'][$this->id]['allowed_countries']) ? $account['payment_methods'][$this->id]['allowed_countries'] : null; + + if (is_array($this->allowed_country_codes)) { + if (in_array('ALL', $this->allowed_country_codes) || empty($this->allowed_country_codes)) { + return true; + } + + //check if country is allowed + if (in_array($billing_code, $this->allowed_country_codes)) { + return true; + } + + return false; + } + + return true; + } + + public function process_standard_payment($order, $amount, $customer_id) + { + $intent = $this->process_standard_intent_payment($order); + if (!empty($intent)) { + return $intent; + } + + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + + try { + //if there's no auth to process payment + if (!$this->checkGateway()) { + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } + + $address_data = PayplugAddressData::from_order($order); + + $return_url = esc_url_raw($order->get_checkout_order_received_url()); + + if (!('http' === substr($return_url, 0, 4))) { + $return_url = get_site_url() . $return_url; + } + + $payment_data = [ + 'amount' => $amount, + 'currency' => get_woocommerce_currency(), + 'payment_method' => $this->id, + 'billing' => $address_data->get_billing(), + 'shipping' => $address_data->get_shipping(), + 'hosted_payment' => [ + 'return_url' => $return_url, + 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), + ], + 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), + 'metadata' => [ + 'order_id' => $order_id, + 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', + 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), + ], + 'save_card' => false, + 'force_3ds' => false, + ]; + + if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { + $payment_data['metadata']['woocommerce_block'] = 'CHECKOUT'; + } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { + $payment_data['metadata']['woocommerce_block'] = 'CART'; + } + + /** + * Filter the payment data before it's used. + * + * @param array $payment_data + * @param int $order_id + * @param array $customer_details + * @param PayplugAddressData $address_data + */ + $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); + $payment = $this->api->payment_create($payment_data); + + // Save transaction id for the order + PayplugWoocommerceHelper::is_pre_30() + ? update_post_meta($order_id, '_transaction_id', $payment->id) + : $order->set_transaction_id($payment->id); + + $order->set_payment_method($this->id); + $order->set_payment_method_title($this->method_title); + + if (is_callable([$order, 'save'])) { + $order->save(); + } + + /* + * Fires once a payment has been created. + * + * @param int $order_id Order ID + * @param PaymentResource $payment Payment resource + */ + \do_action('payplug_gateway_payment_created', $order_id, $payment); + + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); + + PayplugGateway::log(sprintf('Payment creation complete for order #%s', $order_id)); + + return [ + 'result' => 'success', + 'redirect' => $payment->hosted_payment->payment_url, + 'cancel' => $payment->hosted_payment->cancel_url, + ]; + } catch (HttpException $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } catch (\Exception $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } + } + + /** + * Process refund for an order paid with PayPlug gateway. + * + * @param int $order_id + * @param null $amount + * @param string $reason + * + * @return bool|\WP_Error + */ + public function process_refund($order_id, $amount = null, $reason = '') + { + PayplugGateway::log(sprintf('Processing refund for order #%s', $order_id)); + + if (!$this->user_logged_in()) { + PayplugGateway::log(__('You must be logged in with your PayPlug account.', 'payplug'), 'error'); + + return new \WP_Error('process_refund_error', __('You must be logged in with your PayPlug account.', 'payplug')); + } + + $order = wc_get_order($order_id); + if (!$order instanceof \WC_Order) { + PayplugGateway::log(sprintf('The order #%s does not exist.', $order_id), 'error'); + + return new \WP_Error('process_refund_error', sprintf(__('The order %s does not exist.', 'payplug'), $order_id)); + } + + if ('cancelled' === $order->get_status()) { + PayplugGateway::log(sprintf('The order #%s cannot be refund.', $order_id), 'error'); + + return new \WP_Error('process_refund_error', sprintf(__('The order %s cannot be refund.', 'payplug'), $order_id)); + } + + $transaction_id = PayplugWoocommerceHelper::is_pre_30() ? get_post_meta($order_id, '_transaction_id', true) : $order->get_transaction_id(); + if (empty($transaction_id)) { + PayplugGateway::log(sprintf('The order #%s does not have PayPlug transaction ID associated with it.', $order_id), 'error'); + + return new \WP_Error('process_refund_error', __('No PayPlug transaction was found for this order. The refund could not be processed.', 'payplug')); + } + + // PPRO gateways feature! + if (isset($this->enable_refund) && false === $this->enable_refund) { + add_action('admin_head', [$this, 'hide_wc_refund_button']); + PayplugGateway::log(__('payplug_refund_disabled_error', 'payplug'), 'error'); + + return new \WP_Error('process_refund_error', __('payplug_refund_disabled_error', 'payplug')); + } + + $customer_id = PayplugWoocommerceHelper::is_pre_30() ? $order->customer_user : $order->get_customer_id(); + $data = [ + 'metadata' => [ + 'order_id' => $order_id, + 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', + 'refund_from' => 'woocommerce', + ], + ]; + + if (!is_null($amount)) { + $data['amount'] = PayplugWoocommerceHelper::get_payplug_amount($amount); + } + + if (!empty($reason)) { + $data['metadata']['reason'] = $reason; + } + + /** + * Filter the refund data before it's used. + * + * @param array $data + * @param int $order_id + * @param string $transaction_id + */ + $data = apply_filters('payplug_gateway_refund_data', $data, $order_id, $transaction_id); + + try { + $refund = $this->api->refund_create($transaction_id, $data); + + if ('error' === $refund->object) { + PayplugGateway::log(__('payplug_ppro_flag_error', 'payplug'), 'error'); + + return new \WP_Error('process_refund_error', __('payplug_ppro_flag_error', 'payplug')); + } + + /* + * Fires once a refund has been created. + * + * @param int $order_id Order ID + * @param RefundResource $refund Refund resource + * @param string $transaction_id Transaction id + */ + \do_action('payplug_gateway_refund_created', $order_id, $refund, $transaction_id); + + $refund_meta_key = sprintf('_pr_%s', wc_clean($refund->id)); + if (PayplugWoocommerceHelper::is_pre_30()) { + update_post_meta($order_id, $refund_meta_key, $refund->id); + } else { + $order->add_meta_data($refund_meta_key, $refund->id, true); + $order->save(); + } + + $note = sprintf(__('Refund %s : Refunded %s', 'payplug'), wc_clean($refund->id), wc_price(((int) $refund->amount) / 100)); + if (!empty($refund->metadata['reason'])) { + $note .= sprintf(' (%s)', esc_html($refund->metadata['reason'])); + } + $order->add_order_note($note); + + try { + $payment = $this->api->payment_retrieve($transaction_id); + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); + } catch (\Exception $e) { + } + + PayplugGateway::log('Refund process complete for the order.'); + + return true; + } catch (HttpException $e) { + PayplugGateway::log(sprintf('Refund request error for the order %s from PayPlug API : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); + + return new \WP_Error('process_refund_error', __('The transaction could not be refunded. Please try again.', 'payplug')); + } catch (\Exception $e) { + PayplugGateway::log(sprintf('Refund request error for the order %s : %s', $order_id, wc_clean($e->getMessage())), 'error'); + + return new \WP_Error('process_refund_error', __('The transaction could not be refunded. Please try again.', 'payplug')); + } + } + + /** + * Avoid usage of button refund on the BO. + * + * @return false|void + */ + public function hide_wc_refund_button() + { + global $post; + + $payment_methods = []; + + if (class_exists('OrderUtil') && OrderUtil::custom_orders_table_usage_is_enabled()) { + $order_id = !empty($_GET['id']) ? $_GET['id'] : null; + } else { + if (!empty($post->ID)) { + $order_id = $post->ID; + } elseif (!empty($_GET['id'])) { + $order_id = $_GET['id']; + } else { + $order_id = null; + } + } + + if (empty($order_id)) { + return false; + } + + $order = new \WC_Order($order_id); + if (in_array($order->get_payment_method(), $payment_methods)) { + ?> id === $order->get_payment_method() && isset($this->enable_refund) && $this->enable_refund === false) { - echo "

    " . __('payplug_refund_disabled_error', 'payplug') . "

    "; - } - } - - /** - * Empty the cart and add all order_items - * - * @param $cart - * @param $items - * @return void - */ - private function order_items_to_cart($cart, $items){ - $cart->empty_cart(); - foreach ($items as $item){ - $cart->add_to_cart($item->get_product_id(), $item->get_quantity(), $item->get_variation_id()); - } - } - + } + } + + /** + * refund not possible for PPRO payments. + * + * @param mixed $order + */ + public function refund_not_available($order) + { + if ($this->id === $order->get_payment_method() && isset($this->enable_refund) && false === $this->enable_refund) { + echo "

    " . __('payplug_refund_disabled_error', 'payplug') . '

    '; + } + } + + /** + * check if payment is enable and customer has permissions. + * + * @param $account + * + * @return bool + */ + protected function check_api_gateway_enable($account) + { + if ( + isset($account['payment_methods']) + && empty($account['payment_methods'][$this->id]) + && !$account['payment_methods'][$this->id]['enabled'] + ) { + return false; + } + + return true; + } + + /** + * if payment was generated by an intend, we shouldn't generate another one and try to pay it, this would generate duplications. + * + * @param $order + * + * @throws \Exception + * + * @return array|null + */ + private function process_standard_intent_payment($order) + { + if (!is_wc_endpoint_url('order-pay') + && empty($_POST['payplug_non_blocks']) + && PayplugWoocommerceHelper::is_checkout_block() + && ( + ('payplug' === $this->id && ('integrated' === $this->payment_method || 'popup' === $this->payment_method)) + || ('american_express' === $this->id && 'popup' === $this->payment_method) + ) + && !empty($order->get_transaction_id())) { + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + + try { + $payment = $this->api->payment_retrieve($order->get_transaction_id()); + if (ob_get_length() > 0) { + ob_clean(); + } + + // Save transaction id for the order + PayplugWoocommerceHelper::is_pre_30() + ? update_post_meta($order_id, '_transaction_id', $payment->id) + : $order->set_transaction_id($payment->id); + + if (is_callable([$order, 'save'])) { + $order->save(); + } + + /* + * Fires once a payment has been created. + * + * @param int $order_id Order ID + * @param PaymentResource $payment Payment resource + */ + \do_action('payplug_gateway_payment_created', $order_id, $payment); + + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); + + PayplugGateway::log(sprintf('Payment intent created for order #%s', $order_id)); + + $return_url = esc_url_raw($order->get_checkout_order_received_url()); + + wp_send_json_success( + [ + 'payment_id' => $payment->id, + 'result' => 'success', + 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, + 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null, + ] + ); + + return ['stt' => 'OK']; + } catch (HttpException $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } catch (\Exception $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } + } + + return null; + } + + /** + * Empty the cart and add all order_items. + * + * @param $cart + * @param $items + */ + private function order_items_to_cart($cart, $items) + { + $cart->empty_cart(); + foreach ($items as $item) { + $cart->add_to_cart($item->get_product_id(), $item->get_quantity(), $item->get_variation_id()); + } + } } diff --git a/src/Front/ApplePay.php b/src/Front/ApplePay.php index 76e1e1de..51658a11 100644 --- a/src/Front/ApplePay.php +++ b/src/Front/ApplePay.php @@ -1,438 +1,462 @@ customer->set_shipping_country('FR'); - WC()->customer->set_shipping_city('Paris'); - WC()->customer->set_shipping_postcode('12345'); - WC()->customer->set_shipping_address('Dummy Address'); - - $packages = WC()->cart->get_shipping_packages(); - $shippings = []; - - foreach ( $packages as $package_key => $package ) { - $shipping_methods = $this->get_shipping_methods_from_package($package); - - foreach ( $shipping_methods as $shipping_method ) { - - if (!$shipping_method->supports('shipping-zones') || !$shipping_method->is_enabled()) { - continue; - } - - $rates = $shipping_method->get_rates_for_package($package); - if($this->checkApplePayShipping($shipping_method)){ - $shipping_rate = $rates[$shipping_method->get_rate_id()]; - - array_push($shippings, [ - 'identifier' => $shipping_method->id.'_'.$shipping_method->instance_id, - 'label' => $shipping_method->method_title, - 'detail' => strip_tags($shipping_method->method_description), - 'amount' =>$shipping_rate->get_cost()+$shipping_rate->get_shipping_tax() - ]); - } - } - } - wp_send_json_success($shippings); - } - - /** - * @param $shipping - * @return bool - */ - private function checkApplePayShipping($shipping = []){ - if(empty($shipping)){ - return false; - } - - $apple_pay_options = PayplugWoocommerceHelper::get_applepay_options(); - $apple_pay_carriers = $apple_pay_options['carriers']; - - $exists = false; - foreach($apple_pay_carriers as $carrier => $carrier_id){ - if($carrier_id === $shipping->id){ - return true; - } - } - - return $exists; - } - - - private function get_shipping_methods_from_package($package){ - $shipping_zone = \WC_Shipping_Zones::get_zone_matching_package( $package ); - return $shipping_zone->get_shipping_methods( true ); - } - - public function place_order_with_dummy_data() { - $apple_pay = new ApplePayGateway(); - if ( is_admin() ) { - return; - } - - $cart = WC()->cart; - - if ( ! $cart->is_empty() ) { - try{ - $checkout = WC()->checkout(); - - $order_id = $checkout->create_order(array('payment_method' => $apple_pay->id)); - $order = wc_get_order($order_id); - - - $order->set_address( [ - 'first_name' => 'payplug_applepay_first_name', - 'last_name' => 'payplug_applepay_last_name', - 'address_1' => 'payplug_applepay_address', - 'address_2' => '', - 'city' => 'payplug_applepay_city', - 'postcode' => 'payplug_applepay_psotcode', - 'country' => WC()->countries->get_base_country(), - 'email' => 'payplug_applepay_email@payplug.com' - ], 'billing' ); - $order->set_address( [ - 'first_name' => 'payplug_applepay_first_name', - 'last_name' => 'payplug_applepay_last_name', - 'address_1' => 'payplug_applepay_address', - 'address_2' => '', - 'city' => 'payplug_applepay_city', - 'postcode' => 'payplug_applepay_psotcode', - 'country' => WC()->countries->get_base_country(), - 'email' => 'payplug_applepay_email@payplug.com' - ], 'shipping' ); - - $order->set_payment_method($apple_pay); - - $packages = WC()->cart->get_shipping_packages(); - - WC()->shipping()->reset_shipping(); - - $order->calculate_taxes(); - - $order->calculate_totals(); - - $order->save(); - - $cart->empty_cart(); - - $this->process_cart_payment($order, $apple_pay); - - }catch (\Exception $exception){ - wp_send_json_error([ - 'message' => __('Your order was cancelled.', 'woocommerce') - ]); - } - - } else { - wp_send_json_error(); - } - } - - public function process_cart_payment($order ,$gateway) { - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - $customer_id = PayplugWoocommerceHelper::is_pre_30() ? $order->customer_user : $order->get_customer_id(); - $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($order->get_total() - ($order->get_shipping_tax() + $order->get_shipping_total())); - $amount = $gateway->validate_order_amount($amount); - wp_send_json([ - 'total' => $amount, - 'order_id' => $order_id, - 'payment_data' => $gateway->process_standard_payment($order, $amount, $customer_id, 'product') - ]); - - } - - public function update_applepay_order() { - $order_id = $_POST['order_id']; - $order = wc_get_order( $order_id ); - - $selected_shipping_method = !empty($_POST['shipping_method']) ? $_POST['shipping_method'] : null; - if (!empty($_POST['shipping'])) { - foreach ($_POST['shipping'] as $key => $data) { - switch ($key) { - case 'familyName': - $order->set_shipping_last_name($data); - break; - case 'givenName': - $order->set_shipping_first_name($data); - break; - case 'country': - $order->set_shipping_country($data); - break; - case 'locality': - $order->set_shipping_city($data); - break; - case 'phoneNumber': - $order->set_shipping_phone($data); - break; - case 'postalCode': - $order->set_shipping_postcode($data); - break; - case 'addressLines': - $order->set_shipping_address_1($data[0]); - if (!empty($data[1])) { - $order->set_shipping_address_2($data[1]); - } - break; - case 'emailAddress': - $order->set_billing_email($data); - break; - } - } - } - if (!empty($_POST['billing'])) { - foreach ( $_POST['billing'] as $key => $data ) { - switch ($key) { - case 'familyName': - $order->set_billing_last_name($data); - break; - case 'givenName': - $order->set_billing_first_name($data); - break; - case 'addressLines': - $order->set_billing_address_1($data[0]); - if (!empty($data[1])) { - $order->set_billing_address_2($data[1]); - } - break; - case 'locality': - $order->set_billing_city($data); - break; - case 'country': - $order->set_billing_country($data); - break; - case 'postalCode': - $order->set_billing_postcode($data); - break; - } - } - } - - $address_data = PayplugAddressData::from_order($order); - - $order->set_shipping_country($address_data->get_shipping()['country']); - $order->set_billing_country($address_data->get_billing()['country']); - - $shipping_address= $address_data->get_shipping(); - $shipping_address['state'] = ''; - - $package = array( - 'contents' => array(), - 'contents_cost' => 0, - 'destination' => $shipping_address, - 'applied_coupons' => $order->get_used_coupons(), - 'user' => array( - 'ID' => $order->get_customer_id() - ) - ); - - foreach ($order->get_items('shipping') as $item_id => $shipping_item) { - $order->remove_item($item_id); - } - - $shipping_zone = \WC_Shipping_Zones::get_zone_matching_package( $package ); - if ( $shipping_zone && !empty( $selected_shipping_method ) ) { - - $shipping_methods = $shipping_zone->get_shipping_methods( true ); - $use_taxes = false; - - foreach ( $shipping_methods as $shipping_method ) { - if ( ! $shipping_method->supports( 'shipping-zones' ) || ! $shipping_method->is_enabled() ) { - continue; - } - - $id_shipping_method = $shipping_method->id.'_'.$shipping_method->instance_id; - if ($id_shipping_method === $selected_shipping_method) { - - $shipping_method->calculate_shipping( $package ); - $rates = $shipping_method->get_rates_for_package($package); - - if ( ! empty( $rates ) ) { - - $rate = reset( $rates ); - - $item = new \WC_Order_Item_Shipping(); - $item->set_method_title( $rate->get_label() ); - $item->set_method_id( $rate->get_id() ); - $item->set_total( $rate->get_cost() ); - - if (!empty($rate->taxes)) { - $use_taxes = true; - } - $shipping_taxes = \WC_Tax::calc_shipping_tax( - $rate->get_cost(), - $rate->get_taxes() - ); - - $item->set_taxes( [ - 'total' => $shipping_taxes, - ] ); - - $item->calculate_taxes(); - - $item->save(); - - $order->add_item( $item ); - break; - } - } - } - } - - $order->calculate_totals($use_taxes); - $order->save(); - - wp_send_json($order); - - } - - /** - * update the payment since customers can change their options during the payment - * @return void - * @throws \Payplug\Exception\ConfigurationNotSetException - */ - public function update_applepay_payment() { - - $applepay = new ApplePayGateway(); - - $payment_id = $_POST['payment_id']; - $order_id = $_POST['order_id']; - $payment_token = $_POST['payment_token']; - $amount = $_POST['amount']; - - $payment = \Payplug\Payment::retrieve($payment_id); - - $order = wc_get_order( $order_id ); - $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($amount); - $amount = $applepay->validate_order_amount($amount); - - $address_data = PayplugAddressData::from_order($order); - - // delivery_type must be removed in Apple Pay - $billing = $address_data->get_billing(); - unset($billing['delivery_type']); - $shipping = $address_data->get_shipping(); - unset($shipping['delivery_type']); - - $data = ['apple_pay' => array( - "amount" => $amount, - "payment_token" => $payment_token, - "billing" => $billing, - "shipping" => $shipping, - )]; - - $update = $payment->update($data); - - wp_send_json_success([ - 'amount' => $amount, - 'update' => $update - ]); - } - - public function applepay_cancel_order() - { - $payment_id = !empty($_POST['payment_id']) ? $_POST['payment_id'] : null; - $order_id = $_POST['order_id']; - - if(empty($_POST['order_id'])){ - wp_send_json_error([ - 'message' => __('Your order was cancelled.', 'woocommerce') - ]); - } - - $order = wc_get_order($order_id); - $items = $order->get_items(); - foreach ($items as $item) { - $product_id = $item->get_product_id(); - $quantity = $item->get_quantity(); - $variation_id = $item->get_variation_id(); - $variations = array(); - - if ($variation_id) { - $product = wc_get_product($variation_id); - $variations = $product->get_variation_attributes(); - } - - WC()->cart->add_to_cart($product_id, $quantity, $variation_id, $variations); - } - - //if there's no payment created - if (!empty($payment_id)){ - $options = PayplugWoocommerceHelper::get_payplug_options(); - $payplug_test_key = !empty($options['payplug_test_key']) ? $options['payplug_test_key'] : ''; - $payplug_live_key = !empty($options['payplug_live_key']) ? $options['payplug_live_key'] : ''; - - if (empty($payplug_test_key) && empty($payplug_live_key)) { - wp_send_json_error([ - 'message' => __('Your order was cancelled.', 'woocommerce') - ]); - } - - $payment = \Payplug\Payment::retrieve($payment_id, new Payplug($options['mode'] === 'yes' ? $payplug_live_key : $payplug_test_key)); - $payment->abort(new Payplug($options['mode'] === 'yes' ? $payplug_live_key : $payplug_test_key)); - } - - if ($order->delete(true)) { - wp_send_json_success([ - 'message' => __('Your order was cancelled.', 'woocommerce') - ]); - } else { - wp_send_json_error([ - 'message' => __('Your order was cancelled.', 'woocommerce') - ]); - } - - - } - - public function applepay_empty_cart() { - try { - WC()->cart->empty_cart(); - wp_send_json_success(); - } catch (\Exception $e) { - wp_send_json_error([ - 'message' => __('Your order was cancelled.', 'woocommerce') - ]); - } - } - - public function applepay_add_to_cart() { - try { - if (!empty($_POST['product_id'])) { - $product_id = $_POST['product_id']; - } else { - $product_id = $_POST['product_variation_id']; - } - - $product_quantity = !empty($_POST['product_quantity']) ? $_POST['product_quantity'] : 1; - - WC()->cart->add_to_cart($product_id, $product_quantity); - wp_send_json_success([ - 'total' => WC()->cart->total - WC()->cart->shipping_total - ]); - } catch (\Exception $e) { - wp_send_json_error([ - 'message' => __('Your order was cancelled.', 'woocommerce') - ]); - } - } +class ApplePay +{ + public function __construct() + { + //routes for apple_pay on cart and product page + add_action('wc_ajax_applepay_get_shippings', [$this, 'applepay_get_shippings']); + add_action('wc_ajax_place_order_with_dummy_data', [$this, 'place_order_with_dummy_data']); + add_action('wc_ajax_update_applepay_order', [$this, 'update_applepay_order']); + add_action('wc_ajax_update_applepay_payment', [$this, 'update_applepay_payment']); + add_action('wc_ajax_applepay_cancel_order', [$this, 'applepay_cancel_order']); + add_action('wc_ajax_applepay_empty_cart', [$this, 'applepay_empty_cart']); + add_action('wc_ajax_applepay_add_to_cart', [$this, 'applepay_add_to_cart']); + } + + public function applepay_get_shippings() + { + WC()->customer->set_shipping_country('FR'); + WC()->customer->set_shipping_city('Paris'); + WC()->customer->set_shipping_postcode('12345'); + WC()->customer->set_shipping_address('Dummy Address'); + + $packages = WC()->cart->get_shipping_packages(); + $shippings = []; + + foreach ($packages as $package_key => $package) { + $shipping_methods = $this->get_shipping_methods_from_package($package); + + foreach ($shipping_methods as $shipping_method) { + if (!$shipping_method->supports('shipping-zones') || !$shipping_method->is_enabled()) { + continue; + } + + $rates = $shipping_method->get_rates_for_package($package); + if ($this->checkApplePayShipping($shipping_method)) { + $shipping_rate = $rates[$shipping_method->get_rate_id()]; + + array_push($shippings, [ + 'identifier' => $shipping_method->id . '_' . $shipping_method->instance_id, + 'label' => $shipping_method->method_title, + 'detail' => strip_tags($shipping_method->method_description), + 'amount' => $shipping_rate->get_cost() + $shipping_rate->get_shipping_tax(), + ]); + } + } + } + wp_send_json_success($shippings); + } + + public function place_order_with_dummy_data() + { + $apple_pay = new ApplePayGateway(); + if (is_admin()) { + return; + } + + $cart = WC()->cart; + + if (!$cart->is_empty()) { + try { + $checkout = WC()->checkout(); + + $order_id = $checkout->create_order(['payment_method' => $apple_pay->id]); + $order = wc_get_order($order_id); + + $order->set_address([ + 'first_name' => 'payplug_applepay_first_name', + 'last_name' => 'payplug_applepay_last_name', + 'address_1' => 'payplug_applepay_address', + 'address_2' => '', + 'city' => 'payplug_applepay_city', + 'postcode' => 'payplug_applepay_psotcode', + 'country' => WC()->countries->get_base_country(), + 'email' => 'payplug_applepay_email@payplug.com', + ], 'billing'); + $order->set_address([ + 'first_name' => 'payplug_applepay_first_name', + 'last_name' => 'payplug_applepay_last_name', + 'address_1' => 'payplug_applepay_address', + 'address_2' => '', + 'city' => 'payplug_applepay_city', + 'postcode' => 'payplug_applepay_psotcode', + 'country' => WC()->countries->get_base_country(), + 'email' => 'payplug_applepay_email@payplug.com', + ], 'shipping'); + + $order->set_payment_method($apple_pay); + + $packages = WC()->cart->get_shipping_packages(); + + WC()->shipping()->reset_shipping(); + + $order->calculate_taxes(); + + $order->calculate_totals(); + + $order->save(); + + $cart->empty_cart(); + + $this->process_cart_payment($order, $apple_pay); + } catch (\Exception $exception) { + wp_send_json_error([ + 'message' => __('Your order was cancelled.', 'woocommerce'), + ]); + } + } else { + wp_send_json_error(); + } + } + + public function process_cart_payment($order, $gateway) + { + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + $customer_id = PayplugWoocommerceHelper::is_pre_30() ? $order->customer_user : $order->get_customer_id(); + $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($order->get_total() - ($order->get_shipping_tax() + $order->get_shipping_total())); + $amount = $gateway->validate_order_amount($amount); + wp_send_json([ + 'total' => $amount, + 'order_id' => $order_id, + 'payment_data' => $gateway->process_standard_payment($order, $amount, $customer_id, 'product'), + ]); + } + + public function update_applepay_order() + { + $order_id = $_POST['order_id']; + $order = wc_get_order($order_id); + + $selected_shipping_method = !empty($_POST['shipping_method']) ? $_POST['shipping_method'] : null; + if (!empty($_POST['shipping'])) { + foreach ($_POST['shipping'] as $key => $data) { + switch ($key) { + case 'familyName': + $order->set_shipping_last_name($data); + + break; + + case 'givenName': + $order->set_shipping_first_name($data); + + break; + + case 'country': + $order->set_shipping_country($data); + + break; + + case 'locality': + $order->set_shipping_city($data); + + break; + + case 'phoneNumber': + $order->set_shipping_phone($data); + + break; + + case 'postalCode': + $order->set_shipping_postcode($data); + + break; + + case 'addressLines': + $order->set_shipping_address_1($data[0]); + if (!empty($data[1])) { + $order->set_shipping_address_2($data[1]); + } + + break; + + case 'emailAddress': + $order->set_billing_email($data); + + break; + } + } + } + if (!empty($_POST['billing'])) { + foreach ($_POST['billing'] as $key => $data) { + switch ($key) { + case 'familyName': + $order->set_billing_last_name($data); + + break; + + case 'givenName': + $order->set_billing_first_name($data); + + break; + + case 'addressLines': + $order->set_billing_address_1($data[0]); + if (!empty($data[1])) { + $order->set_billing_address_2($data[1]); + } + + break; + + case 'locality': + $order->set_billing_city($data); + + break; + + case 'country': + $order->set_billing_country($data); + + break; + + case 'postalCode': + $order->set_billing_postcode($data); + + break; + } + } + } + + $address_data = PayplugAddressData::from_order($order); + + $order->set_shipping_country($address_data->get_shipping()['country']); + $order->set_billing_country($address_data->get_billing()['country']); + + $shipping_address = $address_data->get_shipping(); + $shipping_address['state'] = ''; + + $package = [ + 'contents' => [], + 'contents_cost' => 0, + 'destination' => $shipping_address, + 'applied_coupons' => $order->get_used_coupons(), + 'user' => [ + 'ID' => $order->get_customer_id(), + ], + ]; + + foreach ($order->get_items('shipping') as $item_id => $shipping_item) { + $order->remove_item($item_id); + } + + $shipping_zone = \WC_Shipping_Zones::get_zone_matching_package($package); + if ($shipping_zone && !empty($selected_shipping_method)) { + $shipping_methods = $shipping_zone->get_shipping_methods(true); + $use_taxes = false; + + foreach ($shipping_methods as $shipping_method) { + if (!$shipping_method->supports('shipping-zones') || !$shipping_method->is_enabled()) { + continue; + } + + $id_shipping_method = $shipping_method->id . '_' . $shipping_method->instance_id; + if ($id_shipping_method === $selected_shipping_method) { + $shipping_method->calculate_shipping($package); + $rates = $shipping_method->get_rates_for_package($package); + + if (!empty($rates)) { + $rate = reset($rates); + + $item = new \WC_Order_Item_Shipping(); + $item->set_method_title($rate->get_label()); + $item->set_method_id($rate->get_id()); + $item->set_total($rate->get_cost()); + + if (!empty($rate->taxes)) { + $use_taxes = true; + } + $shipping_taxes = \WC_Tax::calc_shipping_tax( + $rate->get_cost(), + $rate->get_taxes() + ); + + $item->set_taxes([ + 'total' => $shipping_taxes, + ]); + + $item->calculate_taxes(); + + $item->save(); + + $order->add_item($item); + + break; + } + } + } + } + + $order->calculate_totals($use_taxes); + $order->save(); + + wp_send_json($order); + } + + /** + * update the payment since customers can change their options during the payment. + * + * @throws \Payplug\Exception\ConfigurationNotSetException + */ + public function update_applepay_payment() + { + $applepay = new ApplePayGateway(); + + $payment_id = $_POST['payment_id']; + $order_id = $_POST['order_id']; + $payment_token = $_POST['payment_token']; + $amount = $_POST['amount']; + + $payment = \Payplug\Payment::retrieve($payment_id); + + $order = wc_get_order($order_id); + $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($amount); + $amount = $applepay->validate_order_amount($amount); + + $address_data = PayplugAddressData::from_order($order); + + // delivery_type must be removed in Apple Pay + $billing = $address_data->get_billing(); + unset($billing['delivery_type']); + $shipping = $address_data->get_shipping(); + unset($shipping['delivery_type']); + + $data = ['apple_pay' => [ + 'amount' => $amount, + 'payment_token' => $payment_token, + 'billing' => $billing, + 'shipping' => $shipping, + ]]; + + $update = $payment->update($data); + + wp_send_json_success([ + 'amount' => $amount, + 'update' => $update, + ]); + } + + public function applepay_cancel_order() + { + $payment_id = !empty($_POST['payment_id']) ? $_POST['payment_id'] : null; + $order_id = $_POST['order_id']; + + if (empty($_POST['order_id'])) { + wp_send_json_error([ + 'message' => __('Your order was cancelled.', 'woocommerce'), + ]); + } + + $order = wc_get_order($order_id); + $items = $order->get_items(); + foreach ($items as $item) { + $product_id = $item->get_product_id(); + $quantity = $item->get_quantity(); + $variation_id = $item->get_variation_id(); + $variations = []; + + if ($variation_id) { + $product = wc_get_product($variation_id); + $variations = $product->get_variation_attributes(); + } + + WC()->cart->add_to_cart($product_id, $quantity, $variation_id, $variations); + } + + //if there's no payment created + if (!empty($payment_id)) { + $options = PayplugWoocommerceHelper::get_payplug_options(); + $payplug_test_key = !empty($options['payplug_test_key']) ? $options['payplug_test_key'] : ''; + $payplug_live_key = !empty($options['payplug_live_key']) ? $options['payplug_live_key'] : ''; + + if (empty($payplug_test_key) && empty($payplug_live_key)) { + wp_send_json_error([ + 'message' => __('Your order was cancelled.', 'woocommerce'), + ]); + } + + $payment = \Payplug\Payment::retrieve($payment_id, new Payplug('yes' === $options['mode'] ? $payplug_live_key : $payplug_test_key)); + $payment->abort(new Payplug('yes' === $options['mode'] ? $payplug_live_key : $payplug_test_key)); + } + + if ($order->delete(true)) { + wp_send_json_success([ + 'message' => __('Your order was cancelled.', 'woocommerce'), + ]); + } else { + wp_send_json_error([ + 'message' => __('Your order was cancelled.', 'woocommerce'), + ]); + } + } + + public function applepay_empty_cart() + { + try { + WC()->cart->empty_cart(); + wp_send_json_success(); + } catch (\Exception $e) { + wp_send_json_error([ + 'message' => __('Your order was cancelled.', 'woocommerce'), + ]); + } + } + + public function applepay_add_to_cart() + { + try { + if (!empty($_POST['product_id'])) { + $product_id = $_POST['product_id']; + } else { + $product_id = $_POST['product_variation_id']; + } + + $product_quantity = !empty($_POST['product_quantity']) ? $_POST['product_quantity'] : 1; + + WC()->cart->add_to_cart($product_id, $product_quantity); + wp_send_json_success([ + 'total' => WC()->cart->total - WC()->cart->shipping_total, + ]); + } catch (\Exception $e) { + wp_send_json_error([ + 'message' => __('Your order was cancelled.', 'woocommerce'), + ]); + } + } + + /** + * @param $shipping + * + * @return bool + */ + private function checkApplePayShipping($shipping = []) + { + if (empty($shipping)) { + return false; + } + + $apple_pay_options = PayplugWoocommerceHelper::get_applepay_options(); + $apple_pay_carriers = $apple_pay_options['carriers']; + + $exists = false; + foreach ($apple_pay_carriers as $carrier => $carrier_id) { + if ($carrier_id === $shipping->id) { + return true; + } + } + + return $exists; + } + + private function get_shipping_methods_from_package($package) + { + $shipping_zone = \WC_Shipping_Zones::get_zone_matching_package($package); + + return $shipping_zone->get_shipping_methods(true); + } } diff --git a/src/Front/Layout/InterfaceOneyLayout.php b/src/Front/Layout/InterfaceOneyLayout.php index 04506dca..31143cb5 100644 --- a/src/Front/Layout/InterfaceOneyLayout.php +++ b/src/Front/Layout/InterfaceOneyLayout.php @@ -4,12 +4,15 @@ interface InterfaceOneyLayout { + public static function simulationPopupContentWithoutFees($oney); - static function simulationPopupContentWithoutFees($oney); - static function simulationPopupContent($oney); - static function footerOneyWithoutFees($min, $max); - static function footerOneyWithFees($min, $max); - static function disabledOneyPopup($oney); - static function payWithOney($oney); + public static function simulationPopupContent($oney); + public static function footerOneyWithoutFees($min, $max); + + public static function footerOneyWithFees($min, $max); + + public static function disabledOneyPopup($oney); + + public static function payWithOney($oney); } diff --git a/src/Front/Layout/InterfaceOneyResources.php b/src/Front/Layout/InterfaceOneyResources.php index 3d561324..d71beebe 100644 --- a/src/Front/Layout/InterfaceOneyResources.php +++ b/src/Front/Layout/InterfaceOneyResources.php @@ -4,11 +4,9 @@ interface InterfaceOneyResources { + public static function addOneyScript(); - static function addOneyScript(); - - static function addOneyCSS(); - - static function addOneyJs(); + public static function addOneyCSS(); + public static function addOneyJs(); } diff --git a/src/Front/Layout/OneyBase.php b/src/Front/Layout/OneyBase.php index 6d66b998..15179799 100644 --- a/src/Front/Layout/OneyBase.php +++ b/src/Front/Layout/OneyBase.php @@ -2,91 +2,99 @@ namespace Payplug\PayplugWoocommerce\Front\Layout; -Abstract Class OneyBase implements InterfaceOneyResources +abstract class OneyBase implements InterfaceOneyResources { + public function __construct() + { + add_action('wp_enqueue_scripts', [self::addOneyCSS()]); + add_action('wp_enqueue_scripts', [self::addOneyJs()]); + add_action('wp_enqueue_scripts', [self::addOneyScript()]); + } - public function __construct() - { - add_action( 'wp_enqueue_scripts', [self::addOneyCSS() ]); - add_action( 'wp_enqueue_scripts', [self::addOneyJs() ]); - add_action( 'wp_enqueue_scripts', [self::addOneyScript()]); + /** + * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. + */ + public static function addOneyScript() + { + wp_localize_script('payplug-oney', 'payplug_config', [ + 'ajax_url' => admin_url('admin-ajax.php'), + 'ajax_action' => 'simulate_oney_payment', + ]); + } - } + /** + * Add CSS. + */ + public static function addOneyCSS() + { + wp_enqueue_style('payplug-oney', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-oney.css', [], PAYPLUG_GATEWAY_VERSION); + } - /** - * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. - * - */ - static function addOneyScript() { - wp_localize_script('payplug-oney', 'payplug_config', array( - 'ajax_url' => admin_url('admin-ajax.php'), - 'ajax_action' => 'simulate_oney_payment' - )); + /** + * Add JS. + */ + public static function addOneyJs() + { + wp_enqueue_script('payplug-oney-mobile', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-detect-mobile.js', [], PAYPLUG_GATEWAY_VERSION, true); + wp_enqueue_script('payplug-oney', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-oney.js', [ + 'jquery', + 'jquery-ui-position', + ], PAYPLUG_GATEWAY_VERSION, true); + } - } + /** + * Popup Content for Oney Without fees. + * + * @param $oney + * + * @return mixed + */ + abstract public static function simulationPopupContentWithoutFees($oney); - /** - * Add CSS - * - */ - static function addOneyCSS() { - wp_enqueue_style('payplug-oney', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-oney.css', [], PAYPLUG_GATEWAY_VERSION); - } + /** + * Popup Content for Oney With fees. + * + * @param $oney + * + * @return mixed + */ + abstract public static function simulationPopupContent($oney); - /** - * Add JS - * - */ - static function addOneyJs() { - wp_enqueue_script('payplug-oney-mobile', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-detect-mobile.js', [], PAYPLUG_GATEWAY_VERSION, true); - wp_enqueue_script('payplug-oney', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-oney.js', [ - 'jquery', - 'jquery-ui-position' - ], PAYPLUG_GATEWAY_VERSION, true); - } + /** + * Popup footer for Oney without fees. + * + * @param $min + * @param $max + * + * @return mixed + */ + abstract public static function footerOneyWithoutFees($min, $max); - /** - * Popup Content for Oney Without fees - * @param $oney - * @return mixed - */ - abstract static function simulationPopupContentWithoutFees($oney); + /** + * Popup footer for Oney with fees. + * + * @param $min + * @param $max + * + * @return mixed + */ + abstract public static function footerOneyWithFees($min, $max); - /** - * Popup Content for Oney With fees - * @param $oney - * @return mixed - */ - abstract static function simulationPopupContent($oney); - - /** - * Popup footer for Oney without fees - * @param $min - * @param $max - * @return mixed - */ - abstract static function footerOneyWithoutFees($min, $max); - - /** - * Popup footer for Oney with fees - * @param $min - * @param $max - * @return mixed - */ - abstract static function footerOneyWithFees($min, $max); - - /** - * disable Oney image on cart - * @param $oney - * @return mixed - */ - abstract static function disabledOneyPopup($oney); - - /** - * Oney image on cart - * @param $oney - * @return mixed - */ - abstract static function payWithOney($oney); + /** + * disable Oney image on cart. + * + * @param $oney + * + * @return mixed + */ + abstract public static function disabledOneyPopup($oney); + /** + * Oney image on cart. + * + * @param $oney + * + * @return mixed + */ + abstract public static function payWithOney($oney); } diff --git a/src/Front/Layout/OneyFR.php b/src/Front/Layout/OneyFR.php index 67fc6bdd..e620c8c7 100644 --- a/src/Front/Layout/OneyFR.php +++ b/src/Front/Layout/OneyFR.php @@ -2,35 +2,36 @@ namespace Payplug\PayplugWoocommerce\Front\Layout; +use function is_cart; use Payplug\PayplugWoocommerce\Front\PayplugOney\Requests\OneyWithFees; use Payplug\PayplugWoocommerce\Front\PayplugOney\Requests\OneyWithoutFees; use Payplug\PayplugWoocommerce\Gateway\PayplugGatewayOney3x; -use function is_cart; class OneyFR extends OneyBase implements InterfaceOneyLayout { - public function __construct() - { - parent::__construct(); - } - - /** - * @param OneyWithoutFees $oney - * @return string - */ - static function simulationPopupContentWithoutFees( $oney ){ + public function __construct() + { + parent::__construct(); + } - $simulationResponse = $oney->getSimulation(); + /** + * @param OneyWithoutFees $oney + * + * @return string + */ + public static function simulationPopupContentWithoutFees($oney) + { + $simulationResponse = $oney->getSimulation(); - $x4 = $simulationResponse['x4_without_fees']; - $x3 = $simulationResponse['x3_without_fees']; + $x4 = $simulationResponse['x4_without_fees']; + $x3 = $simulationResponse['x3_without_fees']; - $financing_cost_3x = intval($x3['total_cost']) / 100; - $financing_cost_4x = intval($x4['total_cost']) / 100; + $financing_cost_3x = intval($x3['total_cost']) / 100; + $financing_cost_4x = intval($x4['total_cost']) / 100; - $f = function($fn) { return $fn; }; + $f = function ($fn) { return $fn; }; - return <<
    @@ -61,26 +62,26 @@ static function simulationPopupContentWithoutFees( $oney ){
    HTML; + } - } + /** + * @param OneyWithFees $oney + * + * @return string + */ + public static function simulationPopupContent($oney) + { + $simulationResponse = $oney->getSimulation(); - /** - * @param OneyWithFees $oney - * @return string - */ - static function simulationPopupContent($oney) - { - $simulationResponse = $oney->getSimulation(); + $x4 = $simulationResponse['x4_with_fees']; + $x3 = $simulationResponse['x3_with_fees']; - $x4 = $simulationResponse['x4_with_fees']; - $x3 = $simulationResponse['x3_with_fees']; + $financing_cost_3x = intval($x3['total_cost']) / 100; + $financing_cost_4x = intval($x4['total_cost']) / 100; - $financing_cost_3x = intval($x3['total_cost']) / 100; - $financing_cost_4x = intval($x4['total_cost']) / 100; + $f = function ($fn) { return $fn; }; - $f = function($fn) { return $fn; }; - - return <<
    @@ -111,100 +112,103 @@ static function simulationPopupContent($oney)
    HTML; - } - - /** - * @param $min - * @param $max - * @return string - */ - static function footerOneyWithoutFees($min, $max) - { - $f = function($fn) { return $fn; }; - - $footer = << {$f(sprintf( - esc_html__("Offre de financement sans assurance avec apport obligatoire, réservée aux particuliers et valable pour tout achat de %s€ à %s€. Sous réserve d’acceptation par Oney Bank. Vous disposez d’un délai de 14 jours pour renoncer à votre crédit. Oney Bank - SA au capital de 51286585€ - 34 Avenue de Flandre 59 170 Croix - 546 380 197 RCS Lille Métropole - n° Orias 07023 261 %s . Correspondance : CS 60 006 - 59895 Lille Cedex - %s", "payplug"), - $min, - $max, - __(" www.orias.fr "), - __(" www.oney.fr ") - ))} + esc_html__('Offre de financement sans assurance avec apport obligatoire, réservée aux particuliers et valable pour tout achat de %s€ à %s€. Sous réserve d’acceptation par Oney Bank. Vous disposez d’un délai de 14 jours pour renoncer à votre crédit. Oney Bank - SA au capital de 51286585€ - 34 Avenue de Flandre 59 170 Croix - 546 380 197 RCS Lille Métropole - n° Orias 07023 261 %s . Correspondance : CS 60 006 - 59895 Lille Cedex - %s', 'payplug'), + $min, + $max, + __(" www.orias.fr "), + __(' www.oney.fr ') + ))} HTML; - - return $footer; - - } - - /** - * @param $min - * @param $max - * @return string - */ - static function footerOneyWithFees($min, $max) - { - $f = function($fn) { return $fn; }; - - return << - {$f( sprintf( - esc_html__("Offre de financement avec apport obligatoire, réservée aux particuliers et valable pour tout achat de %s€ à %s€. Sous réserve d'acceptation par Oney Bank. Vous disposez d'un délai de 14 jours pour renoncer à votre crédit. Oney Bank - SA au capital de 51 286 585€ - 34 Avenue de Flandre 59170 Croix - 546 380 197 RCS Lille Métropole - n° Orias 07 023 261 %s Correspondance : CS 60 006 - 59895 Lille Cedex - %s"), - $min, - $max, - __(" www.orias.fr "), - __(" www.oney.fr ") - ))} + {$f(sprintf( + esc_html__("Offre de financement avec apport obligatoire, réservée aux particuliers et valable pour tout achat de %s€ à %s€. Sous réserve d'acceptation par Oney Bank. Vous disposez d'un délai de 14 jours pour renoncer à votre crédit. Oney Bank - SA au capital de 51 286 585€ - 34 Avenue de Flandre 59170 Croix - 546 380 197 RCS Lille Métropole - n° Orias 07 023 261 %s Correspondance : CS 60 006 - 59895 Lille Cedex - %s"), + $min, + $max, + __(" www.orias.fr "), + __(' www.oney.fr ') + ))} HTML; - - } - - /** - * disabled oney popup - * @param \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\Oney $oney - * @return string - */ - static function disabledOneyPopup($oney) - { - return '
    + } + + /** + * disabled oney popup. + * + * @param \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\Oney $oney + * + * @return string + */ + public static function disabledOneyPopup($oney) + { + return '
    -
    ' . sprintf( __('The total amount of your order should be between %s€ and %s€ to pay with Oney.', 'payplug'), $oney->get_min_amount(), $oney->get_max_amount()) . '
    +
    ' . sprintf(__('The total amount of your order should be between %s€ and %s€ to pay with Oney.', 'payplug'), $oney->get_min_amount(), $oney->get_max_amount()) . '
    ' . sprintf(__('The payment with Oney is unavailable because you have more than %s items in your cart.', 'payplug'), PayplugGatewayOney3x::ONEY_PRODUCT_QUANTITY_MAXIMUM) . '
    '; - } - - /** - * header for cart oney - * @return string - */ - static function payWithOney($oney) - { - $variations = $oney->getVariations(); - - $html = ' -
    getVariations(); + + $html = ' +
    '; - $html .= __('OR PAY IN', 'payplug'); - if(!empty($variations)){ - foreach($variations as $id => $price){ - $html .= ''; - } - } - $html .= '
    + data-price="' . $oney->getTotalPrice() . '" + data-max-oney-qty="' . PayplugGatewayOney3x::ONEY_PRODUCT_QUANTITY_MAXIMUM . '" + data-min-oney="' . $oney->get_min_amount() . '" + data-max-oney="' . $oney->get_max_amount() . '" >'; + $html .= __('OR PAY IN', 'payplug'); + if (!empty($variations)) { + foreach ($variations as $id => $price) { + $html .= ''; + } + } + $html .= '
    ?
    '; - return $html; - } + return $html; + } } diff --git a/src/Front/Layout/OneyIT.php b/src/Front/Layout/OneyIT.php index 70e53048..54072fd0 100644 --- a/src/Front/Layout/OneyIT.php +++ b/src/Front/Layout/OneyIT.php @@ -2,35 +2,36 @@ namespace Payplug\PayplugWoocommerce\Front\Layout; +use function is_cart; use Payplug\PayplugWoocommerce\Front\PayplugOney\Requests\OneyWithFees; use Payplug\PayplugWoocommerce\Front\PayplugOney\Requests\OneyWithoutFees; use Payplug\PayplugWoocommerce\Gateway\PayplugGatewayOney3x; -use function is_cart; class OneyIT extends OneyBase implements InterfaceOneyLayout { - public function __construct() - { - parent::__construct(); - } - - /** - * @param OneyWithoutFees $oney - * @return string - */ - static function simulationPopupContentWithoutFees( $oney ){ + public function __construct() + { + parent::__construct(); + } - $simulationResponse = $oney->getSimulation(); + /** + * @param OneyWithoutFees $oney + * + * @return string + */ + public static function simulationPopupContentWithoutFees($oney) + { + $simulationResponse = $oney->getSimulation(); - $x4 = $simulationResponse['x4_without_fees']; - $x3 = $simulationResponse['x3_without_fees']; + $x4 = $simulationResponse['x4_without_fees']; + $x3 = $simulationResponse['x3_without_fees']; - $financing_cost_3x = intval($x3['total_cost']) / 100; - $financing_cost_4x = intval($x4['total_cost']) / 100; + $financing_cost_3x = intval($x3['total_cost']) / 100; + $financing_cost_4x = intval($x4['total_cost']) / 100; - $f = function($fn) { return $fn; }; + $f = function ($fn) { return $fn; }; - return <<
    @@ -45,7 +46,7 @@ static function simulationPopupContentWithoutFees( $oney ){

    {$f(__('Bring', 'payplug'))}: {$x3['down_payment_amount']} €

    -

    {$f(sprintf(__('IT monthly payment of', 'payplug'),2))}: {$x3['installments'][0]['amount']} €

    +

    {$f(sprintf(__('IT monthly payment of', 'payplug'), 2))}: {$x3['installments'][0]['amount']} €

    {$f(__('Of which financing cost', 'payplug'))}: {$financing_cost_3x} €

    {$f(__('TAEG', 'payplug'))}: {$x3['effective_annual_percentage_rate']} %

    @@ -61,26 +62,26 @@ static function simulationPopupContentWithoutFees( $oney ){
    HTML; + } - } + /** + * @param OneyWithFees $oney + * + * @return string + */ + public static function simulationPopupContent($oney) + { + $simulationResponse = $oney->getSimulation(); - /** - * @param OneyWithFees $oney - * @return string - */ - static function simulationPopupContent($oney) - { - $simulationResponse = $oney->getSimulation(); + $x4 = $simulationResponse['x4_with_fees']; + $x3 = $simulationResponse['x3_with_fees']; - $x4 = $simulationResponse['x4_with_fees']; - $x3 = $simulationResponse['x3_with_fees']; + $financing_cost_3x = intval($x3['total_cost']) / 100; + $financing_cost_4x = intval($x4['total_cost']) / 100; - $financing_cost_3x = intval($x3['total_cost']) / 100; - $financing_cost_4x = intval($x4['total_cost']) / 100; + $f = function ($fn) { return $fn; }; - $f = function($fn) { return $fn; }; - - return <<
    @@ -95,7 +96,7 @@ static function simulationPopupContent($oney)

    {$f(__('Bring', 'payplug'))}: {$x3['down_payment_amount']} €

    -

    {$f(sprintf(__('IT monthly payment of', 'payplug'),2))}: {$x3['installments'][0]['amount']} €

    +

    {$f(sprintf(__('IT monthly payment of', 'payplug'), 2))}: {$x3['installments'][0]['amount']} €

    {$f(__('Of which financing cost', 'payplug'))}: {$financing_cost_3x} €

    {$f(__('TAEG', 'payplug'))}: {$x3['effective_annual_percentage_rate']} %

    @@ -105,99 +106,109 @@ static function simulationPopupContent($oney)

    {$f(__('Bring', 'payplug'))}: {$x4['down_payment_amount']} €

    -

    {$f(sprintf(__('IT monthly payment of', 'payplug'),3))}: {$x4['installments'][0]['amount']} €

    +

    {$f(sprintf(__('IT monthly payment of', 'payplug'), 3))}: {$x4['installments'][0]['amount']} €

    {$f(__('Of which financing cost', 'payplug'))}: {$financing_cost_4x} €

    {$f(__('TAEG', 'payplug'))}: {$x4['effective_annual_percentage_rate']} %

    HTML; - } - - /** - * @param $min - * @param $max - * @return string - */ - static function footerOneyWithoutFees($min, $max) - { - $f = function($fn) { return $fn; }; - - $footer = << - {$f(sprintf(esc_html__('payplug_oneyIT_popup-footer', 'payplug'), $min, $max, - __("payplug_oneyIT_popup-url", "payplug"), - __("payplug_oneyIT-without-fees_popup-footer_pdf", "payplug")))} + {$f(sprintf( + esc_html__('payplug_oneyIT_popup-footer', 'payplug'), + $min, + $max, + __('payplug_oneyIT_popup-url', 'payplug'), + __('payplug_oneyIT-without-fees_popup-footer_pdf', 'payplug') + ))}
    HTML; - - return $footer; - - } - - /** - * @param $min - * @param $max - * @return string - */ - static function footerOneyWithFees($min, $max) - { - $f = function($fn) { return $fn; }; - - $footer = << - {$f(sprintf(esc_html__('payplug_oneyIT_popup-footer', 'payplug'), $min, $max, - __("payplug_oneyIT_popup-url", "payplug"), - __("payplug_oneyIT_popup-footer_pdf", "payplug")))} + {$f(sprintf( + esc_html__('payplug_oneyIT_popup-footer', 'payplug'), + $min, + $max, + __('payplug_oneyIT_popup-url', 'payplug'), + __('payplug_oneyIT_popup-footer_pdf', 'payplug') + ))}
    HTML; - return $footer; - - } - - /** - * disabled oney popup - * @param \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\Oney $oney - * @return string - */ - static function disabledOneyPopup($oney) - { - return '
    + } + + /** + * disabled oney popup. + * + * @param \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\Oney $oney + * + * @return string + */ + public static function disabledOneyPopup($oney) + { + return '
    -
    ' . sprintf( __('The total amount of your order should be between %s€ and %s€ to pay with Oney.', 'payplug'), $oney->get_min_amount(), $oney->get_max_amount()) . '
    +
    ' . sprintf(__('The total amount of your order should be between %s€ and %s€ to pay with Oney.', 'payplug'), $oney->get_min_amount(), $oney->get_max_amount()) . '
    ' . sprintf(__('The payment with Oney is unavailable because you have more than %s items in your cart.', 'payplug'), PayplugGatewayOney3x::ONEY_PRODUCT_QUANTITY_MAXIMUM) . '
    '; - } - - /** - * header for cart oney - * @return string - */ - static function payWithOney($oney) - { - $variations = $oney->getVariations(); - - $html = ' -
    getVariations(); + + $html = ' +
    '; - $html .= __('OR PAY IN', 'payplug'); - if(!empty($variations)){ - foreach($variations as $id => $price){ - $html .= ''; - } - } - $html .= '
    + data-price="' . $oney->getTotalPrice() . '" + data-max-oney-qty="' . PayplugGatewayOney3x::ONEY_PRODUCT_QUANTITY_MAXIMUM . '" + data-min-oney="' . $oney->get_min_amount() . '" + data-max-oney="' . $oney->get_max_amount() . '" >'; + $html .= __('OR PAY IN', 'payplug'); + if (!empty($variations)) { + foreach ($variations as $id => $price) { + $html .= ''; + } + } + $html .= '
    ?
    '; - return $html; - } + return $html; + } } diff --git a/src/Front/PayplugOney/Country/InterfaceOney.php b/src/Front/PayplugOney/Country/InterfaceOney.php index 09defb37..ab6f6c47 100644 --- a/src/Front/PayplugOney/Country/InterfaceOney.php +++ b/src/Front/PayplugOney/Country/InterfaceOney.php @@ -4,48 +4,43 @@ interface InterfaceOney { + public function handleTotalProducts(); - public function handleTotalProducts(); + public function addTotalProducts($qty); - public function addTotalProducts($qty); + public function resetTotalProducts(); - public function resetTotalProducts(); + public function set_min_amount($amount); - public function set_min_amount($amount); + public function set_max_amount($amount); - public function set_max_amount($amount); + public function setIcon($icon); - public function setIcon($icon); + public function isDisable(); - public function isDisable(); + public function setDisable($disable); - public function setDisable($disable); + public function setTotalPrice($total_price); - public function setTotalPrice($total_price); + public function setSimulatedClass($simulatedClass); - public function setSimulatedClass($simulatedClass); + public function setOneyType($oney_type); - public function setOneyType($oney_type); + public function get_min_amount(); - public function get_min_amount(); + public function get_max_amount(); - public function get_max_amount(); + public function getIcon(); - public function getIcon(); + public function getTotalProducts(); - public function getTotalProducts(); - - public function getTotalPrice(); - - public function getSimulatedClass(); - - public function setPayplugOptions($payplugOptions); - - public function getOneyType(); - - public function getPayplugOptions(); + public function getTotalPrice(); + public function getSimulatedClass(); + public function setPayplugOptions($payplugOptions); + public function getOneyType(); + public function getPayplugOptions(); } diff --git a/src/Front/PayplugOney/Country/InterfaceOneyType.php b/src/Front/PayplugOney/Country/InterfaceOneyType.php index 5b86d564..3388b01a 100644 --- a/src/Front/PayplugOney/Country/InterfaceOneyType.php +++ b/src/Front/PayplugOney/Country/InterfaceOneyType.php @@ -4,5 +4,5 @@ interface InterfaceOneyType { - public function setIcon($icon); + public function setIcon($icon); } diff --git a/src/Front/PayplugOney/Country/OneyBase.php b/src/Front/PayplugOney/Country/OneyBase.php index 8b06dc63..66ac608f 100644 --- a/src/Front/PayplugOney/Country/OneyBase.php +++ b/src/Front/PayplugOney/Country/OneyBase.php @@ -1,8 +1,9 @@ payplugOptions = PayplugWoocommerceHelper::get_payplug_options(); - $max = ( !empty($this->payplugOptions['oney_thresholds_max']) && (int) $this->payplugOptions['oney_thresholds_max'] <= $this->max_default_amount ) ? $this->payplugOptions['oney_thresholds_max'] : $this->max_default_amount; - $min = ( !empty($this->payplugOptions['oney_thresholds_min']) && (int) $this->payplugOptions['oney_thresholds_min'] >= $this->min_default_amount) ? $this->payplugOptions['oney_thresholds_min'] : $this->min_default_amount; - - $this->set_max_amount( $max ); - $this->set_min_amount( $min ); - } - - /** - * SUM totalproducts that are in the cart - */ - public function handleTotalProducts() - { - $this->addTotalProducts(1); - if(is_cart()) { - $this->resetTotalProducts(); - foreach(WC()->cart->cart_contents as $product) { - $this->addTotalProducts($product['quantity']); - } - } - } - - /** - * Setter - * @param $amount - */ - public function set_min_amount($amount) - { - $this->min_amount = (int) $amount; - } - - /** - * Setter - * @param $amount - */ - public function set_max_amount($amount) - { - $this->max_amount = (int) $amount; - } - - /** - * @return int - */ - public function get_min_amount() - { - return $this->min_amount; - } - - /** - * @return int - */ - public function get_max_amount() - { - return $this->max_amount; - } - - /** - * @return string - */ - public function getIcon() - { - return $this->icon; - } - - /** - * @param string $icon - */ - public function setIcon($icon) - { - $this->icon = $icon; - } - - /** - * @return bool - */ - public function isDisable() - { - if($this->disable){ - return "disabled"; - } - - return ''; - } - - /** - * @param bool $disable - */ - public function setDisable($disable) - { - $this->disable = $disable; - } - - /** - * @param $qty - * @return void - */ - public function addTotalProducts($qty) - { - $this->total_products += $qty; - } - - /** - * @set total_products to 0 - */ - public function resetTotalProducts() - { - $this->total_products = 0; - } - - /** - * @return int - */ - public function getTotalProducts() - { - return $this->total_products; - } - - /** - * @return int - */ - public function getTotalPrice() - { - return $this->total_price; - } - - /** - * @param int $total_price - */ - public function setTotalPrice($total_price) - { - $this->total_price = $total_price; - } - - /** - * @return string - */ - public function getSimulatedClass() - { - return $this->simulatedClass; - } - - /** - * @param string $simulatedClass - */ - public function setSimulatedClass($simulatedClass) - { - $this->simulatedClass = $simulatedClass; - } - - /** - * @return string - */ - public function getOneyType() - { - return $this->oney_type; - } - - /** - * @param string $oney_type - */ - public function setOneyType($oney_type) - { - $this->oney_type = $oney_type; - } - - /** - * @return array - */ - public function getPayplugOptions() - { - return $this->payplugOptions; - } - - /** - * @param array $payplugOptions - */ - public function setPayplugOptions($payplugOptions) - { - $this->payplugOptions = $payplugOptions; - } - - /** - * @return array - */ - public function getVariations(){ - return $this->variations; - } - - /** - * @return array - */ - public function setVariations($variations){ - $this->variations[$variations['variation_id']] = (float) $variations["display_price"]; - } - - + /** + * @var int + */ + private $total_products = 0; + + /** + * @var int + */ + private $total_price = 0; + + /** + * @var string + */ + private $simulatedClass = ''; + + /** + * @var string + */ + private $oney_type = 'with_fees'; + + /** + * @var array + */ + private $payplugOptions = []; + + /** + * @var int + */ + private $max_default_amount = 3000; + + /** + * @var int + */ + private $min_default_amount = 100; + + /** + * @var array + */ + private $variations = []; + + public function __construct() + { + $this->payplugOptions = PayplugWoocommerceHelper::get_payplug_options(); + $max = (!empty($this->payplugOptions['oney_thresholds_max']) && (int) $this->payplugOptions['oney_thresholds_max'] <= $this->max_default_amount) ? $this->payplugOptions['oney_thresholds_max'] : $this->max_default_amount; + $min = (!empty($this->payplugOptions['oney_thresholds_min']) && (int) $this->payplugOptions['oney_thresholds_min'] >= $this->min_default_amount) ? $this->payplugOptions['oney_thresholds_min'] : $this->min_default_amount; + + $this->set_max_amount($max); + $this->set_min_amount($min); + } + + /** + * SUM totalproducts that are in the cart. + */ + public function handleTotalProducts() + { + $this->addTotalProducts(1); + if (is_cart()) { + $this->resetTotalProducts(); + foreach (WC()->cart->cart_contents as $product) { + $this->addTotalProducts($product['quantity']); + } + } + } + + /** + * Setter. + * + * @param $amount + */ + public function set_min_amount($amount) + { + $this->min_amount = (int) $amount; + } + + /** + * Setter. + * + * @param $amount + */ + public function set_max_amount($amount) + { + $this->max_amount = (int) $amount; + } + + /** + * @return int + */ + public function get_min_amount() + { + return $this->min_amount; + } + + /** + * @return int + */ + public function get_max_amount() + { + return $this->max_amount; + } + + /** + * @return string + */ + public function getIcon() + { + return $this->icon; + } + + /** + * @param string $icon + */ + public function setIcon($icon) + { + $this->icon = $icon; + } + + /** + * @return bool + */ + public function isDisable() + { + if ($this->disable) { + return 'disabled'; + } + + return ''; + } + + /** + * @param bool $disable + */ + public function setDisable($disable) + { + $this->disable = $disable; + } + + /** + * @param $qty + */ + public function addTotalProducts($qty) + { + $this->total_products += $qty; + } + + /** + * @set total_products to 0 + */ + public function resetTotalProducts() + { + $this->total_products = 0; + } + + /** + * @return int + */ + public function getTotalProducts() + { + return $this->total_products; + } + + /** + * @return int + */ + public function getTotalPrice() + { + return $this->total_price; + } + + /** + * @param int $total_price + */ + public function setTotalPrice($total_price) + { + $this->total_price = $total_price; + } + + /** + * @return string + */ + public function getSimulatedClass() + { + return $this->simulatedClass; + } + + /** + * @param string $simulatedClass + */ + public function setSimulatedClass($simulatedClass) + { + $this->simulatedClass = $simulatedClass; + } + + /** + * @return string + */ + public function getOneyType() + { + return $this->oney_type; + } + + /** + * @param string $oney_type + */ + public function setOneyType($oney_type) + { + $this->oney_type = $oney_type; + } + + /** + * @return array + */ + public function getPayplugOptions() + { + return $this->payplugOptions; + } + + /** + * @param array $payplugOptions + */ + public function setPayplugOptions($payplugOptions) + { + $this->payplugOptions = $payplugOptions; + } + + /** + * @return array + */ + public function getVariations() + { + return $this->variations; + } + + /** + * @param mixed $variations + * + * @return array + */ + public function setVariations($variations) + { + $this->variations[$variations['variation_id']] = (float) $variations['display_price']; + } } diff --git a/src/Front/PayplugOney/Country/OneyFR.php b/src/Front/PayplugOney/Country/OneyFR.php index 1250691c..ea4d5e43 100644 --- a/src/Front/PayplugOney/Country/OneyFR.php +++ b/src/Front/PayplugOney/Country/OneyFR.php @@ -4,31 +4,31 @@ class OneyFR extends OneyBase implements InterfaceOneyType { + /** + * @var string + */ + private $icon_withoutfees = 'oney-without-fees-3x4x'; - /** - * @var string - */ - private $icon_withoutfees = 'oney-without-fees-3x4x'; + /** + * @var string + */ + private $icon_withfees = 'oney-3x4x'; - /** - * @var string - */ - private $icon_withfees = 'oney-3x4x'; + public function __construct() + { + parent::__construct(); + } - public function __construct() - { - parent::__construct(); + public function setIcon($icon = '') + { + switch ($this->getOneyType()) { + case 'without_fees': parent::setIcon($this->icon_withoutfees); - } - - public function setIcon($icon = '') - { - switch ($this->getOneyType()){ - case "without_fees": parent::setIcon($this->icon_withoutfees);break; - default: parent::setIcon($this->icon_withfees);break; - } - - } +break; + default: parent::setIcon($this->icon_withfees); +break; + } + } } diff --git a/src/Front/PayplugOney/Country/OneyIT.php b/src/Front/PayplugOney/Country/OneyIT.php index 86993a2b..b7886d38 100644 --- a/src/Front/PayplugOney/Country/OneyIT.php +++ b/src/Front/PayplugOney/Country/OneyIT.php @@ -4,32 +4,31 @@ class OneyIT extends OneyBase { + /** + * @var string + */ + private $icon_withoutfees = 'oney-without-fees-3x4x-it'; - /** - * @var string - */ - private $icon_withoutfees = 'oney-without-fees-3x4x-it'; + /** + * @var string + */ + private $icon_withfees = 'oney-3x4x'; - /** - * @var string - */ - private $icon_withfees = 'oney-3x4x'; + public function __construct() + { + parent::__construct(); + } - public function __construct() - { - parent::__construct(); - - } - - public function setIcon($icon = '') - { - switch ($this->getOneyType()){ - case "without_fees": parent::setIcon($this->icon_withoutfees);break; - default: parent::setIcon($this->icon_withfees);break; - } - - } + public function setIcon($icon = '') + { + switch ($this->getOneyType()) { + case 'without_fees': parent::setIcon($this->icon_withoutfees); +break; + default: parent::setIcon($this->icon_withfees); +break; + } + } } diff --git a/src/Front/PayplugOney/InterfaceOneySimulation.php b/src/Front/PayplugOney/InterfaceOneySimulation.php index 7ed22535..3050719c 100644 --- a/src/Front/PayplugOney/InterfaceOneySimulation.php +++ b/src/Front/PayplugOney/InterfaceOneySimulation.php @@ -4,9 +4,7 @@ interface InterfaceOneySimulation { + public function OneySimulation(); - public function OneySimulation(); - - public function requestOneySimulation(); - + public function requestOneySimulation(); } diff --git a/src/Front/PayplugOney/OneySimulation.php b/src/Front/PayplugOney/OneySimulation.php index c6a0ecc1..cf597964 100644 --- a/src/Front/PayplugOney/OneySimulation.php +++ b/src/Front/PayplugOney/OneySimulation.php @@ -6,61 +6,65 @@ class OneySimulation implements InterfaceOneySimulation { + /** + * @var + */ + public $simulation = []; - /** - * Dependency Injection - * @var \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\OneyBase - */ - private $oney; + /** + * Dependency Injection. + * + * @var \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\OneyBase + */ + private $oney; - /** - * @var - */ - public $simulation = []; + /** + * Dependency injection. + * + * @param \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\OneyBase $oney + */ + public function __construct($oney) + { + $this->oney = $oney; + } - /** - * Dependency injection - * @param \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\OneyBase $oney - */ - public function __construct($oney) - { - $this->oney = $oney; - } + /** + * Check if Oney Simulation is possible if it is returnss simulation data. + * + * @return array|false|object + */ + public function OneySimulation() + { + $this->oney->setTotalPrice($_POST['price']); - /** - * Check if Oney Simulation is possible if it is returnss simulation data - * @return array|false|object - */ - public function OneySimulation() - { - $this->oney->setTotalPrice($_POST['price']); + if ($this->oney->getTotalPrice() < $this->oney->get_min_amount() || $this->oney->getTotalPrice() > $this->oney->get_max_amount()) { + return false; + } - if ($this->oney->getTotalPrice() < $this->oney->get_min_amount() || $this->oney->getTotalPrice() > $this->oney->get_max_amount()) - return false; + try { + $this->simulation = $this->requestOneySimulation(); + } catch (\Exception $e) { + PayplugGateway::log('Simulate Oney ' . $this->oney->getOneyType() . ' Fees Payment, ' . $e->getMessage()); - try { - $this->simulation = $this->requestOneySimulation(); + return false; + } - } catch (\Exception $e) { - PayplugGateway::log("Simulate Oney " . $this->oney->getOneyType() ." Fees Payment, " . $e->getMessage() ); - return false; + return $this->simulation; + } - } - - return $this->simulation; - } - - /** - * return oney simulation data for the order - * @param $class - * @return array|object - */ - public function requestOneySimulation() - { - $class = $this->oney->getSimulatedClass(); - $api = new \Payplug\PayplugWoocommerce\Gateway\PayplugApi( new $class() ); - $api->init(); - return $api->simulate_oney_payment($this->oney->getTotalPrice(), $this->oney->getOneyType()); - } + /** + * return oney simulation data for the order. + * + * @param $class + * + * @return array|object + */ + public function requestOneySimulation() + { + $class = $this->oney->getSimulatedClass(); + $api = new \Payplug\PayplugWoocommerce\Gateway\PayplugApi(new $class()); + $api->init(); + return $api->simulate_oney_payment($this->oney->getTotalPrice(), $this->oney->getOneyType()); + } } diff --git a/src/Front/PayplugOney/Requests/OneyAnimation.php b/src/Front/PayplugOney/Requests/OneyAnimation.php index 1ac7e9b1..16dc5a18 100644 --- a/src/Front/PayplugOney/Requests/OneyAnimation.php +++ b/src/Front/PayplugOney/Requests/OneyAnimation.php @@ -4,19 +4,20 @@ use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -class OneyAnimation extends OneyBase { - public function __construct($oney_type = "with_fees", $class_name = "PayplugGatewayOney3x") - { - $this->setCountry(PayplugWoocommerceHelper::get_payplug_options()); +class OneyAnimation extends OneyBase +{ + public function __construct($oney_type = 'with_fees', $class_name = 'PayplugGatewayOney3x') + { + $this->setCountry(PayplugWoocommerceHelper::get_payplug_options()); - /** @var $oney \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\OneyFR */ - $class = "\\Payplug\\PayplugWoocommerce\\Front\\PayplugOney\\Country\\Oney" . $this->getCountry(); - $oney = new $class(); - $oney->setOneyType($oney_type); - $oney->setIcon(); - $oney->setSimulatedClass("Payplug\\PayplugWoocommerce\\Gateway\\$class_name"); - $this->setOney($oney); + /** @var \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\OneyFR $oney */ + $class = '\\Payplug\\PayplugWoocommerce\\Front\\PayplugOney\\Country\\Oney' . $this->getCountry(); + $oney = new $class(); + $oney->setOneyType($oney_type); + $oney->setIcon(); + $oney->setSimulatedClass("Payplug\\PayplugWoocommerce\\Gateway\\{$class_name}"); + $this->setOney($oney); - parent::__construct(); - } + parent::__construct(); + } } diff --git a/src/Front/PayplugOney/Requests/OneyBase.php b/src/Front/PayplugOney/Requests/OneyBase.php index de3b927d..7c529297 100644 --- a/src/Front/PayplugOney/Requests/OneyBase.php +++ b/src/Front/PayplugOney/Requests/OneyBase.php @@ -2,197 +2,195 @@ namespace Payplug\PayplugWoocommerce\Front\PayplugOney\Requests; +use function is_cart; +use function is_product; use Payplug\PayplugWoocommerce\Front\PayplugOney\OneySimulation; use Payplug\PayplugWoocommerce\Gateway\PayplugGatewayOney3x; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -use function is_cart; -use function is_checkout; -use function is_product; -Abstract class OneyBase +abstract class OneyBase { - - /** - * @var string - */ - private $country; - - /** - * @var OneySimulation - */ - private $simulation = []; - - /** - * Dependency injection - * @var \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\OneyBase - */ - private $oney; - - - public function __construct() - { - add_action( 'wp_ajax_simulate_oney_payment', [ $this, 'simulateOneyPayment' ]); - add_action( 'wp_ajax_nopriv_simulate_oney_payment', [ $this, 'simulateOneyPayment' ]); - add_action('woocommerce_cart_totals_after_order_total', [$this, 'showOneyAnimationCart']); - - $options = get_option('woocommerce_payplug_settings', []); - - if (isset($options['oney_product_animation']) && ($options['oney_product_animation'] == 'yes')){ - add_action( 'woocommerce_before_add_to_cart_form', [ $this, 'showOneyAnimationProduct' ] ); - - } - } - - /** - * request simulation - * print results - */ - public function simulateOneyPayment(){ - $simulation = new OneySimulation($this->oney); - $this->simulation = $simulation->OneySimulation(); - $html = $this->drawAnimation(); - - wp_send_json_success( - array( - 'popup' => $html - ) - ); - - wp_die(); - } - - /** - * draw html popup - * @return string - */ - public function drawAnimation(){ - $class = "Payplug\\PayplugWoocommerce\\Front\\Layout\\Oney" . $this->getCountry(); - - switch($this->oney->getOneyType()){ - case "without_fees": - $footer = $class::footerOneyWithoutFees($this->oney->get_min_amount(), $this->oney->get_max_amount()); - $content = $class::simulationPopupContentWithoutFees($this); - break; - default: - $footer = $class::footerOneyWithFees($this->oney->get_min_amount(), $this->oney->get_max_amount()); - $content = $class::simulationPopupContent($this); - break; - } - - $html = <<oney); + $this->simulation = $simulation->OneySimulation(); + $html = $this->drawAnimation(); + + wp_send_json_success( + [ + 'popup' => $html, + ] + ); + + wp_die(); + } + + /** + * draw html popup. + * + * @return string + */ + public function drawAnimation() + { + $class = 'Payplug\\PayplugWoocommerce\\Front\\Layout\\Oney' . $this->getCountry(); + + switch ($this->oney->getOneyType()) { + case 'without_fees': + $footer = $class::footerOneyWithoutFees($this->oney->get_min_amount(), $this->oney->get_max_amount()); + $content = $class::simulationPopupContentWithoutFees($this); + + break; + + default: + $footer = $class::footerOneyWithFees($this->oney->get_min_amount(), $this->oney->get_max_amount()); + $content = $class::simulationPopupContent($this); + + break; + } + + return <<cart->total))) ? floatval(WC()->cart->total) : (float)($product->get_price()); - $this->oney->setTotalPrice($total_price); - $this->oney->handleTotalProducts(); - - //don't show animation - if ( !PayplugWoocommerceHelper::check_order_max_amount($this->oney->getTotalPrice()) ) { - return false; - } - - if ($this->oney->getTotalPrice() < $this->oney->get_min_amount() || $this->oney->getTotalPrice() > $this->oney->get_max_amount() || $this->oney->getTotalProducts() >= PayplugGatewayOney3x::ONEY_PRODUCT_QUANTITY_MAXIMUM) { - $this->oney->setDisable(true); - } - - $this->oneyGeneratePopup(); - } - - } - - /** - * Button to show oney popup product page - * - * @return void - */ - public function showOneyAnimationProduct() - { - global $product; - - if ( (is_product()) && PayplugWoocommerceHelper::is_oney_available() && !in_array($product->get_type(), array("subscription", "downloadable_subscription", "virtual_subscription", "variable-subscription")) ) { - $price = $product->get_price(); - - if(method_exists($product,"get_available_variations")){ - $available_variations = $product->get_available_variations(); - } - - if(!empty($available_variations)){ - foreach ($available_variations as $k => $value){ - $this->oney->setVariations($value); - } - } - - $this->oney->setTotalPrice($price); - $this->oney->handleTotalProducts(); - - //don't show animation - if ( !PayplugWoocommerceHelper::check_order_max_amount($price) ) { - return false; - } - - if ($price < $this->oney->get_min_amount() || $price > $this->oney->get_max_amount() || $this->oney->getTotalProducts() >= PayplugGatewayOney3x::ONEY_PRODUCT_QUANTITY_MAXIMUM) { - $this->oney->setDisable(true); - } - - $this->oneyGeneratePopup(); - } - - } - - /** - * get Html for Oney - */ - public function oneyGeneratePopup(){ - $class = "Payplug\\PayplugWoocommerce\\Front\\Layout\\Oney" . $this->getCountry(); - $class = new $class(); - echo $class::payWithOney($this->oney); - echo $class::disabledOneyPopup($this->oney); - - } - - /** - * @param $options - * @return String - */ - public function setCountry($options){ - $this->country = !empty($options["payplug_merchant_country"]) ? $options["payplug_merchant_country"] : "FR"; - } - - /** - * @return string - */ - public function getCountry(){ - return $this->country; - } - - /** - * @return array|OneySimulation - */ - public function getSimulation(){ - return $this->simulation; - } - - /** - * @param $oney - */ - public function setOney($oney) - { - $this->oney = $oney; - } + } + + /** + * Button to show oney popup cart page. + */ + public function showOneyAnimationCart() + { + if ((is_cart()) && PayplugWoocommerceHelper::is_oney_available() && !PayplugWoocommerceHelper::is_subscription()) { + global $product; + + $total_price = (is_numeric(floatval(WC()->cart->total))) ? floatval(WC()->cart->total) : (float) ($product->get_price()); + $this->oney->setTotalPrice($total_price); + $this->oney->handleTotalProducts(); + + //don't show animation + if (!PayplugWoocommerceHelper::check_order_max_amount($this->oney->getTotalPrice())) { + return false; + } + + if ($this->oney->getTotalPrice() < $this->oney->get_min_amount() || $this->oney->getTotalPrice() > $this->oney->get_max_amount() || $this->oney->getTotalProducts() >= PayplugGatewayOney3x::ONEY_PRODUCT_QUANTITY_MAXIMUM) { + $this->oney->setDisable(true); + } + + $this->oneyGeneratePopup(); + } + } + + /** + * Button to show oney popup product page. + */ + public function showOneyAnimationProduct() + { + global $product; + + if ((is_product()) && PayplugWoocommerceHelper::is_oney_available() && !in_array($product->get_type(), ['subscription', 'downloadable_subscription', 'virtual_subscription', 'variable-subscription'])) { + $price = $product->get_price(); + + if (method_exists($product, 'get_available_variations')) { + $available_variations = $product->get_available_variations(); + } + + if (!empty($available_variations)) { + foreach ($available_variations as $k => $value) { + $this->oney->setVariations($value); + } + } + + $this->oney->setTotalPrice($price); + $this->oney->handleTotalProducts(); + + //don't show animation + if (!PayplugWoocommerceHelper::check_order_max_amount($price)) { + return false; + } + + if ($price < $this->oney->get_min_amount() || $price > $this->oney->get_max_amount() || $this->oney->getTotalProducts() >= PayplugGatewayOney3x::ONEY_PRODUCT_QUANTITY_MAXIMUM) { + $this->oney->setDisable(true); + } + + $this->oneyGeneratePopup(); + } + } + + /** + * get Html for Oney. + */ + public function oneyGeneratePopup() + { + $class = 'Payplug\\PayplugWoocommerce\\Front\\Layout\\Oney' . $this->getCountry(); + $class = new $class(); + echo $class::payWithOney($this->oney); + echo $class::disabledOneyPopup($this->oney); + } + + /** + * @param $options + * + * @return string + */ + public function setCountry($options) + { + $this->country = !empty($options['payplug_merchant_country']) ? $options['payplug_merchant_country'] : 'FR'; + } + + /** + * @return string + */ + public function getCountry() + { + return $this->country; + } + + /** + * @return array|OneySimulation + */ + public function getSimulation() + { + return $this->simulation; + } + + /** + * @param $oney + */ + public function setOney($oney) + { + $this->oney = $oney; + } } diff --git a/src/Gateway/AmericanExpress.php b/src/Gateway/AmericanExpress.php index 914e72e9..c41809bd 100644 --- a/src/Gateway/AmericanExpress.php +++ b/src/Gateway/AmericanExpress.php @@ -2,32 +2,30 @@ namespace Payplug\PayplugWoocommerce\Gateway; -use Payplug\Exception\HttpException; use Payplug\PayplugWoocommerce\Controller\PayplugGenericGateway; class AmericanExpress extends PayplugGenericGateway { - const ENABLE_ON_TEST_MODE = false; + const ENABLE_ON_TEST_MODE = false; - public function __construct() { + public function __construct() + { + parent::__construct(); - parent::__construct(); + // @var \WC_Settings_API override $id + $this->id = 'american_express'; - /** @var \WC_Settings_API override $id */ - $this->id = 'american_express'; + // @var \WC_Payment_Gateway overwrite for apple pay settings + $this->method_title = __('payplug_amex_title', 'payplug'); + $this->method_description = ''; - /** @var \WC_Payment_Gateway overwrite for apple pay settings */ - $this->method_title = __('payplug_amex_title', 'payplug'); - $this->method_description = ""; - - $this->title = __('payplug_amex_title', 'payplug'); - $this->description = ''; - $this->has_fields = false; - $this->image = 'Amex_logo_color.svg'; - - if(!$this->checkGateway()) - $this->enabled = 'no'; - - } + $this->title = __('payplug_amex_title', 'payplug'); + $this->description = ''; + $this->has_fields = false; + $this->image = 'Amex_logo_color.svg'; + if (!$this->checkGateway()) { + $this->enabled = 'no'; + } + } } diff --git a/src/Gateway/Bancontact.php b/src/Gateway/Bancontact.php index 24d2eb9e..e7312513 100644 --- a/src/Gateway/Bancontact.php +++ b/src/Gateway/Bancontact.php @@ -2,36 +2,32 @@ namespace Payplug\PayplugWoocommerce\Gateway; -use Payplug\Exception\HttpException; use Payplug\PayplugWoocommerce\Controller\PayplugGenericGateway; -class Bancontact extends PayplugGenericGateway +class Bancontact extends PayplugGenericGateway { + const ENABLE_ON_TEST_MODE = false; - protected $enable_refund = true; - const ENABLE_ON_TEST_MODE = false; + protected $enable_refund = true; - public function __construct() - { + public function __construct() + { + parent::__construct(); - parent::__construct(); + // @var \WC_Settings_API override $id + $this->id = 'bancontact'; - /** @var \WC_Settings_API override $id */ - $this->id = 'bancontact'; + // @var \WC_Payment_Gateway overwrite for bancontact settings + $this->method_title = __('payplug_bancontact_title', 'payplug'); + $this->method_description = __('payplug_bancontact_description', 'payplug'); - /** @var \WC_Payment_Gateway overwrite for bancontact settings */ - $this->method_title = __('payplug_bancontact_title', 'payplug'); - $this->method_description = __('payplug_bancontact_description', 'payplug'); - - $this->title = __('payplug_bancontact_title', 'payplug'); - $this->description = ''; - $this->has_fields = false; - $this->image = 'lg-bancontact-checkout.svg'; - - if(!$this->checkGateway()){ - $this->enabled = 'no'; - } - - } + $this->title = __('payplug_bancontact_title', 'payplug'); + $this->description = ''; + $this->has_fields = false; + $this->image = 'lg-bancontact-checkout.svg'; + if (!$this->checkGateway()) { + $this->enabled = 'no'; + } + } } diff --git a/src/Gateway/Blocks/PayplugAmex.php b/src/Gateway/Blocks/PayplugAmex.php index 3e8bc720..a82f04c6 100644 --- a/src/Gateway/Blocks/PayplugAmex.php +++ b/src/Gateway/Blocks/PayplugAmex.php @@ -4,59 +4,54 @@ class PayplugAmex extends PayplugGenericBlock { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "american_express"; - - /** - * Returns an associative array of data to be exposed for the payment method's client side. - */ - public function get_payment_method_data() { - $data = parent::get_payment_method_data(); - $data['icon'] = [ - "src" => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), - 'icon_alt' => $data['name'], - ]; - - $options = get_option('woocommerce_payplug_settings', []); - if( $options['payment_method'] === "popup" ){ - $data['payment_method'] = $this->get_name(); - $data["popup"] = true; - $data['payplug_create_intent_payment'] = \WC_AJAX::get_endpoint('payplug_create_intent'); - $data['payplug_create_order'] = \WC_AJAX::get_endpoint('payplug_create_order'); - $data['wp_nonce'] = wp_create_nonce( "woocommerce-process_checkout" ); - - } - - - return $data; - } - - /** - * Returns an array of scripts/handles to be registered for this payment method. - * - * @return array - */ - public function get_payment_method_script_handles() { - - $options = get_option('woocommerce_payplug_settings', []); - if ( $options['payment_method'] == "popup" ) { - $this->popup_scripts(); - } - - return parent::get_payment_method_script_handles(); - } - - - private function popup_scripts(){ - wp_register_script('payplug', 'https://api.payplug.com/js/1/form.latest.js', [], null, true); - wp_enqueue_script('payplug'); - } - - - + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'american_express'; + + /** + * Returns an associative array of data to be exposed for the payment method's client side. + */ + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + $data['icon'] = [ + 'src' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), + 'icon_alt' => $data['name'], + ]; + + $options = get_option('woocommerce_payplug_settings', []); + if ('popup' === $options['payment_method']) { + $data['payment_method'] = $this->get_name(); + $data['popup'] = true; + $data['payplug_create_intent_payment'] = \WC_AJAX::get_endpoint('payplug_create_intent'); + $data['payplug_create_order'] = \WC_AJAX::get_endpoint('payplug_create_order'); + $data['wp_nonce'] = wp_create_nonce('woocommerce-process_checkout'); + } + + return $data; + } + + /** + * Returns an array of scripts/handles to be registered for this payment method. + * + * @return array + */ + public function get_payment_method_script_handles() + { + $options = get_option('woocommerce_payplug_settings', []); + if ('popup' == $options['payment_method']) { + $this->popup_scripts(); + } + + return parent::get_payment_method_script_handles(); + } + + private function popup_scripts() + { + wp_register_script('payplug', 'https://api.payplug.com/js/1/form.latest.js', [], null, true); + wp_enqueue_script('payplug'); + } } diff --git a/src/Gateway/Blocks/PayplugApplePay.php b/src/Gateway/Blocks/PayplugApplePay.php index 62c0b96c..175a5412 100644 --- a/src/Gateway/Blocks/PayplugApplePay.php +++ b/src/Gateway/Blocks/PayplugApplePay.php @@ -6,186 +6,184 @@ class PayplugApplePay extends PayplugGenericBlock { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "apple_pay"; - - /** - * Returns an associative array of data to be exposed for the payment method's client side. - * - * @return array - */ - public function get_payment_method_data() { - $data = parent::get_payment_method_data(); - $data['icon'] = [ - "src" => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/' . $this->gateway->image), - 'icon_alt' => $data['name'], - ]; - - $data['payplug_locale'] = get_locale(); - $data['payplug_countryCode'] = WC()->customer !== null ? WC()->customer->get_billing_country() : "FR"; - $data['payplug_currencyCode'] = get_woocommerce_currency(); - $data['payplug_apple_pay_domain'] = $_SERVER['HTTP_HOST']; - $data['ajax_url_applepay_update_payment'] = \WC_AJAX::get_endpoint('applepay_update_payment'); - $data['payplug_create_intent_payment'] = \WC_AJAX::get_endpoint('payplug_create_intent'); - $data['is_cart'] = is_cart() && $this->gateway->get_button_cart() && !PayplugWoocommerceHelper::is_subscription(); - $data['is_product'] = is_product() && $this->gateway->get_button_product() && !PayplugWoocommerceHelper::is_subscription(); - - $data['ajax_url_applepay_get_shippings'] = \WC_AJAX::get_endpoint('applepay_get_shippings'); - $data['ajax_url_place_order_with_dummy_data'] = \WC_AJAX::get_endpoint('place_order_with_dummy_data'); - $data['ajax_url_update_applepay_order'] = \WC_AJAX::get_endpoint('update_applepay_order'); - $data['ajax_url_update_applepay_payment'] = \WC_AJAX::get_endpoint('update_applepay_payment'); - $data['ajax_url_applepay_get_order_totals'] = \WC_AJAX::get_endpoint('applepay_get_order_totals'); - $data['ajax_url_applepay_cancel_order'] = \WC_AJAX::get_endpoint('applepay_cancel_order'); - $data['ajax_url_applepay_empty_cart'] = \WC_AJAX::get_endpoint('applepay_empty_cart'); - $data['ajax_url_applepay_add_to_cart'] = \WC_AJAX::get_endpoint('applepay_add_to_cart'); - - $data['countryCode'] = WC()->customer !== null ? WC()->customer->get_billing_country() : "FR"; - $data['currencyCode'] = get_woocommerce_currency(); - $data['apple_pay_domain'] = $_SERVER['HTTP_HOST']; - $data['payplug_authorized_carriers'] = $this->gateway->get_carriers(); - $data['payplug_carriers'] = $this->get_carriers(); - - return $data; - } - - /** - * Returns an array of scripts/handles to be registered for this payment method. - * - * @return array - */ - public function get_payment_method_script_handles() { - - wp_register_script( - 'apple-pay-sdk', - 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', - array(), - '1.latest', - true - ); - - wp_enqueue_style('payplug-apple-pay', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-apple-pay.css', [], PAYPLUG_GATEWAY_VERSION); - wp_enqueue_script( 'apple-pay-sdk' ); - - return parent::get_payment_method_script_handles(); - } - - /** - * Checks if the Apple Pay payment method is active. - * - * @return bool - */ - public function is_active() - { - if (class_exists('WC_Blocks_Utils')) { - - //replace for the helper function when merged - if ( \WC_Blocks_Utils::has_block_in_page( wc_get_page_id('checkout'), 'woocommerce/checkout' ) || - \WC_Blocks_Utils::has_block_in_page( wc_get_page_id('cart'), 'woocommerce/cart' ) || - \WC_Blocks_Utils::has_block_in_page( wc_get_page_id('product'), 'woocommerce/product' ) ) { - - if( !empty($this->gateway) && $this->gateway->checkApplePay() && $this->gateway->isSSL() ){ - return true; - } - - return false; - - - } - } - } - - /** - * Retrieves available shipping carriers for Apple Pay. - * - * @return array - */ - public function get_carriers() { - - $shippings = []; - - if ( is_null( WC()->cart ) ) { - wc_load_cart(); - WC()->cart->get_cart_from_session(); - } - - if ( empty( WC()->cart ) || empty( WC()->cart->get_shipping_packages() ) ) { - return $shippings; - } - - $packages = WC()->cart !== null ? WC()->cart->get_shipping_packages() : null; - - if(!empty($packages)) { - foreach ( $packages as $package_key => $package ) { - $shipping_methods = $this->get_shipping_methods_from_package( $package ); - foreach ( $shipping_methods as $shipping_method ) { - - if ( ! $shipping_method->supports( 'shipping-zones' ) || ! $shipping_method->is_enabled() ) { - continue; - } - - $rates = $shipping_method->get_rates_for_package( $package ); - if ( $this->checkApplePayShipping( $shipping_method ) ) { - - if(empty($rates[ $shipping_method->get_rate_id() ])){ - continue; - } - $shipping_rate = $rates[ $shipping_method->get_rate_id() ]; - - !empty($shipping_rate) && method_exists($shipping_rate, 'get_cost') ? $shipping_costs = $shipping_rate->get_cost() : $shipping_costs = 0; - !empty($shipping_rate) && method_exists($shipping_rate, 'get_shipping_tax') ? $shipping_tax = $shipping_rate->get_shipping_tax() : $shipping_tax = "Na"; - - array_push( $shippings, [ - 'identifier' => $shipping_method->id, - 'label' => $shipping_method->method_title, - 'detail' => strip_tags( $shipping_method->method_description ), - 'amount' => $shipping_costs + $shipping_tax - ] ); - } - } - } - } - - return $shippings; - } - - /** - * Checks if the shipping method is compatible with Apple Pay. - * - * @param array $shipping - * @return bool - */ - public function checkApplePayShipping($shipping = []){ - if(empty($shipping)){ - return false; - } - - $apple_pay_options = PayplugWoocommerceHelper::get_applepay_options(); - $apple_pay_carriers = $apple_pay_options['carriers']; - - $exists = false; - foreach($apple_pay_carriers as $carrier => $carrier_id){ - if($carrier_id === $shipping->id){ - return true; - } - } - - return $exists; - } - - /** - * Retrieves shipping methods from a package. - * - * @param array $package - * @return array - */ - public function get_shipping_methods_from_package($package){ - $shipping_zone = \WC_Shipping_Zones::get_zone_matching_package( $package ); - return $shipping_zone->get_shipping_methods( true ); - } - + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'apple_pay'; + + /** + * Returns an associative array of data to be exposed for the payment method's client side. + * + * @return array + */ + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + $data['icon'] = [ + 'src' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/' . $this->gateway->image), + 'icon_alt' => $data['name'], + ]; + + $data['payplug_locale'] = get_locale(); + $data['payplug_countryCode'] = null !== WC()->customer ? WC()->customer->get_billing_country() : 'FR'; + $data['payplug_currencyCode'] = get_woocommerce_currency(); + $data['payplug_apple_pay_domain'] = $_SERVER['HTTP_HOST']; + $data['ajax_url_applepay_update_payment'] = \WC_AJAX::get_endpoint('applepay_update_payment'); + $data['payplug_create_intent_payment'] = \WC_AJAX::get_endpoint('payplug_create_intent'); + $data['is_cart'] = is_cart() && $this->gateway->get_button_cart() && !PayplugWoocommerceHelper::is_subscription(); + $data['is_product'] = is_product() && $this->gateway->get_button_product() && !PayplugWoocommerceHelper::is_subscription(); + + $data['ajax_url_applepay_get_shippings'] = \WC_AJAX::get_endpoint('applepay_get_shippings'); + $data['ajax_url_place_order_with_dummy_data'] = \WC_AJAX::get_endpoint('place_order_with_dummy_data'); + $data['ajax_url_update_applepay_order'] = \WC_AJAX::get_endpoint('update_applepay_order'); + $data['ajax_url_update_applepay_payment'] = \WC_AJAX::get_endpoint('update_applepay_payment'); + $data['ajax_url_applepay_get_order_totals'] = \WC_AJAX::get_endpoint('applepay_get_order_totals'); + $data['ajax_url_applepay_cancel_order'] = \WC_AJAX::get_endpoint('applepay_cancel_order'); + $data['ajax_url_applepay_empty_cart'] = \WC_AJAX::get_endpoint('applepay_empty_cart'); + $data['ajax_url_applepay_add_to_cart'] = \WC_AJAX::get_endpoint('applepay_add_to_cart'); + + $data['countryCode'] = null !== WC()->customer ? WC()->customer->get_billing_country() : 'FR'; + $data['currencyCode'] = get_woocommerce_currency(); + $data['apple_pay_domain'] = $_SERVER['HTTP_HOST']; + $data['payplug_authorized_carriers'] = $this->gateway->get_carriers(); + $data['payplug_carriers'] = $this->get_carriers(); + + return $data; + } + + /** + * Returns an array of scripts/handles to be registered for this payment method. + * + * @return array + */ + public function get_payment_method_script_handles() + { + wp_register_script( + 'apple-pay-sdk', + 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', + [], + '1.latest', + true + ); + + wp_enqueue_style('payplug-apple-pay', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-apple-pay.css', [], PAYPLUG_GATEWAY_VERSION); + wp_enqueue_script('apple-pay-sdk'); + + return parent::get_payment_method_script_handles(); + } + + /** + * Checks if the Apple Pay payment method is active. + * + * @return bool + */ + public function is_active() + { + if (class_exists('WC_Blocks_Utils')) { + //replace for the helper function when merged + if (\WC_Blocks_Utils::has_block_in_page(wc_get_page_id('checkout'), 'woocommerce/checkout') + || \WC_Blocks_Utils::has_block_in_page(wc_get_page_id('cart'), 'woocommerce/cart') + || \WC_Blocks_Utils::has_block_in_page(wc_get_page_id('product'), 'woocommerce/product')) { + if (!empty($this->gateway) && $this->gateway->checkApplePay() && $this->gateway->isSSL()) { + return true; + } + + return false; + } + } + } + + /** + * Retrieves available shipping carriers for Apple Pay. + * + * @return array + */ + public function get_carriers() + { + $shippings = []; + + if (is_null(WC()->cart)) { + wc_load_cart(); + WC()->cart->get_cart_from_session(); + } + + if (empty(WC()->cart) || empty(WC()->cart->get_shipping_packages())) { + return $shippings; + } + + $packages = null !== WC()->cart ? WC()->cart->get_shipping_packages() : null; + + if (!empty($packages)) { + foreach ($packages as $package_key => $package) { + $shipping_methods = $this->get_shipping_methods_from_package($package); + foreach ($shipping_methods as $shipping_method) { + if (!$shipping_method->supports('shipping-zones') || !$shipping_method->is_enabled()) { + continue; + } + + $rates = $shipping_method->get_rates_for_package($package); + if ($this->checkApplePayShipping($shipping_method)) { + if (empty($rates[$shipping_method->get_rate_id()])) { + continue; + } + $shipping_rate = $rates[$shipping_method->get_rate_id()]; + + !empty($shipping_rate) && method_exists($shipping_rate, 'get_cost') ? $shipping_costs = $shipping_rate->get_cost() : $shipping_costs = 0; + !empty($shipping_rate) && method_exists($shipping_rate, 'get_shipping_tax') ? $shipping_tax = $shipping_rate->get_shipping_tax() : $shipping_tax = 'Na'; + + array_push($shippings, [ + 'identifier' => $shipping_method->id, + 'label' => $shipping_method->method_title, + 'detail' => strip_tags($shipping_method->method_description), + 'amount' => $shipping_costs + $shipping_tax, + ]); + } + } + } + } + + return $shippings; + } + + /** + * Checks if the shipping method is compatible with Apple Pay. + * + * @param array $shipping + * + * @return bool + */ + public function checkApplePayShipping($shipping = []) + { + if (empty($shipping)) { + return false; + } + + $apple_pay_options = PayplugWoocommerceHelper::get_applepay_options(); + $apple_pay_carriers = $apple_pay_options['carriers']; + + $exists = false; + foreach ($apple_pay_carriers as $carrier => $carrier_id) { + if ($carrier_id === $shipping->id) { + return true; + } + } + + return $exists; + } + + /** + * Retrieves shipping methods from a package. + * + * @param array $package + * + * @return array + */ + public function get_shipping_methods_from_package($package) + { + $shipping_zone = \WC_Shipping_Zones::get_zone_matching_package($package); + + return $shipping_zone->get_shipping_methods(true); + } } diff --git a/src/Gateway/Blocks/PayplugBancontact.php b/src/Gateway/Blocks/PayplugBancontact.php index 6ee12fb7..75991620 100644 --- a/src/Gateway/Blocks/PayplugBancontact.php +++ b/src/Gateway/Blocks/PayplugBancontact.php @@ -4,29 +4,24 @@ class PayplugBancontact extends PayplugGenericBlock { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "bancontact"; - - /** - * Returns an associative array of data to be exposed for the payment method's client side. - */ - public function get_payment_method_data() { - $data = parent::get_payment_method_data(); - $data['icon'] = [ - "src" => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), - 'icon_alt' => "Visa & Mastercard", - ]; - return $data; - } - - - - - - + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'bancontact'; + + /** + * Returns an associative array of data to be exposed for the payment method's client side. + */ + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + $data['icon'] = [ + 'src' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), + 'icon_alt' => 'Visa & Mastercard', + ]; + + return $data; + } } diff --git a/src/Gateway/Blocks/PayplugCreditCard.php b/src/Gateway/Blocks/PayplugCreditCard.php index ab687b30..6a4eb4f1 100644 --- a/src/Gateway/Blocks/PayplugCreditCard.php +++ b/src/Gateway/Blocks/PayplugCreditCard.php @@ -6,123 +6,122 @@ class PayplugCreditCard extends PayplugGenericBlock { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "payplug"; - - /** - * Returns an associative array of data to be exposed for the payment method's client side. - */ - public function get_payment_method_data() { - - $data = parent::get_payment_method_data(); - $data['icon'] = [ - "src" => ('it_IT' === get_locale()) ? - PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/logos_scheme_PostePay.svg' : - PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/logos_scheme_CB.svg', - 'icon_alt' => "Visa & Mastercard", - ]; - $data["IP"] = false; - $data["popup"] = false; - $data['payment_method'] = $this->get_name(); - $data['supports'] = $this->get_supported_features(); - $data['showSaveOption'] = !empty($this->gateway->oneclick) ? $this->gateway->oneclick : false; - - $options = get_option('woocommerce_payplug_settings', []); - if( $options['payment_method'] === "integrated" ){ - $data["payplug_integrated_payment_cardHolder_error"] = __('payplug_integrated_payment_cardHolder_error', 'payplug'); - $data["payplug_integrated_payment_empty"] = __('payplug_integrated_payment_empty', 'payplug'); - $data["payplug_integrated_payment_your_card"] = __('payplug_integrated_payment_your_card', 'payplug'); - $data["payplug_integrated_payment_pan_error"] = __('payplug_integrated_payment_pan_error', 'payplug'); - $data["payplug_integrated_payment_exp_error"] = __('payplug_integrated_payment_exp_error', 'payplug'); - $data["payplug_integrated_payment_cvv_error"] = __('payplug_integrated_payment_cvv_error', 'payplug'); - $data["payplug_integrated_payment_error"] = __('payplug_integrated_payment_error', 'payplug'); - $data["payplug_integrated_payment_transaction_secure"] = __('payplug_integrated_payment_transaction_secure', 'payplug'); - $data['logo'] = PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/integrated/logo-payplug.png'; - $data['lock'] = PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/integrated/lock.svg'; - $data['payplug_integrated_payment_privacy_policy_url'] = __("payplug_integrated_payment_privacy_policy_url", "payplug"); - $data['payplug_integrated_payment_privacy_policy'] = __('payplug_integrated_payment_privacy_policy', 'payplug'); - $data["payplug_integrated_payment_cardholder"] = __('payplug_integrated_payment_cardholder', 'payplug'); - $data["payplug_integrated_payment_card_number"] = __('payplug_integrated_payment_card_number', 'payplug'); - $data["payplug_integrated_payment_expiration_date"] = __('payplug_integrated_payment_expiration_date', 'payplug'); - $data["payplug_integrated_payment_cvv"] = __('payplug_integrated_payment_cvv', 'payplug'); - $data["payplug_invalid_form"] = __('payplug_required_fields_error', 'payplug'); - $data['payplug_create_intent_payment'] = \WC_AJAX::get_endpoint('payplug_create_intent'); - $data['payplug_integrated_payment_check_payment_url'] = \WC_AJAX::get_endpoint('payplug_check_payment'); - $data['payplug_integrated_payment_nonce_field'] = wp_nonce_field('woocommerce-process_checkout', 'woocommerce-process-checkout-nonce'); - $data['wp_nonce'] = wp_create_nonce( "woocommerce-process_checkout" ); - $data['mode'] = PayplugWoocommerceHelper::check_mode(); - $data["IP"] = true; - - }else if( $options['payment_method'] === "popup" ){ - $data["popup"] = true; - $data['payplug_create_intent_payment'] = \WC_AJAX::get_endpoint('payplug_create_intent'); - $data['payplug_create_order'] = \WC_AJAX::get_endpoint('payplug_create_order'); - $data['wp_nonce'] = wp_create_nonce( "woocommerce-process_checkout" ); - - } - - return $data; - } - - /** - * Returns an array of scripts/handles to be registered for this payment method. - * - * @return array - */ - public function get_payment_method_script_handles() { - - $options = get_option('woocommerce_payplug_settings', []); - if( $options['payment_method'] === "integrated" && !is_wc_endpoint_url('order-pay')){ - $this->ip_scripts(); - } - - if ( $options['payment_method'] == "popup" ) { - $this->popup_scripts(); - } - - return parent::get_payment_method_script_handles(); - } - - private function ip_scripts(){ - wp_enqueue_style('payplugIP', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-integrated-payments.css', [], PAYPLUG_GATEWAY_VERSION); - wp_register_script( - 'payplug-integrated-payments-api', - IP_API, - array(), - 'v1.1', - true - ); - - wp_register_script('payplug-domain', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-domain.js', [], 'v1.0'); - wp_enqueue_script('payplug-domain'); - - wp_enqueue_script('payplug-integrated-payments-api'); - } - - private function popup_scripts(){ - wp_register_script('payplug-popup', 'https://api.payplug.com/js/1/form.latest.js', [], null, true); - if (isset($_GET['pay_for_order'])) { - wp_register_script('payplug-checkout', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-checkout.js', [ - 'jquery', - 'payplug-popup' - ], PAYPLUG_GATEWAY_VERSION, true); - } - - wp_localize_script('payplug-checkout', 'payplug_checkout_params', [ - 'ajax_url' => \WC_AJAX::get_endpoint('payplug_create_order'), - 'order_review_url' => \WC_AJAX::get_endpoint('payplug_order_review_url'), - 'nonce' => [ - 'checkout' => wp_create_nonce('woocommerce-process_checkout'), - ], - 'is_embedded' => 'redirect' !== $this->gateway->payment_method - ]); - - wp_enqueue_script('payplug-popup'); - wp_enqueue_script('payplug-checkout'); - } + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'payplug'; + + /** + * Returns an associative array of data to be exposed for the payment method's client side. + */ + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + $data['icon'] = [ + 'src' => ('it_IT' === get_locale()) ? + PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/logos_scheme_PostePay.svg' : + PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/logos_scheme_CB.svg', + 'icon_alt' => 'Visa & Mastercard', + ]; + $data['IP'] = false; + $data['popup'] = false; + $data['payment_method'] = $this->get_name(); + $data['supports'] = $this->get_supported_features(); + $data['showSaveOption'] = !empty($this->gateway->oneclick) ? $this->gateway->oneclick : false; + + $options = get_option('woocommerce_payplug_settings', []); + if ('integrated' === $options['payment_method']) { + $data['payplug_integrated_payment_cardHolder_error'] = __('payplug_integrated_payment_cardHolder_error', 'payplug'); + $data['payplug_integrated_payment_empty'] = __('payplug_integrated_payment_empty', 'payplug'); + $data['payplug_integrated_payment_your_card'] = __('payplug_integrated_payment_your_card', 'payplug'); + $data['payplug_integrated_payment_pan_error'] = __('payplug_integrated_payment_pan_error', 'payplug'); + $data['payplug_integrated_payment_exp_error'] = __('payplug_integrated_payment_exp_error', 'payplug'); + $data['payplug_integrated_payment_cvv_error'] = __('payplug_integrated_payment_cvv_error', 'payplug'); + $data['payplug_integrated_payment_error'] = __('payplug_integrated_payment_error', 'payplug'); + $data['payplug_integrated_payment_transaction_secure'] = __('payplug_integrated_payment_transaction_secure', 'payplug'); + $data['logo'] = PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/integrated/logo-payplug.png'; + $data['lock'] = PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/integrated/lock.svg'; + $data['payplug_integrated_payment_privacy_policy_url'] = __('payplug_integrated_payment_privacy_policy_url', 'payplug'); + $data['payplug_integrated_payment_privacy_policy'] = __('payplug_integrated_payment_privacy_policy', 'payplug'); + $data['payplug_integrated_payment_cardholder'] = __('payplug_integrated_payment_cardholder', 'payplug'); + $data['payplug_integrated_payment_card_number'] = __('payplug_integrated_payment_card_number', 'payplug'); + $data['payplug_integrated_payment_expiration_date'] = __('payplug_integrated_payment_expiration_date', 'payplug'); + $data['payplug_integrated_payment_cvv'] = __('payplug_integrated_payment_cvv', 'payplug'); + $data['payplug_invalid_form'] = __('payplug_required_fields_error', 'payplug'); + $data['payplug_create_intent_payment'] = \WC_AJAX::get_endpoint('payplug_create_intent'); + $data['payplug_integrated_payment_check_payment_url'] = \WC_AJAX::get_endpoint('payplug_check_payment'); + $data['payplug_integrated_payment_nonce_field'] = wp_nonce_field('woocommerce-process_checkout', 'woocommerce-process-checkout-nonce'); + $data['wp_nonce'] = wp_create_nonce('woocommerce-process_checkout'); + $data['mode'] = PayplugWoocommerceHelper::check_mode(); + $data['IP'] = true; + } elseif ('popup' === $options['payment_method']) { + $data['popup'] = true; + $data['payplug_create_intent_payment'] = \WC_AJAX::get_endpoint('payplug_create_intent'); + $data['payplug_create_order'] = \WC_AJAX::get_endpoint('payplug_create_order'); + $data['wp_nonce'] = wp_create_nonce('woocommerce-process_checkout'); + } + + return $data; + } + + /** + * Returns an array of scripts/handles to be registered for this payment method. + * + * @return array + */ + public function get_payment_method_script_handles() + { + $options = get_option('woocommerce_payplug_settings', []); + if ('integrated' === $options['payment_method'] && !is_wc_endpoint_url('order-pay')) { + $this->ip_scripts(); + } + + if ('popup' == $options['payment_method']) { + $this->popup_scripts(); + } + + return parent::get_payment_method_script_handles(); + } + + private function ip_scripts() + { + wp_enqueue_style('payplugIP', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-integrated-payments.css', [], PAYPLUG_GATEWAY_VERSION); + wp_register_script( + 'payplug-integrated-payments-api', + IP_API, + [], + 'v1.1', + true + ); + + wp_register_script('payplug-domain', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-domain.js', [], 'v1.0'); + wp_enqueue_script('payplug-domain'); + + wp_enqueue_script('payplug-integrated-payments-api'); + } + + private function popup_scripts() + { + wp_register_script('payplug-popup', 'https://api.payplug.com/js/1/form.latest.js', [], null, true); + if (isset($_GET['pay_for_order'])) { + wp_register_script('payplug-checkout', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-checkout.js', [ + 'jquery', + 'payplug-popup', + ], PAYPLUG_GATEWAY_VERSION, true); + } + + wp_localize_script('payplug-checkout', 'payplug_checkout_params', [ + 'ajax_url' => \WC_AJAX::get_endpoint('payplug_create_order'), + 'order_review_url' => \WC_AJAX::get_endpoint('payplug_order_review_url'), + 'nonce' => [ + 'checkout' => wp_create_nonce('woocommerce-process_checkout'), + ], + 'is_embedded' => 'redirect' !== $this->gateway->payment_method, + ]); + + wp_enqueue_script('payplug-popup'); + wp_enqueue_script('payplug-checkout'); + } } diff --git a/src/Gateway/Blocks/PayplugGenericBlock.php b/src/Gateway/Blocks/PayplugGenericBlock.php index 519ff052..e8f7c3b6 100644 --- a/src/Gateway/Blocks/PayplugGenericBlock.php +++ b/src/Gateway/Blocks/PayplugGenericBlock.php @@ -7,116 +7,111 @@ class PayplugGenericBlock extends AbstractPaymentMethodType { - - protected $gateway; - - protected $allowed_country_codes; - - public function initialize() - { - if (class_exists('WC_Blocks_Utils')) { - if (\WC_Blocks_Utils::has_block_in_page( wc_get_page_id('checkout'), 'woocommerce/checkout' ) || - \WC_Blocks_Utils::has_block_in_page( wc_get_page_id('cart'), 'woocommerce/cart' ) - ) { - $gateways = WC()->payment_gateways->payment_gateways(); - $this->gateway = $gateways[$this->name]; - } - } - - - } - - public function is_active() - { - if (class_exists('WC_Blocks_Utils')) { - if (\WC_Blocks_Utils::has_block_in_page( wc_get_page_id('checkout'), 'woocommerce/checkout' )) { - - if(empty($this->gateway)){ - return false; - } - - $active = false; - if ( method_exists( $this->gateway, "is_available" ) ) { - $active = $this->gateway->is_available(); - } - - if ( method_exists( $this->gateway, "checkGateway" ) ) { - $active = $this->gateway->checkGateway() && $active; - } - - return $active && $this->gateway->check_gateway( WC()->payment_gateways->payment_gateways() ); - } - } - } - - - - - /** - * Returns an array of scripts/handles to be registered for this payment method. - * - * @return array - */ - public function get_payment_method_script_handles() { - - $script_path = '/assets/js/blocks/wc-payplug-'.$this->get_name().'-blocks.js'; - $script_asset_path = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/blocks/frontend/wc-payplug-'.$this->get_name().'-blocks.asset.php'; - $script_asset = file_exists( $script_asset_path ) ? require( $script_asset_path ) : array('dependencies' => array(), 'version' => '1.0.0'); - $script_url = PAYPLUG_GATEWAY_PLUGIN_URL. $script_path; - - wp_register_script('wc-payplug-'.$this->get_name().'-blocks', $script_url, $script_asset[ 'dependencies' ], $script_asset[ 'version' ], true ); - return [ 'wc-payplug-'.$this->get_name().'-blocks' ]; - } - - /** - * Returns an array of supported features. - * - * @return string[] - */ - public function get_supported_features() { - $features = $this->gateway->supports; - - // Only include tokenization in supported features when order amount is between min and max allowed values - $cart_total = WC()->cart ? WC()->cart->get_total('') : 0; - $cart_total_cents = (int) PayplugWoocommerceHelper::get_payplug_amount($cart_total); - $min_amount = PayplugWoocommerceHelper::get_minimum_amount(); - $max_amount = PayplugWoocommerceHelper::get_maximum_amount(); - - if (!($cart_total_cents >= $min_amount && $cart_total_cents <= $max_amount)) { - // Remove tokenization from supported features if outside allowed amount range - $features = array_diff($features, ['tokenization']); - } - - return $features; - } - - - /** - * Returns an associative array of data to be exposed for the payment method's client side. - */ - public function get_payment_method_data() { - $account = PayplugWoocommerceHelper::generic_get_account_data_from_options( $this->name ); - $this->allowed_country_codes = !empty($account["payment_methods"][ $this->name ]['allowed_countries']) ? $account["payment_methods"][ $this->name ]['allowed_countries'] : null; - - // Only show saved cards when order amount is between min and max allowed values - $cart_total = WC()->cart ? WC()->cart->get_total('') : 0; - $cart_total_cents = (int) PayplugWoocommerceHelper::get_payplug_amount($cart_total); - $min_amount = PayplugWoocommerceHelper::get_minimum_amount(); - $max_amount = PayplugWoocommerceHelper::get_maximum_amount(); - - if ($this->gateway->settings['oneclick'] === 'yes' && $cart_total_cents >= $min_amount && $cart_total_cents <= $max_amount) { - $oneclick = true; - } else { - $oneclick = false; - } - return [ - 'enabled' => $this->is_active(), - 'name' => $this->gateway->id, - 'title' => $this->gateway->title, - 'description' => $this->gateway->description, - 'allowed_country_codes' => $this->allowed_country_codes, - 'oneclick' => $oneclick - ]; - } - + protected $gateway; + + protected $allowed_country_codes; + + public function initialize() + { + if (class_exists('WC_Blocks_Utils')) { + if (\WC_Blocks_Utils::has_block_in_page(wc_get_page_id('checkout'), 'woocommerce/checkout') + || \WC_Blocks_Utils::has_block_in_page(wc_get_page_id('cart'), 'woocommerce/cart') + ) { + $gateways = WC()->payment_gateways->payment_gateways(); + $this->gateway = $gateways[$this->name]; + } + } + } + + public function is_active() + { + if (class_exists('WC_Blocks_Utils')) { + if (\WC_Blocks_Utils::has_block_in_page(wc_get_page_id('checkout'), 'woocommerce/checkout')) { + if (empty($this->gateway)) { + return false; + } + + $active = false; + if (method_exists($this->gateway, 'is_available')) { + $active = $this->gateway->is_available(); + } + + if (method_exists($this->gateway, 'checkGateway')) { + $active = $this->gateway->checkGateway() && $active; + } + + return $active && $this->gateway->check_gateway(WC()->payment_gateways->payment_gateways()); + } + } + } + + /** + * Returns an array of scripts/handles to be registered for this payment method. + * + * @return array + */ + public function get_payment_method_script_handles() + { + $script_path = '/assets/js/blocks/wc-payplug-' . $this->get_name() . '-blocks.js'; + $script_asset_path = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/blocks/frontend/wc-payplug-' . $this->get_name() . '-blocks.asset.php'; + $script_asset = file_exists($script_asset_path) ? require($script_asset_path) : ['dependencies' => [], 'version' => '1.0.0']; + $script_url = PAYPLUG_GATEWAY_PLUGIN_URL . $script_path; + + wp_register_script('wc-payplug-' . $this->get_name() . '-blocks', $script_url, $script_asset['dependencies'], $script_asset['version'], true); + + return ['wc-payplug-' . $this->get_name() . '-blocks']; + } + + /** + * Returns an array of supported features. + * + * @return string[] + */ + public function get_supported_features() + { + $features = $this->gateway->supports; + + // Only include tokenization in supported features when order amount is between min and max allowed values + $cart_total = WC()->cart ? WC()->cart->get_total('') : 0; + $cart_total_cents = (int) PayplugWoocommerceHelper::get_payplug_amount($cart_total); + $min_amount = PayplugWoocommerceHelper::get_minimum_amount(); + $max_amount = PayplugWoocommerceHelper::get_maximum_amount(); + + if (!($cart_total_cents >= $min_amount && $cart_total_cents <= $max_amount)) { + // Remove tokenization from supported features if outside allowed amount range + $features = array_diff($features, ['tokenization']); + } + + return $features; + } + + /** + * Returns an associative array of data to be exposed for the payment method's client side. + */ + public function get_payment_method_data() + { + $account = PayplugWoocommerceHelper::generic_get_account_data_from_options($this->name); + $this->allowed_country_codes = !empty($account['payment_methods'][$this->name]['allowed_countries']) ? $account['payment_methods'][$this->name]['allowed_countries'] : null; + + // Only show saved cards when order amount is between min and max allowed values + $cart_total = WC()->cart ? WC()->cart->get_total('') : 0; + $cart_total_cents = (int) PayplugWoocommerceHelper::get_payplug_amount($cart_total); + $min_amount = PayplugWoocommerceHelper::get_minimum_amount(); + $max_amount = PayplugWoocommerceHelper::get_maximum_amount(); + + if ('yes' === $this->gateway->settings['oneclick'] && $cart_total_cents >= $min_amount && $cart_total_cents <= $max_amount) { + $oneclick = true; + } else { + $oneclick = false; + } + + return [ + 'enabled' => $this->is_active(), + 'name' => $this->gateway->id, + 'title' => $this->gateway->title, + 'description' => $this->gateway->description, + 'allowed_country_codes' => $this->allowed_country_codes, + 'oneclick' => $oneclick, + ]; + } } diff --git a/src/Gateway/Blocks/PayplugIdeal.php b/src/Gateway/Blocks/PayplugIdeal.php index 8e2c2dc8..0c5e604c 100644 --- a/src/Gateway/Blocks/PayplugIdeal.php +++ b/src/Gateway/Blocks/PayplugIdeal.php @@ -2,35 +2,26 @@ namespace Payplug\PayplugWoocommerce\Gateway\Blocks; -use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; - class PayplugIdeal extends PayplugGenericBlock { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = 'ideal'; - - - /** - * Returns an associative array of data to be exposed for the payment method's client side. - */ - public function get_payment_method_data() { - $data = parent::get_payment_method_data(); - $data['icon'] = [ - "src" => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), - 'icon_alt' => $data['name'], - ]; - - return $data; - } - - - - - - + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'ideal'; + + /** + * Returns an associative array of data to be exposed for the payment method's client side. + */ + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + $data['icon'] = [ + 'src' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), + 'icon_alt' => $data['name'], + ]; + + return $data; + } } diff --git a/src/Gateway/Blocks/PayplugMybank.php b/src/Gateway/Blocks/PayplugMybank.php index 5428a8e5..78f18ba8 100644 --- a/src/Gateway/Blocks/PayplugMybank.php +++ b/src/Gateway/Blocks/PayplugMybank.php @@ -2,34 +2,26 @@ namespace Payplug\PayplugWoocommerce\Gateway\Blocks; -use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; - class PayplugMybank extends PayplugGenericBlock { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = 'mybank'; - - /** - * Returns an associative array of data to be exposed for the payment method's client side. - */ - public function get_payment_method_data() { - $data = parent::get_payment_method_data(); - $data['icon'] = [ - "src" => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), - 'icon_alt' => $data['name'], - ]; - - return $data; - } - - - - - - + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'mybank'; + + /** + * Returns an associative array of data to be exposed for the payment method's client side. + */ + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + $data['icon'] = [ + 'src' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), + 'icon_alt' => $data['name'], + ]; + + return $data; + } } diff --git a/src/Gateway/Blocks/PayplugOney.php b/src/Gateway/Blocks/PayplugOney.php index a910b5cb..e9592a32 100644 --- a/src/Gateway/Blocks/PayplugOney.php +++ b/src/Gateway/Blocks/PayplugOney.php @@ -4,68 +4,66 @@ use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -class PayplugOney extends PayplugGenericBlock { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "oney"; - - protected $icon = ''; - - protected $cart; - - protected $total_price; - - /** - * Returns an associative array of data to be exposed for the payment method's client side. - */ - public function get_payment_method_data() { - - $data = parent::get_payment_method_data(); - - if ( is_checkout() ) { - $this->cart = WC()->cart; - $this->total_price = floatval( WC()->cart->total ); - } - - if ( PayplugWoocommerceHelper::is_cart_block() && is_cart() && !PayplugWoocommerceHelper::is_subscription() ) { - $data['oney_cart_label'] = __( 'OR PAY IN', 'payplug' ); - if ($this->gateway->settings['oney_type'] == 'without_fees') { - $data['oney_cart_logo'] = esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/Oneywithoutfees3x4x.png' ); - } else { - $data['oney_cart_logo'] = esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/lg-3x4xoney.png' ); - } - } - - $data['icon'] = [ - 'src' => esc_url( PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->icon ), - 'class' => 'payplug-payment-icon', - 'alt' => $this->gateway->title - ]; - $data['description'] = $this->gateway->description; - $data['oney_response'] = $this->gateway->api->simulate_oney_payment( $this->total_price, 'with_fees' ); - - $data['currency'] = get_woocommerce_currency_symbol( get_option( 'woocommerce_currency' ) ); - - $data['translations']['bring'] = __( 'Bring', 'payplug' ); - $data['translations']['oney_financing_cost'] = __( 'oney_financing_cost', 'payplug' ); - $data['translations']['1st_monthly_payment'] = __( '1st monthly payment', 'payplug' ); - $data['translations']['2nd_monthly_payment'] = __( '2nd monthly payment', 'payplug' ); - $data['translations']['oney_total'] = __( 'oney_total', 'payplug' ); - $data['allowed_country_codes'] = $this->gateway->allowed_country_codes; - - $data['requirements'] = [ - 'max_quantity' => $this->gateway::ONEY_PRODUCT_QUANTITY_MAXIMUM, - 'max_threshold' => $this->gateway->oney_thresholds_max * 100, - 'min_threshold' => $this->gateway->oney_thresholds_min * 100, - 'allowed_country_codes' => $this->gateway->allowed_country_codes - ]; - - return $data; - - } - +class PayplugOney extends PayplugGenericBlock +{ + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'oney'; + + protected $icon = ''; + + protected $cart; + + protected $total_price; + + /** + * Returns an associative array of data to be exposed for the payment method's client side. + */ + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + + if (is_checkout()) { + $this->cart = WC()->cart; + $this->total_price = floatval(WC()->cart->total); + } + + if (PayplugWoocommerceHelper::is_cart_block() && is_cart() && !PayplugWoocommerceHelper::is_subscription()) { + $data['oney_cart_label'] = __('OR PAY IN', 'payplug'); + if ('without_fees' == $this->gateway->settings['oney_type']) { + $data['oney_cart_logo'] = esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/Oneywithoutfees3x4x.png'); + } else { + $data['oney_cart_logo'] = esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/lg-3x4xoney.png'); + } + } + + $data['icon'] = [ + 'src' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->icon), + 'class' => 'payplug-payment-icon', + 'alt' => $this->gateway->title, + ]; + $data['description'] = $this->gateway->description; + $data['oney_response'] = $this->gateway->api->simulate_oney_payment($this->total_price, 'with_fees'); + + $data['currency'] = get_woocommerce_currency_symbol(get_option('woocommerce_currency')); + + $data['translations']['bring'] = __('Bring', 'payplug'); + $data['translations']['oney_financing_cost'] = __('oney_financing_cost', 'payplug'); + $data['translations']['1st_monthly_payment'] = __('1st monthly payment', 'payplug'); + $data['translations']['2nd_monthly_payment'] = __('2nd monthly payment', 'payplug'); + $data['translations']['oney_total'] = __('oney_total', 'payplug'); + $data['allowed_country_codes'] = $this->gateway->allowed_country_codes; + + $data['requirements'] = [ + 'max_quantity' => $this->gateway::ONEY_PRODUCT_QUANTITY_MAXIMUM, + 'max_threshold' => $this->gateway->oney_thresholds_max * 100, + 'min_threshold' => $this->gateway->oney_thresholds_min * 100, + 'allowed_country_codes' => $this->gateway->allowed_country_codes, + ]; + + return $data; + } } diff --git a/src/Gateway/Blocks/PayplugOney3x.php b/src/Gateway/Blocks/PayplugOney3x.php index c44799ea..4a402369 100644 --- a/src/Gateway/Blocks/PayplugOney3x.php +++ b/src/Gateway/Blocks/PayplugOney3x.php @@ -2,17 +2,14 @@ namespace Payplug\PayplugWoocommerce\Gateway\Blocks; -class PayplugOney3x extends PayplugOney { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "oney_x3_with_fees"; - - protected $icon = 'x3_with_fees.svg'; - - - +class PayplugOney3x extends PayplugOney +{ + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'oney_x3_with_fees'; + + protected $icon = 'x3_with_fees.svg'; } diff --git a/src/Gateway/Blocks/PayplugOney3xWithoutFees.php b/src/Gateway/Blocks/PayplugOney3xWithoutFees.php index 21eb99a9..d6b136e5 100644 --- a/src/Gateway/Blocks/PayplugOney3xWithoutFees.php +++ b/src/Gateway/Blocks/PayplugOney3xWithoutFees.php @@ -4,37 +4,35 @@ use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -class PayplugOney3xWithoutFees extends PayplugOney { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "oney_x3_without_fees"; - - protected $icon = 'x3_without_fees_'; - - - public function get_payment_method_data() { - $data = parent::get_payment_method_data(); - - $country = PayplugWoocommerceHelper::getISOCountryCode(); - if ( file_exists( PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/'.$this->icon . $country . '.svg' ) ) { - $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/'. $this->icon. $country . '.svg'; - } else { - $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/'.$this->icon.'FR.svg'; - } - $data['icon'] = [ - 'src' => $image, - 'class' => 'payplug-payment-icon', - 'alt' => $this->gateway->title - ]; - - $data['oney_response'] = $this->gateway->api->simulate_oney_payment( $this->total_price, 'without_fees' ); - - return $data; - } - - +class PayplugOney3xWithoutFees extends PayplugOney +{ + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'oney_x3_without_fees'; + + protected $icon = 'x3_without_fees_'; + + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + + $country = PayplugWoocommerceHelper::getISOCountryCode(); + if (file_exists(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/' . $this->icon . $country . '.svg')) { + $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/' . $this->icon . $country . '.svg'; + } else { + $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/' . $this->icon . 'FR.svg'; + } + $data['icon'] = [ + 'src' => $image, + 'class' => 'payplug-payment-icon', + 'alt' => $this->gateway->title, + ]; + + $data['oney_response'] = $this->gateway->api->simulate_oney_payment($this->total_price, 'without_fees'); + + return $data; + } } diff --git a/src/Gateway/Blocks/PayplugOney4x.php b/src/Gateway/Blocks/PayplugOney4x.php index 2c975cf4..93e6ed10 100644 --- a/src/Gateway/Blocks/PayplugOney4x.php +++ b/src/Gateway/Blocks/PayplugOney4x.php @@ -2,26 +2,23 @@ namespace Payplug\PayplugWoocommerce\Gateway\Blocks; -class PayplugOney4x extends PayplugOney { +class PayplugOney4x extends PayplugOney +{ + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'oney_x4_with_fees'; - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "oney_x4_with_fees"; + protected $icon = 'x4_with_fees.svg'; - protected $icon = 'x4_with_fees.svg'; - - - public function get_payment_method_data() { - - $data = parent::get_payment_method_data(); - - $data['translations']['3rd_monthly_payment'] = __( '3rd monthly payment', 'payplug' ); - - return $data; - } + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + $data['translations']['3rd_monthly_payment'] = __('3rd monthly payment', 'payplug'); + return $data; + } } diff --git a/src/Gateway/Blocks/PayplugOney4xWithoutFees.php b/src/Gateway/Blocks/PayplugOney4xWithoutFees.php index 65f3c1a2..0bbef5bb 100644 --- a/src/Gateway/Blocks/PayplugOney4xWithoutFees.php +++ b/src/Gateway/Blocks/PayplugOney4xWithoutFees.php @@ -2,26 +2,23 @@ namespace Payplug\PayplugWoocommerce\Gateway\Blocks; -use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; +class PayplugOney4xWithoutFees extends PayplugOney3xWithoutFees +{ + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'oney_x4_without_fees'; -class PayplugOney4xWithoutFees extends PayplugOney3xWithoutFees { + protected $icon = 'x4_without_fees_'; - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "oney_x4_without_fees"; + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); - protected $icon = 'x4_without_fees_'; - - public function get_payment_method_data() { - - $data = parent::get_payment_method_data(); - - $data['translations']['3rd_monthly_payment'] = __( '3rd monthly payment', 'payplug' ); - - return $data; - } + $data['translations']['3rd_monthly_payment'] = __('3rd monthly payment', 'payplug'); + return $data; + } } diff --git a/src/Gateway/Blocks/PayplugSatispay.php b/src/Gateway/Blocks/PayplugSatispay.php index 6519e89f..76fde03d 100644 --- a/src/Gateway/Blocks/PayplugSatispay.php +++ b/src/Gateway/Blocks/PayplugSatispay.php @@ -4,29 +4,24 @@ class PayplugSatispay extends PayplugGenericBlock { - - /** - * Payment method name/id/slug. - * - * @var string - */ - protected $name = "satispay"; - - /** - * Returns an associative array of data to be exposed for the payment method's client side. - */ - public function get_payment_method_data() { - $data = parent::get_payment_method_data(); - $data['icon'] = [ - "src" => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), - 'icon_alt' => $data['name'], - ]; - return $data; - } - - - - - - + /** + * Payment method name/id/slug. + * + * @var string + */ + protected $name = 'satispay'; + + /** + * Returns an associative array of data to be exposed for the payment method's client side. + */ + public function get_payment_method_data() + { + $data = parent::get_payment_method_data(); + $data['icon'] = [ + 'src' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->gateway->image), + 'icon_alt' => $data['name'], + ]; + + return $data; + } } diff --git a/src/Gateway/PPRO/Ideal.php b/src/Gateway/PPRO/Ideal.php index 5637972b..855a9d0e 100644 --- a/src/Gateway/PPRO/Ideal.php +++ b/src/Gateway/PPRO/Ideal.php @@ -1,42 +1,39 @@ id = 'ideal'; - $this->method_title = __("pay_with_ideal", "payplug"); - $this->title = __("pay_with_ideal", "payplug"); - $this->method_description = ""; - $this->description = ""; - $this->image = 'ideal.svg'; - - //WOOCO FIELDS - $this->has_fields = false; - $this->enabled = "yes"; - - if (!$this->checkGateway()) { - $this->enabled = "no"; - } - - - add_action('woocommerce_order_item_add_action_buttons', [$this, 'refund_not_available']); - - } - + const ENABLE_ON_TEST_MODE = false; + + protected $min_thresholds; + protected $max_thresholds; + protected $allowed_country_codes = []; + protected $enable_refund = true; + + public function __construct() + { + parent::__construct(); + + //since we're calling the parent construct we need to redefine the payment properties + //once we detach the cc from default payment method, this will be no longer needed + $this->id = 'ideal'; + $this->method_title = __('pay_with_ideal', 'payplug'); + $this->title = __('pay_with_ideal', 'payplug'); + $this->method_description = ''; + $this->description = ''; + $this->image = 'ideal.svg'; + + //WOOCO FIELDS + $this->has_fields = false; + $this->enabled = 'yes'; + + if (!$this->checkGateway()) { + $this->enabled = 'no'; + } + + add_action('woocommerce_order_item_add_action_buttons', [$this, 'refund_not_available']); + } } diff --git a/src/Gateway/PPRO/Mybank.php b/src/Gateway/PPRO/Mybank.php index 8333d15c..2101bbe7 100644 --- a/src/Gateway/PPRO/Mybank.php +++ b/src/Gateway/PPRO/Mybank.php @@ -1,42 +1,39 @@ id = 'mybank'; - $this->method_title = __("pay_with_mybank", "payplug"); - $this->title = __("pay_with_mybank", "payplug"); - $this->method_description = ""; - $this->description = ""; - $this->image = 'mybank.svg'; - - //WOOCO FIELDS - $this->has_fields = false; - $this->enabled = "yes"; - - - if(!$this->checkGateway()){ - $this->enabled = "no"; - } - - add_action('woocommerce_order_item_add_action_buttons', [$this, 'refund_not_available']); - - } - + const ENABLE_ON_TEST_MODE = false; + + protected $min_thresholds; + protected $max_thresholds; + protected $allowed_country_codes = []; + protected $enable_refund = true; + + public function __construct() + { + parent::__construct(); + + //since we're calling the parent construct we need to redefine the payment properties + //once we detach the cc from default payment method, this will be no longer needed + $this->id = 'mybank'; + $this->method_title = __('pay_with_mybank', 'payplug'); + $this->title = __('pay_with_mybank', 'payplug'); + $this->method_description = ''; + $this->description = ''; + $this->image = 'mybank.svg'; + + //WOOCO FIELDS + $this->has_fields = false; + $this->enabled = 'yes'; + + if (!$this->checkGateway()) { + $this->enabled = 'no'; + } + + add_action('woocommerce_order_item_add_action_buttons', [$this, 'refund_not_available']); + } } diff --git a/src/Gateway/PPRO/Satispay.php b/src/Gateway/PPRO/Satispay.php index 1917d495..d024e478 100644 --- a/src/Gateway/PPRO/Satispay.php +++ b/src/Gateway/PPRO/Satispay.php @@ -4,39 +4,36 @@ use Payplug\PayplugWoocommerce\Controller\PayplugGenericGateway; -class Satispay extends PayplugGenericGateway +class Satispay extends PayplugGenericGateway { - - protected $min_thresholds; - protected $max_thresholds; - protected $allowed_country_codes = []; - protected $enable_refund = true; - const ENABLE_ON_TEST_MODE = false; - - public function __construct() - { - - parent::__construct(); - - //since we're calling the parent construct we need to redefine the payment properties - //once we detach the cc from default payment method, this will be no longer needed - $this->id = 'satispay'; - $this->method_title = __("pay_with_satispay", "payplug"); - $this->title = __("pay_with_satispay", "payplug"); - $this->method_description = ""; - $this->description = ""; - $this->image = 'satispay.svg'; - - //WOOCO FIELDS - $this->has_fields = false; - $this->enabled = "yes"; - - if (!$this->checkGateway()) { - $this->enabled = "no"; - } - - add_action('woocommerce_order_item_add_action_buttons', [$this, 'refund_not_available']); - - } - + const ENABLE_ON_TEST_MODE = false; + + protected $min_thresholds; + protected $max_thresholds; + protected $allowed_country_codes = []; + protected $enable_refund = true; + + public function __construct() + { + parent::__construct(); + + //since we're calling the parent construct we need to redefine the payment properties + //once we detach the cc from default payment method, this will be no longer needed + $this->id = 'satispay'; + $this->method_title = __('pay_with_satispay', 'payplug'); + $this->title = __('pay_with_satispay', 'payplug'); + $this->method_description = ''; + $this->description = ''; + $this->image = 'satispay.svg'; + + //WOOCO FIELDS + $this->has_fields = false; + $this->enabled = 'yes'; + + if (!$this->checkGateway()) { + $this->enabled = 'no'; + } + + add_action('woocommerce_order_item_add_action_buttons', [$this, 'refund_not_available']); + } } diff --git a/src/Gateway/PayplugAddressData.php b/src/Gateway/PayplugAddressData.php index 3150c4d7..494aa1ac 100644 --- a/src/Gateway/PayplugAddressData.php +++ b/src/Gateway/PayplugAddressData.php @@ -3,8 +3,8 @@ namespace Payplug\PayplugWoocommerce\Gateway; // Exit if accessed directly -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } use libphonenumber\PhoneNumberFormat; @@ -12,293 +12,301 @@ use libphonenumber\PhoneNumberUtil; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -class PayplugAddressData { - - const DELIVERY_TYPE_BILLING = 'BILLING'; - const DELIVERY_TYPE_VERIFIED = 'VERIFIED'; - const DELIVERY_TYPE_NEW = 'NEW'; - const DELIVERY_TYPE_SHIP_TO_STORE = 'SHIP_TO_STORE'; - const DELIVERY_TYPE_DIGITAL_GOODS = 'DIGITAL_GOODS'; - const DELIVERY_TYPE_TRAVEL_OR_EVENT = 'TRAVEL_OR_EVENT'; - const DELIVERY_TYPE_OTHER = 'OTHER'; - - public static $address_fields = [ - 'address1', - 'address2', - 'postcode', - 'city', - 'state', - 'country' - ]; - - /** - * @var array - */ - protected $billing; - - /** - * @var array - */ - protected $shipping; - - /** - * Get address data from order. - * - * @param $order - * - * @return PayplugAddressData - * @throws \InvalidArgumentException - */ - public static function from_order( $order ) { - if ( ! is_a( $order, '\WC_Order' ) ) { - throw new \InvalidArgumentException( - sprintf( 'Expected WC_Order object, got %s', get_class( $order ) ) - ); - } - - $address_data = new PayplugAddressData(); - $address_data->prepare_address_data( $order ); - - return $address_data; - } - - /** - * Check if an address has already been used by a customer - * - * @param int $customer - * @param string $hash - * - * @return bool - */ - public static function address_already_used( $customer, $hash ) { - $hash_list = self::get_customer_addresses_hash( $customer ); - - return ! empty( $hash_list ) && in_array( $hash, $hash_list ); - } - - /** - * Get the list of hash of all addresses used by the customer - * - * @param int $customer - * - * @return array - */ - public static function get_customer_addresses_hash( $customer ) { - $hash_list = get_user_meta( $customer, 'payplug_addresses_hash', true ); - - return is_array( $hash_list ) ? $hash_list : []; - } - - /** - * Update the list of hash of all addresses used by the customer - * - * @param int $customer - * @param array $hash_list - * - * @return bool - */ - public static function update_customer_addresses_hash( $customer, $hash_list ) { - $result = update_user_meta( $customer, 'payplug_addresses_hash', $hash_list ); - - return false !== $result; - } - - /** - * Hash an address - * - * @param array $address - * - * @return string - */ - public static function hash_address( $address ) { - - $to_hash = ''; - foreach ( self::$address_fields as $field ) { - if ( empty( $address[ $field ] ) ) { - continue; - } - - $to_hash .= strtolower( remove_accents( $address[ $field ] ) ); - } - - return md5( $to_hash ); - } - - /** - * Get billing data. - * - * @return array|null - */ - public function get_billing() { - return ( ! empty( $this->billing ) ) ? $this->billing : null; - } - - /** - * Get shipping data. - * - * @return array|null - */ - public function get_shipping() { - return ( ! empty( $this->shipping ) ) ? $this->shipping : null; - } - - /** - * Prepare data for billing and shipping. - * - * @param \WC_Order $order - */ - protected function prepare_address_data( $order ) { - - $customer = PayplugWoocommerceHelper::is_pre_30() ? $order->customer_user : $order->get_customer_id(); - - $billing_first_name = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_first_name : $order->get_billing_first_name(); - $billing_last_name = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_last_name : $order->get_billing_last_name(); - $billing_email = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_email : $order->get_billing_email(); - $billing_address1 = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_address_1 : $order->get_billing_address_1(); - $billing_address2 = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_address_2 : $order->get_billing_address_2(); - $billing_postcode = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_postcode : $order->get_billing_postcode(); - $billing_city = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_city : $order->get_billing_city(); - $billing_country = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_country : $order->get_billing_country(); - $billing_company = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_company : $order->get_billing_company(); - if (empty($billing_company)) { - $billing_company = $billing_first_name .' '. $billing_last_name; - } - - if ( ! PayplugWoocommerceHelper::is_country_supported( $billing_country ) ) { - $billing_country = PayplugWoocommerceHelper::get_default_country(); - } - - $this->billing = [ - 'first_name' => $this->limit_length( $billing_first_name ), - 'last_name' => $this->limit_length( $billing_last_name ), - 'email' => $this->limit_length( $billing_email, 255 ), - 'address1' => $this->limit_length( $billing_address1, 255 ), - 'postcode' => $this->limit_length( $billing_postcode, 16 ), - 'city' => $this->limit_length( $billing_city ), - 'country' => $this->limit_length( $billing_country, 2 ), - 'company_name' => $this->limit_length( $billing_company ) - ]; - - if ( ! empty( $billing_address2 ) ) { - $this->billing['address2'] = $this->limit_length( $billing_address2, 255 ); - } - - // We need to know if current cart contain products we will be shipped to the customer - // to set the correct `delivery_type` value - if ( $order->needs_shipping_address() ) { - $has_shipping_address = PayplugWoocommerceHelper::is_pre_30() - ? $order->shipping_address_1 - : $order->get_shipping_address_1(); - - if ( $has_shipping_address && ! wc_ship_to_billing_address_only() ) { - $shipping_first_name = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_first_name : $order->get_shipping_first_name(); - $shipping_last_name = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_last_name : $order->get_shipping_last_name(); - // Using email from billing address since Woocommerce doesn't provide one for the shipping address by default. - $shipping_email = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_email : $order->get_billing_email(); - $shipping_address1 = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_address_1 : $order->get_shipping_address_1(); - $shipping_address2 = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_address_2 : $order->get_shipping_address_2(); - $shipping_postcode = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_postcode : $order->get_shipping_postcode(); - $shipping_city = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_city : $order->get_shipping_city(); - $shipping_country = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_country : $order->get_shipping_country(); - $shipping_company = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_company : $order->get_shipping_company(); +class PayplugAddressData +{ + const DELIVERY_TYPE_BILLING = 'BILLING'; + const DELIVERY_TYPE_VERIFIED = 'VERIFIED'; + const DELIVERY_TYPE_NEW = 'NEW'; + const DELIVERY_TYPE_SHIP_TO_STORE = 'SHIP_TO_STORE'; + const DELIVERY_TYPE_DIGITAL_GOODS = 'DIGITAL_GOODS'; + const DELIVERY_TYPE_TRAVEL_OR_EVENT = 'TRAVEL_OR_EVENT'; + const DELIVERY_TYPE_OTHER = 'OTHER'; + + public static $address_fields = [ + 'address1', + 'address2', + 'postcode', + 'city', + 'state', + 'country', + ]; + + /** + * @var array + */ + protected $billing; + + /** + * @var array + */ + protected $shipping; + + /** + * Get address data from order. + * + * @param $order + * + * @throws \InvalidArgumentException + * + * @return PayplugAddressData + */ + public static function from_order($order) + { + if (!is_a($order, '\WC_Order')) { + throw new \InvalidArgumentException( + sprintf('Expected WC_Order object, got %s', get_class($order)) + ); + } + + $address_data = new PayplugAddressData(); + $address_data->prepare_address_data($order); + + return $address_data; + } + + /** + * Check if an address has already been used by a customer. + * + * @param int $customer + * @param string $hash + * + * @return bool + */ + public static function address_already_used($customer, $hash) + { + $hash_list = self::get_customer_addresses_hash($customer); + + return !empty($hash_list) && in_array($hash, $hash_list); + } + + /** + * Get the list of hash of all addresses used by the customer. + * + * @param int $customer + * + * @return array + */ + public static function get_customer_addresses_hash($customer) + { + $hash_list = get_user_meta($customer, 'payplug_addresses_hash', true); + + return is_array($hash_list) ? $hash_list : []; + } + + /** + * Update the list of hash of all addresses used by the customer. + * + * @param int $customer + * @param array $hash_list + * + * @return bool + */ + public static function update_customer_addresses_hash($customer, $hash_list) + { + $result = update_user_meta($customer, 'payplug_addresses_hash', $hash_list); + + return false !== $result; + } + + /** + * Hash an address. + * + * @param array $address + * + * @return string + */ + public static function hash_address($address) + { + $to_hash = ''; + foreach (self::$address_fields as $field) { + if (empty($address[$field])) { + continue; + } + + $to_hash .= strtolower(remove_accents($address[$field])); + } + + return md5($to_hash); + } + + /** + * Get billing data. + * + * @return array|null + */ + public function get_billing() + { + return (!empty($this->billing)) ? $this->billing : null; + } + + /** + * Get shipping data. + * + * @return array|null + */ + public function get_shipping() + { + return (!empty($this->shipping)) ? $this->shipping : null; + } + + /** + * Prepare data for billing and shipping. + * + * @param \WC_Order $order + */ + protected function prepare_address_data($order) + { + $customer = PayplugWoocommerceHelper::is_pre_30() ? $order->customer_user : $order->get_customer_id(); + + $billing_first_name = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_first_name : $order->get_billing_first_name(); + $billing_last_name = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_last_name : $order->get_billing_last_name(); + $billing_email = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_email : $order->get_billing_email(); + $billing_address1 = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_address_1 : $order->get_billing_address_1(); + $billing_address2 = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_address_2 : $order->get_billing_address_2(); + $billing_postcode = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_postcode : $order->get_billing_postcode(); + $billing_city = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_city : $order->get_billing_city(); + $billing_country = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_country : $order->get_billing_country(); + $billing_company = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_company : $order->get_billing_company(); + if (empty($billing_company)) { + $billing_company = $billing_first_name . ' ' . $billing_last_name; + } + + if (!PayplugWoocommerceHelper::is_country_supported($billing_country)) { + $billing_country = PayplugWoocommerceHelper::get_default_country(); + } + + $this->billing = [ + 'first_name' => $this->limit_length($billing_first_name), + 'last_name' => $this->limit_length($billing_last_name), + 'email' => $this->limit_length($billing_email, 255), + 'address1' => $this->limit_length($billing_address1, 255), + 'postcode' => $this->limit_length($billing_postcode, 16), + 'city' => $this->limit_length($billing_city), + 'country' => $this->limit_length($billing_country, 2), + 'company_name' => $this->limit_length($billing_company), + ]; + + if (!empty($billing_address2)) { + $this->billing['address2'] = $this->limit_length($billing_address2, 255); + } + + // We need to know if current cart contain products we will be shipped to the customer + // to set the correct `delivery_type` value + if ($order->needs_shipping_address()) { + $has_shipping_address = PayplugWoocommerceHelper::is_pre_30() + ? $order->shipping_address_1 + : $order->get_shipping_address_1(); + + if ($has_shipping_address && !wc_ship_to_billing_address_only()) { + $shipping_first_name = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_first_name : $order->get_shipping_first_name(); + $shipping_last_name = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_last_name : $order->get_shipping_last_name(); + // Using email from billing address since Woocommerce doesn't provide one for the shipping address by default. + $shipping_email = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_email : $order->get_billing_email(); + $shipping_address1 = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_address_1 : $order->get_shipping_address_1(); + $shipping_address2 = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_address_2 : $order->get_shipping_address_2(); + $shipping_postcode = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_postcode : $order->get_shipping_postcode(); + $shipping_city = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_city : $order->get_shipping_city(); + $shipping_country = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_country : $order->get_shipping_country(); + $shipping_company = PayplugWoocommerceHelper::is_pre_30() ? $order->shipping_company : $order->get_shipping_company(); if (empty($shipping_company)) { - $shipping_company = $shipping_first_name .' '. $shipping_last_name; + $shipping_company = $shipping_first_name . ' ' . $shipping_last_name; } - if ( ! PayplugWoocommerceHelper::is_country_supported( $shipping_country ) ) { - $shipping_country = PayplugWoocommerceHelper::get_default_country(); - } - - $this->shipping = [ - 'first_name' => $this->limit_length( $shipping_first_name ), - 'last_name' => $this->limit_length( $shipping_last_name ), - 'email' => $this->limit_length( $shipping_email, 255 ), - 'address1' => $this->limit_length( $shipping_address1, 255 ), - 'postcode' => $this->limit_length( $shipping_postcode, 16 ), - 'city' => $this->limit_length( $shipping_city ), - 'country' => $this->limit_length( $shipping_country, 2 ), - 'company_name' => $this->limit_length( $shipping_company ) - ]; - - if ( ! empty( $shipping_address2 ) ) { - $this->shipping['address2'] = $this->limit_length( $shipping_address2, 255 ); - } - - if ( $customer > 0 ) { - $address_hash = self::hash_address( $this->shipping ); - $address_already_used = self::address_already_used( $customer, $address_hash ); - - // Set the delivery_type to `VERIFIED` if the customer has already used the address before - // otherwise set it to `NEW` since we have separate shipping address - $this->shipping['delivery_type'] = ( $address_already_used ) - ? self::DELIVERY_TYPE_VERIFIED - : self::DELIVERY_TYPE_NEW; - } else { - // Set the delivery_type to `NEW` since we have separate shipping address - $this->shipping['delivery_type'] = self::DELIVERY_TYPE_NEW; - } - } else { - $this->shipping = $this->billing; - - if ( $customer > 0 ) { - $address_hash = self::hash_address( $this->shipping ); - $address_already_used = self::address_already_used( $customer, $address_hash ); - - // Set the delivery_type to `VERIFIED` if the customer has already used the address before - // otherwise set it to `BILLING` since we reuse the billing address for shipping - $this->shipping['delivery_type'] = ( $address_already_used ) - ? self::DELIVERY_TYPE_VERIFIED - : self::DELIVERY_TYPE_BILLING; - } else { - // Set the delivery_type to `BILLING` since we reuse the billing address for shipping - $this->shipping['delivery_type'] = self::DELIVERY_TYPE_BILLING; - } - } - } else { - // Set the delivery_type to `OTHER` since we dont't need to ship the products - $this->shipping = $this->billing; - $this->shipping['delivery_type'] = self::DELIVERY_TYPE_OTHER; - } - - // Maybe set the phone field if available - $country = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_country : $order->get_billing_country(); - $phone = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_phone : $order->get_billing_phone(); - if ( ! empty( $phone ) && ! empty( $country ) ) { - try { - $phone_number_util = PhoneNumberUtil::getInstance(); - $phone_number = $phone_number_util->parse( $phone, $country ); - - if ( ! $phone_number_util->isValidNumber( $phone_number ) ) { - throw new \Exception( 'Invalid phone number' ); - } - - if ( PhoneNumberType::MOBILE === $phone_number_util->getNumberType( $phone_number ) ) { - $this->billing['mobile_phone_number'] = $phone_number_util->format( $phone_number, PhoneNumberFormat::E164 ); - $this->shipping['mobile_phone_number'] = $phone_number_util->format( $phone_number, PhoneNumberFormat::E164 ); - } else { - $this->billing['landline_phone_number'] = $phone_number_util->format( $phone_number, PhoneNumberFormat::E164 ); - } - } catch ( \Exception $e ) { - // Fail to parse phone number. - // Could be an incorrect number or the number doesn't belong to the billing country. - } - } - } - - /** - * Limit string length. - * - * @param string $value - * @param int $maxlength - * - * @return string - */ - protected function limit_length( $value, $maxlength = 100 ) { - if ( ! empty( $value ) ) { - $value = ( strlen( $value ) > $maxlength ) ? substr( $value, 0, $maxlength ) : $value; - } - - return $value; - } + if (!PayplugWoocommerceHelper::is_country_supported($shipping_country)) { + $shipping_country = PayplugWoocommerceHelper::get_default_country(); + } + + $this->shipping = [ + 'first_name' => $this->limit_length($shipping_first_name), + 'last_name' => $this->limit_length($shipping_last_name), + 'email' => $this->limit_length($shipping_email, 255), + 'address1' => $this->limit_length($shipping_address1, 255), + 'postcode' => $this->limit_length($shipping_postcode, 16), + 'city' => $this->limit_length($shipping_city), + 'country' => $this->limit_length($shipping_country, 2), + 'company_name' => $this->limit_length($shipping_company), + ]; + + if (!empty($shipping_address2)) { + $this->shipping['address2'] = $this->limit_length($shipping_address2, 255); + } + + if ($customer > 0) { + $address_hash = self::hash_address($this->shipping); + $address_already_used = self::address_already_used($customer, $address_hash); + + // Set the delivery_type to `VERIFIED` if the customer has already used the address before + // otherwise set it to `NEW` since we have separate shipping address + $this->shipping['delivery_type'] = ($address_already_used) + ? self::DELIVERY_TYPE_VERIFIED + : self::DELIVERY_TYPE_NEW; + } else { + // Set the delivery_type to `NEW` since we have separate shipping address + $this->shipping['delivery_type'] = self::DELIVERY_TYPE_NEW; + } + } else { + $this->shipping = $this->billing; + + if ($customer > 0) { + $address_hash = self::hash_address($this->shipping); + $address_already_used = self::address_already_used($customer, $address_hash); + + // Set the delivery_type to `VERIFIED` if the customer has already used the address before + // otherwise set it to `BILLING` since we reuse the billing address for shipping + $this->shipping['delivery_type'] = ($address_already_used) + ? self::DELIVERY_TYPE_VERIFIED + : self::DELIVERY_TYPE_BILLING; + } else { + // Set the delivery_type to `BILLING` since we reuse the billing address for shipping + $this->shipping['delivery_type'] = self::DELIVERY_TYPE_BILLING; + } + } + } else { + // Set the delivery_type to `OTHER` since we dont't need to ship the products + $this->shipping = $this->billing; + $this->shipping['delivery_type'] = self::DELIVERY_TYPE_OTHER; + } + + // Maybe set the phone field if available + $country = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_country : $order->get_billing_country(); + $phone = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_phone : $order->get_billing_phone(); + if (!empty($phone) && !empty($country)) { + try { + $phone_number_util = PhoneNumberUtil::getInstance(); + $phone_number = $phone_number_util->parse($phone, $country); + + if (!$phone_number_util->isValidNumber($phone_number)) { + throw new \Exception('Invalid phone number'); + } + + if (PhoneNumberType::MOBILE === $phone_number_util->getNumberType($phone_number)) { + $this->billing['mobile_phone_number'] = $phone_number_util->format($phone_number, PhoneNumberFormat::E164); + $this->shipping['mobile_phone_number'] = $phone_number_util->format($phone_number, PhoneNumberFormat::E164); + } else { + $this->billing['landline_phone_number'] = $phone_number_util->format($phone_number, PhoneNumberFormat::E164); + } + } catch (\Exception $e) { + // Fail to parse phone number. + // Could be an incorrect number or the number doesn't belong to the billing country. + } + } + } + + /** + * Limit string length. + * + * @param string $value + * @param int $maxlength + * + * @return string + */ + protected function limit_length($value, $maxlength = 100) + { + if (!empty($value)) { + $value = (strlen($value) > $maxlength) ? substr($value, 0, $maxlength) : $value; + } + + return $value; + } } diff --git a/src/Gateway/PayplugApi.php b/src/Gateway/PayplugApi.php index 4aedba74..4f582d9a 100644 --- a/src/Gateway/PayplugApi.php +++ b/src/Gateway/PayplugApi.php @@ -7,257 +7,279 @@ exit; } +use Payplug\Core\HttpClient; use Payplug\Exception\BadRequestException; +use Payplug\Exception\ForbiddenException; use Payplug\Exception\NotFoundException; use Payplug\Exception\PayplugServerException; use Payplug\Exception\UnauthorizedException; -use Payplug\Exception\ForbiddenException; use Payplug\Payplug; -use Payplug\Core\HttpClient; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; /** * Handle calls to PayPlug PHP client. - * - * @package Payplug\PayplugWoocommerce\Gateway */ -class PayplugApi { - - /** - * @var PayplugGateway - */ - protected $gateway; +class PayplugApi +{ + /** + * @var PayplugGateway + */ + protected $gateway; - /** - * PayplugApi constructor. - * - * @param PayplugGateway $gateway - */ - public function __construct( $gateway ) { - $this->gateway = $gateway; - } + /** + * PayplugApi constructor. + * + * @param PayplugGateway $gateway + */ + public function __construct($gateway) + { + $this->gateway = $gateway; + } - /** - * Get register url - * - * @param string $callback_uri - * - * @return object - * @throws \Payplug\Exception\ConfigurationException - */ - public function retrieve_register_url($callback_uri) - { - return $this->do_request_with_fallback( '\Payplug\Authentication::getRegisterUrl', [$callback_uri, $callback_uri] ); - } + /** + * Get register url. + * + * @param string $callback_uri + * + * @throws \Payplug\Exception\ConfigurationException + * + * @return object + */ + public function retrieve_register_url($callback_uri) + { + return $this->do_request_with_fallback('\Payplug\Authentication::getRegisterUrl', [$callback_uri, $callback_uri]); + } - /** - * Configure PayPlug client. - */ - public function init() { - $current_mode = $this->gateway->get_current_mode(); - $key = $this->gateway->get_api_key( $current_mode ); + /** + * Configure PayPlug client. + */ + public function init() + { + $current_mode = $this->gateway->get_current_mode(); + $key = $this->gateway->get_api_key($current_mode); - Payplug::init(array( + Payplug::init([ 'secretKey' => $key, - 'apiVersion' => "2019-08-06", - )); - HttpClient::setDefaultUserAgentProduct( - 'PayPlug-WooCommerce', - PAYPLUG_GATEWAY_VERSION, - sprintf( 'WooCommerce/%s', WC()->version ) - ); - } + 'apiVersion' => '2019-08-06', + ]); + HttpClient::setDefaultUserAgentProduct( + 'PayPlug-WooCommerce', + PAYPLUG_GATEWAY_VERSION, + sprintf('WooCommerce/%s', WC()->version) + ); + } - /** - * Generate the JWT from API - * - * @param string $client_id - * @param string $client_secret - * - * @return array - * @throws \Payplug\Exception\ConfigurationException - */ - public function generateJWT($client_id = '', $client_secret = '') - { - return $this->do_request_with_fallback( '\Payplug\Authentication::generateJWT', [$client_id, $client_secret]); - } + /** + * Generate the JWT from API. + * + * @param string $client_id + * @param string $client_secret + * + * @throws \Payplug\Exception\ConfigurationException + * + * @return array + */ + public function generateJWT($client_id = '', $client_secret = '') + { + return $this->do_request_with_fallback('\Payplug\Authentication::generateJWT', [$client_id, $client_secret]); + } - /** - * Retrieve payment data from PayPlug API. - * - * @param string $transaction_id - * - * @return null|\Payplug\Resource\Payment - * @throws \Payplug\Exception\ConfigurationException - */ - public function payment_retrieve( $transaction_id ) { - return $this->do_request_with_fallback( '\Payplug\Payment::retrieve', $transaction_id ); - } + /** + * Retrieve payment data from PayPlug API. + * + * @param string $transaction_id + * + * @throws \Payplug\Exception\ConfigurationException + * + * @return \Payplug\Resource\Payment|null + */ + public function payment_retrieve($transaction_id) + { + return $this->do_request_with_fallback('\Payplug\Payment::retrieve', $transaction_id); + } - /** - * Create a payment. - * - * @param array $data - * - * @return null|\Payplug\Resource\Payment - */ - public function payment_create( $data ) { - return $this->do_request( '\Payplug\Payment::create', [ $data ] ); - } + /** + * Create a payment. + * + * @param array $data + * + * @return \Payplug\Resource\Payment|null + */ + public function payment_create($data) + { + return $this->do_request('\Payplug\Payment::create', [$data]); + } - /** - * Retrieve all refunds associated with a payment. - * - * @param string $transaction_id - * - * @return \Payplug\Resource\Refund[] - * @throws \Payplug\Exception\ConfigurationException - */ - public function refund_list( $transaction_id ) { - return $this->do_request_with_fallback( '\Payplug\Refund::listRefunds', $transaction_id ); - } + /** + * Retrieve all refunds associated with a payment. + * + * @param string $transaction_id + * + * @throws \Payplug\Exception\ConfigurationException + * + * @return \Payplug\Resource\Refund[] + */ + public function refund_list($transaction_id) + { + return $this->do_request_with_fallback('\Payplug\Refund::listRefunds', $transaction_id); + } - /** - * Retrieve refund data from PayPlug API. - * - * @param string $transaction_id - * @param string $refund_id - * - * @return \Payplug\Resource\Refund - * @throws \Payplug\Exception\ConfigurationException - */ - public function refund_retrieve( $transaction_id, $refund_id ) { - return $this->do_request_with_fallback( '\Payplug\Refund::retrieve', [ $transaction_id, $refund_id ] ); - } + /** + * Retrieve refund data from PayPlug API. + * + * @param string $transaction_id + * @param string $refund_id + * + * @throws \Payplug\Exception\ConfigurationException + * + * @return \Payplug\Resource\Refund + */ + public function refund_retrieve($transaction_id, $refund_id) + { + return $this->do_request_with_fallback('\Payplug\Refund::retrieve', [$transaction_id, $refund_id]); + } - /** - * Create a refund. - * - * @param string $transaction_id - * @param array $data - * - * @return null|\Payplug\Resource\Refund - * @throws \Payplug\Exception\ConfigurationException - * @author Clément Boirie - */ - public function refund_create( $transaction_id, $data ) { - return $this->do_request_with_fallback( '\Payplug\Refund::create', [ $transaction_id, $data ] ); - } + /** + * Create a refund. + * + * @param string $transaction_id + * @param array $data + * + * @throws \Payplug\Exception\ConfigurationException + * + * @return \Payplug\Resource\Refund|null + * + * @author Clément Boirie + */ + public function refund_create($transaction_id, $data) + { + return $this->do_request_with_fallback('\Payplug\Refund::create', [$transaction_id, $data]); + } - /** - * Simulate a oney payment + /** + * Simulate a oney payment. + * + * @param mixed $price + * @param mixed $oney_type * * @return array */ public function simulate_oney_payment($price, $oney_type = 'with_fees') { $country = PayplugWoocommerceHelper::get_payplug_merchant_country(); - $oney_fees = ["x3_" . $oney_type, "x4_" . $oney_type]; + $oney_fees = ['x3_' . $oney_type, 'x4_' . $oney_type]; - try { - try { - try { - try { - $response = $this->do_request('\Payplug\OneySimulation::getSimulations', [[ - "amount" => intval(floatval($price) * 100), - "country" => $country, - "operations" => $oney_fees - ]]); - PayplugWoocommerceHelper::oney_simulation_values($oney_fees, $response); - } catch (PayplugServerException $e) { - $response = __('Your payment schedule simulation is temporarily unavailable. You will find this information at the payment stage.', 'payplug'); - } - } catch (BadRequestException $e) { - $response = __('Your payment schedule simulation is temporarily unavailable. You will find this information at the payment stage.', 'payplug'); - } - } catch (UnauthorizedException $e) { - $response = __('Your payment schedule simulation is temporarily unavailable. You will find this information at the payment stage.', 'payplug'); - } - } catch (ForbiddenException $e) { - $response = __('Your payment schedule simulation is temporarily unavailable. You will find this information at the payment stage.', 'payplug'); - } + try { + try { + try { + try { + $response = $this->do_request('\Payplug\OneySimulation::getSimulations', [[ + 'amount' => intval(floatval($price) * 100), + 'country' => $country, + 'operations' => $oney_fees, + ]]); + PayplugWoocommerceHelper::oney_simulation_values($oney_fees, $response); + } catch (PayplugServerException $e) { + $response = __('Your payment schedule simulation is temporarily unavailable. You will find this information at the payment stage.', 'payplug'); + } + } catch (BadRequestException $e) { + $response = __('Your payment schedule simulation is temporarily unavailable. You will find this information at the payment stage.', 'payplug'); + } + } catch (UnauthorizedException $e) { + $response = __('Your payment schedule simulation is temporarily unavailable. You will find this information at the payment stage.', 'payplug'); + } + } catch (ForbiddenException $e) { + $response = __('Your payment schedule simulation is temporarily unavailable. You will find this information at the payment stage.', 'payplug'); + } return $response; } - public function validate_jwt($client_data, $jwt) - { - return $this->do_request_with_fallback( '\Payplug\Authentication::validateJWT', [$client_data, $jwt] ); - } + public function validate_jwt($client_data, $jwt) + { + return $this->do_request_with_fallback('\Payplug\Authentication::validateJWT', [$client_data, $jwt]); + } - /** - * Invoke PayPlug API. If it fail it switch to the other mode and retry the same request. - * - * @param callable $callback - * @param array $params - * - * @return object - * @throws \Payplug\Exception\ConfigurationException - */ - protected function do_request_with_fallback( $callback, $params = [] ) { - try { - $response = $this->do_request( $callback, $params ); - } catch ( NotFoundException $e ) { - try { - $this->switch_mode(); - $response = $this->do_request( $callback, $params ); - $this->restore_mode(); - } catch ( \Exception $e ) { - $this->restore_mode(); - throw $e; - } - } + /** + * Invoke PayPlug API. If it fail it switch to the other mode and retry the same request. + * + * @param callable $callback + * @param array $params + * + * @throws \Payplug\Exception\ConfigurationException + * + * @return object + */ + protected function do_request_with_fallback($callback, $params = []) + { + try { + $response = $this->do_request($callback, $params); + } catch (NotFoundException $e) { + try { + $this->switch_mode(); + $response = $this->do_request($callback, $params); + $this->restore_mode(); + } catch (\Exception $e) { + $this->restore_mode(); - return $response; - } + throw $e; + } + } - /** - * Invoke PayPlug API. - * - * @param callable $callback - * @param array $params - * - * @return object - */ - protected function do_request( $callback, $params = [] ) { + return $response; + } - if ( ! is_array( $params ) ) { - $params = [ $params ]; - } + /** + * Invoke PayPlug API. + * + * @param callable $callback + * @param array $params + * + * @return object + */ + protected function do_request($callback, $params = []) + { + if (!is_array($params)) { + $params = [$params]; + } - return call_user_func_array( $callback, $params ); - } + return call_user_func_array($callback, $params); + } - /** - * Reconfigure PayPlug client with new secret keys. - * - * @throws \Payplug\Exception\ConfigurationException - */ - protected function switch_mode() { - $switched_mode = 'test' === $this->gateway->get_current_mode() ? 'live' : 'test'; - $new_key = $this->gateway->get_api_key( $switched_mode ); - if ( empty( $new_key ) ) { - throw new \Exception( sprintf( - 'No secret key available for the %s mode', $switched_mode - ) ); - } + /** + * Reconfigure PayPlug client with new secret keys. + * + * @throws \Payplug\Exception\ConfigurationException + */ + protected function switch_mode() + { + $switched_mode = 'test' === $this->gateway->get_current_mode() ? 'live' : 'test'; + $new_key = $this->gateway->get_api_key($switched_mode); + if (empty($new_key)) { + throw new \Exception(sprintf( + 'No secret key available for the %s mode', + $switched_mode + )); + } - Payplug::setSecretKey( $new_key ); - } + Payplug::setSecretKey($new_key); + } - /** - * Restore PayPlug client secret keys for the current mode. - * - * @throws \Payplug\Exception\ConfigurationException - */ - protected function restore_mode() { - $key = $this->gateway->get_api_key( $this->gateway->get_current_mode() ); - if ( empty( $key ) ) { - throw new \Exception( sprintf( - 'No secret key available for the %s mode', $this->gateway->get_current_mode() - ) ); - } + /** + * Restore PayPlug client secret keys for the current mode. + * + * @throws \Payplug\Exception\ConfigurationException + */ + protected function restore_mode() + { + $key = $this->gateway->get_api_key($this->gateway->get_current_mode()); + if (empty($key)) { + throw new \Exception(sprintf( + 'No secret key available for the %s mode', + $this->gateway->get_current_mode() + )); + } - Payplug::setSecretKey( $key ); - } + Payplug::setSecretKey($key); + } } diff --git a/src/Gateway/PayplugCreditCard.php b/src/Gateway/PayplugCreditCard.php index ea3aeadb..992c62c5 100644 --- a/src/Gateway/PayplugCreditCard.php +++ b/src/Gateway/PayplugCreditCard.php @@ -5,337 +5,344 @@ use Payplug\PayplugWoocommerce\Controller\IntegratedPayment; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -class PayplugCreditCard extends PayplugGateway { - - public $oneclick = false; - - public function __construct() { - parent::__construct(); - - $this->id = 'payplug'; - $this->icon = ''; - $this->has_fields = false; - $this->method_title = _x('PayPlug', 'Gateway method title', 'payplug'); - $this->method_description = __('Enable PayPlug for your customers.', 'payplug'); - $this->new_method_label = __('Pay with another credit card', 'payplug'); - $this->title = $this->get_option('title'); - $this->description = $this->get_option('description'); - $this->oneclick = (('yes' === $this->get_option('oneclick', 'no')) && (is_user_logged_in())); - $this->payment_method = $this->get_option('payment_method'); - $this->supports = array( - 'products', - 'refunds', - 'tokenization', - 'subscriptions', - 'subscription_cancellation', - 'subscription_suspension', - 'subscription_reactivation', - 'subscription_amount_changes', - 'subscription_date_changes', - 'subscription_payment_method_change', - 'subscription_payment_method_change_customer', - 'subscription_payment_method_change_admin', - 'multiple_subscriptions', - - ); - - // Ensure the description is not empty to correctly display users's save cards - if (empty($this->description) && $this->oneclick_available()) { - $this->description = ' '; - } - - if ('test' === $this->mode) { - $this->description .= " \n"; - $this->description .= __('You are in TEST MODE. In test mode you can use the card 4242424242424242 with any valid expiration date and CVC.', 'payplug'); - $this->description = trim($this->description); - } - - //add fields of IP to the description - if($this->payment_method === 'integrated'){ - $this->has_fields = true; - } - - $this->handle_cc_enabled(); - - add_action('wp_enqueue_scripts', [$this, 'scripts']); - if (PayplugWoocommerceHelper::is_subscriptions_enabled()) { - add_action('woocommerce_scheduled_subscription_payment_' . $this->id, - array($this, 'scheduled_subscription_payment'), 10, 2); - } - - } - - /** - * if the plugin is disabled the gateways should be disabled - * @return mixed|string - */ - private function handle_cc_enabled(){ - - if (!empty($this->settings["enabled"]) && $this->settings["enabled"] === "yes") { - $this->enabled = !empty($this->settings[$this->id]) ? $this->settings[$this->id] : $this->settings["enabled"]; - } else { - $this->enabled = "no"; - } - - return $this->enabled; - } - - /** - * Get payment icons. - * - * @return string - */ - public function get_icon() - { - - $src = ('it_IT' === get_locale()) - ? PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/logos_scheme_PostePay.svg' - : PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/logos_scheme_CB.svg'; - - $icons = apply_filters('payplug_payment_icons', [ - 'payplug' => sprintf('Visa & Mastercard', esc_url($src)), - ]); - - $icons_str = ''; - foreach ($icons as $icon) { - $icons_str .= $icon; - } - - return $icons_str; - } - - - /** - * Embedded payment form scripts. - * - * Register scripts and additionnal data needed for the - * embedded payment form. - */ - public function scripts() - { - if (!is_cart() && !is_checkout() && !isset($_GET['pay_for_order']) && !is_add_payment_method_page() && !isset($_GET['change_payment_method'])) { - return; - } - - // If PayPlug is not enabled bail. - if ('no' === $this->enabled) { - return; - } - - // If keys are not set bail. - if (empty($this->get_api_key($this->mode))) { - PayplugGateway::log('Keys are not set correctly.'); - return; - } - - // Register checkout styles. - wp_register_style('payplug-checkout', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-checkout.css', [], PAYPLUG_GATEWAY_VERSION); - wp_enqueue_style('payplug-checkout'); - - if ( - ( $this->payment_method == "integrated" && !PayplugWoocommerceHelper::is_checkout_block() ) || - ($this->payment_method == "integrated" && is_wc_endpoint_url('order-pay') ) - ) { - $this->integrated_payments_scripts(); - } - - if (($this->payment_method == "popup" ) && ($this->id === "payplug" || $this->id === "american_express") && !PayplugWoocommerceHelper::is_checkout_block() ) { - $this->popup_payments_scripts(); - - } - - } - - - /** - * Integrated payment form scripts. - * - * Register scripts and additionnal data needed for the - * embedded payment form. - */ - public function integrated_payments_scripts(){ - - $translations = array( - "cardholder" => __('payplug_integrated_payment_cardholder', 'payplug'), - "your_card" => __('payplug_integrated_payment_your_card', 'payplug'), - "card_number" => __('payplug_integrated_payment_card_number', 'payplug'), - "expiration_date" => __('payplug_integrated_payment_expiration_date', 'payplug'), - "cvv" => __('payplug_integrated_payment_cvv', 'payplug'), - "one_click" => __('payplug_integrated_payment_oneClick', 'payplug'), - 'ajax_url' => \WC_AJAX::get_endpoint('payplug_create_order'), - 'order_review_url' => \WC_AJAX::get_endpoint('payplug_order_review_url'), - 'nonce' => wp_create_nonce('woocommerce-process_checkout'), - 'mode' => PayplugWoocommerceHelper::check_mode(), // true for TEST, false for LIVE - 'check_payment_url' => \WC_AJAX::get_endpoint('payplug_check_payment') - ); - - /**x - * Integrated payments scripts - */ - wp_enqueue_style('payplugIP', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-integrated-payments.css', [], PAYPLUG_GATEWAY_VERSION); - - wp_register_script('payplug-domain', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-domain.js', [], 'v1.0'); - wp_enqueue_script('payplug-domain'); - wp_register_script('payplug-integrated-payments-api', IP_API, [], 'v1.1', true); - wp_enqueue_script('payplug-integrated-payments-api'); - - wp_register_script( 'jquery-bind-first', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/jquery.bind-first-0.2.3.min.js', array( 'jquery' ), '1.0.0', true ); - wp_enqueue_script('jquery-bind-first'); - - wp_register_script('payplug-integrated-payments', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-integrated-payments.js', ['jquery', 'jquery-bind-first', 'payplug-integrated-payments-api'], 'v1.1', true); - wp_enqueue_script('payplug-integrated-payments'); - - wp_localize_script( 'payplug-integrated-payments', 'payplug_integrated_payment_params', $translations); - } - - /** - * popup payment form scripts. - * - * Register scripts and additionnal data needed for the - * embedded payment form. - */ - public function popup_payments_scripts(){ - //load popup features - wp_register_script('payplug', 'https://api.payplug.com/js/1/form.latest.js', [], null, true); - wp_register_script('payplug-checkout', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-checkout.js', [ 'jquery', 'payplug' ], PAYPLUG_GATEWAY_VERSION, true); - wp_localize_script('payplug-checkout', 'payplug_checkout_params', [ - 'ajax_url' => \WC_AJAX::get_endpoint('payplug_create_order'), - 'order_review_url' => \WC_AJAX::get_endpoint('payplug_order_review_url'), - 'nonce' => [ - 'checkout' => wp_create_nonce('woocommerce-process_checkout'), - ], - 'is_embedded' => 'redirect' !== $this->payment_method - ]); - - wp_enqueue_script('payplug-checkout'); - } - - /** - * extra payment fields - */ - public function payment_fields() - { - $description = $this->get_description(); - - if (!empty($description)) { - echo wpautop(wptexturize($description)); - } - - if(($this->payment_method === 'integrated') ){ - echo IntegratedPayment::template_form($this->oneclick); - } - - if ($this->oneclick_available()) { - $this->tokenization_script(); - $this->saved_payment_methods(); - } - } - - /** - * Process the subscription scheduled payment - */ - public function scheduled_subscription_payment($amount, $order) { - - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - $subscription = wcs_get_subscription($order->get_meta('_subscription_renewal')); - $payplug_parent_meta = $subscription->get_parent()->get_meta("_payplug_metadata"); - - if (!$payplug_parent_meta ) { - PayplugGateway::log('Could not find the intial payment data belong to the current user and the current subscription.', 'error'); - throw new \Exception(__('Invalid payment method.', 'payplug')); - } - - $parent_order = $subscription->get_parent(); - $parent_tokens = $parent_order->get_payment_tokens(); - - if (!empty($parent_tokens)) { - $token = $parent_tokens[0]; - } else { - $token = $this->api->payment_retrieve($payplug_parent_meta['transaction_id'])->card->id; - } - - if (!$token) { - PayplugGateway::log('Could not find the payment token or the payment doesn\'t belong to the current user.', 'error'); - throw new \Exception(__('Invalid payment method.', 'payplug')); - } - - $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($amount); - - try { - $address_data = PayplugAddressData::from_order($order); - $return_url = esc_url_raw($order->get_checkout_order_received_url()); - - if (!(substr( $return_url, 0, 4 ) === "http")) { - $return_url = get_site_url().$return_url; - } - - $payment_data = [ - 'amount' => $amount, - 'currency' => get_woocommerce_currency(), - 'payment_method' => $token, - 'allow_save_card' => false, - 'billing' => $address_data->get_billing(), - 'shipping' => $address_data->get_shipping(), - 'initiator' => 'MERCHANT', - 'hosted_payment' => [ - 'return_url' => $return_url, - 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), - ], - 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), - 'metadata' => [ - 'order_id' => $order->get_id(), - 'customer_id' => ((int) get_current_user_id() > 0) ? get_current_user_id() : 'guest', - 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), - 'woocommerce_block' => \WC_Blocks_Utils::has_block_in_page( wc_get_page_id('checkout'), 'woocommerce/checkout' ), - 'subscription' => 'renewal' - ], - ]; - - PayplugGateway::log(sprintf('Processing payment for order #%s', $order_id)); - PayplugGateway::log(sprintf('Processing payment for subscription #%s', $order->get_meta('_subscription_renewal'))); - - /** This filter is documented in src/Gateway/PayplugGateway */ - $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); - $payment = $this->api->payment_create($payment_data); - - // Save transaction id for the order - PayplugWoocommerceHelper::is_pre_30() - ? update_post_meta($order_id, '_transaction_id', $payment->id) - : $order->set_transaction_id($payment->id); - - if (is_callable([$order, 'save'])) { - $order->save(); - } - - /** This action is documented in src/Gateway/PayplugGateway */ - \do_action('payplug_gateway_payment_created', $order_id, $payment); - - - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); - PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); - - $this->response->process_payment($payment, true); - - if(($payment->__get('is_paid'))){ - $redirect = $order->get_checkout_order_received_url(); - }else if(isset($payment->__get('hosted_payment')->payment_url)){ - $redirect = $payment->__get('hosted_payment')->payment_url; - }else{ - $redirect = $return_url; - } - - return [ - 'payment_id' => $payment->id, - 'result' => 'success', - 'is_paid' => $payment->__get('is_paid'), // Use for path redirect before DSP2 - 'redirect' => $redirect - ]; - } catch (HttpException $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } catch (\Exception $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } - } +class PayplugCreditCard extends PayplugGateway +{ + public $oneclick = false; + + public function __construct() + { + parent::__construct(); + + $this->id = 'payplug'; + $this->icon = ''; + $this->has_fields = false; + $this->method_title = _x('PayPlug', 'Gateway method title', 'payplug'); + $this->method_description = __('Enable PayPlug for your customers.', 'payplug'); + $this->new_method_label = __('Pay with another credit card', 'payplug'); + $this->title = $this->get_option('title'); + $this->description = $this->get_option('description'); + $this->oneclick = (('yes' === $this->get_option('oneclick', 'no')) && (is_user_logged_in())); + $this->payment_method = $this->get_option('payment_method'); + $this->supports = [ + 'products', + 'refunds', + 'tokenization', + 'subscriptions', + 'subscription_cancellation', + 'subscription_suspension', + 'subscription_reactivation', + 'subscription_amount_changes', + 'subscription_date_changes', + 'subscription_payment_method_change', + 'subscription_payment_method_change_customer', + 'subscription_payment_method_change_admin', + 'multiple_subscriptions', + ]; + + // Ensure the description is not empty to correctly display users's save cards + if (empty($this->description) && $this->oneclick_available()) { + $this->description = ' '; + } + + if ('test' === $this->mode) { + $this->description .= " \n"; + $this->description .= __('You are in TEST MODE. In test mode you can use the card 4242424242424242 with any valid expiration date and CVC.', 'payplug'); + $this->description = trim($this->description); + } + + //add fields of IP to the description + if ('integrated' === $this->payment_method) { + $this->has_fields = true; + } + + $this->handle_cc_enabled(); + + add_action('wp_enqueue_scripts', [$this, 'scripts']); + if (PayplugWoocommerceHelper::is_subscriptions_enabled()) { + add_action( + 'woocommerce_scheduled_subscription_payment_' . $this->id, + [$this, 'scheduled_subscription_payment'], + 10, + 2 + ); + } + } + + /** + * Get payment icons. + * + * @return string + */ + public function get_icon() + { + $src = ('it_IT' === get_locale()) + ? PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/logos_scheme_PostePay.svg' + : PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/logos_scheme_CB.svg'; + + $icons = apply_filters('payplug_payment_icons', [ + 'payplug' => sprintf('Visa & Mastercard', esc_url($src)), + ]); + + $icons_str = ''; + foreach ($icons as $icon) { + $icons_str .= $icon; + } + + return $icons_str; + } + + /** + * Embedded payment form scripts. + * + * Register scripts and additionnal data needed for the + * embedded payment form. + */ + public function scripts() + { + if (!is_cart() && !is_checkout() && !isset($_GET['pay_for_order']) && !is_add_payment_method_page() && !isset($_GET['change_payment_method'])) { + return; + } + + // If PayPlug is not enabled bail. + if ('no' === $this->enabled) { + return; + } + + // If keys are not set bail. + if (empty($this->get_api_key($this->mode))) { + PayplugGateway::log('Keys are not set correctly.'); + + return; + } + + // Register checkout styles. + wp_register_style('payplug-checkout', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-checkout.css', [], PAYPLUG_GATEWAY_VERSION); + wp_enqueue_style('payplug-checkout'); + + if ( + ('integrated' == $this->payment_method && !PayplugWoocommerceHelper::is_checkout_block()) + || ('integrated' == $this->payment_method && is_wc_endpoint_url('order-pay')) + ) { + $this->integrated_payments_scripts(); + } + + if (('popup' == $this->payment_method) && ('payplug' === $this->id || 'american_express' === $this->id) && !PayplugWoocommerceHelper::is_checkout_block()) { + $this->popup_payments_scripts(); + } + } + + /** + * Integrated payment form scripts. + * + * Register scripts and additionnal data needed for the + * embedded payment form. + */ + public function integrated_payments_scripts() + { + $translations = [ + 'cardholder' => __('payplug_integrated_payment_cardholder', 'payplug'), + 'your_card' => __('payplug_integrated_payment_your_card', 'payplug'), + 'card_number' => __('payplug_integrated_payment_card_number', 'payplug'), + 'expiration_date' => __('payplug_integrated_payment_expiration_date', 'payplug'), + 'cvv' => __('payplug_integrated_payment_cvv', 'payplug'), + 'one_click' => __('payplug_integrated_payment_oneClick', 'payplug'), + 'ajax_url' => \WC_AJAX::get_endpoint('payplug_create_order'), + 'order_review_url' => \WC_AJAX::get_endpoint('payplug_order_review_url'), + 'nonce' => wp_create_nonce('woocommerce-process_checkout'), + 'mode' => PayplugWoocommerceHelper::check_mode(), // true for TEST, false for LIVE + 'check_payment_url' => \WC_AJAX::get_endpoint('payplug_check_payment'), + ]; + + /*x + * Integrated payments scripts + */ + wp_enqueue_style('payplugIP', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/css/payplug-integrated-payments.css', [], PAYPLUG_GATEWAY_VERSION); + + wp_register_script('payplug-domain', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-domain.js', [], 'v1.0'); + wp_enqueue_script('payplug-domain'); + wp_register_script('payplug-integrated-payments-api', IP_API, [], 'v1.1', true); + wp_enqueue_script('payplug-integrated-payments-api'); + + wp_register_script('jquery-bind-first', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/jquery.bind-first-0.2.3.min.js', ['jquery'], '1.0.0', true); + wp_enqueue_script('jquery-bind-first'); + + wp_register_script('payplug-integrated-payments', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-integrated-payments.js', ['jquery', 'jquery-bind-first', 'payplug-integrated-payments-api'], 'v1.1', true); + wp_enqueue_script('payplug-integrated-payments'); + + wp_localize_script('payplug-integrated-payments', 'payplug_integrated_payment_params', $translations); + } + + /** + * popup payment form scripts. + * + * Register scripts and additionnal data needed for the + * embedded payment form. + */ + public function popup_payments_scripts() + { + //load popup features + wp_register_script('payplug', 'https://api.payplug.com/js/1/form.latest.js', [], null, true); + wp_register_script('payplug-checkout', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/js/payplug-checkout.js', ['jquery', 'payplug'], PAYPLUG_GATEWAY_VERSION, true); + wp_localize_script('payplug-checkout', 'payplug_checkout_params', [ + 'ajax_url' => \WC_AJAX::get_endpoint('payplug_create_order'), + 'order_review_url' => \WC_AJAX::get_endpoint('payplug_order_review_url'), + 'nonce' => [ + 'checkout' => wp_create_nonce('woocommerce-process_checkout'), + ], + 'is_embedded' => 'redirect' !== $this->payment_method, + ]); + + wp_enqueue_script('payplug-checkout'); + } + + /** + * extra payment fields. + */ + public function payment_fields() + { + $description = $this->get_description(); + + if (!empty($description)) { + echo wpautop(wptexturize($description)); + } + + if (('integrated' === $this->payment_method)) { + echo IntegratedPayment::template_form($this->oneclick); + } + + if ($this->oneclick_available()) { + $this->tokenization_script(); + $this->saved_payment_methods(); + } + } + + /** + * Process the subscription scheduled payment. + * + * @param mixed $amount + * @param mixed $order + */ + public function scheduled_subscription_payment($amount, $order) + { + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + $subscription = wcs_get_subscription($order->get_meta('_subscription_renewal')); + $payplug_parent_meta = $subscription->get_parent()->get_meta('_payplug_metadata'); + + if (!$payplug_parent_meta) { + PayplugGateway::log('Could not find the intial payment data belong to the current user and the current subscription.', 'error'); + + throw new \Exception(__('Invalid payment method.', 'payplug')); + } + + $parent_order = $subscription->get_parent(); + $parent_tokens = $parent_order->get_payment_tokens(); + + if (!empty($parent_tokens)) { + $token = $parent_tokens[0]; + } else { + $token = $this->api->payment_retrieve($payplug_parent_meta['transaction_id'])->card->id; + } + + if (!$token) { + PayplugGateway::log('Could not find the payment token or the payment doesn\'t belong to the current user.', 'error'); + + throw new \Exception(__('Invalid payment method.', 'payplug')); + } + + $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($amount); + + try { + $address_data = PayplugAddressData::from_order($order); + $return_url = esc_url_raw($order->get_checkout_order_received_url()); + + if (!('http' === substr($return_url, 0, 4))) { + $return_url = get_site_url() . $return_url; + } + + $payment_data = [ + 'amount' => $amount, + 'currency' => get_woocommerce_currency(), + 'payment_method' => $token, + 'allow_save_card' => false, + 'billing' => $address_data->get_billing(), + 'shipping' => $address_data->get_shipping(), + 'initiator' => 'MERCHANT', + 'hosted_payment' => [ + 'return_url' => $return_url, + 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), + ], + 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), + 'metadata' => [ + 'order_id' => $order->get_id(), + 'customer_id' => ((int) get_current_user_id() > 0) ? get_current_user_id() : 'guest', + 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), + 'woocommerce_block' => \WC_Blocks_Utils::has_block_in_page(wc_get_page_id('checkout'), 'woocommerce/checkout'), + 'subscription' => 'renewal', + ], + ]; + + PayplugGateway::log(sprintf('Processing payment for order #%s', $order_id)); + PayplugGateway::log(sprintf('Processing payment for subscription #%s', $order->get_meta('_subscription_renewal'))); + + /** This filter is documented in src/Gateway/PayplugGateway */ + $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); + $payment = $this->api->payment_create($payment_data); + + // Save transaction id for the order + PayplugWoocommerceHelper::is_pre_30() + ? update_post_meta($order_id, '_transaction_id', $payment->id) + : $order->set_transaction_id($payment->id); + + if (is_callable([$order, 'save'])) { + $order->save(); + } + + // This action is documented in src/Gateway/PayplugGateway + \do_action('payplug_gateway_payment_created', $order_id, $payment); + + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); + + $this->response->process_payment($payment, true); + + if (($payment->__get('is_paid'))) { + $redirect = $order->get_checkout_order_received_url(); + } elseif (isset($payment->__get('hosted_payment')->payment_url)) { + $redirect = $payment->__get('hosted_payment')->payment_url; + } else { + $redirect = $return_url; + } + + return [ + 'payment_id' => $payment->id, + 'result' => 'success', + 'is_paid' => $payment->__get('is_paid'), // Use for path redirect before DSP2 + 'redirect' => $redirect, + ]; + } catch (HttpException $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } catch (\Exception $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); + + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } + } + + /** + * if the plugin is disabled the gateways should be disabled. + * + * @return mixed|string + */ + private function handle_cc_enabled() + { + if (!empty($this->settings['enabled']) && 'yes' === $this->settings['enabled']) { + $this->enabled = !empty($this->settings[$this->id]) ? $this->settings[$this->id] : $this->settings['enabled']; + } else { + $this->enabled = 'no'; + } + + return $this->enabled; + } } diff --git a/src/Gateway/PayplugGateway.php b/src/Gateway/PayplugGateway.php index ca2f330f..030c71d8 100644 --- a/src/Gateway/PayplugGateway.php +++ b/src/Gateway/PayplugGateway.php @@ -11,64 +11,62 @@ use Payplug\Exception\ConfigurationException; use Payplug\Exception\HttpException; use Payplug\Payplug; -use Payplug\PayplugWoocommerce\Controller\IntegratedPayment; use Payplug\PayplugWoocommerce\Helper\Lock; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; use Payplug\Resource\Payment as PaymentResource; use Payplug\Resource\Refund as RefundResource; -use WC_Blocks_Utils; use WC_Payment_Gateway_CC; use WC_Payment_Tokens; /** * PayPlug WooCommerce Gateway. - * - * @package Payplug\PayplugWoocommerce\Gateway */ class PayplugGateway extends WC_Payment_Gateway_CC { - const OPTION_NAME = "payplug_config"; - - /** - * @var string - */ - public $mode; - /** - * @var bool - */ - public $debug; - /** - * @var string - */ - public $email; - /** - * @var string - */ - public $payment_method; - /** - * @var bool - */ - public $oneclick; - - /** - * @var string - */ - public $oney_type; - - /** - * @var string - */ - public $oney_product_animation; - - /** - * @var PayplugGatewayRequirements + const OPTION_NAME = 'payplug_config'; + + /** + * @var float */ - private $requirements; + const MIN_AMOUNT = 0.99; /** - * @var PayplugPermissions + * @var float */ - private $permissions; + const MAX_AMOUNT = 20000; + + const ENABLE_ON_TEST_MODE = true; + + /** + * @var string + */ + public $mode; + /** + * @var bool + */ + public $debug; + /** + * @var string + */ + public $email; + /** + * @var string + */ + public $payment_method; + /** + * @var bool + */ + public $oneclick; + + /** + * @var string + */ + public $oney_type; + + /** + * @var string + */ + public $oney_product_animation; /** * @var PayplugResponse @@ -79,6 +77,10 @@ class PayplugGateway extends WC_Payment_Gateway_CC * @var PayplugApi */ public $api; + public $min_oney_price; + public $oney_thresholds_min; + public $max_oney_price; + public $oney_thresholds_max; /** * @var \WC_Logger @@ -90,33 +92,82 @@ class PayplugGateway extends WC_Payment_Gateway_CC */ protected static $log_enabled; + protected $oney_response; + /** - * @var float + * @var PayplugGatewayRequirements */ - const MIN_AMOUNT = 0.99; + private $requirements; + + /** + * @var PayplugPermissions + */ + private $permissions; + + /** + * @var string + */ + private $payplug_merchant_country = 'FR'; + + /** + * Construct method. + */ + public function __construct() + { + //required plugin id + $this->id = 'payplug'; + $this->supports = [ + 'products', + 'refunds', + 'tokenization', + ]; + + $payplug_gateways = ['payplug', 'american_express', 'apple_pay', 'bancontact', 'oney_x3_with_fees', 'oney_x3_without_fees', 'oney_x4_with_fees', 'oney_x4_without_fees', 'satispay', 'ideal', 'mybank']; - /** - * @var float - */ - const MAX_AMOUNT = 20000; + //save buttom admin + if ((!empty($_GET['section'])) && (in_array($_GET['section'], $payplug_gateways))) { + $GLOBALS['hide_save_button'] = true; + } + + $this->init_settings(); + $this->requirements = new PayplugGatewayRequirements($this); + if ($this->user_logged_in()) { + $this->init_payplug(); + } + + $this->mode = 'yes' === $this->get_option('mode', 'no') ? 'live' : 'test'; + $this->debug = 'yes' === $this->get_option('debug', 'no'); + $this->email = $this->get_option('email'); - /** - * @var string - */ - private $payplug_merchant_country = 'FR'; + $this->oney_type = $this->get_option('oney_type', 'with_fees'); + $oney_range = PayplugWoocommerceHelper::get_min_max_oney(); + $this->min_oney_price = (isset($oney_range['min'])) ? intval($oney_range['min']) : 100; + $this->max_oney_price = (isset($oney_range['max'])) ? intval($oney_range['max']) : 3000; + $this->oney_thresholds_min = $this->get_option('oney_thresholds_min', $this->min_oney_price); + $this->oney_thresholds_max = $this->get_option('oney_thresholds_max', $this->max_oney_price); - protected $oney_response; - public $min_oney_price, $oney_thresholds_min; - public $max_oney_price, $oney_thresholds_max; + //admin form + $this->init_form_fields(); + + //used for oney + $this->payplug_merchant_country = PayplugWoocommerceHelper::get_payplug_merchant_country(); + $this->oney_product_animation = $this->get_option('oney_product_animation'); - const ENABLE_ON_TEST_MODE = true; + add_filter('woocommerce_get_customer_payment_tokens', [$this, 'filter_tokens'], 10, 3); + + self::$log_enabled = $this->debug; - /** + add_filter('woocommerce_get_order_item_totals', [$this, 'customize_gateway_title'], 10, 2); + add_action('the_post', [$this, 'validate_payment']); + add_action('woocommerce_available_payment_gateways', [$this, 'check_gateway']); + } + + /** * Logging method. * - * @param string $message Log message. + * @param string $message log message * @param string $level Optional. Default 'info'. - * emergency|alert|critical|error|warning|notice|info|debug + * emergency|alert|critical|error|warning|notice|info|debug */ public static function log($message, $level = 'info') { @@ -130,89 +181,36 @@ public static function log($message, $level = 'info') PayplugWoocommerceHelper::is_pre_30() ? self::$log->add('payplug_gateway', $message) - : self::$log->log($level, $message, array('source' => 'payplug_gateway')); + : self::$log->log($level, $message, ['source' => 'payplug_gateway']); } /** - * Construct method + * @param $option + * @param $value * - * @return void + * @return bool|void */ - public function __construct() + public function update_option($option, $value = '') { - //required plugin id - $this->id = 'payplug'; - $this->supports = array( - 'products', - 'refunds', - 'tokenization', - ); - - $payplug_gateways = array('payplug', 'american_express', 'apple_pay', 'bancontact', 'oney_x3_with_fees', 'oney_x3_without_fees', 'oney_x4_with_fees', 'oney_x4_without_fees', 'satispay', 'ideal', 'mybank'); - - //save buttom admin - if ((!empty($_GET['section'])) && (in_array($_GET['section'], $payplug_gateways))) { - $GLOBALS['hide_save_button'] = true; - } - - $this->init_settings(); - $this->requirements = new PayplugGatewayRequirements($this); - if ($this->user_logged_in()) { - $this->init_payplug(); - + if ($this->needs_setup()) { + wp_send_json_error('needs_setup'); + wp_die(); } - $this->mode = 'yes' === $this->get_option('mode', 'no') ? 'live' : 'test'; - $this->debug = 'yes' === $this->get_option('debug', 'no'); - $this->email = $this->get_option('email'); - - $this->oney_type = $this->get_option('oney_type', 'with_fees'); - $oney_range = PayplugWoocommerceHelper::get_min_max_oney(); - $this->min_oney_price = (isset($oney_range['min'])) ? intval($oney_range['min']) : 100; - $this->max_oney_price = (isset($oney_range['max'])) ? intval($oney_range['max']) : 3000; - $this->oney_thresholds_min = $this->get_option('oney_thresholds_min', $this->min_oney_price ); - $this->oney_thresholds_max = $this->get_option('oney_thresholds_max', $this->max_oney_price ); - - //admin form - $this->init_form_fields(); - - //used for oney - $this->payplug_merchant_country = PayplugWoocommerceHelper::get_payplug_merchant_country(); - $this->oney_product_animation = $this->get_option('oney_product_animation'); - - add_filter('woocommerce_get_customer_payment_tokens', [$this, 'filter_tokens'], 10, 3); + parent::update_option($option, $value); + } - self::$log_enabled = $this->debug; + /** + * this payment gateway cannot be updated on the wooco payment settings. + * + * @return bool + */ + public function needs_setup() + { + return true; + } - add_filter('woocommerce_get_order_item_totals', [$this, 'customize_gateway_title'], 10, 2); - add_action('the_post', [$this, 'validate_payment']); - add_action('woocommerce_available_payment_gateways', [$this, 'check_gateway']); - } - - /** - * @param $option - * @param $value - * @return bool|void - */ - public function update_option($option, $value = ''){ - if ( $this->needs_setup() ) { - wp_send_json_error( 'needs_setup' ); - wp_die(); - } - - parent::update_option($option, $value); - } - - /** - * this payment gateway cannot be updated on the wooco payment settings - * @return bool - */ - public function needs_setup() - { - return true; - } - - /** + /** * Customize gateway title in emails. * * @param array $total_rows @@ -224,13 +222,12 @@ public function needs_setup() */ public function customize_gateway_title($total_rows, $order) { + $get_payment_method = $this->id; + if (method_exists($order, 'get_payment_method')) { + $get_payment_method = $order->get_payment_method(); + } - $get_payment_method = $this->id; - if( method_exists($order, "get_payment_method") ) { - $get_payment_method = $order->get_payment_method(); - } - - $payment_method = PayplugWoocommerceHelper::is_pre_30() ? $order->payment_method : $get_payment_method; + $payment_method = PayplugWoocommerceHelper::is_pre_30() ? $order->payment_method : $get_payment_method; if ( $this->id !== $payment_method || !isset($total_rows['payment_method']) @@ -246,45 +243,46 @@ public function customize_gateway_title($total_rows, $order) /** * Validate order payment when the user is redirected to the success confirmation page. * + * @param mixed|null $id + * @param mixed $save_request + * @param mixed $ipn + * * @throws \WC_Data_Exception */ public function validate_payment($id = null, $save_request = true, $ipn = false) { - global $wp; - - if(!$ipn){ - if (!is_wc_endpoint_url('order-received') || (empty($_GET['key']) && empty($id)) ) { - return; - } - } + global $wp; - if (!empty($_GET['order-received'])) { - $order_id = (int) ($_GET['order-received']); - - } elseif (!empty($id) && !is_object($id)) { - $order_id = (int) $id; - } - - if (empty($order_id) && (isset($wp->query_vars['order-received']))) { - $order_id = apply_filters( - 'woocommerce_thankyou_order_id', - absint($wp->query_vars['order-received']) - ); - } + if (!$ipn) { + if (!is_wc_endpoint_url('order-received') || (empty($_GET['key']) && empty($id))) { + return; + } + } - if (empty($order_id)) { + if (!empty($_GET['order-received'])) { + $order_id = (int) ($_GET['order-received']); + } elseif (!empty($id) && !is_object($id)) { + $order_id = (int) $id; + } - if (empty($_GET['key']) && empty($id) && !is_object($id)) { - return; - } + if (empty($order_id) && (isset($wp->query_vars['order-received']))) { + $order_id = apply_filters( + 'woocommerce_thankyou_order_id', + absint($wp->query_vars['order-received']) + ); + } - $order_id = wc_get_order_id_by_order_key(wc_clean( (!empty($_GET['key']) ? $_GET['key'] : (int) $id) ) ); + if (empty($order_id)) { + if (empty($_GET['key']) && empty($id) && !is_object($id)) { + return; + } - } + $order_id = wc_get_order_id_by_order_key(wc_clean((!empty($_GET['key']) ? $_GET['key'] : (int) $id))); + } - if (empty($order_id)) { - return; - } + if (empty($order_id)) { + return; + } $order = wc_get_order($order_id); if (!$order instanceof \WC_Order) { @@ -292,53 +290,51 @@ public function validate_payment($id = null, $save_request = true, $ipn = false) } $payment_method = PayplugWoocommerceHelper::is_pre_30() ? $order->payment_method : $order->get_payment_method(); - if (!in_array($payment_method, ['payplug', 'oney_x3_with_fees', 'oney_x4_with_fees', 'oney_x3_without_fees', 'oney_x4_without_fees','bancontact', 'apple_pay', 'american_express', "satispay","mybank","ideal" ])) { + if (!in_array($payment_method, ['payplug', 'oney_x3_with_fees', 'oney_x4_with_fees', 'oney_x3_without_fees', 'oney_x4_without_fees', 'bancontact', 'apple_pay', 'american_express', 'satispay', 'mybank', 'ideal'])) { return; } - if($payment_method === $this->id) { - + if ($payment_method === $this->id) { + $transaction_id = PayplugWoocommerceHelper::is_pre_30() ? get_post_meta($order_id, '_transaction_id', true) : $order->get_transaction_id(); + if (empty($transaction_id)) { + PayplugGateway::log(sprintf('Order #%s : Missing transaction id.', $order_id), 'error'); - $transaction_id = PayplugWoocommerceHelper::is_pre_30() ? get_post_meta($order_id, '_transaction_id', true) : $order->get_transaction_id(); - if (empty($transaction_id)) { - PayplugGateway::log(sprintf('Order #%s : Missing transaction id.', $order_id), 'error'); - return; - } - - $lock_id = Lock::handle_insert($save_request, $transaction_id); - if(!$lock_id){ - return; - } - - try { - $payment = $this->api->payment_retrieve($transaction_id); + return; + } - } catch (\Exception $e) { - PayplugGateway::log( - sprintf( - 'Order #%s : An error occurred while retrieving the payment data with the message : %s', - $order_id, - $e->getMessage() - ) - ); + $lock_id = Lock::handle_insert($save_request, $transaction_id); + if (!$lock_id) { + return; + } - return; - } + try { + $payment = $this->api->payment_retrieve($transaction_id); + } catch (\Exception $e) { + PayplugGateway::log( + sprintf( + 'Order #%s : An error occurred while retrieving the payment data with the message : %s', + $order_id, + $e->getMessage() + ) + ); + + return; + } - $this->response->process_payment($payment); + $this->response->process_payment($payment); - \Payplug\PayplugWoocommerce\Model\Lock::delete_lock($lock_id); - $waiting_requests = \Payplug\PayplugWoocommerce\Model\Lock::get_lock_by_payment_id($transaction_id); + \Payplug\PayplugWoocommerce\Model\Lock::delete_lock($lock_id); + $waiting_requests = \Payplug\PayplugWoocommerce\Model\Lock::get_lock_by_payment_id($transaction_id); - if($waiting_requests){ - \Payplug\PayplugWoocommerce\Model\Lock::delete_lock_by_payment_id($transaction_id); - $this->validate_payment($order_id, false); - }; - } + if ($waiting_requests) { + \Payplug\PayplugWoocommerce\Model\Lock::delete_lock_by_payment_id($transaction_id); + $this->validate_payment($order_id, false); + } + } } /** - * Check if this gateway is enabled + * Check if this gateway is enabled. */ public function is_available() { @@ -363,199 +359,200 @@ public function init_settings() */ public function init_form_fields() { + $anchor = esc_html_x(__('More informations', 'payplug'), 'modal', 'payplug'); + $domain = __('support.payplug.com/hc/fr/articles/4408142346002', 'payplug'); + $link = sprintf(' %s', $domain, $anchor); - $anchor = esc_html_x( __("More informations", 'payplug'), 'modal', 'payplug' ); - $domain = __( 'support.payplug.com/hc/fr/articles/4408142346002', 'payplug' ); - $link = sprintf( ' %s', $domain, $anchor ); - - - $anchor_bancontact = esc_html_x( __("payplug_bancontact_activation_request", 'payplug'), 'modal', 'payplug' ); - $domain_bancontact = __( 'payplug_bancontact_activation_url', 'payplug' ); - $bancontact_call_to_action = sprintf( ' %s', $domain_bancontact, $anchor_bancontact ); + $anchor_bancontact = esc_html_x(__('payplug_bancontact_activation_request', 'payplug'), 'modal', 'payplug'); + $domain_bancontact = __('payplug_bancontact_activation_url', 'payplug'); + $bancontact_call_to_action = sprintf(' %s', $domain_bancontact, $anchor_bancontact); $fields = [ - 'enabled' => [ - 'title' => __('Enable/Disable', 'payplug'), - 'type' => 'checkbox', - 'label' => __('Enable PayPlug', 'payplug'), + 'enabled' => [ + 'title' => __('Enable/Disable', 'payplug'), + 'type' => 'checkbox', + 'label' => __('Enable PayPlug', 'payplug'), 'description' => __('Only Euro payments can be processed with PayPlug.', 'payplug'), - 'default' => 'no', + 'default' => 'no', ], - 'title' => [ - 'title' => __('Title', 'payplug'), - 'type' => 'text', + 'title' => [ + 'title' => __('Title', 'payplug'), + 'type' => 'text', 'description' => __('The payment solution title displayed to your customers during checkout', 'payplug'), - 'default' => _x('Credit card checkout', 'Default gateway title', 'payplug'), - 'desc_tip' => false, + 'default' => _x('Credit card checkout', 'Default gateway title', 'payplug'), + 'desc_tip' => false, ], - 'description' => [ - 'title' => __('Description', 'payplug'), - 'type' => 'text', + 'description' => [ + 'title' => __('Description', 'payplug'), + 'type' => 'text', 'description' => __('The payment solution description displayed to your customers during checkout', 'payplug'), - 'default' => '', - 'desc_tip' => false, + 'default' => '', + 'desc_tip' => false, ], - 'title_connexion' => [ + 'title_connexion' => [ 'title' => __('Connection', 'payplug'), - 'type' => 'title', + 'type' => 'title', ], - 'email' => [ - 'type' => 'hidden', + 'email' => [ + 'type' => 'hidden', 'default' => '', ], - 'login' => [ - 'type' => 'login', + 'login' => [ + 'type' => 'login', 'default' => '', ], - 'payplug_test_key' => [ - 'type' => 'hidden', + 'payplug_test_key' => [ + 'type' => 'hidden', 'default' => '', ], - 'payplug_live_key' => [ - 'type' => 'hidden', + 'payplug_live_key' => [ + 'type' => 'hidden', 'default' => '', ], - 'payplug_merchant_id' => [ - 'type' => 'hidden', + 'payplug_merchant_id' => [ + 'type' => 'hidden', 'default' => '', ], - 'title_testmode' => [ + 'title_testmode' => [ 'title' => __('Mode', 'payplug'), - 'type' => 'title', + 'type' => 'title', ], - 'mode' => [ - 'title' => '', - 'label' => '', - 'type' => 'yes_no', - 'yes' => 'Live', - 'no' => 'Test', + 'mode' => [ + 'title' => '', + 'label' => '', + 'type' => 'yes_no', + 'yes' => 'Live', + 'no' => 'Test', 'description' => __('In TEST mode, all payments will be simulations and will not generate real transactions.', 'payplug'), - 'default' => 'no', - 'hide_label' => true, + 'default' => 'no', + 'hide_label' => true, ], - 'title_settings' => [ + 'title_settings' => [ 'title' => __('Settings', 'payplug'), - 'type' => 'title', + 'type' => 'title', ], - 'payment_method' => [ - 'title' => __('Payment page', 'payplug'), - 'type' => 'radio', - 'options' => array( - 'redirect' => __('Redirect', 'payplug'), - 'embedded' => __('Integrated', 'payplug'), - ), + 'payment_method' => [ + 'title' => __('Payment page', 'payplug'), + 'type' => 'radio', + 'options' => [ + 'redirect' => __('Redirect', 'payplug'), + 'embedded' => __('Integrated', 'payplug'), + ], 'description' => __('Customers will be redirected to a PayPlug payment page to finalize the transaction, or payments will be performed in an embeddable payment form on your website.', 'payplug'), - 'default' => 'redirect', - 'desc_tip' => false + 'default' => 'redirect', + 'desc_tip' => false, ], - 'debug' => [ - 'title' => __('Debug', 'payplug'), - 'type' => 'checkbox', + 'debug' => [ + 'title' => __('Debug', 'payplug'), + 'type' => 'checkbox', 'description' => __('Debug mode saves additional information on your server for each operation done via the PayPlug plugin (Developer setting).', 'payplug'), - 'label' => __('Activate debug mode', 'payplug'), - 'default' => 'yes', - 'desc_tip' => false + 'label' => __('Activate debug mode', 'payplug'), + 'default' => 'yes', + 'desc_tip' => false, ], 'title_advanced_settings' => [ - 'title' => __('payplug_advanced_settings', 'payplug'), + 'title' => __('payplug_advanced_settings', 'payplug'), 'description' => __( 'Your current offer does not allow this option. Try it on TEST mode. More information here.', 'payplug' ), - 'type' => 'title', + 'type' => 'title', ], - 'oneclick' => [ - 'title' => __('One Click Payment', 'payplug'), - 'type' => 'checkbox', - 'label' => __('Activate', 'payplug'), + 'oneclick' => [ + 'title' => __('One Click Payment', 'payplug'), + 'type' => 'checkbox', + 'label' => __('Activate', 'payplug'), 'description' => __('Allow your customers to save their credit card information for later purchases.', 'payplug'), - 'default' => 'no', - 'desc_tip' => false + 'default' => 'no', + 'desc_tip' => false, + ], + 'bancontact' => [ + 'title' => __('payplug_bancontact_activate_title', 'payplug'), + 'type' => 'checkbox', + 'label' => __('Activate', 'payplug'), + 'description' => '

    ' . __('payplug_bancontact_testmode_description', 'payplug') . '

    ' . + '

    ' . __('payplug_bancontact_livemode_description_disabled', 'payplug') . '

    ' . + $bancontact_call_to_action, + 'default' => 'no', + ], + 'apple_pay' => [ + 'title' => __('payplug_apple_pay_activate_title', 'payplug'), + 'type' => 'checkbox', + 'label' => __('Activate', 'payplug'), + 'description' => '

    ' . __('payplug_apple_pay_testmode_description', 'payplug') . '

    ' . + '

    ' . __('payplug_apple_pay_livemode_description', 'payplug') . '

    ', + 'default' => 'no', + ], + 'american_express' => [ + 'title' => __('payplug_amex_title', 'payplug'), + 'type' => 'checkbox', + 'label' => __('payplug_amex_activate', 'payplug'), + 'description' => '

    ' . __('payplug_amex_testmode_description', 'payplug') . '

    ' . + '

    ' . __('payplug_amex_livemode_description', 'payplug') . '

    ', + 'default' => 'no', + ], + 'oney' => [ + 'title' => __('3x 4x Oney payments', 'payplug'), + 'type' => 'checkbox', + 'label' => __('Activate', 'payplug'), + // TRAD + 'description' => sprintf(__('Allow your customers to split payments into 3 or 4 installments, for orders between %s€ and %s€', 'payplug'), $this->min_oney_price, $this->max_oney_price) . $link, + 'default' => 'no', + 'desc_tip' => false, + ], + 'oney_type' => [ + 'title' => '', + 'type' => 'oney_type', + 'options' => [ + 'with_fees' => __('Oney with fees', 'payplug'), + 'without_fees' => __('Oney without fees', 'payplug'), + ], + 'descriptions' => [ + 'with_fees' => __('The fees are split between you and your customers', 'payplug'), + 'without_fees' => __('You pay the fees', 'payplug'), + ], + 'description' => '', + 'default' => 'with_fees', + 'desc_tip' => false, + ], + 'oney_thresholds' => [ + 'title' => '', + 'type' => 'oney_thresholds', + 'description' => sprintf( + __('I would like to offer guaranteed payment in installments for amounts between %s€ and %s€.', 'payplug'), + '' . $this->oney_thresholds_min . '', + '' . $this->oney_thresholds_max . '' + ), + 'desc_tip' => false, + ], + 'oney_thresholds_min' => [ + 'title' => '', + 'type' => 'hidden', + 'label' => '', + 'description' => '', + 'default' => 'no', + ], + 'oney_thresholds_max' => [ + 'title' => '', + 'type' => 'hidden', + 'label' => '', + 'description' => '', + 'default' => 'no', + ], + 'oney_product_animation' => [ + 'title' => __('oney_installments_pop_up', 'payplug'), + 'description' => __('display_the_oney_installments_pop_up_on_the_product_page', 'payplug'), + 'label' => __('Activate', 'payplug'), + 'default' => 'no', + 'desc_tip' => false, + 'type' => 'oney_product_animation', ], - 'bancontact' => [ - 'title' => __('payplug_bancontact_activate_title', 'payplug'), - 'type' => 'checkbox', - 'label' => __('Activate', 'payplug'), - 'description' => '

    '. __('payplug_bancontact_testmode_description', 'payplug') .'

    ' . - '

    '. __('payplug_bancontact_livemode_description_disabled', 'payplug') .'

    ' . - $bancontact_call_to_action, - 'default' => 'no', - ], - 'apple_pay' => [ - 'title' => __('payplug_apple_pay_activate_title', 'payplug'), - 'type' => 'checkbox', - 'label' => __('Activate', 'payplug'), - 'description' => '

    '. __('payplug_apple_pay_testmode_description', 'payplug') .'

    ' . - '

    '. __('payplug_apple_pay_livemode_description', 'payplug') .'

    ' , - 'default' => 'no', - ], - 'american_express' => [ - 'title' => __('payplug_amex_title', 'payplug'), - 'type' => 'checkbox', - 'label' => __('payplug_amex_activate', 'payplug'), - 'description' => '

    '. __('payplug_amex_testmode_description', 'payplug') .'

    ' . - '

    '. __('payplug_amex_livemode_description', 'payplug') .'

    ' , - 'default' => 'no', - ], - 'oney' => [ - 'title' => __('3x 4x Oney payments', 'payplug'), - 'type' => 'checkbox', - 'label' => __('Activate', 'payplug'), - // TRAD - 'description' => sprintf(__('Allow your customers to split payments into 3 or 4 installments, for orders between %s€ and %s€', 'payplug'), $this->min_oney_price, $this->max_oney_price) . $link, - 'default' => 'no', - 'desc_tip' => false - ], - 'oney_type' => [ - 'title' => '', - 'type' => 'oney_type', - 'options' => array( - 'with_fees' => __('Oney with fees', 'payplug'), - 'without_fees' => __('Oney without fees', 'payplug'), - ), - 'descriptions' => array( - 'with_fees' => __('The fees are split between you and your customers', 'payplug'), - 'without_fees' => __('You pay the fees', 'payplug'), - ), - 'description' => '', - 'default' => 'with_fees', - 'desc_tip' => false - ], - 'oney_thresholds' => [ - 'title' => '', - 'type' => 'oney_thresholds', - 'description' => sprintf(__('I would like to offer guaranteed payment in installments for amounts between %s€ and %s€.', 'payplug'), - '' . $this->oney_thresholds_min . '', '' . $this->oney_thresholds_max . ''), - 'desc_tip' => false - ], - 'oney_thresholds_min' => [ - 'title' => '', - 'type' => 'hidden', - 'label' => '', - 'description' => '', - 'default' => 'no', - ], - 'oney_thresholds_max' => [ - 'title' => '', - 'type' => 'hidden', - 'label' => '', - 'description' => '', - 'default' => 'no', - ], - 'oney_product_animation' => [ - 'title' => __('oney_installments_pop_up', 'payplug'), - 'description' => __('display_the_oney_installments_pop_up_on_the_product_page', 'payplug'), - 'label' => __('Activate', 'payplug'), - 'default' => 'no', - 'desc_tip' => false, - 'type' => 'oney_product_animation' - ], ]; if ($this->user_logged_in()) { if ($this->permissions->has_permissions(PayplugPermissions::SAVE_CARD)) { unset($fields['title_advanced_settings']); - } else if ('live' === $this->get_current_mode()){ + } elseif ('live' === $this->get_current_mode()) { $fields['oneclick']['disabled'] = true; } } @@ -565,7 +562,7 @@ public function init_form_fields() * * @param array $fields */ - $fields = apply_filters('payplug_gateway_settings', $fields); + $fields = apply_filters('payplug_gateway_settings', $fields); $this->form_fields = $fields; } @@ -578,14 +575,13 @@ public function init_payplug() $this->api->init(); $this->permissions = new PayplugPermissions($this); - $this->response = new PayplugResponse($this); + $this->response = new PayplugResponse($this); // Register IPN handler new PayplugIpnResponse($this); - } - /** + /** * Filter saved tokens for the gateway. * * A token will be removed if : @@ -601,23 +597,22 @@ public function init_payplug() */ public function filter_tokens($tokens, $user_id, $gateway_id) { - if (!is_user_logged_in() || !class_exists('WC_Payment_Gateway_CC')) { return $tokens; } - if($this->oneclick === false){ - foreach($tokens as $token_id => $token){ - if($token->get_gateway_id() === "payplug"){ - unset($tokens[$token_id]); - } - } - return $tokens; - } + if (false === $this->oneclick) { + foreach ($tokens as $token_id => $token) { + if ('payplug' === $token->get_gateway_id()) { + unset($tokens[$token_id]); + } + } + + return $tokens; + } - /* @var \WC_Payment_Token_CC $token */ + // @var \WC_Payment_Token_CC $token foreach ($tokens as $k => $token) { - if ($this->id !== $token->get_gateway_id()) { continue; } @@ -626,25 +621,29 @@ public function filter_tokens($tokens, $user_id, $gateway_id) $token_merchant_id = $token->get_meta('payplug_account', true); if (empty($token_merchant_id) || $this->get_merchant_id() !== $token_merchant_id) { unset($tokens[$k]); + continue; } // check if token is available for the current gateway mode if ($this->mode !== $token->get_meta('mode', true)) { unset($tokens[$k]); + continue; } // check if token is not expired $current_month = \absint(date('n')); - $current_year = \absint(date('Y')); + $current_year = \absint(date('Y')); if ($current_year > (int) $token->get_expiry_year()) { unset($tokens[$k]); + continue; } if ($current_year === (int) $token->get_expiry_year() && $current_month > (int) $token->get_expiry_month()) { unset($tokens[$k]); + continue; } } @@ -652,16 +651,16 @@ public function filter_tokens($tokens, $user_id, $gateway_id) return $tokens; } - /** - * extra payment fields - */ + /** + * extra payment fields. + */ public function payment_fields() { $description = $this->get_description(); - if (!empty($description)) { - echo wpautop(wptexturize($description)); - } + if (!empty($description)) { + echo wpautop(wptexturize($description)); + } if ($this->oneclick_available()) { $this->tokenization_script(); @@ -674,25 +673,25 @@ public function payment_fields() */ public function admin_options() { - /************ VUE Code *************/ - wp_enqueue_script('chunk-vendors.js', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/dist/js/chunk-vendors-1.7.12.js', [], PAYPLUG_GATEWAY_VERSION); - wp_enqueue_script('app.js', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/dist/js/app-1.7.12.js', [], PAYPLUG_GATEWAY_VERSION); - wp_enqueue_style('app.css', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/dist/css/app.css', [], PAYPLUG_GATEWAY_VERSION); - wp_localize_script('app.js', 'payplug_admin_config', - array( - "img_path" => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/dist/'), - 'ajax_url' => get_home_url() - )); - - ?> + // VUE Code + wp_enqueue_script('chunk-vendors.js', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/dist/js/chunk-vendors-1.7.12.js', [], PAYPLUG_GATEWAY_VERSION); + wp_enqueue_script('app.js', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/dist/js/app-1.7.12.js', [], PAYPLUG_GATEWAY_VERSION); + wp_enqueue_style('app.css', PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/dist/css/app.css', [], PAYPLUG_GATEWAY_VERSION); + wp_localize_script( + 'app.js', + 'payplug_admin_config', + [ + 'img_path' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/dist/'), + 'ajax_url' => get_home_url(), + ] + ); ?>
    customer_user : $order->get_customer_id(); - $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($order->get_total()); - $amount = $this->validate_order_amount($amount); + $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($order->get_total()); + $amount = $this->validate_order_amount($amount); - if (is_wp_error($amount)) { + if (is_wp_error($amount)) { PayplugGateway::log(sprintf('Invalid amount %s for the order.', $order->get_total()), 'error'); + throw new \Exception($amount->get_error_message()); } @@ -732,155 +733,78 @@ public function process_payment($order_id) return $this->process_payment_with_token($order, $amount, $customer_id, $payment_token_id); } - return $this->process_standard_payment($order, $amount, $customer_id); + return $this->process_standard_payment($order, $amount, $customer_id); } - /** - * if payment was generated by an intend, we shouldn't generate another one and try to pay it, this would generate duplications - * @param $order - * @return array|null - * @throws \Exception - */ - private function process_standard_intent_payment($order){ - - //no order-pay page, no ajax_on_order_review_page - if ( !is_wc_endpoint_url('order-pay') && - PayplugWoocommerceHelper::is_checkout_block() && - ( - ( $this->id === "payplug" && ($this->payment_method === 'integrated'|| $this->payment_method === 'popup') ) || - ( $this->id === "american_express" && $this->payment_method === 'popup') - ) && - $_GET["wc-ajax"] !== "payplug_order_review_url" - ) { - - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - - try { - $payment = $this->api->payment_retrieve($order->get_transaction_id()); - if (ob_get_length() > 0) { - ob_clean(); - } - - // Save transaction id for the order - PayplugWoocommerceHelper::is_pre_30() - ? update_post_meta($order_id, '_transaction_id', $payment->id) - : $order->set_transaction_id($payment->id); - - if($payment->is_paid){ - $finished_status = wc_get_is_paid_statuses(); - $order->set_status($finished_status[0]); - } - - if (is_callable([$order, 'save'])) { - $order->save(); - } - - /** - * Fires once a payment has been created. - * - * @param int $order_id Order ID - * @param PaymentResource $payment Payment resource - */ - \do_action('payplug_gateway_payment_created', $order_id, $payment); - - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); - PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); - - PayplugGateway::log(sprintf('Payment intent created for order #%s', $order_id)); - - $return_url = esc_url_raw($order->get_checkout_order_received_url()); - - wp_send_json_success(array( - 'payment_id' => $payment->id, - 'result' => 'success', - 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, - 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null - )); - - return array("stt" => "OK"); - - } catch (HttpException $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } catch (\Exception $e) { - PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); - throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } - } - - return null; - } - /** * @param \WC_Order $order * @param int $amount * @param int $customer_id * - * @return array * @throws \Exception + * + * @return array */ public function process_standard_payment($order, $amount, $customer_id) - { - - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + { + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - $intent = $this->process_standard_intent_payment($order); - if( !empty($intent) ){ - return $intent; - } + $intent = $this->process_standard_intent_payment($order); + if (!empty($intent)) { + return $intent; + } - try { + try { $address_data = PayplugAddressData::from_order($order); - $return_url = esc_url_raw($order->get_checkout_order_received_url()); + $return_url = esc_url_raw($order->get_checkout_order_received_url()); - if (!(substr( $return_url, 0, 4 ) === "http")) { - $return_url = get_site_url().$return_url; - } + if (!('http' === substr($return_url, 0, 4))) { + $return_url = get_site_url() . $return_url; + } - $payment_data = [ - 'amount' => $amount, - 'currency' => get_woocommerce_currency(), - 'allow_save_card' => $this->oneclick_available() && (int) $customer_id > 0, - 'billing' => $address_data->get_billing(), - 'shipping' => $address_data->get_shipping(), - 'hosted_payment' => [ + $payment_data = [ + 'amount' => $amount, + 'currency' => get_woocommerce_currency(), + 'allow_save_card' => $this->oneclick_available() && (int) $customer_id > 0, + 'billing' => $address_data->get_billing(), + 'shipping' => $address_data->get_shipping(), + 'hosted_payment' => [ 'return_url' => $return_url, 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), ], 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), - 'metadata' => [ - 'order_id' => $order_id, + 'metadata' => [ + 'order_id' => $order_id, 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', - 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), + 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), ], ]; - if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { - $payment_data['metadata']['woocommerce_block'] = "CHECKOUT"; - - } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { - $payment_data['metadata']['woocommerce_block'] = "CART"; - } - - //IP request required variables - if($this->payment_method === 'integrated'){ - $payment_data['initiator'] = 'PAYER'; - $payment_data['integration'] = 'INTEGRATED_PAYMENT'; - unset($payment_data['hosted_payment']['cancel_url']); - } - - //for subscriptions the card needs to be saved - $is_subscription = PayplugWoocommerceHelper::is_subscription(); - if( !empty($is_subscription) && $is_subscription === true ){ - $payment_data['allow_save_card'] = false; - $payment_data['save_card'] = true; - $payment_data['force_3ds'] = true; - $payment_data['metadata']['subscription'] = 'subscription'; - } + if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { + $payment_data['metadata']['woocommerce_block'] = 'CHECKOUT'; + } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { + $payment_data['metadata']['woocommerce_block'] = 'CART'; + } + + //IP request required variables + if ('integrated' === $this->payment_method) { + $payment_data['initiator'] = 'PAYER'; + $payment_data['integration'] = 'INTEGRATED_PAYMENT'; + unset($payment_data['hosted_payment']['cancel_url']); + } + + //for subscriptions the card needs to be saved + $is_subscription = PayplugWoocommerceHelper::is_subscription(); + if (!empty($is_subscription) && true === $is_subscription) { + $payment_data['allow_save_card'] = false; + $payment_data['save_card'] = true; + $payment_data['force_3ds'] = true; + $payment_data['metadata']['subscription'] = 'subscription'; + } /** - * Filter the payment data before it's used + * Filter the payment data before it's used. * * @param array $payment_data * @param int $order_id @@ -888,21 +812,21 @@ public function process_standard_payment($order, $amount, $customer_id) * @param PayplugAddressData $address_data */ $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); - $payment = $this->api->payment_create($payment_data); + $payment = $this->api->payment_create($payment_data); // Save transaction id for the order PayplugWoocommerceHelper::is_pre_30() ? update_post_meta($order_id, '_transaction_id', $payment->id) : $order->set_transaction_id($payment->id); - $order->set_payment_method( $this->id ); - $order->set_payment_method_title($this->method_title); + $order->set_payment_method($this->id); + $order->set_payment_method_title($this->method_title); if (is_callable([$order, 'save'])) { $order->save(); } - /** + /* * Fires once a payment has been created. * * @param int $order_id Order ID @@ -915,22 +839,23 @@ public function process_standard_payment($order, $amount, $customer_id) PayplugGateway::log(sprintf('Payment creation complete for order #%s', $order_id)); - if(ob_get_length() > 0){ - ob_clean(); - } - - return array( - 'payment_id' => $payment->id, - 'result' => 'success', - 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, - 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null - ); + if (ob_get_length() > 0) { + ob_clean(); + } + return [ + 'payment_id' => $payment->id, + 'result' => 'success', + 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, + 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null, + ]; } catch (HttpException $e) { PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); } catch (\Exception $e) { PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); } } @@ -941,96 +866,97 @@ public function process_standard_payment($order, $amount, $customer_id) * @param int $customer_id * @param string $token_id * - * @return array * @throws \Exception + * + * @return array */ public function process_payment_with_token($order, $amount, $customer_id, $token_id) { - - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); $payment_token = WC_Payment_Tokens::get($token_id); if (!$payment_token || (int) $customer_id !== (int) $payment_token->get_user_id()) { PayplugGateway::log('Could not find the payment token or the payment doesn\'t belong to the current user.', 'error'); + throw new \Exception(__('Invalid payment method.', 'payplug')); } try { $address_data = PayplugAddressData::from_order($order); - $return_url = esc_url_raw($order->get_checkout_order_received_url()); + $return_url = esc_url_raw($order->get_checkout_order_received_url()); - if (!(substr( $return_url, 0, 4 ) === "http")) { - $return_url = get_site_url().$return_url; - } + if (!('http' === substr($return_url, 0, 4))) { + $return_url = get_site_url() . $return_url; + } $payment_data = [ - 'amount' => $amount, - 'currency' => get_woocommerce_currency(), - 'payment_method' => $payment_token->get_token(), - 'allow_save_card' => false, - 'billing' => $address_data->get_billing(), - 'shipping' => $address_data->get_shipping(), - 'initiator' => 'PAYER', - 'hosted_payment' => [ + 'amount' => $amount, + 'currency' => get_woocommerce_currency(), + 'payment_method' => $payment_token->get_token(), + 'allow_save_card' => false, + 'billing' => $address_data->get_billing(), + 'shipping' => $address_data->get_shipping(), + 'initiator' => 'PAYER', + 'hosted_payment' => [ 'return_url' => $return_url, 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), ], 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), - 'metadata' => [ - 'order_id' => $order_id, + 'metadata' => [ + 'order_id' => $order_id, 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', - 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), - 'woocommerce_block' => \WC_Blocks_Utils::has_block_in_page( wc_get_page_id('checkout'), 'woocommerce/checkout' ) - ], + 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), + 'woocommerce_block' => \WC_Blocks_Utils::has_block_in_page(wc_get_page_id('checkout'), 'woocommerce/checkout'), + ], ]; - $is_subscription = PayplugWoocommerceHelper::is_subscription(); - if( !empty($is_subscription) && $is_subscription === true ){ - $payment_data['metadata']['subscription'] = 'subscription'; - } - + $is_subscription = PayplugWoocommerceHelper::is_subscription(); + if (!empty($is_subscription) && true === $is_subscription) { + $payment_data['metadata']['subscription'] = 'subscription'; + } /** This filter is documented in src/Gateway/PayplugGateway */ $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); - $payment = $this->api->payment_create($payment_data); + $payment = $this->api->payment_create($payment_data); - // Save transaction id for the order - PayplugWoocommerceHelper::is_pre_30() - ? update_post_meta($order_id, '_transaction_id', $payment->id) - : $order->set_transaction_id($payment->id); + // Save transaction id for the order + PayplugWoocommerceHelper::is_pre_30() + ? update_post_meta($order_id, '_transaction_id', $payment->id) + : $order->set_transaction_id($payment->id); - if (is_callable([$order, 'save'])) { - $order->save(); - } + if (is_callable([$order, 'save'])) { + $order->save(); + } - /** This action is documented in src/Gateway/PayplugGateway */ + // This action is documented in src/Gateway/PayplugGateway \do_action('payplug_gateway_payment_created', $order_id, $payment); - - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); - PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); $this->response->process_payment($payment, true); - if(($payment->__get('is_paid'))){ - $redirect = $order->get_checkout_order_received_url(); - }else if(isset($payment->__get('hosted_payment')->payment_url)){ - $redirect = $payment->__get('hosted_payment')->payment_url; - }else{ - $redirect = $return_url; - } + if (($payment->__get('is_paid'))) { + $redirect = $order->get_checkout_order_received_url(); + } elseif (isset($payment->__get('hosted_payment')->payment_url)) { + $redirect = $payment->__get('hosted_payment')->payment_url; + } else { + $redirect = $return_url; + } return [ - 'payment_id' => $payment->id, - 'result' => 'success', - 'is_paid' => $payment->__get('is_paid'), // Use for path redirect before DSP2 - 'redirect' => $redirect + 'payment_id' => $payment->id, + 'result' => 'success', + 'is_paid' => $payment->__get('is_paid'), // Use for path redirect before DSP2 + 'redirect' => $redirect, ]; } catch (HttpException $e) { PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); } catch (\Exception $e) { PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); } } @@ -1048,10 +974,11 @@ public function process_refund($order_id, $amount = null, $reason = '') { PayplugGateway::log(sprintf('Processing refund for order #%s', $order_id)); - if( !$this->user_logged_in()){ - PayplugGateway::log(__('You must be logged in with your PayPlug account.', 'payplug'), 'error'); - return new \WP_Error('process_refund_error', __('You must be logged in with your PayPlug account.', 'payplug')); - } + if (!$this->user_logged_in()) { + PayplugGateway::log(__('You must be logged in with your PayPlug account.', 'payplug'), 'error'); + + return new \WP_Error('process_refund_error', __('You must be logged in with your PayPlug account.', 'payplug')); + } $order = wc_get_order($order_id); if (!$order instanceof \WC_Order) { @@ -1060,7 +987,7 @@ public function process_refund($order_id, $amount = null, $reason = '') return new \WP_Error('process_refund_error', sprintf(__('The order %s does not exist.', 'payplug'), $order_id)); } - if ($order->get_status() === "cancelled") { + if ('cancelled' === $order->get_status()) { PayplugGateway::log(sprintf('The order #%s cannot be refund.', $order_id), 'error'); return new \WP_Error('process_refund_error', sprintf(__('The order %s cannot be refund.', 'payplug'), $order_id)); @@ -1077,10 +1004,10 @@ public function process_refund($order_id, $amount = null, $reason = '') $data = [ 'metadata' => [ - 'order_id' => $order_id, + 'order_id' => $order_id, 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', 'refund_from' => 'woocommerce', - ] + ], ]; if (!is_null($amount)) { @@ -1103,7 +1030,7 @@ public function process_refund($order_id, $amount = null, $reason = '') try { $refund = $this->api->refund_create($transaction_id, $data); - /** + /* * Fires once a refund has been created. * * @param int $order_id Order ID @@ -1127,7 +1054,7 @@ public function process_refund($order_id, $amount = null, $reason = '') $order->add_order_note($note); try { - $payment = $this->api->payment_retrieve($transaction_id); + $payment = $this->api->payment_retrieve($transaction_id); $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); } catch (\Exception $e) { @@ -1198,13 +1125,13 @@ public function retrieve_user_api_keys($email, $password) try { $response = Authentication::getKeysByLogin($email, $password); - if (empty($response) || !isset($response['httpResponse']) && "payplug" === $this->id) { + if (empty($response) || !isset($response['httpResponse']) && 'payplug' === $this->id) { return new \WP_Error('invalid_credentials', __('Invalid credentials.', 'payplug')); } return $response['httpResponse']['secret_keys']; } catch (HttpException $e) { - if("payplug" === $this->id) { + if ('payplug' === $this->id) { return new \WP_Error('invalid_credentials', __('Invalid credentials.', 'payplug')); } } @@ -1222,19 +1149,17 @@ public function retrieve_user_api_keys($email, $password) */ public function retrieve_merchant_id($key = null) { - $merchant_id = ''; + $merchant_id = ''; + try { - $response = !is_null($key) && !empty($key) ? Authentication::getAccount(new Payplug($key)) : Authentication::getAccount(); + $response = !is_null($key) && !empty($key) ? Authentication::getAccount(new Payplug($key)) : Authentication::getAccount(); PayplugWoocommerceHelper::set_transient_data($response); $merchant_id = isset($response['httpResponse']['id']) ? $response['httpResponse']['id'] : ''; - } catch (ConfigurationException $e) { PayplugGateway::log(sprintf('Missing API key for PayPlug client : %s', wc_print_r($e->getMessage(), true)), 'error'); - } catch (HttpException $e) { - PayplugGateway::log(sprintf('Account request error from PayPlug API : %s', wc_print_r($e->getErrorObject(), true)), 'error'); - PayplugWoocommerceHelper::exception_handler_400_logout($e->getCode(), '', sprintf('Account request error from PayPlug API : %s', wc_print_r($e->getMessage(), true)) ); - + PayplugGateway::log(sprintf('Account request error from PayPlug API : %s', wc_print_r($e->getErrorObject(), true)), 'error'); + PayplugWoocommerceHelper::exception_handler_400_logout($e->getCode(), '', sprintf('Account request error from PayPlug API : %s', wc_print_r($e->getMessage(), true))); } catch (\Exception $e) { PayplugGateway::log(sprintf('Account request error : %s', wc_clean($e->getMessage())), 'error'); } @@ -1261,35 +1186,34 @@ public function get_current_mode() */ public function get_api_key($mode = 'test') { + $options = PayplugWoocommerceHelper::get_payplug_options(); - $options = PayplugWoocommerceHelper::get_payplug_options(); - - $key = $options['payplug_' . $mode . '_key']; - $jwt = isset($options['client_data']) && isset($options['client_data']['jwt']) ? $options['client_data']['jwt'] : []; - - if(!empty($jwt) && !empty($jwt[$mode])) { - $client_data = isset($options['client_data']) ? $options['client_data'] : []; - $this->api = new PayplugApi($this); - $validate_jwt = $this->api->validate_jwt( - array_key_exists($mode, $client_data) ? $client_data[$mode] : [], - $jwt[$mode] - ); - - if ($validate_jwt['token']) { - $key = $validate_jwt['token']; - - if ($validate_jwt['need_update']) { - if (!isset($options['client_data'])) { - $options['client_data'] = []; - } - if (!isset($options['client_data']['jwt'])) { - $options['client_data']['jwt'] = []; - } - $options['client_data']['jwt'][$mode] = $validate_jwt['token']; - update_option( 'woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options), false ); - } - } - } + $key = $options['payplug_' . $mode . '_key']; + $jwt = isset($options['client_data']) && isset($options['client_data']['jwt']) ? $options['client_data']['jwt'] : []; + + if (!empty($jwt) && !empty($jwt[$mode])) { + $client_data = isset($options['client_data']) ? $options['client_data'] : []; + $this->api = new PayplugApi($this); + $validate_jwt = $this->api->validate_jwt( + array_key_exists($mode, $client_data) ? $client_data[$mode] : [], + $jwt[$mode] + ); + + if ($validate_jwt['token']) { + $key = $validate_jwt['token']; + + if ($validate_jwt['need_update']) { + if (!isset($options['client_data'])) { + $options['client_data'] = []; + } + if (!isset($options['client_data']['jwt'])) { + $options['client_data']['jwt'] = []; + } + $options['client_data']['jwt'][$mode] = $validate_jwt['token']; + update_option('woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options), false); + } + } + } return isset($key['access_token']) ? $key['access_token'] : $key; } @@ -1311,11 +1235,11 @@ public function get_merchant_id() */ public function user_logged_in() { - $options = PayplugWoocommerceHelper::get_payplug_options(); + $options = PayplugWoocommerceHelper::get_payplug_options(); - if (isset($options['client_data']) && isset($options['client_data']['jwt']['test']['access_token'])) { - return true; - } + if (isset($options['client_data'], $options['client_data']['jwt']['test']['access_token'])) { + return true; + } return !empty($options['payplug_test_key']); } @@ -1327,33 +1251,33 @@ public function user_logged_in() */ public function oneclick_available() { - return $this->id === "payplug" && $this->user_logged_in() + return 'payplug' === $this->id && $this->user_logged_in() && $this->oneclick && $this->permissions->has_permissions(PayplugPermissions::SAVE_CARD); } /** - * Check if the gatteway is allowed for the order amount + * Check if the gatteway is allowed for the order amount. * * @param array + * @param mixed $gateways + * * @return array */ public function check_gateway($gateways) { - if ( !empty( WC()->cart ) && isset($gateways[$this->id]) && $gateways[$this->id]->id == $this->id) { + if (!empty(WC()->cart) && isset($gateways[$this->id]) && $gateways[$this->id]->id == $this->id) { $order_amount = $this->get_order_total(); if ($order_amount < self::MIN_AMOUNT || $order_amount > self::MAX_AMOUNT) { unset($gateways[$this->id]); } } - if($this->oney_type == 'with_fees'){ - unset($gateways['oney_x3_without_fees']); - unset($gateways['oney_x4_without_fees']); - } else{ - unset($gateways['oney_x3_with_fees']); - unset($gateways['oney_x4_with_fees']); - } + if ('with_fees' == $this->oney_type) { + unset($gateways['oney_x3_without_fees'], $gateways['oney_x4_without_fees']); + } else { + unset($gateways['oney_x3_with_fees'], $gateways['oney_x4_with_fees']); + } return $gateways; } @@ -1361,60 +1285,136 @@ public function check_gateway($gateways) /** * Can the order be refunded via this gateway? * + * @param WC_Order $order order object * - * @param WC_Order $order Order object. - * @return bool If false, the automatic refund button is hidden in the UI. + * @return bool if false, the automatic refund button is hidden in the UI */ public function can_refund_order($order) { $status = $order->get_status(); - return $order && $this->supports('refunds') && $status !== "cancelled" && $status !== "failed"; + + return $order && $this->supports('refunds') && 'cancelled' !== $status && 'failed' !== $status; } + public function tmp_generate_jwt() + { + $options = get_option('woocommerce_payplug_settings'); + + if (!isset($options['client_data']) || empty($options['client_data'])) { + return false; + } + + $client_data = $options['client_data']; + $jwt = []; + + $this->api = new PayplugApi($this); + + foreach ($client_data as $key => $data) { + if (empty($data)) { + $jwt[$key] = []; + + continue; + } + + if (('live' == $key) && isset($data['client_id'], $data['client_secret'])) { + $generated_jwt = $this->api->generateJWT($data['client_id'], $data['client_secret']); - public function tmp_generate_jwt() - { - $options = get_option( 'woocommerce_payplug_settings' ); + if (empty($generated_jwt['httpResponse'])) { + return false; + } + $jwt[$key] = $generated_jwt['httpResponse']; + } - if (!isset($options['client_data']) || empty($options['client_data'])) { - return false; - } + if (('test' == $key) && isset($data['client_id'], $data['client_secret'])) { + $generated_jwt = $this->api->generateJWT($data['client_id'], $data['client_secret']); - $client_data = $options['client_data']; - $jwt = []; + if (empty($generated_jwt['httpResponse'])) { + return false; + } + $jwt[$key] = $generated_jwt['httpResponse']; + } + } + $options['client_data']['jwt'] = $jwt; - $this->api = new PayplugApi($this); + return update_option('woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options), false); + } - foreach ($client_data as $key => $data) { - if (empty($data)) { - $jwt[$key] = []; - continue; - } + /** + * if payment was generated by an intend, we shouldn't generate another one and try to pay it, this would generate duplications. + * + * @param $order + * + * @throws \Exception + * + * @return array|null + */ + private function process_standard_intent_payment($order) + { + //no order-pay page, no ajax_on_order_review_page + if (!is_wc_endpoint_url('order-pay') + && PayplugWoocommerceHelper::is_checkout_block() + && ( + ('payplug' === $this->id && ('integrated' === $this->payment_method || 'popup' === $this->payment_method)) + || ('american_express' === $this->id && 'popup' === $this->payment_method) + ) + && 'payplug_order_review_url' !== $_GET['wc-ajax'] + ) { + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - if (($key == 'live') && isset($data['client_id']) && isset($data['client_secret'])) { + try { + $payment = $this->api->payment_retrieve($order->get_transaction_id()); + if (ob_get_length() > 0) { + ob_clean(); + } + + // Save transaction id for the order + PayplugWoocommerceHelper::is_pre_30() + ? update_post_meta($order_id, '_transaction_id', $payment->id) + : $order->set_transaction_id($payment->id); + + if ($payment->is_paid) { + $finished_status = wc_get_is_paid_statuses(); + $order->set_status($finished_status[0]); + } + + if (is_callable([$order, 'save'])) { + $order->save(); + } + + /* + * Fires once a payment has been created. + * + * @param int $order_id Order ID + * @param PaymentResource $payment Payment resource + */ + \do_action('payplug_gateway_payment_created', $order_id, $payment); - $generated_jwt = $this->api->generateJWT($data['client_id'], $data['client_secret']); + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); - if (empty($generated_jwt['httpResponse'])) { - return false; - } - $jwt[$key] = $generated_jwt['httpResponse']; + PayplugGateway::log(sprintf('Payment intent created for order #%s', $order_id)); - } + $return_url = esc_url_raw($order->get_checkout_order_received_url()); - if (($key == 'test') && isset($data['client_id']) && isset($data['client_secret'])) { + wp_send_json_success([ + 'payment_id' => $payment->id, + 'result' => 'success', + 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, + 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null, + ]); - $generated_jwt = $this->api->generateJWT($data['client_id'], $data['client_secret']); + return ['stt' => 'OK']; + } catch (HttpException $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); - if (empty($generated_jwt['httpResponse'])) { - return false; - } - $jwt[$key] = $generated_jwt['httpResponse']; + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } catch (\Exception $e) { + PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); - } - } - $options['client_data']['jwt'] = $jwt; - return update_option( 'woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options), false ); - } + throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); + } + } + return null; + } } diff --git a/src/Gateway/PayplugGatewayOney3x.php b/src/Gateway/PayplugGatewayOney3x.php index a5b039d7..a0c8aa1f 100644 --- a/src/Gateway/PayplugGatewayOney3x.php +++ b/src/Gateway/PayplugGatewayOney3x.php @@ -2,11 +2,10 @@ namespace Payplug\PayplugWoocommerce\Gateway; -use Payplug\PayplugWoocommerce\Controller\PayplugGenericGateway; -use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -use Payplug\Authentication; use libphonenumber\PhoneNumberType; use libphonenumber\PhoneNumberUtil; +use Payplug\PayplugWoocommerce\Controller\PayplugGenericGateway; +use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; // Exit if accessed directly if (!defined('ABSPATH')) { @@ -15,74 +14,53 @@ /** * PayPlug WooCommerce Gateway. - * - * @package Payplug\PayplugWoocommerce\Gateway */ class PayplugGatewayOney3x extends PayplugGenericGateway { const ONEY_UNAVAILABLE_CODE_COUNTRY_NOT_ALLOWED = 2; const ONEY_UNAVAILABLE_CODE_CART_SIZE_TOO_HIGH = 3; - const ONEY_DISALBE_CHECKOUT_OPTIONS = 4; + const ONEY_DISALBE_CHECKOUT_OPTIONS = 4; const ONEY_PRODUCT_QUANTITY_MAXIMUM = 1000; - - protected $oney_response; - const ENABLE_ON_TEST_MODE = true; + const ENABLE_ON_TEST_MODE = true; public $allowed_country_codes = []; + protected $oney_response; + public function __construct() { parent::__construct(); - $this->id = 'oney_x3_with_fees'; - $this->method_title = _x('PayPlug Oney 3x', 'Gateway method title', 'payplug'); + $this->id = 'oney_x3_with_fees'; + $this->method_title = _x('PayPlug Oney 3x', 'Gateway method title', 'payplug'); $this->method_description = __('Enable PayPlug Oney 3x for your customers.', 'payplug'); - $this->title = __('Pay by card in 3x with Oney', 'payplug'); - $this->has_fields = false; + $this->title = __('Pay by card in 3x with Oney', 'payplug'); + $this->has_fields = false; add_action('woocommerce_order_item_add_action_buttons', [$this, 'oney_refund_text']); - add_action('woocommerce_after_checkout_validation', [$this, 'validate_checkout'], 10); + add_action('woocommerce_after_checkout_validation', [$this, 'validate_checkout'], 10); self::set_oney_configuration(); - if (is_checkout()) { - if ($this->check_oney_is_available() === self::ONEY_DISALBE_CHECKOUT_OPTIONS) { - $this->enabled = 'no'; - } - } - - } - - public function validate_checkout(){ - - $posted_data = $this->get_post_data(); - - if( in_array($posted_data['payment_method'], ["oney_x3_with_fees","oney_x4_with_fees", "oney_x3_without_fees", "oney_x4_without_fees"] ) ){ - if ($this->check_oney_is_available() === self::ONEY_UNAVAILABLE_CODE_COUNTRY_NOT_ALLOWED) { - throw new \Exception(__('Unavailable for the specified country.')); - - } else if ($this->check_oney_is_available() === self::ONEY_UNAVAILABLE_CODE_CART_SIZE_TOO_HIGH) { - throw new \Exception(sprintf(__('The payment with Oney is unavailable because you have more than %s items in your cart.', 'payplug'), self::ONEY_PRODUCT_QUANTITY_MAXIMUM)); - - } else if(!$this->check_oney_is_available()){ - throw new \Exception(sprintf(__('The total amount of your order should be between %s€ and %s€ to pay with Oney.', 'payplug'), $this->oney_thresholds_min , $this->oney_thresholds_max )); - } - } - } + if (is_checkout()) { + if (self::ONEY_DISALBE_CHECKOUT_OPTIONS === $this->check_oney_is_available()) { + $this->enabled = 'no'; + } + } + } - /** - * Set oney settings - * - * @return void - */ - private function set_oney_configuration() + public function validate_checkout() { - $account = PayplugWoocommerceHelper::get_account_data_from_options(); - if ($account) { - $oney_configuration = $account['configuration']['oney']; - $this->min_oney_price = $oney_configuration['min_amounts']['EUR'] / 100; - $this->max_oney_price = $oney_configuration['max_amounts']['EUR'] / 100; - $this->allowed_country_codes = $oney_configuration['allowed_countries']; + $posted_data = $this->get_post_data(); + + if (in_array($posted_data['payment_method'], ['oney_x3_with_fees', 'oney_x4_with_fees', 'oney_x3_without_fees', 'oney_x4_without_fees'])) { + if (self::ONEY_UNAVAILABLE_CODE_COUNTRY_NOT_ALLOWED === $this->check_oney_is_available()) { + throw new \Exception(__('Unavailable for the specified country.')); + } elseif (self::ONEY_UNAVAILABLE_CODE_CART_SIZE_TOO_HIGH === $this->check_oney_is_available()) { + throw new \Exception(sprintf(__('The payment with Oney is unavailable because you have more than %s items in your cart.', 'payplug'), self::ONEY_PRODUCT_QUANTITY_MAXIMUM)); + } elseif (!$this->check_oney_is_available()) { + throw new \Exception(sprintf(__('The total amount of your order should be between %s€ and %s€ to pay with Oney.', 'payplug'), $this->oney_thresholds_min, $this->oney_thresholds_max)); + } } } @@ -93,23 +71,22 @@ private function set_oney_configuration() */ public function get_icon() { - - $disable=''; - if ($this->check_oney_is_available() === true) { + $disable = ''; + if (true === $this->check_oney_is_available()) { $total_price = floatval(WC()->cart->total); $this->oney_response = $this->api->simulate_oney_payment($total_price, 'with_fees'); $currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency')); - $total_price_oney = floatval($this->oney_response['x3_with_fees']['down_payment_amount']); - foreach ($this->oney_response['x3_with_fees']['installments'] as $installment) { - $total_price_oney = $total_price_oney + floatval($installment['amount']); - } + $total_price_oney = floatval($this->oney_response['x3_with_fees']['down_payment_amount']); + foreach ($this->oney_response['x3_with_fees']['installments'] as $installment) { + $total_price_oney = $total_price_oney + floatval($installment['amount']); + } $f = function ($fn) { return $fn; }; - $tax_cost = floatval($this->oney_response['x3_with_fees']['total_cost']) / 100; + $tax_cost = floatval($this->oney_response['x3_with_fees']['total_cost']) / 100; - if(is_array($this->oney_response)) { + if (is_array($this->oney_response)) { $this->description = <<
    @@ -136,12 +113,11 @@ public function get_icon() } else { $this->description = $this->oney_response; } - } else { - $disable='disable-checkout-icons'; + $disable = 'disable-checkout-icons'; } - $available_img = 'x3_with_fees.svg'; + $available_img = 'x3_with_fees.svg'; $icons = apply_filters('payplug_payment_icons', [ 'payplug' => sprintf('Oney 3x', esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $available_img)), @@ -150,77 +126,79 @@ public function get_icon() foreach ($icons as $icon) { $icons_str .= $icon; } + return $icons_str; } /** - * Check if Oney is available + * Check if Oney is available. * * @return false - */ + */ public function check_oney_is_available() { $cart = WC()->cart; - //for backend orders - if( !empty(get_query_var('order-pay')) ){ - $order = wc_get_order(get_query_var('order-pay')); + //for backend orders + if (!empty(get_query_var('order-pay'))) { + $order = wc_get_order(get_query_var('order-pay')); - //wc_get_order @return bool|WC_Order|WC_Order_Refund - if($order === false){ - return false; - } + //wc_get_order @return bool|WC_Order|WC_Order_Refund + if (false === $order) { + return false; + } - $items = $order->get_items(); + $items = $order->get_items(); - $country_code_shipping = $order->get_shipping_country(); - $country_code_billing = $order->get_billing_country(); + $country_code_shipping = $order->get_shipping_country(); + $country_code_billing = $order->get_billing_country(); - $this->order_items_to_cart($cart, $items); - } + $this->order_items_to_cart($cart, $items); + } - if(empty($cart->total)){ - return false; - } + if (empty($cart->total)) { + return false; + } - if(empty($cart->cart_contents_count)){ - return false; - } + if (empty($cart->cart_contents_count)) { + return false; + } $total_price = floatval($cart->total); - $products_qty = (int) $cart->cart_contents_count; + $products_qty = (int) $cart->cart_contents_count; - // Min and max + // Min and max if ($total_price < $this->oney_thresholds_min || $total_price > $this->oney_thresholds_max) { - $this->description = '
    '.sprintf(__('The total amount of your order should be between %s€ and %s€ to pay with Oney.', 'payplug'), $this->oney_thresholds_min , $this->oney_thresholds_max ).'
    '; + $this->description = '
    ' . sprintf(__('The total amount of your order should be between %s€ and %s€ to pay with Oney.', 'payplug'), $this->oney_thresholds_min, $this->oney_thresholds_max) . '
    '; + return false; } // Cart check if ($products_qty >= self::ONEY_PRODUCT_QUANTITY_MAXIMUM) { - $this->description = '
    '.sprintf(__('The payment with Oney is unavailable because you have more than %s items in your cart.', 'payplug'), self::ONEY_PRODUCT_QUANTITY_MAXIMUM).'
    '; + $this->description = '
    ' . sprintf(__('The payment with Oney is unavailable because you have more than %s items in your cart.', 'payplug'), self::ONEY_PRODUCT_QUANTITY_MAXIMUM) . '
    '; + return self::ONEY_UNAVAILABLE_CODE_CART_SIZE_TOO_HIGH; } // Country check - if( empty($country_code_shipping) || empty($country_code_shipping) ){ - $country_code_shipping = WC()->customer->get_shipping_country(); - $country_code_billing = WC()->customer->get_billing_country(); - } - + if (empty($country_code_shipping) || empty($country_code_shipping)) { + $country_code_shipping = WC()->customer->get_shipping_country(); + $country_code_billing = WC()->customer->get_billing_country(); + } - //WOOC-663 exception for the description to be visible - //billing allowed? - if ( $this->allowed_country($country_code_billing, $this->allowed_country_codes) ) { + //WOOC-663 exception for the description to be visible + //billing allowed? + if ($this->allowed_country($country_code_billing, $this->allowed_country_codes)) { + //if shipping is different from billing and billing is accepted + if (!$this->validate_shipping_billing_country($country_code_shipping, $country_code_billing)) { + $this->description = '
    ' . __('Unavailable for the specified country.', 'payplug') . '
    '; - //if shipping is different from billing and billing is accepted - if(!$this->validate_shipping_billing_country($country_code_shipping, $country_code_billing)){ - $this->description = '
    '.__('Unavailable for the specified country.', 'payplug').'
    '; - return self::ONEY_UNAVAILABLE_CODE_COUNTRY_NOT_ALLOWED; - } - }else{ - return self::ONEY_DISALBE_CHECKOUT_OPTIONS; - } + return self::ONEY_UNAVAILABLE_CODE_COUNTRY_NOT_ALLOWED; + } + } else { + return self::ONEY_DISALBE_CHECKOUT_OPTIONS; + } return true; } @@ -249,92 +227,94 @@ public function validate_order_amount($amount) * @param int $amount * @param int $customer_id * - * @return array * @throws \Exception + * + * @return array */ public function process_standard_payment($order, $amount, $customer_id) { $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + try { if (!$this->check_oney_is_available()) { throw new \Exception(__('Payment processing failed. Please retry.', 'payplug')); - } elseif ($this->check_oney_is_available() === self::ONEY_UNAVAILABLE_CODE_COUNTRY_NOT_ALLOWED) { + } elseif (self::ONEY_UNAVAILABLE_CODE_COUNTRY_NOT_ALLOWED === $this->check_oney_is_available()) { $country_code = WC()->customer->get_shipping_country(); + throw new \Exception(__('Unavailable for the specified country.')); - } elseif ($this->check_oney_is_available() === self::ONEY_UNAVAILABLE_CODE_CART_SIZE_TOO_HIGH) { + } elseif (self::ONEY_UNAVAILABLE_CODE_CART_SIZE_TOO_HIGH === $this->check_oney_is_available()) { throw new \Exception(sprintf(__('The payment with Oney is unavailable because you have more than %s items in your cart.', 'payplug'), self::ONEY_PRODUCT_QUANTITY_MAXIMUM)); } $country = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_country : $order->get_billing_country(); - $phone = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_phone : $order->get_billing_phone(); - $billing_email = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_email : $order->get_billing_email(); + $phone = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_phone : $order->get_billing_phone(); + $billing_email = PayplugWoocommerceHelper::is_pre_30() ? $order->billing_email : $order->get_billing_email(); $phone_number_util = PhoneNumberUtil::getInstance(); - $phone_number = $phone_number_util->parse( $phone, $country ); - if ( PhoneNumberType::MOBILE !== $phone_number_util->getNumberType( $phone_number ) ) { + $phone_number = $phone_number_util->parse($phone, $country); + if (PhoneNumberType::MOBILE !== $phone_number_util->getNumberType($phone_number)) { throw new \Exception(__('Mobile phone number fullfilled is invalid. Please retry.', 'payplug')); } - if (!filter_var($billing_email, FILTER_VALIDATE_EMAIL) || strpos($billing_email,'+') !== false) { - throw new \Exception(__("Your email address is too long and the + character is not valid, please change it to another address (max 100 characters).", 'payplug')); + if (!filter_var($billing_email, FILTER_VALIDATE_EMAIL) || false !== strpos($billing_email, '+')) { + throw new \Exception(__('Your email address is too long and the + character is not valid, please change it to another address (max 100 characters).', 'payplug')); } $address_data = PayplugAddressData::from_order($order); - $return_url = esc_url_raw($order->get_checkout_order_received_url()); + $return_url = esc_url_raw($order->get_checkout_order_received_url()); - if (!(substr( $return_url, 0, 4 ) === "http")) { - $return_url = get_site_url().$return_url; - } + if (!('http' === substr($return_url, 0, 4))) { + $return_url = get_site_url() . $return_url; + } $cart_items = []; $items = $order->get_items(); - foreach($items as $item) { + foreach ($items as $item) { $data = $item->get_data(); $total = floatval(round($data['total'], 2)) * 100; $cart_items[] = [ 'delivery_label' => 'storepickup', 'delivery_type' => 'storepickup', 'brand' => 'Woocommerce', - 'merchant_item_id' => 'cart-'.$data['id'].'-'.$data['product_id'], + 'merchant_item_id' => 'cart-' . $data['id'] . '-' . $data['product_id'], 'name' => $data['name'], 'expected_delivery_date' => date('Y-m-d'), 'total_amount' => (int) $total, - 'price' => round($total / $data['quantity']), - 'quantity' => $data['quantity'] + 'price' => round($total / $data['quantity']), + 'quantity' => $data['quantity'], ]; } $payment_data = [ 'authorized_amount' => $amount, - 'auto_capture' => true, - 'currency' => get_woocommerce_currency(), - 'payment_method' => $this->id, - 'billing' => $address_data->get_billing(), - 'shipping' => $address_data->get_shipping(), - 'payment_context' => [ - "cart" => $cart_items + 'auto_capture' => true, + 'currency' => get_woocommerce_currency(), + 'payment_method' => $this->id, + 'billing' => $address_data->get_billing(), + 'shipping' => $address_data->get_shipping(), + 'payment_context' => [ + 'cart' => $cart_items, ], 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), - 'hosted_payment' => [ + 'hosted_payment' => [ 'return_url' => $return_url, 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), ], - 'metadata' => [ - 'order_id' => $order_id, + 'metadata' => [ + 'order_id' => $order_id, 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', - 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), + 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), ], ]; - if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { - $payment_data['metadata']['woocommerce_block'] = "CHECKOUT"; - - } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { - $payment_data['metadata']['woocommerce_block'] = "CART"; - } + if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { + $payment_data['metadata']['woocommerce_block'] = 'CHECKOUT'; + } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { + $payment_data['metadata']['woocommerce_block'] = 'CART'; + } /** - * Filter the payment data before it's used + * Filter the payment data before it's used. * * @param array $payment_data * @param int $order_id @@ -342,7 +322,7 @@ public function process_standard_payment($order, $amount, $customer_id) * @param PayplugAddressData $address_data */ $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); - $payment = $this->api->payment_create($payment_data); + $payment = $this->api->payment_create($payment_data); // Save transaction id for the order PayplugWoocommerceHelper::is_pre_30() @@ -353,7 +333,7 @@ public function process_standard_payment($order, $amount, $customer_id) $order->save(); } - /** + /* * Fires once a payment has been created. * * @param int $order_id Order ID @@ -367,65 +347,66 @@ public function process_standard_payment($order, $amount, $customer_id) PayplugGateway::log(sprintf('Payment creation complete for order #%s', $order_id)); return [ - 'result' => 'success', + 'result' => 'success', 'redirect' => $payment->hosted_payment->payment_url, - 'cancel' => $payment->hosted_payment->cancel_url, + 'cancel' => $payment->hosted_payment->cancel_url, ]; } catch (\HttpException $e) { PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, wc_print_r($e->getErrorObject(), true)), 'error'); + throw new \Exception(__($e->getMessage(), 'payplug')); } catch (\Exception $e) { PayplugGateway::log(sprintf('Error while processing order #%s : %s', $order_id, $e->getMessage()), 'error'); + throw new \Exception(__($e->getMessage(), 'payplug')); } } - /** - * Check if the gatteway is allowed for the order amount + * Check if the gatteway is allowed for the order amount. * * @param array + * @param mixed $gateways + * * @return array */ public function check_gateway($gateways) { if (isset($gateways[$this->id]) && $gateways[$this->id]->id == $this->id) { + //remove gateway if thresholds/country criteria are not met + if (false === $this->check_oney_is_available()) { + unset($gateways[$this->id]); + } - //remove gateway if thresholds/country criteria are not met - if( $this->check_oney_is_available() === false){ - unset($gateways[$this->id]); - } - - //remove gateway if account doesn't have permission + //remove gateway if account doesn't have permission if (!PayplugWoocommerceHelper::is_oney_available()) { unset($gateways[$this->id]); - } else { - $gateways = parent::check_gateway($gateways); + $gateways = parent::check_gateway($gateways); } } + return $gateways; } /** - * Show Oney refund text + * Show Oney refund text. * - * @return void + * @param mixed $order */ public function oney_refund_text($order) { - if ($this->id === $order->get_payment_method() && parent::can_refund_order($order) && $order->get_status() !== "refunded" && $this->api) { + if ($this->id === $order->get_payment_method() && parent::can_refund_order($order) && 'refunded' !== $order->get_status() && $this->api) { $order_metadata = $order->get_meta('_payplug_metadata'); - if ( is_array($order_metadata) && !empty($order_metadata['transaction_id']) ){ - $payment = $this->api->payment_retrieve($order_metadata['transaction_id']); - $today = current_time('Y-m-d H:i:s'); - $can_refund_date = date('Y-m-d H:i:s', $payment->__get('refundable_after')); - if ($can_refund_date >= $today) { - echo "

    " . __('Refund will be possible 48 hours after the last payment or refund transaction.', 'payplug') . "

    "; - } - } - + if (is_array($order_metadata) && !empty($order_metadata['transaction_id'])) { + $payment = $this->api->payment_retrieve($order_metadata['transaction_id']); + $today = current_time('Y-m-d H:i:s'); + $can_refund_date = date('Y-m-d H:i:s', $payment->__get('refundable_after')); + if ($can_refund_date >= $today) { + echo "

    " . __('Refund will be possible 48 hours after the last payment or refund transaction.', 'payplug') . '

    '; + } + } } } @@ -437,62 +418,78 @@ public function payment_fields() } } - /** - * - * Billing and shipping addresses should have the same country and allowed by Oney - * https://payplug-prod.atlassian.net/browse/WOOC-227 - * - * @param $order - * @return bool - * - */ - public function validate_shipping_billing_country($shipping_country, $billing_country) - { - if($billing_country === $shipping_country) - return true; - - return false; - } - - /** - * Country of billing or shipping at oney payments should be on the allowedCountry that comes from pauyplug-api /account - * - * @param string $country - * @param array $allowed - * @return bool - */ - public function allowed_country($country, $allowed) - { - if( in_array($country, $allowed)) - return true; - - return false; - } - - /** - * Empty the cart and add all order_items - * - * @param $cart - * @param $items - * @return void - */ - private function order_items_to_cart($cart, $items){ - $cart->empty_cart(); - foreach ($items as $item){ - $cart->add_to_cart($item->get_product_id(), $item->get_quantity(), $item->get_variation_id()); - } - } - - public function checkGateway() { - - $options = PayplugWoocommerceHelper::get_payplug_options(); - - if (empty($options) || !isset($options['oney'] ) || $options['oney'] === 'no') { - return false; - } - - return true; - - } + /** + * Billing and shipping addresses should have the same country and allowed by Oney + * https://payplug-prod.atlassian.net/browse/WOOC-227. + * + * @param $order + * @param mixed $shipping_country + * @param mixed $billing_country + * + * @return bool + */ + public function validate_shipping_billing_country($shipping_country, $billing_country) + { + if ($billing_country === $shipping_country) { + return true; + } + + return false; + } + + /** + * Country of billing or shipping at oney payments should be on the allowedCountry that comes from pauyplug-api /account. + * + * @param string $country + * @param array $allowed + * + * @return bool + */ + public function allowed_country($country, $allowed) + { + if (in_array($country, $allowed)) { + return true; + } + + return false; + } + + public function checkGateway() + { + $options = PayplugWoocommerceHelper::get_payplug_options(); + + if (empty($options) || !isset($options['oney']) || 'no' === $options['oney']) { + return false; + } + + return true; + } + + /** + * Set oney settings. + */ + private function set_oney_configuration() + { + $account = PayplugWoocommerceHelper::get_account_data_from_options(); + if ($account) { + $oney_configuration = $account['configuration']['oney']; + $this->min_oney_price = $oney_configuration['min_amounts']['EUR'] / 100; + $this->max_oney_price = $oney_configuration['max_amounts']['EUR'] / 100; + $this->allowed_country_codes = $oney_configuration['allowed_countries']; + } + } + /** + * Empty the cart and add all order_items. + * + * @param $cart + * @param $items + */ + private function order_items_to_cart($cart, $items) + { + $cart->empty_cart(); + foreach ($items as $item) { + $cart->add_to_cart($item->get_product_id(), $item->get_quantity(), $item->get_variation_id()); + } + } } diff --git a/src/Gateway/PayplugGatewayOney3xWithoutFees.php b/src/Gateway/PayplugGatewayOney3xWithoutFees.php index 41af8e92..c577b519 100644 --- a/src/Gateway/PayplugGatewayOney3xWithoutFees.php +++ b/src/Gateway/PayplugGatewayOney3xWithoutFees.php @@ -11,20 +11,17 @@ /** * PayPlug WooCommerce Gateway. - * - * @package Payplug\PayplugWoocommerce\Gateway */ class PayplugGatewayOney3xWithoutFees extends PayplugGatewayOney3x { - public function __construct() { parent::__construct(); - $this->id = 'oney_x3_without_fees'; - $this->method_title = _x('PayPlug Oney 3x', 'Gateway method title', 'payplug'); + $this->id = 'oney_x3_without_fees'; + $this->method_title = _x('PayPlug Oney 3x', 'Gateway method title', 'payplug'); $this->method_description = __('Enable PayPlug Oney 3x for your customers.', 'payplug'); - $this->title = __('Pay by credit card in 3x installments without fees with Oney', 'payplug'); - $this->has_fields = false; + $this->title = __('Pay by credit card in 3x installments without fees with Oney', 'payplug'); + $this->has_fields = false; } /** @@ -34,27 +31,25 @@ public function __construct() */ public function get_icon() { - $disable=''; - if ($this->check_oney_is_available() === true) { - $total_price = floatval(WC()->cart->total); - $this->oney_response = $this->api->simulate_oney_payment($total_price,'without_fees'); + $disable = ''; + if (true === $this->check_oney_is_available()) { + $total_price = floatval(WC()->cart->total); + $this->oney_response = $this->api->simulate_oney_payment($total_price, 'without_fees'); - if( empty($this->oney_response)){ - $disable='disable-checkout-icons'; - } + if (empty($this->oney_response)) { + $disable = 'disable-checkout-icons'; + } $currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency')); $f = function ($fn) { return $fn; }; - - if(is_array($this->oney_response)) { - - $total_price_oney = floatval($this->oney_response['x3_without_fees']['down_payment_amount']); - foreach ($this->oney_response['x3_without_fees']['installments'] as $installment) { - $total_price_oney = $total_price_oney + floatval($installment['amount']); - } + if (is_array($this->oney_response)) { + $total_price_oney = floatval($this->oney_response['x3_without_fees']['down_payment_amount']); + foreach ($this->oney_response['x3_without_fees']['installments'] as $installment) { + $total_price_oney = $total_price_oney + floatval($installment['amount']); + } $this->description = << @@ -80,17 +75,17 @@ public function get_icon() } else { $this->description = $this->oney_response; } - }else{ - $disable='disable-checkout-icons'; - } + } else { + $disable = 'disable-checkout-icons'; + } - $country = PayplugWoocommerceHelper::getISOCountryCode(); + $country = PayplugWoocommerceHelper::getISOCountryCode(); - if( file_exists(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_' . $country . '.svg') ){ - $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_' . $country . '.svg'; - }else{ - $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_FR.svg'; - } + if (file_exists(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_' . $country . '.svg')) { + $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_' . $country . '.svg'; + } else { + $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_FR.svg'; + } $icons = apply_filters('payplug_payment_icons', [ 'payplug' => sprintf('Oney 3x', esc_url($image)), @@ -99,6 +94,7 @@ public function get_icon() foreach ($icons as $icon) { $icons_str .= $icon; } + return $icons_str; } } diff --git a/src/Gateway/PayplugGatewayOney4x.php b/src/Gateway/PayplugGatewayOney4x.php index 8536279b..e739c436 100644 --- a/src/Gateway/PayplugGatewayOney4x.php +++ b/src/Gateway/PayplugGatewayOney4x.php @@ -9,20 +9,17 @@ /** * PayPlug WooCommerce Gateway. - * - * @package Payplug\PayplugWoocommerce\Gateway */ class PayplugGatewayOney4x extends PayplugGatewayOney3x { - public function __construct() { parent::__construct(); - $this->id = 'oney_x4_with_fees'; - $this->method_title = _x('PayPlug Oney 4x', 'Gateway method title', 'payplug'); + $this->id = 'oney_x4_with_fees'; + $this->method_title = _x('PayPlug Oney 4x', 'Gateway method title', 'payplug'); $this->method_description = __('Enable PayPlug Oney 4x for your customers.', 'payplug'); - $this->title = __('Pay by card in 4x with Oney', 'payplug'); - $this->has_fields = false; + $this->title = __('Pay by card in 4x with Oney', 'payplug'); + $this->has_fields = false; } /** @@ -32,21 +29,21 @@ public function __construct() */ public function get_icon() { - if ($this->check_oney_is_available() === true) { - $total_price = floatval(WC()->cart->total); - $this->oney_response = $this->api->simulate_oney_payment($total_price, 'with_fees'); + if (true === $this->check_oney_is_available()) { + $total_price = floatval(WC()->cart->total); + $this->oney_response = $this->api->simulate_oney_payment($total_price, 'with_fees'); $currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency')); - $total_price_oney = floatval($this->oney_response['x4_with_fees']['down_payment_amount']); - foreach ($this->oney_response['x4_with_fees']['installments'] as $installment) { - $total_price_oney = $total_price_oney + floatval($installment['amount']); - } + $total_price_oney = floatval($this->oney_response['x4_with_fees']['down_payment_amount']); + foreach ($this->oney_response['x4_with_fees']['installments'] as $installment) { + $total_price_oney = $total_price_oney + floatval($installment['amount']); + } - $tax_cost = floatval($this->oney_response['x4_with_fees']['total_cost']) / 100; - $disable=''; + $tax_cost = floatval($this->oney_response['x4_with_fees']['total_cost']) / 100; + $disable = ''; $f = function ($fn) { return $fn; }; - if(is_array($this->oney_response)) { + if (is_array($this->oney_response)) { $this->description = <<
    @@ -77,9 +74,9 @@ public function get_icon() } else { $this->description = $this->oney_response; } - }else { - $disable='disable-checkout-icons'; - } + } else { + $disable = 'disable-checkout-icons'; + } $available_img = 'x4_with_fees.svg'; $icons = apply_filters('payplug_payment_icons', [ @@ -89,6 +86,7 @@ public function get_icon() foreach ($icons as $icon) { $icons_str .= $icon; } + return $icons_str; } } diff --git a/src/Gateway/PayplugGatewayOney4xWithoutFees.php b/src/Gateway/PayplugGatewayOney4xWithoutFees.php index ca16ba17..6de4aff6 100644 --- a/src/Gateway/PayplugGatewayOney4xWithoutFees.php +++ b/src/Gateway/PayplugGatewayOney4xWithoutFees.php @@ -11,20 +11,17 @@ /** * PayPlug WooCommerce Gateway. - * - * @package Payplug\PayplugWoocommerce\Gateway */ class PayplugGatewayOney4xWithoutFees extends PayplugGatewayOney3x { - public function __construct() { parent::__construct(); - $this->id = 'oney_x4_without_fees'; - $this->method_title = _x('PayPlug Oney 4x', 'Gateway method title', 'payplug'); + $this->id = 'oney_x4_without_fees'; + $this->method_title = _x('PayPlug Oney 4x', 'Gateway method title', 'payplug'); $this->method_description = __('Enable PayPlug Oney 4x for your customers.', 'payplug'); - $this->title = __('Pay by credit card in 4x installments without fees with Oney', 'payplug'); - $this->has_fields = false; + $this->title = __('Pay by credit card in 4x installments without fees with Oney', 'payplug'); + $this->has_fields = false; } /** @@ -34,21 +31,21 @@ public function __construct() */ public function get_icon() { - $disable = ''; - if ($this->check_oney_is_available() === true) { - $total_price = floatval(WC()->cart->total); - $this->oney_response = $this->api->simulate_oney_payment($total_price, 'without_fees'); + $disable = ''; + if (true === $this->check_oney_is_available()) { + $total_price = floatval(WC()->cart->total); + $this->oney_response = $this->api->simulate_oney_payment($total_price, 'without_fees'); $currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency')); $f = function ($fn) { return $fn; }; - $total_price_oney = floatval($this->oney_response['x4_without_fees']['down_payment_amount']); - foreach ($this->oney_response['x4_without_fees']['installments'] as $installment) { - $total_price_oney = $total_price_oney + floatval($installment['amount']); - } + $total_price_oney = floatval($this->oney_response['x4_without_fees']['down_payment_amount']); + foreach ($this->oney_response['x4_without_fees']['installments'] as $installment) { + $total_price_oney = $total_price_oney + floatval($installment['amount']); + } - if(is_array($this->oney_response)) { + if (is_array($this->oney_response)) { $this->description = <<
    {$f(__('oney_total', 'payplug'))}
    @@ -77,25 +74,26 @@ public function get_icon() } else { $this->description = $this->oney_response; } - }else{ - $disable='disable-checkout-icons'; - } + } else { + $disable = 'disable-checkout-icons'; + } - $country = PayplugWoocommerceHelper::getISOCountryCode(); + $country = PayplugWoocommerceHelper::getISOCountryCode(); - if( file_exists(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x4_without_fees_' . $country . '.svg') ){ - $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x4_without_fees_' . $country . '.svg'; - }else{ - $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x4_without_fees_FR.svg'; - } + if (file_exists(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x4_without_fees_' . $country . '.svg')) { + $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x4_without_fees_' . $country . '.svg'; + } else { + $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x4_without_fees_FR.svg'; + } $icons = apply_filters('payplug_payment_icons', [ - 'payplug' => sprintf('Oney 4x', esc_url( $image )), + 'payplug' => sprintf('Oney 4x', esc_url($image)), ]); $icons_str = ''; foreach ($icons as $icon) { $icons_str .= $icon; } + return $icons_str; } } diff --git a/src/Gateway/PayplugGatewayRequirements.php b/src/Gateway/PayplugGatewayRequirements.php index 383be91f..1aa5548d 100644 --- a/src/Gateway/PayplugGatewayRequirements.php +++ b/src/Gateway/PayplugGatewayRequirements.php @@ -3,160 +3,166 @@ namespace Payplug\PayplugWoocommerce\Gateway; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; - // Exit if accessed directly -use const OPENSSL_VERSION_TEXT; use const PHP_VERSION; -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } -class PayplugGatewayRequirements { - - const PHP_MIN = '5.6'; - const OPENSSL_MIN = 268439567; - const OPENSSL_MIN_TEXT = 'OpenSSL 1.0.1 14 Mar 2012'; - - /** - * @var PayplugGateway - */ - private $gateway; - - /** - * Gateway settings. - * - * @var array - */ - protected $settings; - - /** - * PayplugGatewayRequirements constructor. - * - * @param PayplugGateway $gateway - */ - public function __construct( PayplugGateway $gateway ) { - $this->gateway = $gateway; - $this->settings = PayplugWoocommerceHelper::get_payplug_options(); - } - - /** - * Check if all gateway requirements are fulfilled. - * - * @return bool - */ - public function satisfy_requirements() { - return $this->valid_php() - && $this->valid_curl() - && $this->valid_openssl() - && $this->valid_currency() - && $this->valid_account(); - } - - /** - * @return array - */ - public function curl_requirement() { - return array( - "status" => $this->valid_curl(), - "text" => __("payplug_section_status_curl", "payplug") - ); - } - - /** - * @return array - */ - public function php_requirement() { - return array( - "status" => $this->valid_php(), - "text" => __("payplug_section_status_php", "payplug") - ); - - } - - /** - * @return array - */ - public function openssl_requirement() { - return array( - "status" => $this->valid_openssl(), - "text" => __("payplug_section_status_ssl", "payplug") - ); - } - - /** - * @return array - */ - public function currency_requirement() { - return array( - "status" => $this->valid_currency(), - "text" => __("payplug_section_status_currency", "payplug") - ); - } - - /** - * @return array - */ - public function account_requirement() { - return array( - "status" => $this->valid_account(), - "text" => __("payplug_section_status_account", "payplug") - ); - } - - /** - * Check if CURL is available and support SSL - * - * @return bool - */ - public function valid_curl() { - if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) ) { - return false; - } - - // Also Check for SSL support - $curl_version = curl_version(); - if ( ! ( CURL_VERSION_SSL & $curl_version['features'] ) ) { - return false; - } - - return true; - } - - /** - * Check if PHP version is equal or above the minimum supported. - * - * @return bool - */ - public function valid_php() { - return version_compare( PHP_VERSION, self::PHP_MIN, '>=' ); - } - - /** - * Check if OPENSSL version is equal or above the minimum supported. - * - * @return bool - */ - public function valid_openssl() { - return OPENSSL_VERSION_NUMBER >= self::OPENSSL_MIN; - } - - /** - * Check if the shop currency is Euro. - * - * @return bool - */ - public function valid_currency() { - return 'EUR' === get_woocommerce_currency(); - } - - /** - * Check if the user is logged in. - * - * @return bool - */ - public function valid_account() { - return $this->gateway->user_logged_in(); - } - +class PayplugGatewayRequirements +{ + const PHP_MIN = '5.6'; + const OPENSSL_MIN = 268439567; + const OPENSSL_MIN_TEXT = 'OpenSSL 1.0.1 14 Mar 2012'; + + /** + * Gateway settings. + * + * @var array + */ + protected $settings; + + /** + * @var PayplugGateway + */ + private $gateway; + + /** + * PayplugGatewayRequirements constructor. + */ + public function __construct(PayplugGateway $gateway) + { + $this->gateway = $gateway; + $this->settings = PayplugWoocommerceHelper::get_payplug_options(); + } + + /** + * Check if all gateway requirements are fulfilled. + * + * @return bool + */ + public function satisfy_requirements() + { + return $this->valid_php() + && $this->valid_curl() + && $this->valid_openssl() + && $this->valid_currency() + && $this->valid_account(); + } + + /** + * @return array + */ + public function curl_requirement() + { + return [ + 'status' => $this->valid_curl(), + 'text' => __('payplug_section_status_curl', 'payplug'), + ]; + } + + /** + * @return array + */ + public function php_requirement() + { + return [ + 'status' => $this->valid_php(), + 'text' => __('payplug_section_status_php', 'payplug'), + ]; + } + + /** + * @return array + */ + public function openssl_requirement() + { + return [ + 'status' => $this->valid_openssl(), + 'text' => __('payplug_section_status_ssl', 'payplug'), + ]; + } + + /** + * @return array + */ + public function currency_requirement() + { + return [ + 'status' => $this->valid_currency(), + 'text' => __('payplug_section_status_currency', 'payplug'), + ]; + } + + /** + * @return array + */ + public function account_requirement() + { + return [ + 'status' => $this->valid_account(), + 'text' => __('payplug_section_status_account', 'payplug'), + ]; + } + + /** + * Check if CURL is available and support SSL. + * + * @return bool + */ + public function valid_curl() + { + if (!function_exists('curl_init') || !function_exists('curl_exec')) { + return false; + } + + // Also Check for SSL support + $curl_version = curl_version(); + if (!(CURL_VERSION_SSL & $curl_version['features'])) { + return false; + } + + return true; + } + + /** + * Check if PHP version is equal or above the minimum supported. + * + * @return bool + */ + public function valid_php() + { + return version_compare(PHP_VERSION, self::PHP_MIN, '>='); + } + + /** + * Check if OPENSSL version is equal or above the minimum supported. + * + * @return bool + */ + public function valid_openssl() + { + return OPENSSL_VERSION_NUMBER >= self::OPENSSL_MIN; + } + + /** + * Check if the shop currency is Euro. + * + * @return bool + */ + public function valid_currency() + { + return 'EUR' === get_woocommerce_currency(); + } + + /** + * Check if the user is logged in. + * + * @return bool + */ + public function valid_account() + { + return $this->gateway->user_logged_in(); + } } diff --git a/src/Gateway/PayplugIpnResponse.php b/src/Gateway/PayplugIpnResponse.php index 9f1280fb..20944ad9 100644 --- a/src/Gateway/PayplugIpnResponse.php +++ b/src/Gateway/PayplugIpnResponse.php @@ -3,100 +3,104 @@ namespace Payplug\PayplugWoocommerce\Gateway; // Exit if accessed directly -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } use Payplug\Exception\UnknownAPIResourceException; use Payplug\Notification; use Payplug\PayplugWoocommerce\Model\Lock; -use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; use Payplug\Resource\IVerifiableAPIResource; -use WC_Payment_Token_CC; - -class PayplugIpnResponse { - - private $gateway; - - /** - * PayplugIpnResponse constructor. - * - * @param PayplugGateway $gateway - */ - public function __construct( $gateway ) { - $this->gateway = $gateway; - add_action( 'woocommerce_api_paypluggateway', [ $this, 'handle_ipn_response' ] ); - } - - public function handle_ipn_response() { - $input = file_get_contents( 'php://input' ); - - try { - $resource = Notification::treat( $input ); - } catch ( UnknownAPIResourceException $e ) { - PayplugGateway::log( sprintf( 'Error while parsing IPN payload : %s', $e->getMessage() ), 'error' ); - exit; - } - - if ( ! $this->validate_ipn( $resource ) ) { - PayplugGateway::log( sprintf( 'Resource %s is not supported (Transaction %s).', wc_clean( $resource->object ), wc_clean( $resource->id ) ), 'error' ); - exit; - } - - if ( ! method_exists( $this, sprintf( 'process_%s_resource', wc_clean( $resource->object ) ) ) ) { - PayplugGateway::log( sprintf( 'No method found to process resource %s (Transaction %s).', wc_clean( $resource->object ), wc_clean( $resource->id ) ), 'error' ); - exit; - } - - call_user_func( [ $this, sprintf( 'process_%s_resource', $resource->object ) ], $resource ); - exit; - } - - /** - * Validate IPN notification. - * - * @param IVerifiableAPIResource $resource - * - * @return bool - */ - public function validate_ipn( $resource ) { - return isset( $resource->object ) && in_array( $resource->object, [ 'payment', 'refund' ] ); - } - - /** - * Process payment notification. - * - * @param $resource - * - * @return void - * @throws \WC_Data_Exception - */ - public function process_payment_resource( $resource, $save_request = true ) { - - $lock_id = \Payplug\PayplugWoocommerce\Helper\Lock::handle_insert($save_request, $resource->id); - if(!$lock_id){ - return; - } - - $this->gateway->response->process_payment( $resource, false, "ipn" ); - - Lock::delete_lock($lock_id); - $waiting_requests = Lock::get_lock_by_payment_id($resource->id); - - if($waiting_requests){ - Lock::delete_lock_by_payment_id($resource->id); - $this->gateway->validate_payment($resource->metadata['order_id'], false, true); - }; - - - } - - /** - * Process refund notification. - * - * @param $resource - */ - public function process_refund_resource( $resource ) { - $this->gateway->response->process_refund( $resource ); - } + +class PayplugIpnResponse +{ + private $gateway; + + /** + * PayplugIpnResponse constructor. + * + * @param PayplugGateway $gateway + */ + public function __construct($gateway) + { + $this->gateway = $gateway; + add_action('woocommerce_api_paypluggateway', [$this, 'handle_ipn_response']); + } + + public function handle_ipn_response() + { + $input = file_get_contents('php://input'); + + try { + $resource = Notification::treat($input); + } catch (UnknownAPIResourceException $e) { + PayplugGateway::log(sprintf('Error while parsing IPN payload : %s', $e->getMessage()), 'error'); + + exit; + } + + if (!$this->validate_ipn($resource)) { + PayplugGateway::log(sprintf('Resource %s is not supported (Transaction %s).', wc_clean($resource->object), wc_clean($resource->id)), 'error'); + + exit; + } + + if (!method_exists($this, sprintf('process_%s_resource', wc_clean($resource->object)))) { + PayplugGateway::log(sprintf('No method found to process resource %s (Transaction %s).', wc_clean($resource->object), wc_clean($resource->id)), 'error'); + + exit; + } + + call_user_func([$this, sprintf('process_%s_resource', $resource->object)], $resource); + + exit; + } + + /** + * Validate IPN notification. + * + * @param IVerifiableAPIResource $resource + * + * @return bool + */ + public function validate_ipn($resource) + { + return isset($resource->object) && in_array($resource->object, ['payment', 'refund']); + } + + /** + * Process payment notification. + * + * @param $resource + * @param mixed $save_request + * + * @throws \WC_Data_Exception + */ + public function process_payment_resource($resource, $save_request = true) + { + $lock_id = \Payplug\PayplugWoocommerce\Helper\Lock::handle_insert($save_request, $resource->id); + if (!$lock_id) { + return; + } + + $this->gateway->response->process_payment($resource, false, 'ipn'); + + Lock::delete_lock($lock_id); + $waiting_requests = Lock::get_lock_by_payment_id($resource->id); + + if ($waiting_requests) { + Lock::delete_lock_by_payment_id($resource->id); + $this->gateway->validate_payment($resource->metadata['order_id'], false, true); + } + } + + /** + * Process refund notification. + * + * @param $resource + */ + public function process_refund_resource($resource) + { + $this->gateway->response->process_refund($resource); + } } diff --git a/src/Gateway/PayplugPermissions.php b/src/Gateway/PayplugPermissions.php index f818d771..c7b6af7a 100644 --- a/src/Gateway/PayplugPermissions.php +++ b/src/Gateway/PayplugPermissions.php @@ -3,30 +3,28 @@ namespace Payplug\PayplugWoocommerce\Gateway; // Exit if accessed directly -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } - -use Payplug\Payplug; use Payplug\Authentication; use Payplug\Exception\PayplugException; +use Payplug\Payplug; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; -class PayplugPermissions { - - const OPTION_NAME = 'payplug_permission'; - const LIVE_MODE = 'use_live_mode'; - const SAVE_CARD = 'can_save_cards'; - const USE_ONEY = 'can_use_oney'; - +class PayplugPermissions +{ + const OPTION_NAME = 'payplug_permission'; + const LIVE_MODE = 'use_live_mode'; + const SAVE_CARD = 'can_save_cards'; + const USE_ONEY = 'can_use_oney'; - /** - * The current mode for the gateway. - * - * @var string - */ - private $gateway_mode; + /** + * The current mode for the gateway. + * + * @var string + */ + private $gateway_mode; /** * The current key for account permissions. @@ -35,98 +33,101 @@ class PayplugPermissions { */ private $current_key; - /** - * @var array - */ - private $permissions; - - /** - * PayplugPermissions constructor. - * - * @param PayplugGateway $gateway - */ - public function __construct( PayplugGateway $gateway) { - $this->gateway_mode = $gateway->get_current_mode(); - if (!isset($gateway->settings['payplug_live_key']) || !isset($gateway->settings['payplug_test_key'])) { - $this->current_key = ''; - } else { - $this->current_key = "live" === $this->gateway_mode ? - $gateway->settings['payplug_live_key'] : $gateway->settings['payplug_test_key']; - } - $this->load_permissions(); - } - - /** - * Get all permissions. - * - * @return array - */ - public function get_permissions() { - return $this->permissions; - } - - /** - * Check if user has specific permission. - * - * @param string $user_can - * - * @return bool - */ - public function has_permissions( $user_can ) { - if ( empty( $user_can ) ) { - return false; - } - - return isset( $this->permissions[ $user_can ] ) && true === $this->permissions[ $user_can ]; - } - - /** - * Delete permissions for the current mode. - * - * @return bool - */ - public function clear_permissions() { - return delete_transient( $this->get_key() ); - } - - /** - * Load permissions for the current mode. - */ - protected function load_permissions() { - $payplug_permissions = get_transient( $this->get_key() ); - if ( ! empty( $payplug_permissions ) ) { - $this->permissions = $payplug_permissions; - - return true; - } - - if(empty($this->current_key)){ - return false; - } - - try { - $response = Authentication::getPermissions(new Payplug($this->current_key)); - $this->permissions = ! empty( $response ) ? $response : []; - set_transient( $this->get_key(), $this->permissions, DAY_IN_SECONDS ); - - return true; - } catch ( PayplugException $e ) { - - //logout - PayplugGateway::log(sprintf('Account request error from PayPlug API : %s', wc_print_r($e->getErrorObject(), true)), 'error'); - PayplugWoocommerceHelper::payplug_logout(); - $this->permissions = []; - } - - return false; - } - - /** - * Build the key to retrieve the permissions. - * - * @return string - */ - protected function get_key() { - return self::OPTION_NAME . '_' . $this->gateway_mode; - } + /** + * @var array + */ + private $permissions; + + /** + * PayplugPermissions constructor. + */ + public function __construct(PayplugGateway $gateway) + { + $this->gateway_mode = $gateway->get_current_mode(); + if (!isset($gateway->settings['payplug_live_key']) || !isset($gateway->settings['payplug_test_key'])) { + $this->current_key = ''; + } else { + $this->current_key = 'live' === $this->gateway_mode ? + $gateway->settings['payplug_live_key'] : $gateway->settings['payplug_test_key']; + } + $this->load_permissions(); + } + + /** + * Get all permissions. + * + * @return array + */ + public function get_permissions() + { + return $this->permissions; + } + + /** + * Check if user has specific permission. + * + * @param string $user_can + * + * @return bool + */ + public function has_permissions($user_can) + { + if (empty($user_can)) { + return false; + } + + return isset($this->permissions[$user_can]) && true === $this->permissions[$user_can]; + } + + /** + * Delete permissions for the current mode. + * + * @return bool + */ + public function clear_permissions() + { + return delete_transient($this->get_key()); + } + + /** + * Load permissions for the current mode. + */ + protected function load_permissions() + { + $payplug_permissions = get_transient($this->get_key()); + if (!empty($payplug_permissions)) { + $this->permissions = $payplug_permissions; + + return true; + } + + if (empty($this->current_key)) { + return false; + } + + try { + $response = Authentication::getPermissions(new Payplug($this->current_key)); + $this->permissions = !empty($response) ? $response : []; + set_transient($this->get_key(), $this->permissions, DAY_IN_SECONDS); + + return true; + } catch (PayplugException $e) { + //logout + PayplugGateway::log(sprintf('Account request error from PayPlug API : %s', wc_print_r($e->getErrorObject(), true)), 'error'); + PayplugWoocommerceHelper::payplug_logout(); + $this->permissions = []; + } + + return false; + } + + /** + * Build the key to retrieve the permissions. + * + * @return string + */ + protected function get_key() + { + return self::OPTION_NAME . '_' . $this->gateway_mode; + } } diff --git a/src/Gateway/PayplugResponse.php b/src/Gateway/PayplugResponse.php index b7d114c6..e6f10364 100644 --- a/src/Gateway/PayplugResponse.php +++ b/src/Gateway/PayplugResponse.php @@ -3,523 +3,532 @@ namespace Payplug\PayplugWoocommerce\Gateway; // Exit if accessed directly -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } +use Automattic\WooCommerce\Utilities\OrderUtil; use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper; use Payplug\Resource\IVerifiableAPIResource; use Payplug\Resource\Payment as PaymentResource; use Payplug\Resource\Refund as RefundResource; -use WC_Payment_Tokens; use WC_Payment_Token_CC; -use Automattic\WooCommerce\Utilities\OrderUtil; +use WC_Payment_Tokens; /** * Process responses from PayPlug. - * - * @package Payplug\PayplugWoocommerce\Gateway */ -class PayplugResponse { - - private $gateway; - - public function __construct( PayplugGateway $gateway ) { - $this->gateway = $gateway; - } - - /** - * Process payment. - * - * @param $resource - * @param $is_payment_with_token - * - * @return void - * @throws \WC_Data_Exception - */ - public function process_payment($resource, $is_payment_with_token = false, $source = "") - { - $order_id = wc_clean($resource->metadata['order_id']); - - $order = wc_get_order($order_id); - $gateway_id = $order->get_payment_method(); - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($resource); - - // Ignore undefined orders - if (!$order) { - PayplugGateway::log(sprintf('Coudn\'t find order #%s (Transaction %s).', $order_id, wc_clean($resource->id)), 'error'); - return; - } - - /** - * - * Checking if it is coming from the order confirmation page or the IPN - * - */ - - if (($gateway_id == $this->gateway->id) || (!empty($source) && ($source === "ipn"))) { - - // Ignore cancelled orders - if ($order->has_status('refunded')) { - PayplugGateway::log(sprintf('Order #%s : '. $this->gateway_name($gateway_id) .' order has been refunded. Ignoring IPN', $order_id)); - return; - } - $paid_date = $order->get_date_paid(); - if( isset($paid_date) && !$order->is_paid()){ - $finished_status = wc_get_is_paid_statuses(); - $order->set_status($finished_status[0]); - } - - // Ignore paid orders - if ( $order->is_paid() ) { - PayplugGateway::log(sprintf('Order #%s : '. $this->gateway_name($gateway_id) .' order is already complete. Ignoring IPN. "' . !empty($source) ? '[IPN]' : ''. '"', $order_id)); - return; - } - - // Handle failed payments - if (!empty($resource->failure)) { - if($order->get_status() != "failed"){ - $order->update_status( 'failed', sprintf(__('PayPlug %s OK | Transaction %s failed : %s', 'payplug'), strtoupper($source), $resource->id, wc_clean($resource->failure->message)) ); - } - - /** This action is documented in src/Gateway/PayplugResponse */ - \do_action('payplug_gateway_payment_response_processed', $order_id, $resource); - PayplugWoocommerceHelper::set_flag_ipn_order($order, $metadata, false); - PayplugGateway::log(sprintf('Order #%s : '. $this->gateway_name($gateway_id) .' payment IPN %s processing completed but failed.', $order_id, $resource->id)); - wc_increase_stock_levels($order); - return; - } - - elseif (( $resource->failure == null ) && !empty($resource->payment_method['is_pending']) - && ( $resource->payment_method['is_pending'] == true )) { - $this->handle_pending_oney( $order, $resource, $source ); - } - - // Save Logs of the payment for the different payment gateways: - // For Oney 4 gateways & Bancontact gateway: "$resource->payment_method" exists and is an array - // but not for Payplug credit card gateway (in this case we check the payment_method from the order itself not the $resource) - if (isset($resource->payment_method) && is_array($resource->payment_method)) { - $gateway_id = $resource->payment_method['type']; - - switch ($gateway_id) { - case substr( $gateway_id, 0, 5 ) === "oney_" : - $this->oney_ipn($resource); - break; - case "bancontact" : - $this->bancontact_ipn($resource, $source); - break; - case "apple_pay" : - $this->apple_pay_ipn($resource, $source); - break; - case "american_express" : - $this->amex_ipn($resource, $source); - break; - } - - } elseif ($gateway_id == "payplug") { - if (!$is_payment_with_token) { - $this->payplug_ipn($resource, $source); - } - - } - - // Handle successful payments - if ($resource->is_paid) { - if (!$is_payment_with_token) { - $this->maybe_save_card($resource); - } - $this->maybe_save_address_hash($resource); - $order->add_order_note(sprintf(__('PayPlug %s OK | Transaction %s', 'payplug'), strtoupper($source) ,wc_clean($resource->id))); - $order->payment_complete(wc_clean($resource->id)); - if (PayplugWoocommerceHelper::is_pre_30()) { - $order->reduce_order_stock(); - } - /** - * Fires once a payment response has been processed. - * - * @param int $order_id Order ID - * @param PaymentResource $resource Payment resource - */ - \do_action('payplug_gateway_payment_response_processed', $order_id, $resource); - PayplugWoocommerceHelper::set_flag_ipn_order($order, $metadata, false); - PayplugGateway::log(sprintf('Order #%s : '. $this->gateway_name($gateway_id) .' payment %s %s processing completed successfully.', strtoupper($source), $order_id, $resource->id)); - } - - } - } - - /** - * - * Handle pending oney payments orders - * - * @param $order - * @param $resource - * - * @return void - */ - - public function handle_pending_oney($order, $resource, $source) { - $order->add_order_note(sprintf(__('PayPlug %s OK | Transaction %s | Payment PENDING to be checked by an Oney agent', 'payplug'), strtoupper($source), wc_clean($resource->id))); - wc_reduce_stock_levels( $order ); - } - - /** - * Payplug IPN - * - * @param $resource - */ - public function payplug_ipn($resource, $source) { - $order_id = wc_clean( $resource->metadata['order_id'] ); - PayplugGateway::log( sprintf( 'Order #%s : Begin processing Payplug payment %s %s', $order_id, strtoupper($source), $resource->id ) ); - } - - /** - * Bancontact IPN - * - * @param $resource - */ - public function bancontact_ipn($resource, $source) { - $order_id = wc_clean( $resource->metadata['order_id'] ); - PayplugGateway::log( sprintf( 'Order #%s : Begin processing Bancontact payment %s %s', $order_id, strtoupper($source), $resource->id ) ); - } - - /** - * Apple Pay IPN - * - * @param $resource - */ - public function apple_pay_ipn($resource, $source) { - $order_id = wc_clean( $resource->metadata['order_id'] ); - PayplugGateway::log( sprintf( 'Order #%s : Begin processing Apple Pay payment %s %s', $order_id, strtoupper($source), $resource->id ) ); - } - - /** - * American Express IPN - * - * @param $resource - */ - public function amex_ipn($resource, $source) { - $order_id = wc_clean( $resource->metadata['order_id'] ); - PayplugGateway::log( sprintf( 'Order #%s : Begin processing Amex payment %s %s', $order_id, strtoupper($source), $resource->id ) ); - } - - /** - * Oney IPN - * - * @param $resource - */ - public function oney_ipn( $resource ) { - $gateway_id = $resource->payment_method['type']; - $order_id = wc_clean( $resource->metadata['order_id'] ); - - if ( ( $resource->is_paid == true ) && ( $resource->failure == null ) ) { - PayplugGateway::log( sprintf( 'Order #%s : '. $this->gateway_name($gateway_id) .' payment SUCCESS', $order_id ) ); - } - - if ( ( $resource->is_paid == false ) && ( $resource->failure != null ) ) { - PayplugGateway::log( sprintf( 'Order #%s : '. $this->gateway_name($gateway_id) .' payment FAILED', $order_id ) ); - } - - if ( ( $resource->is_paid == false ) && ( $resource->failure == null ) && ( $resource->payment_method['is_pending'] == true ) ) { - PayplugGateway::log( sprintf( 'Order #%s : '. $this->gateway_name($gateway_id) .' payment PENDING and checked by an Oney agent', $order_id ) ); - } - } - - /** - * Get the gateway name from the gateway_id - * - * @param $gateway_id - */ - private function gateway_name($gateway_id){ - return ucwords(str_replace("_", " ", $gateway_id)); - } - - /** - * Process refund. - * - * @param $resource - * @param bool $ignore_woocommerce_refund Flag to determine if IPN notification for refunds created by WooCommerce - * should be ignored or not. Default to true. - * - * @throws \Exception - */ - public function process_refund( $resource, $ignore_woocommerce_refund = true ) { - $refund_id = wc_clean( $resource->id ); - $transaction_id = wc_clean( $resource->payment_id ); - $order = $this->get_order_from_transaction_id( $transaction_id ); - if ( ! $order ) { - PayplugGateway::log( sprintf( 'Coudn\'t find order for transaction %s (Refund %s).', wc_clean( $resource->payment_id ), wc_clean( $resource->id ) ), 'error' ); - - return; - } - $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); - - PayplugGateway::log( sprintf( 'Order #%s : Begin processing refund IPN %s', $order_id, $resource->id ) ); - - $refund_exist = $this->refund_exist_for_order( $order_id, $refund_id ); - if ( $refund_exist ) { - PayplugGateway::log( sprintf( 'Order #%s : Refund has already been processed. Ignoring IPN.', $order_id ) ); - - return; - } - - // Since refund notification doesn't contain the full resource, we need to retrieve - // the refund resource to access its metadata. - try { - $refund = $this->gateway->api->refund_retrieve( $transaction_id, $refund_id ); - } catch ( \Exception $e ) { - PayplugGateway::log( sprintf( 'Order #%s : Fail to retrieve refund data with error %s', $order_id, $e->getMessage() ) ); - - return; - } - - if ( - $ignore_woocommerce_refund - && isset( $refund->metadata['refund_from'] ) - && 'woocommerce' === $refund->metadata['refund_from'] - ) { - PayplugGateway::log( sprintf( 'Order #%s : Refund created by WooCommerce. Ignoring IPN.', $order_id ) ); - - return; - } - - $refund = wc_create_refund( [ - 'amount' => ( (int) $resource->amount ) / 100, - 'reason' => isset( $resource->metadata['reason'] ) ? $resource->metadata['reason'] : null, - 'order_id' => (int) $order_id, - 'refund_id' => 0, - 'refund_payment' => false, - ] ); - if ( is_wp_error( $refund ) ) { - PayplugGateway::log( $refund->get_error_message() ); - } - - $refund_meta_key = sprintf( '_pr_%s', wc_clean( $resource->id ) ); - if ( PayplugWoocommerceHelper::is_pre_30() ) { - update_post_meta( $order_id, $refund_meta_key, $resource->id ); - } else { - $order->add_meta_data( $refund_meta_key, $resource->id, true ); - $order->save(); - } - - $note = sprintf( __( 'Refund %s : Refunded %s', 'payplug' ), wc_clean( $resource->id ), wc_price( ( (int) $resource->amount ) / 100 ) ); - if ( ! empty( $resource->metadata['reason'] ) ) { - $note .= sprintf( ' (%s)', esc_html( $resource->metadata['reason'] ) ); - } - $order->add_order_note( $note ); - - /** - * Fires once a refund response has been processed. - * - * @param int $order_id Order ID - * @param RefundResource $resource Refund resource - */ - \do_action( 'payplug_gateway_refund_response_processed', $order_id, $resource ); - - try { - $payment = $this->gateway->api->payment_retrieve( $transaction_id ); - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata( $payment ); - PayplugWoocommerceHelper::save_transaction_metadata( $order, $metadata ); - } catch ( \Exception $e ) {} - - PayplugGateway::log( sprintf( 'Order #%s : Refund IPN %s processing completed.', $order_id, $resource->id ) ); - } - - /** - * Get an order from its transaction id. - * - * @param int $transaction_id - * - * @return bool|\WC_Order - */ - protected function get_order_from_transaction_id( $transaction_id ) { - global $wpdb; - - if ( OrderUtil::custom_orders_table_usage_is_enabled() ) { - - $orders = wc_get_orders( - array( - 'field_query' => array( - array( - 'field' => 'transaction_id', - 'value' => $transaction_id - ), - ), - ) - ); - $order = $orders[0]; - $order_id = $order->get_id(); - //$sql = "SELECT o.id FROM $wpdb->wc_orders o WHERE o.transaction_id = %s"; - - }else{ - $order_id = $wpdb->get_var( - $wpdb->prepare( - "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_transaction_id' AND meta_value = %s", - $transaction_id - ) - ); - } - - return ! is_null( $order_id ) ? wc_get_order( $order_id ) : false; - } - - /** - * Check if a refund id already exist for the order. - * - * @param string $refund_id - * - * @return bool - */ - protected function refund_exist_for_order( $order_id, $refund_id ) { - global $wpdb; - - if ( OrderUtil::custom_orders_table_usage_is_enabled() ) { - - $results = wc_get_orders( - array( - 'meta_query' => array( - array( - 'field_query' => array( - 'relation' => 'AND', - array( - 'field' => 'meta_key', - 'value' => '_pr_' . esc_sql( $refund_id ), - ), - array( - 'field' => 'meta_value', - 'value' => $refund_id - ), - array( - 'field' => 'order_id', - 'value' => (int) $order_id - ), - ) - ) - ), - ) - ); - - }else{ - $sql = " +class PayplugResponse +{ + private $gateway; + + public function __construct(PayplugGateway $gateway) + { + $this->gateway = $gateway; + } + + /** + * Process payment. + * + * @param $resource + * @param $is_payment_with_token + * @param mixed $source + * + * @throws \WC_Data_Exception + */ + public function process_payment($resource, $is_payment_with_token = false, $source = '') + { + $order_id = wc_clean($resource->metadata['order_id']); + + $order = wc_get_order($order_id); + $gateway_id = $order->get_payment_method(); + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($resource); + + // Ignore undefined orders + if (!$order) { + PayplugGateway::log(sprintf('Coudn\'t find order #%s (Transaction %s).', $order_id, wc_clean($resource->id)), 'error'); + + return; + } + + // Checking if it is coming from the order confirmation page or the IPN + + if (($gateway_id == $this->gateway->id) || (!empty($source) && ('ipn' === $source))) { + // Ignore cancelled orders + if ($order->has_status('refunded')) { + PayplugGateway::log(sprintf('Order #%s : ' . $this->gateway_name($gateway_id) . ' order has been refunded. Ignoring IPN', $order_id)); + + return; + } + $paid_date = $order->get_date_paid(); + if (isset($paid_date) && !$order->is_paid()) { + $finished_status = wc_get_is_paid_statuses(); + $order->set_status($finished_status[0]); + } + + // Ignore paid orders + if ($order->is_paid()) { + PayplugGateway::log(sprintf('Order #%s : ' . $this->gateway_name($gateway_id) . ' order is already complete. Ignoring IPN. "' . !empty($source) ? '[IPN]' : '' . '"', $order_id)); + + return; + } + + // Handle failed payments + if (!empty($resource->failure)) { + if ('failed' != $order->get_status()) { + $order->update_status('failed', sprintf(__('PayPlug %s OK | Transaction %s failed : %s', 'payplug'), strtoupper($source), $resource->id, wc_clean($resource->failure->message))); + } + + // This action is documented in src/Gateway/PayplugResponse + \do_action('payplug_gateway_payment_response_processed', $order_id, $resource); + PayplugWoocommerceHelper::set_flag_ipn_order($order, $metadata, false); + PayplugGateway::log(sprintf('Order #%s : ' . $this->gateway_name($gateway_id) . ' payment IPN %s processing completed but failed.', $order_id, $resource->id)); + wc_increase_stock_levels($order); + + return; + } elseif ((null == $resource->failure) && !empty($resource->payment_method['is_pending']) + && (true == $resource->payment_method['is_pending'])) { + $this->handle_pending_oney($order, $resource, $source); + } + + // Save Logs of the payment for the different payment gateways: + // For Oney 4 gateways & Bancontact gateway: "$resource->payment_method" exists and is an array + // but not for Payplug credit card gateway (in this case we check the payment_method from the order itself not the $resource) + if (isset($resource->payment_method) && is_array($resource->payment_method)) { + $gateway_id = $resource->payment_method['type']; + + switch ($gateway_id) { + case 'oney_' === substr($gateway_id, 0, 5): + $this->oney_ipn($resource); + + break; + + case 'bancontact': + $this->bancontact_ipn($resource, $source); + + break; + + case 'apple_pay': + $this->apple_pay_ipn($resource, $source); + + break; + + case 'american_express': + $this->amex_ipn($resource, $source); + + break; + } + } elseif ('payplug' == $gateway_id) { + if (!$is_payment_with_token) { + $this->payplug_ipn($resource, $source); + } + } + + // Handle successful payments + if ($resource->is_paid) { + if (!$is_payment_with_token) { + $this->maybe_save_card($resource); + } + $this->maybe_save_address_hash($resource); + $order->add_order_note(sprintf(__('PayPlug %s OK | Transaction %s', 'payplug'), strtoupper($source), wc_clean($resource->id))); + $order->payment_complete(wc_clean($resource->id)); + if (PayplugWoocommerceHelper::is_pre_30()) { + $order->reduce_order_stock(); + } + /* + * Fires once a payment response has been processed. + * + * @param int $order_id Order ID + * @param PaymentResource $resource Payment resource + */ + \do_action('payplug_gateway_payment_response_processed', $order_id, $resource); + PayplugWoocommerceHelper::set_flag_ipn_order($order, $metadata, false); + PayplugGateway::log(sprintf('Order #%s : ' . $this->gateway_name($gateway_id) . ' payment %s %s processing completed successfully.', strtoupper($source), $order_id, $resource->id)); + } + } + } + + /** + * Handle pending oney payments orders. + * + * @param $order + * @param $resource + * @param mixed $source + */ + public function handle_pending_oney($order, $resource, $source) + { + $order->add_order_note(sprintf(__('PayPlug %s OK | Transaction %s | Payment PENDING to be checked by an Oney agent', 'payplug'), strtoupper($source), wc_clean($resource->id))); + wc_reduce_stock_levels($order); + } + + /** + * Payplug IPN. + * + * @param $resource + * @param mixed $source + */ + public function payplug_ipn($resource, $source) + { + $order_id = wc_clean($resource->metadata['order_id']); + PayplugGateway::log(sprintf('Order #%s : Begin processing Payplug payment %s %s', $order_id, strtoupper($source), $resource->id)); + } + + /** + * Bancontact IPN. + * + * @param $resource + * @param mixed $source + */ + public function bancontact_ipn($resource, $source) + { + $order_id = wc_clean($resource->metadata['order_id']); + PayplugGateway::log(sprintf('Order #%s : Begin processing Bancontact payment %s %s', $order_id, strtoupper($source), $resource->id)); + } + + /** + * Apple Pay IPN. + * + * @param $resource + * @param mixed $source + */ + public function apple_pay_ipn($resource, $source) + { + $order_id = wc_clean($resource->metadata['order_id']); + PayplugGateway::log(sprintf('Order #%s : Begin processing Apple Pay payment %s %s', $order_id, strtoupper($source), $resource->id)); + } + + /** + * American Express IPN. + * + * @param $resource + * @param mixed $source + */ + public function amex_ipn($resource, $source) + { + $order_id = wc_clean($resource->metadata['order_id']); + PayplugGateway::log(sprintf('Order #%s : Begin processing Amex payment %s %s', $order_id, strtoupper($source), $resource->id)); + } + + /** + * Oney IPN. + * + * @param $resource + */ + public function oney_ipn($resource) + { + $gateway_id = $resource->payment_method['type']; + $order_id = wc_clean($resource->metadata['order_id']); + + if ((true == $resource->is_paid) && (null == $resource->failure)) { + PayplugGateway::log(sprintf('Order #%s : ' . $this->gateway_name($gateway_id) . ' payment SUCCESS', $order_id)); + } + + if ((false == $resource->is_paid) && (null != $resource->failure)) { + PayplugGateway::log(sprintf('Order #%s : ' . $this->gateway_name($gateway_id) . ' payment FAILED', $order_id)); + } + + if ((false == $resource->is_paid) && (null == $resource->failure) && (true == $resource->payment_method['is_pending'])) { + PayplugGateway::log(sprintf('Order #%s : ' . $this->gateway_name($gateway_id) . ' payment PENDING and checked by an Oney agent', $order_id)); + } + } + + /** + * Process refund. + * + * @param $resource + * @param bool $ignore_woocommerce_refund Flag to determine if IPN notification for refunds created by WooCommerce + * should be ignored or not. Default to true. + * + * @throws \Exception + */ + public function process_refund($resource, $ignore_woocommerce_refund = true) + { + $refund_id = wc_clean($resource->id); + $transaction_id = wc_clean($resource->payment_id); + $order = $this->get_order_from_transaction_id($transaction_id); + if (!$order) { + PayplugGateway::log(sprintf('Coudn\'t find order for transaction %s (Refund %s).', wc_clean($resource->payment_id), wc_clean($resource->id)), 'error'); + + return; + } + $order_id = PayplugWoocommerceHelper::is_pre_30() ? $order->id : $order->get_id(); + + PayplugGateway::log(sprintf('Order #%s : Begin processing refund IPN %s', $order_id, $resource->id)); + + $refund_exist = $this->refund_exist_for_order($order_id, $refund_id); + if ($refund_exist) { + PayplugGateway::log(sprintf('Order #%s : Refund has already been processed. Ignoring IPN.', $order_id)); + + return; + } + + // Since refund notification doesn't contain the full resource, we need to retrieve + // the refund resource to access its metadata. + try { + $refund = $this->gateway->api->refund_retrieve($transaction_id, $refund_id); + } catch (\Exception $e) { + PayplugGateway::log(sprintf('Order #%s : Fail to retrieve refund data with error %s', $order_id, $e->getMessage())); + + return; + } + + if ( + $ignore_woocommerce_refund + && isset($refund->metadata['refund_from']) + && 'woocommerce' === $refund->metadata['refund_from'] + ) { + PayplugGateway::log(sprintf('Order #%s : Refund created by WooCommerce. Ignoring IPN.', $order_id)); + + return; + } + + $refund = wc_create_refund([ + 'amount' => ((int) $resource->amount) / 100, + 'reason' => isset($resource->metadata['reason']) ? $resource->metadata['reason'] : null, + 'order_id' => (int) $order_id, + 'refund_id' => 0, + 'refund_payment' => false, + ]); + if (is_wp_error($refund)) { + PayplugGateway::log($refund->get_error_message()); + } + + $refund_meta_key = sprintf('_pr_%s', wc_clean($resource->id)); + if (PayplugWoocommerceHelper::is_pre_30()) { + update_post_meta($order_id, $refund_meta_key, $resource->id); + } else { + $order->add_meta_data($refund_meta_key, $resource->id, true); + $order->save(); + } + + $note = sprintf(__('Refund %s : Refunded %s', 'payplug'), wc_clean($resource->id), wc_price(((int) $resource->amount) / 100)); + if (!empty($resource->metadata['reason'])) { + $note .= sprintf(' (%s)', esc_html($resource->metadata['reason'])); + } + $order->add_order_note($note); + + /* + * Fires once a refund response has been processed. + * + * @param int $order_id Order ID + * @param RefundResource $resource Refund resource + */ + \do_action('payplug_gateway_refund_response_processed', $order_id, $resource); + + try { + $payment = $this->gateway->api->payment_retrieve($transaction_id); + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); + } catch (\Exception $e) { + } + + PayplugGateway::log(sprintf('Order #%s : Refund IPN %s processing completed.', $order_id, $resource->id)); + } + + /** + * Get an order from its transaction id. + * + * @param int $transaction_id + * + * @return bool|\WC_Order + */ + protected function get_order_from_transaction_id($transaction_id) + { + global $wpdb; + + if (OrderUtil::custom_orders_table_usage_is_enabled()) { + $orders = wc_get_orders( + [ + 'field_query' => [ + [ + 'field' => 'transaction_id', + 'value' => $transaction_id, + ], + ], + ] + ); + $order = $orders[0]; + $order_id = $order->get_id(); + //$sql = "SELECT o.id FROM $wpdb->wc_orders o WHERE o.transaction_id = %s"; + } else { + $order_id = $wpdb->get_var( + $wpdb->prepare( + "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '_transaction_id' AND meta_value = %s", + $transaction_id + ) + ); + } + + return !is_null($order_id) ? wc_get_order($order_id) : false; + } + + /** + * Check if a refund id already exist for the order. + * + * @param string $refund_id + * @param mixed $order_id + * + * @return bool + */ + protected function refund_exist_for_order($order_id, $refund_id) + { + global $wpdb; + + if (OrderUtil::custom_orders_table_usage_is_enabled()) { + $results = wc_get_orders( + [ + 'meta_query' => [ + [ + 'field_query' => [ + 'relation' => 'AND', + [ + 'field' => 'meta_key', + 'value' => '_pr_' . esc_sql($refund_id), + ], + [ + 'field' => 'meta_value', + 'value' => $refund_id, + ], + [ + 'field' => 'order_id', + 'value' => (int) $order_id, + ], + ], + ], + ], + ] + ); + } else { + $sql = " SELECT p.ID - FROM $wpdb->posts p - INNER JOIN $wpdb->postmeta pm + FROM {$wpdb->posts} p + INNER JOIN {$wpdb->postmeta} pm ON p.ID = pm.post_id WHERE 1=1 AND p.post_type = %s AND p.ID = %d - AND pm.meta_key LIKE '_pr_" . esc_sql( $refund_id ) . "' + AND pm.meta_key LIKE '_pr_" . esc_sql($refund_id) . "' AND pm.meta_value = %s LIMIT 1 "; - $results = $wpdb->get_col( - $wpdb->prepare( - $sql, - 'shop_order', - (int) $order_id, - $refund_id - ) - ); - } - - return ! empty( $results ) ? true : false; - } - - /** - * Save card from the transaction. - * - * @param IVerifiableAPIResource $resource - * - * @return bool - */ - protected function maybe_save_card( $resource ) { - - if ( ! isset( $resource->card ) || empty( $resource->card->id ) ) { - return false; - } - - if ( ! isset( $resource->metadata['customer_id'] ) ) { - return false; - } - - $customer = get_user_by( 'id', $resource->metadata['customer_id'] ); - if ( ! $customer || 0 === (int) $customer->ID ) { - return false; - } - - $merchant_id = $this->gateway->get_merchant_id(); - if ( empty( $merchant_id ) ) { - return false; - } - - PayplugGateway::log( sprintf( 'Saving card from transaction %s for customer %s', wc_clean( $resource->id ), $customer->ID ) ); + $results = $wpdb->get_col( + $wpdb->prepare( + $sql, + 'shop_order', + (int) $order_id, + $refund_id + ) + ); + } + + return !empty($results) ? true : false; + } + + /** + * Save card from the transaction. + * + * @param IVerifiableAPIResource $resource + * + * @return bool + */ + protected function maybe_save_card($resource) + { + if (!isset($resource->card) || empty($resource->card->id)) { + return false; + } + + if (!isset($resource->metadata['customer_id'])) { + return false; + } + + $customer = get_user_by('id', $resource->metadata['customer_id']); + if (!$customer || 0 === (int) $customer->ID) { + return false; + } + + $merchant_id = $this->gateway->get_merchant_id(); + if (empty($merchant_id)) { + return false; + } + + PayplugGateway::log(sprintf('Saving card from transaction %s for customer %s', wc_clean($resource->id), $customer->ID)); $token = new WC_Payment_Token_CC(); - $existing_tokens = WC_Payment_Tokens::get_customer_tokens( $customer->ID , $this->gateway->id ); - $set_token = wc_clean( $resource->card->id ); - $set_last4 = wc_clean( $resource->card->last4 ); - $set_expiry_year = wc_clean( $resource->card->exp_year ) ; - $set_expiry_month = zeroise( (int) wc_clean( $resource->card->exp_month ), 2 ) ; - $set_card_type = \strtolower( wc_clean( $resource->card->brand ) ) ; - if(!empty($existing_tokens)) { - foreach($existing_tokens as $token_id => $existing_token) { + $existing_tokens = WC_Payment_Tokens::get_customer_tokens($customer->ID, $this->gateway->id); + $set_token = wc_clean($resource->card->id); + $set_last4 = wc_clean($resource->card->last4); + $set_expiry_year = wc_clean($resource->card->exp_year); + $set_expiry_month = zeroise((int) wc_clean($resource->card->exp_month), 2); + $set_card_type = \strtolower(wc_clean($resource->card->brand)); + if (!empty($existing_tokens)) { + foreach ($existing_tokens as $token_id => $existing_token) { $current_data = $existing_token->get_data(); - if( $current_data['token'] === $set_token && - $current_data['last4'] === $set_last4 && - $current_data['expiry_year'] === $set_expiry_year && - $current_data['expiry_month'] === $set_expiry_month && - $current_data['card_type'] === $set_card_type) { + if ($current_data['token'] === $set_token + && $current_data['last4'] === $set_last4 + && $current_data['expiry_year'] === $set_expiry_year + && $current_data['expiry_month'] === $set_expiry_month + && $current_data['card_type'] === $set_card_type) { $token->set_id($current_data['id']); } } } - $token->set_token( $set_token ); - $token->set_gateway_id( 'payplug' ); - $token->set_last4( $set_last4 ); - $token->set_expiry_year( $set_expiry_year ); - $token->set_expiry_month( $set_expiry_month ); - $token->set_card_type( $set_card_type ); - $token->set_user_id( $customer->ID ); - $token->add_meta_data( 'mode', $resource->is_live ? 'live' : 'test', true ); - $token->add_meta_data( 'payplug_account', \wc_clean( $merchant_id ), true ); - $token->save(); - - PayplugGateway::log( sprintf( 'Payment card saved', wc_clean( $resource->id ), $customer->ID ) ); - - return true; - } - - /** - * Save shipping address. - * - * @param IVerifiableAPIResource $resource - * - * @return bool - */ - protected function maybe_save_address_hash( $resource ) { - - if ( ! isset( $resource->metadata['customer_id'] ) ) { - return false; - } - - $customer = get_user_by( 'id', $resource->metadata['customer_id'] ); - if ( ! $customer || 0 === (int) $customer->ID ) { - return false; - } - - $shipping = []; - foreach ( PayplugAddressData::$address_fields as $field ) { - $shipping[ $field ] = $resource->shipping->{$field}; - } - - $shipping_hash = PayplugAddressData::hash_address( $shipping ); - $hash_list = PayplugAddressData::get_customer_addresses_hash( $customer->ID ); - $hash_list[] = $shipping_hash; - $hash_list = array_unique( $hash_list ); - PayplugAddressData::update_customer_addresses_hash( $customer->ID, $hash_list ); - - return true; - } + $token->set_token($set_token); + $token->set_gateway_id('payplug'); + $token->set_last4($set_last4); + $token->set_expiry_year($set_expiry_year); + $token->set_expiry_month($set_expiry_month); + $token->set_card_type($set_card_type); + $token->set_user_id($customer->ID); + $token->add_meta_data('mode', $resource->is_live ? 'live' : 'test', true); + $token->add_meta_data('payplug_account', \wc_clean($merchant_id), true); + $token->save(); + + PayplugGateway::log(sprintf('Payment card saved', wc_clean($resource->id), $customer->ID)); + + return true; + } + + /** + * Save shipping address. + * + * @param IVerifiableAPIResource $resource + * + * @return bool + */ + protected function maybe_save_address_hash($resource) + { + if (!isset($resource->metadata['customer_id'])) { + return false; + } + + $customer = get_user_by('id', $resource->metadata['customer_id']); + if (!$customer || 0 === (int) $customer->ID) { + return false; + } + + $shipping = []; + foreach (PayplugAddressData::$address_fields as $field) { + $shipping[$field] = $resource->shipping->{$field}; + } + + $shipping_hash = PayplugAddressData::hash_address($shipping); + $hash_list = PayplugAddressData::get_customer_addresses_hash($customer->ID); + $hash_list[] = $shipping_hash; + $hash_list = array_unique($hash_list); + PayplugAddressData::update_customer_addresses_hash($customer->ID, $hash_list); + + return true; + } + + /** + * Get the gateway name from the gateway_id. + * + * @param $gateway_id + */ + private function gateway_name($gateway_id) + { + return ucwords(str_replace('_', ' ', $gateway_id)); + } } diff --git a/src/Helper/Lock.php b/src/Helper/Lock.php index 60b093a1..e3354906 100644 --- a/src/Helper/Lock.php +++ b/src/Helper/Lock.php @@ -2,34 +2,27 @@ namespace Payplug\PayplugWoocommerce\Helper; -use Payplug\PayplugWoocommerce\Gateway\PayplugGateway; - class Lock { - - public static function handle_insert($save, $payment_id ){ - - if($save){ - $lock_id = \Payplug\PayplugWoocommerce\Model\Lock::insert_lock($payment_id); - - //there's a payment being processed this moment - if( \Payplug\PayplugWoocommerce\Model\Lock::locked($payment_id, $lock_id) ){ - return false; - } - - return $lock_id; - - }else{ - //saved request to be processed - $lock = \Payplug\PayplugWoocommerce\Model\Lock::get_lock_by_payment_id($payment_id); - - if(empty($lock->id)){ - return false; - } - - return $lock->id; - } - - } - + public static function handle_insert($save, $payment_id) + { + if ($save) { + $lock_id = \Payplug\PayplugWoocommerce\Model\Lock::insert_lock($payment_id); + + //there's a payment being processed this moment + if (\Payplug\PayplugWoocommerce\Model\Lock::locked($payment_id, $lock_id)) { + return false; + } + + return $lock_id; + } + //saved request to be processed + $lock = \Payplug\PayplugWoocommerce\Model\Lock::get_lock_by_payment_id($payment_id); + + if (empty($lock->id)) { + return false; + } + + return $lock->id; + } } diff --git a/src/Interfaces/PayplugGatewayBuilder.php b/src/Interfaces/PayplugGatewayBuilder.php index 0df82e27..68cd4037 100644 --- a/src/Interfaces/PayplugGatewayBuilder.php +++ b/src/Interfaces/PayplugGatewayBuilder.php @@ -4,15 +4,13 @@ interface PayplugGatewayBuilder { + public function get_icon(); - public function get_icon(); + public function display_notice(); - public function display_notice(); + public function checkGateway(); - public function checkGateway(); - - public function process_standard_payment($order, $amount, $customer_id); - - public function process_admin_options(); + public function process_standard_payment($order, $amount, $customer_id); + public function process_admin_options(); } diff --git a/src/Model/Lock.php b/src/Model/Lock.php index 60cec12e..ecee8435 100644 --- a/src/Model/Lock.php +++ b/src/Model/Lock.php @@ -4,130 +4,140 @@ class Lock { - - /** - * create Lock table - */ - static function create_lock_table(){ - global $wpdb; - - $sql = "CREATE TABLE IF NOT EXISTS `{$wpdb->base_prefix}woocommerce_payplug_lock` ("; - $sql .= " `payment_id` VARCHAR(50) NOT NULL,"; - $sql .= " `created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,"; - $sql .= " PRIMARY KEY (`payment_id`));"; - - $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; - require_once ABSPATH . 'wp-admin/includes/upgrade.php'; - maybe_create_table( $table_name, $sql); - - $result = $wpdb->get_row( - $wpdb->prepare( - "SELECT count(column_name) as column_exists FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{$wpdb->base_prefix}woocommerce_payplug_lock' AND column_name = %s ", ['id'] - ) - ); - - if( !empty($result) && !$result->column_exists){ - static::update_lock_table(); - } - - } - - /** - * update table - */ - static function update_lock_table(){ - global $wpdb; - - $sql = "ALTER TABLE `{$wpdb->base_prefix}woocommerce_payplug_lock` "; - $sql .= " ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT FIRST,"; - $sql .= " DROP PRIMARY KEY,"; - $sql .= " ADD PRIMARY KEY (`id`);"; - $wpdb->query($sql); - - } - - /** - * @param $payment_id - * @return bool|int - */ - static function insert_lock($payment_id){ - global $wpdb; - $wpdb->hide_errors(); - $wpdb->insert($wpdb->base_prefix . 'woocommerce_payplug_lock', array("payment_id" => $payment_id)); - return $wpdb->insert_id; - } - - /** - * @param $id - * @return bool - */ - static function delete_lock($id){ - global $wpdb; - $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; - $wpdb->query( $wpdb->prepare("DELETE FROM {$table_name} WHERE id = %s OR created < NOW() - INTERVAL 1 DAY;", [$id] )); - return true; - } - - /** - * @param $payment_id - * @return bool - */ - static function delete_lock_by_payment_id($payment_id){ - global $wpdb; - $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; - $wpdb->query( $wpdb->prepare("DELETE FROM {$table_name} WHERE payment_id = %s OR created < NOW() - INTERVAL 1 DAY;", [$payment_id] )); - return true; - } - - - /** - * @param $payment_id - * @param $id - * @return bool - */ - static function locked($payment_id, $id){ - global $wpdb; - - $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; - - // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared - $result = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$table_name} WHERE `payment_id` = %s AND `id` <> %s ", array( $payment_id, $id ) ) ); - - if ( empty($result) ) { - return false; - } - - return true; - - } - - /** - * @param $id - * @return bool|int - */ - static function get_lock_by_payment_id($payment_id){ - global $wpdb; - - $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; - - // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared - $result = $wpdb->get_row( $wpdb->prepare( "SELECT id FROM {$table_name} WHERE payment_id = %s", array( $payment_id ) ) ); - if ( !$result ) { - return false; - } - - return $result; - - } - - static function delete_lock_table(){ - global $wpdb; - - $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; - $sql = "DROP TABLE IF EXISTS $table_name;"; - $wpdb->query($sql); - - } - - + /** + * create Lock table. + */ + public static function create_lock_table() + { + global $wpdb; + + $sql = "CREATE TABLE IF NOT EXISTS `{$wpdb->base_prefix}woocommerce_payplug_lock` ("; + $sql .= ' `payment_id` VARCHAR(50) NOT NULL,'; + $sql .= ' `created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,'; + $sql .= ' PRIMARY KEY (`payment_id`));'; + + $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; + + require_once ABSPATH . 'wp-admin/includes/upgrade.php'; + maybe_create_table($table_name, $sql); + + $result = $wpdb->get_row( + $wpdb->prepare( + "SELECT count(column_name) as column_exists FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{$wpdb->base_prefix}woocommerce_payplug_lock' AND column_name = %s ", + ['id'] + ) + ); + + if (!empty($result) && !$result->column_exists) { + static::update_lock_table(); + } + } + + /** + * update table. + */ + public static function update_lock_table() + { + global $wpdb; + + $sql = "ALTER TABLE `{$wpdb->base_prefix}woocommerce_payplug_lock` "; + $sql .= ' ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT FIRST,'; + $sql .= ' DROP PRIMARY KEY,'; + $sql .= ' ADD PRIMARY KEY (`id`);'; + $wpdb->query($sql); + } + + /** + * @param $payment_id + * + * @return bool|int + */ + public static function insert_lock($payment_id) + { + global $wpdb; + $wpdb->hide_errors(); + $wpdb->insert($wpdb->base_prefix . 'woocommerce_payplug_lock', ['payment_id' => $payment_id]); + + return $wpdb->insert_id; + } + + /** + * @param $id + * + * @return bool + */ + public static function delete_lock($id) + { + global $wpdb; + $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; + $wpdb->query($wpdb->prepare("DELETE FROM {$table_name} WHERE id = %s OR created < NOW() - INTERVAL 1 DAY;", [$id])); + + return true; + } + + /** + * @param $payment_id + * + * @return bool + */ + public static function delete_lock_by_payment_id($payment_id) + { + global $wpdb; + $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; + $wpdb->query($wpdb->prepare("DELETE FROM {$table_name} WHERE payment_id = %s OR created < NOW() - INTERVAL 1 DAY;", [$payment_id])); + + return true; + } + + /** + * @param $payment_id + * @param $id + * + * @return bool + */ + public static function locked($payment_id, $id) + { + global $wpdb; + + $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $result = $wpdb->get_row($wpdb->prepare("SELECT id FROM {$table_name} WHERE `payment_id` = %s AND `id` <> %s ", [$payment_id, $id])); + + if (empty($result)) { + return false; + } + + return true; + } + + /** + * @param $id + * @param mixed $payment_id + * + * @return bool|int + */ + public static function get_lock_by_payment_id($payment_id) + { + global $wpdb; + + $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; + + // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared + $result = $wpdb->get_row($wpdb->prepare("SELECT id FROM {$table_name} WHERE payment_id = %s", [$payment_id])); + if (!$result) { + return false; + } + + return $result; + } + + public static function delete_lock_table() + { + global $wpdb; + + $table_name = $wpdb->base_prefix . 'woocommerce_payplug_lock'; + $sql = "DROP TABLE IF EXISTS {$table_name};"; + $wpdb->query($sql); + } } diff --git a/src/PayplugWoocommerce.php b/src/PayplugWoocommerce.php index 07d102b7..8338a614 100644 --- a/src/PayplugWoocommerce.php +++ b/src/PayplugWoocommerce.php @@ -3,8 +3,8 @@ namespace Payplug\PayplugWoocommerce; // Exit if accessed directly -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } use Payplug\PayplugWoocommerce\Admin\Ajax; @@ -12,226 +12,230 @@ use Payplug\PayplugWoocommerce\Admin\Notices; use Payplug\PayplugWoocommerce\Admin\SetupCallback; use Payplug\PayplugWoocommerce\Admin\WoocommerceActions; -use Payplug\PayplugWoocommerce\Controller\ApplePay; use Payplug\PayplugWoocommerce\Front\PayplugOney\Requests\OneyAnimation; -use Payplug\PayplugWoocommerce\Front\PayplugOney\Requests\OneyWithFees; -use Payplug\PayplugWoocommerce\Front\PayplugOney\Requests\OneyWithoutFees; - use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugAmex; use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugApplePay; -use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugCreditCard; use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugBancontact; +use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugCreditCard; +use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugIdeal; use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugMybank; use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugOney3x; use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugOney3xWithoutFees; use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugOney4x; use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugOney4xWithoutFees; use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugSatispay; -use Payplug\PayplugWoocommerce\Gateway\Blocks\PayplugIdeal; -class PayplugWoocommerce { - - /** - * @var PayplugWoocommerce - */ - private static $instance; - - /** - * PayPlug admin notices - * - * @var Notices - */ - public $notices; - - /** - * PayPlug metabox - * - * @var Metabox - */ - public $metabox; - - /** - * Custom woocommerce actions - * - * @var WoocommerceActions - */ - public $actions; - - /** - * @var PayplugWoocommerceRequest - */ - public $requests; - - /** - * Ajax actions handler - * - * @var Ajax - */ - public $ajax; - - /** - * PayPlug Setup authentifications. - * - * @var SetupCallback - */ - public $setup_callback; - - /** - * Get the singleton instance. - * - * @return PayplugWoocommerce - */ - public static function get_instance() { - if ( is_null( self::$instance ) ) { - self::$instance = new static(); - } - - return self::$instance; - } - - /** - * Singleton instance can't be cloned. - */ - private function __clone() { - } - - /** - * Singleton instance can't be serialized. - */ - public function __wakeup() { - } - - /** - * PayplugWoocommerce constructor. - */ - private function __construct() { - - // Bail early if WooCommerce is not activated - if ( ! defined( 'WC_VERSION' ) ) { - add_action( 'admin_notices', function () { - ?> +class PayplugWoocommerce +{ + /** + * PayPlug admin notices. + * + * @var Notices + */ + public $notices; + + /** + * PayPlug metabox. + * + * @var Metabox + */ + public $metabox; + + /** + * Custom woocommerce actions. + * + * @var WoocommerceActions + */ + public $actions; + + /** + * @var PayplugWoocommerceRequest + */ + public $requests; + + /** + * Ajax actions handler. + * + * @var Ajax + */ + public $ajax; + + /** + * PayPlug Setup authentifications. + * + * @var SetupCallback + */ + public $setup_callback; + + /** + * @var PayplugWoocommerce + */ + private static $instance; + + /** + * PayplugWoocommerce constructor. + */ + private function __construct() + { + // Bail early if WooCommerce is not activated + if (!defined('WC_VERSION')) { + add_action('admin_notices', function () { + ?>
    -

    +

    notices = new Notices(); - $this->metabox = new Metabox(); - $this->actions = new WoocommerceActions(); - $this->requests = new PayplugWoocommerceRequest(); - new Front\ApplePay(); - $this->ajax = new Ajax(); - - $this->setup_callback = new SetupCallback(); - - if( PayplugWoocommerceHelper::show_oney_popup() ) { - $this->animationHandlers(); - } - - add_action( 'woocommerce_payment_gateways', [ $this, 'register_payplug_gateway' ] ); - - // Registers WooCommerce Blocks integration. - add_action( 'woocommerce_blocks_loaded', [$this, 'woocommerce_gateways_block_support'] ); - - add_filter( 'plugin_action_links_' . PAYPLUG_GATEWAY_PLUGIN_BASENAME, [ $this, 'plugin_action_links' ] ); - } - - /** - * Register PayPlug gateway. - * - * @param $methods - * - * @return array - */ - public function register_payplug_gateway( $methods ) { - $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugCreditCard'; - $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugGatewayOney3x'; - $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugGatewayOney4x'; - $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugGatewayOney3xWithoutFees'; - $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugGatewayOney4xWithoutFees'; - $methods[] = __NAMESPACE__ . '\\Gateway\\Bancontact'; - $methods[] = __NAMESPACE__ . '\\Gateway\\AmericanExpress'; - $methods[] = __NAMESPACE__ . '\\Gateway\\PPRO\\Mybank'; - $methods[] = __NAMESPACE__ . '\\Gateway\\PPRO\\Ideal'; - $methods[] = __NAMESPACE__ . '\\Gateway\\PPRO\\Satispay'; - - $methods[] = __NAMESPACE__ . '\\Controller\\ApplePay'; - - return $methods; - } - - /** - * Add additional action links. - * - * @param array $links - * - * @return array - */ - public function plugin_action_links( $links = [] ) { - $plugin_links = [ - '' . esc_html__( 'Settings', 'payplug' ) . '', - ]; - - return array_merge( $plugin_links, $links ); - } - - public function animationHandlers() - { - $options = get_option('woocommerce_payplug_settings', []); - - //if live and don't have country setted on the option - if ( !isset($options['payplug_merchant_country']) ) { - $options['payplug_merchant_country'] = PayplugWoocommerceHelper::UpdateCountryOption($options); - } - - //failsafe - if( empty($options['payplug_merchant_country']) || empty($options['oney_type']) ){ - return ; - } - - if( !class_exists( "\\Payplug\\PayplugWoocommerce\\Front\\PayplugOney\\Country\\Oney" .$options['payplug_merchant_country'] )){ - return ; - } - - Switch($options['oney_type']){ - case "without_fees" : $class = "PayplugGatewayOney3xWithoutFees";break; - default: $class = "PayplugGatewayOney3x"; break; - } - new OneyAnimation( $options['oney_type'], $class ); - } - - /** - * Registers WooCommerce Blocks integration. - * - */ - public function woocommerce_gateways_block_support(){ - if ( class_exists( 'Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType' ) ) { - - add_action( - 'woocommerce_blocks_payment_method_type_registration', - function( \Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry ) { - $payment_method_registry->register( new PayplugCreditCard() ); - $payment_method_registry->register( new PayplugBancontact() ); - $payment_method_registry->register( new PayplugSatispay() ); - $payment_method_registry->register( new PayplugAmex() ); - $payment_method_registry->register( new PayplugIdeal() ); - $payment_method_registry->register( new PayplugMybank() ); - $payment_method_registry->register( new PayplugApplePay() ); - $payment_method_registry->register( new PayplugOney3x() ); - $payment_method_registry->register( new PayplugOney4x() ); - $payment_method_registry->register( new PayplugOney3xWithoutFees() ); - $payment_method_registry->register( new PayplugOney4xWithoutFees() ); - } - ); - } - } - + }); + + return; + } + + if (PayplugWoocommerceHelper::is_pre_30()) { + require_once PAYPLUG_GATEWAY_PLUGIN_DIR . '/woocommerce-compat.php'; + } + + $this->notices = new Notices(); + $this->metabox = new Metabox(); + $this->actions = new WoocommerceActions(); + $this->requests = new PayplugWoocommerceRequest(); + new Front\ApplePay(); + $this->ajax = new Ajax(); + + $this->setup_callback = new SetupCallback(); + + if (PayplugWoocommerceHelper::show_oney_popup()) { + $this->animationHandlers(); + } + + add_action('woocommerce_payment_gateways', [$this, 'register_payplug_gateway']); + + // Registers WooCommerce Blocks integration. + add_action('woocommerce_blocks_loaded', [$this, 'woocommerce_gateways_block_support']); + + add_filter('plugin_action_links_' . PAYPLUG_GATEWAY_PLUGIN_BASENAME, [$this, 'plugin_action_links']); + } + + /** + * Singleton instance can't be cloned. + */ + private function __clone() + { + } + + /** + * Singleton instance can't be serialized. + */ + public function __wakeup() + { + } + + /** + * Get the singleton instance. + * + * @return PayplugWoocommerce + */ + public static function get_instance() + { + if (is_null(self::$instance)) { + self::$instance = new static(); + } + + return self::$instance; + } + + /** + * Register PayPlug gateway. + * + * @param $methods + * + * @return array + */ + public function register_payplug_gateway($methods) + { + $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugCreditCard'; + $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugGatewayOney3x'; + $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugGatewayOney4x'; + $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugGatewayOney3xWithoutFees'; + $methods[] = __NAMESPACE__ . '\\Gateway\\PayplugGatewayOney4xWithoutFees'; + $methods[] = __NAMESPACE__ . '\\Gateway\\Bancontact'; + $methods[] = __NAMESPACE__ . '\\Gateway\\AmericanExpress'; + $methods[] = __NAMESPACE__ . '\\Gateway\\PPRO\\Mybank'; + $methods[] = __NAMESPACE__ . '\\Gateway\\PPRO\\Ideal'; + $methods[] = __NAMESPACE__ . '\\Gateway\\PPRO\\Satispay'; + + $methods[] = __NAMESPACE__ . '\\Controller\\ApplePay'; + + return $methods; + } + + /** + * Add additional action links. + * + * @param array $links + * + * @return array + */ + public function plugin_action_links($links = []) + { + $plugin_links = [ + '' . esc_html__('Settings', 'payplug') . '', + ]; + + return array_merge($plugin_links, $links); + } + + public function animationHandlers() + { + $options = get_option('woocommerce_payplug_settings', []); + + //if live and don't have country setted on the option + if (!isset($options['payplug_merchant_country'])) { + $options['payplug_merchant_country'] = PayplugWoocommerceHelper::UpdateCountryOption($options); + } + + //failsafe + if (empty($options['payplug_merchant_country']) || empty($options['oney_type'])) { + return; + } + + if (!class_exists('\\Payplug\\PayplugWoocommerce\\Front\\PayplugOney\\Country\\Oney' . $options['payplug_merchant_country'])) { + return; + } + + switch ($options['oney_type']) { + case 'without_fees' : $class = 'PayplugGatewayOney3xWithoutFees'; + +break; + + default: $class = 'PayplugGatewayOney3x'; + +break; + } + new OneyAnimation($options['oney_type'], $class); + } + + /** + * Registers WooCommerce Blocks integration. + */ + public function woocommerce_gateways_block_support() + { + if (class_exists('Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType')) { + add_action( + 'woocommerce_blocks_payment_method_type_registration', + function (\Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry) { + $payment_method_registry->register(new PayplugCreditCard()); + $payment_method_registry->register(new PayplugBancontact()); + $payment_method_registry->register(new PayplugSatispay()); + $payment_method_registry->register(new PayplugAmex()); + $payment_method_registry->register(new PayplugIdeal()); + $payment_method_registry->register(new PayplugMybank()); + $payment_method_registry->register(new PayplugApplePay()); + $payment_method_registry->register(new PayplugOney3x()); + $payment_method_registry->register(new PayplugOney4x()); + $payment_method_registry->register(new PayplugOney3xWithoutFees()); + $payment_method_registry->register(new PayplugOney4xWithoutFees()); + } + ); + } + } } diff --git a/src/PayplugWoocommerceHelper.php b/src/PayplugWoocommerceHelper.php index 9216a100..4aa53efc 100644 --- a/src/PayplugWoocommerceHelper.php +++ b/src/PayplugWoocommerceHelper.php @@ -3,902 +3,926 @@ namespace Payplug\PayplugWoocommerce; // Exit if accessed directly -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } +use Payplug\Authentication; use Payplug\Exception\ForbiddenException; -use Payplug\PayplugWoocommerce\Gateway\PayplugGateway; -use Payplug\Resource\APIResource; use Payplug\Payplug; -use Payplug\Authentication; +use Payplug\PayplugWoocommerce\Gateway\PayplugGateway; use Payplug\PayplugWoocommerce\Gateway\PayplugGatewayOney3x; use Payplug\PayplugWoocommerce\Gateway\PayplugPermissions; +use Payplug\Resource\APIResource; use WC_Blocks_Utils; use WC_Subscriptions; /** * Helper class. - * - * @package Payplug\PayplugWoocommerce */ -class PayplugWoocommerceHelper { - - /** - * Check if current WooCommerce version is below 3.0.0 - * - * @return bool - */ - public static function is_pre_30() { - $wc = function_exists( 'WC' ) ? WC() : $GLOBALS['woocommerce']; - - return version_compare( $wc->version, '3.0.0', '<' ); - } - - /** - * Get a URL to the PayPlug gateway settings page. - * - * @return string - */ - public static function get_setting_link() { - $use_id_as_section = function_exists( 'WC' ) ? version_compare( WC()->version, '2.6', '>=' ) : false; - $section_slug = $use_id_as_section ? 'payplug' : strtolower( 'PayplugGateway' ); - - return admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=' . $section_slug ); - } - - /** - * Get all country code supported by PayPlug. - * - * Those are ISO 3166-1 alpha-2. You can find more information on https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 - * - * @return array - */ - public static function get_supported_countries() { - return [ - 'AD', - 'AO', - 'AX', - 'BG', - 'BO', - 'BY', - 'CH', - 'CR', - 'DE', - 'EE', - 'FI', - 'GB', - 'GL', - 'GT', - 'HR', - 'IN', - 'JM', - 'KM', - 'KZ', - 'LS', - 'MD', - 'MM', - 'MT', - 'NA', - 'NO', - 'PE', - 'PN', - 'RE', - 'SC', - 'SK', - 'ST', - 'TF', - 'TN', - 'UA', - 'VC', - 'WS', - 'AE', - 'AQ', - 'AZ', - 'BH', - 'BQ', - 'BZ', - 'CI', - 'CU', - 'DJ', - 'EG', - 'FJ', - 'GD', - 'GM', - 'GU', - 'HT', - 'IO', - 'JO', - 'KN', - 'LA', - 'LT', - 'ME', - 'MN', - 'MU', - 'NC', - 'NP', - 'PF', - 'PR', - 'RO', - 'SD', - 'SL', - 'SV', - 'TG', - 'TO', - 'UG', - 'VE', - 'YE', - 'AM', - 'AW', - 'BF', - 'BN', - 'BW', - 'CG', - 'CO', - 'AF', - 'CZ', - 'EC', - 'EU', - 'GA', - 'GI', - 'GS', - 'HN', - 'IM', - 'JE', - 'KI', - 'KY', - 'LR', - 'MC', - 'ML', - 'MS', - 'MZ', - 'NL', - 'PA', - 'PM', - 'QA', - 'SB', - 'SJ', - 'SS', - 'TD', - 'TM', - 'TZ', - 'VA', - 'WF', - 'AR', - 'BA', - 'BI', - 'BR', - 'CA', - 'CK', - 'CV', - 'DK', - 'EH', - 'FK', - 'GE', - 'GN', - 'GW', - 'HU', - 'IQ', - 'JP', - 'KP', - 'LB', - 'LU', - 'MF', - 'MO', - 'MV', - 'NE', - 'NR', - 'PG', - 'PS', - 'RS', - 'SE', - 'SM', - 'SX', - 'TH', - 'TR', - 'UM', - 'VG', - 'YT', - 'AL', - 'AU', - 'BE', - 'BM', - 'BV', - 'CF', - 'CN', - 'CY', - 'DZ', - 'ET', - 'FR', - 'GH', - 'GR', - 'HM', - 'IL', - 'IT', - 'KH', - 'KW', - 'LK', - 'MA', - 'MK', - 'MR', - 'MY', - 'NI', - 'OM', - 'PL', - 'PY', - 'SA', - 'SI', - 'SR', - 'TC', - 'TL', - 'TW', - 'UZ', - 'VU', - 'ZW', - 'AI', - 'AT', - 'BD', - 'BL', - 'BT', - 'CD', - 'CM', - 'CX', - 'DO', - 'ES', - 'FO', - 'GG', - 'GQ', - 'HK', - 'IE', - 'IS', - 'KG', - 'KS', - 'LI', - 'LY', - 'MH', - 'MQ', - 'MX', - 'NG', - 'NZ', - 'PK', - 'PW', - 'RW', - 'SH', - 'SO', - 'SZ', - 'TK', - 'TV', - 'UY', - 'VN', - 'ZM', - 'AG', - 'AS', - 'BB', - 'BJ', - 'BS', - 'CC', - 'CL', - 'CW', - 'DM', - 'ER', - 'FM', - 'GF', - 'GP', - 'GY', - 'ID', - 'IR', - 'KE', - 'KR', - 'LC', - 'LV', - 'MG', - 'MP', - 'MW', - 'NF', - 'NU', - 'PH', - 'PT', - 'RU', - 'SG', - 'SN', - 'SY', - 'TJ', - 'TT', - 'US', - 'VI', - 'ZA' - ]; - } - - /** - * Ensure country code is supported by PayPlug. - * - * @param string $country The ISO 3166-1 alpha-2 code for the country - * - * @return bool - * @author Clément Boirie - */ - public static function is_country_supported( $country ) { - $country = trim( $country ); - if ( empty( $country ) ) { - return false; - } - - return in_array( strtoupper( $country ), self::get_supported_countries() ); - } - - /** - * Get default country. - * - * @return string - */ - public static function get_default_country() { - $country = \WC()->countries->get_base_country(); - - return ( self::is_country_supported( $country ) ) ? strtoupper( $country ) : 'FR'; - } - - /** - * Get minimum amount allowed by PayPlug. - * - * This amount is in cents. - * - * @return int - */ - public static function get_minimum_amount() { - return 99; - } - - /** - * Get maximum amount allowed by PayPlug. - * - * This amount is in cents. - * - * @return int - */ - public static function get_maximum_amount() { - return 2000000; - } - - /** - * Convert amount in cents. - * - * @param float $amount - * - * @return int - */ - public static function get_payplug_amount( $amount ) { - if ( is_null( $amount ) ) { - return $amount; - } - - return absint( wc_format_decimal( ( (float) $amount * 100 ), wc_get_price_decimals() ) ); - } - - /** - * Extract useful metadata from PayPlug response. - * - * @param APIResource $resource - * - * @return array - */ - public static function extract_transaction_metadata( $resource ) { - return [ - 'transaction_id' => sanitize_text_field( $resource->id ), - 'paid' => (bool) $resource->is_paid, - 'refunded' => (bool) $resource->is_refunded, - 'amount' => sanitize_text_field( $resource->amount ), - 'amount_refunded' => sanitize_text_field( $resource->amount_refunded ), - '3ds' => (bool) $resource->is_3ds, - 'live' => (bool) $resource->is_live, - 'paid_at' => isset( $resource->hosted_payment->paid_at ) ? sanitize_text_field( $resource->hosted_payment->paid_at ) : sanitize_text_field( $resource->created_at ), - 'card_last4' => sanitize_text_field( $resource->card->last4 ), - 'card_exp_month' => sanitize_text_field( $resource->card->exp_month ), - 'card_exp_year' => sanitize_text_field( $resource->card->exp_year ), - 'card_brand' => sanitize_text_field( $resource->card->brand ), - 'card_country' => sanitize_text_field( $resource->card->country ), - ]; - } - - /** - * @param \WC_Order $order - * - * @return array|bool - * @author Clément Boirie - */ - public static function get_transaction_metadata( $order ) { - - if ( PayplugWoocommerceHelper::is_pre_30() ) { - return get_post_meta( $order->id, '_payplug_metadata', true ); - } else { - return $order->get_meta( '_payplug_metadata', true ); - } - } - - /** - * Save transaction metadata extracted from PayPlug response. - * - * @param \WC_Order $order - * @param array $metadata - * - * @return void - */ - public static function save_transaction_metadata( $order, $metadata ) { - - if ( PayplugWoocommerceHelper::is_pre_30() ) { - update_post_meta( $order->id, '_payplug_metadata', $metadata ); - } else { - $order->add_meta_data( '_payplug_metadata', $metadata, true ); - $order->save_meta_data(); - - } - } - - /** - * Set flag ipn ( in progress / over ) on order - * - * @param \WC_Order $order - * @param array $metadata - * @param boolean $flag - * - * @return void - */ - public static function set_flag_ipn_order ( $order, $metadata, $flag) { - $metadata['transaction_in_progress'] = $flag; - PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); - } - - /** - * Get transient key from payplug option - * - * @return string - */ - public static function get_transient_key($options) - { - $transient_key = PayplugGateway::OPTION_NAME . (array_key_exists('mode', $options) && $options['mode'] === 'yes' ? "_live" : "_test"); - return $transient_key; - } - - - /** - * Get transient live key from payplug option - * - * @return string - */ - public static function get_live_transient_key() - { - return PayplugGateway::OPTION_NAME . "_live"; - } - - /** - * Set transient data for payplug account - * - * @return string - */ - public static function set_transient_data($data, $options = null) - { - $options = $options ? $options : get_option('woocommerce_payplug_settings', []); - $transient_key = PayplugWoocommerceHelper::get_transient_key($options); - set_transient($transient_key, isset($data['httpResponse']) ? $data['httpResponse'] : []); - } - - /** - * Get current option from payplug settings - * - * @return array - */ - public static function get_account_data_from_options() - { - $options = get_option('woocommerce_payplug_settings', []); - $transient_key = self::get_transient_key($options); - $account = get_transient($transient_key); - - if(empty($account) || !is_array($account) ){ - self::set_account_data_from_options(); - $account = get_transient($transient_key); - } - - return $account; - } - - /** - * Get current option from payplug settings - *this should replace get_account_data_from_options - * - * @return array - */ - public static function generic_get_account_data_from_options($gateway_id){ - $options = get_option('woocommerce_payplug_settings', []); - $transient_key = self::get_transient_key($options); - $account = get_transient($transient_key); - - //if transient is empty, it goes and get the permissions for the customer to populate it - if(empty($account) || !is_array($account) ){ - self::set_account_data_from_options(); - $account = get_transient($transient_key); - } - - if( isset($options[$gateway_id]) && $options[$gateway_id] == "yes"){ - $account['permissions'][$gateway_id] = true; - } - - return $account; - - } - - /** - * Set current option from payplug settings and api call - * - * @return void - */ - public static function set_account_data_from_options() - { - $options = get_option('woocommerce_payplug_settings', []); - $payplug_test_key = !empty($options['payplug_test_key']) ? $options['payplug_test_key'] : ''; - $payplug_live_key = !empty($options['payplug_live_key']) ? $options['payplug_live_key'] : ''; - - if (empty($payplug_test_key) && isset( $options['client_data']['jwt']['test']['access_token'] ) ) { - $payplug_test_key = $options['client_data']['jwt']['test']['access_token']; - } - if (empty($payplug_live_key) && isset( $options['client_data']['jwt']['live']['access_token'] ) ) { - $payplug_live_key = $options['client_data']['jwt']['live']['access_token']; - } - if (empty($payplug_test_key) && empty($payplug_live_key)) { - return array(); - } - - if( $options['mode'] === 'yes' && empty($payplug_live_key) ){ - return array(); - } - - if( $options['mode'] != 'yes' && empty($payplug_test_key)){ - return array(); - } - - try { - $parameters_account = Authentication::getAccount(new Payplug($options['mode'] === 'yes' ? $payplug_live_key : $payplug_test_key)); - self::set_transient_data($parameters_account, $options); - } catch (\Payplug\Exception\UnauthorizedException $e) { - self::exception_handler_400_logout($e->getCode(), __( 'payplug_enable_feature', 'payplug' ), sprintf('Account request error from PayPlug API : %s
    ' . __('Successfully logged out.', 'payplug') . '', wc_print_r($e->getMessage(), true))); - - } catch (\Payplug\Exception\ConfigurationNotSetException $e) { - } catch( \Payplug\Exception\ForbiddenException $e){ - } catch (\Payplug\Exception\ForbiddenException $e){return array();} - - } - - /** - * Get min and max for oney payment - * - * @return array - */ - public static function get_min_max_oney() { - $account = self::get_account_data_from_options(); - if (!$account) { - return array(); - } - return [ - 'min' => floatval($account['configuration']['oney']['min_amounts']['EUR'])/100, - 'max' => floatval($account['configuration']['oney']['max_amounts']['EUR'])/100 - ]; - } - - /** - * Check if oney is available with current settings - * - * @return boolean - */ - public static function is_oney_available() { - $account = self::get_account_data_from_options(); - if (!$account) { - return false; - } - - $options = self::get_payplug_options(); - $oney_active = (isset($options['oney']) && !empty($options['oney'])) ? $options['oney'] : ''; - - return ($account && $account['permissions'][PayplugPermissions::USE_ONEY] == "1" && $oney_active === "yes"); - } - - /** - * Hide popup for if country_code != payplug country - * https://payplug-prod.atlassian.net/browse/WOOC-249 - * - * @return bool - */ - public static function show_oney_popup() - { - $account = self::get_account_data_from_options(); - if( $account && $account['permissions'][PayplugPermissions::USE_ONEY] == true && $account["country"] == self::getISOCountryCode() ){ - return true; - } - return false; - } - - /** - * @return bool - */ - public static function check_order_max_amount($order_total){ - if ($order_total < PayplugGatewayOney3x::MIN_AMOUNT || $order_total > PayplugGatewayOney3x::MAX_AMOUNT) { - return false; - } - return true; - } - - /** - * Load translations from plugin languages folder. - * - * @param string $plugin_rel_path - * - * @return bool - */ - public static function load_plugin_textdomain( $plugin_rel_path ) { - - $domain = 'payplug'; - - $locale = apply_filters( 'plugin_locale', is_admin() ? get_user_locale() : get_locale(), $domain ); - - $mofile = $domain . '-' . $locale . '.mo'; - - $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' ); - - return load_textdomain( $domain, $path . '/' . $mofile ); - } - - /** - * Check and update value for oney simulation - * - * @return void - */ - public static function oney_simulation_values ($keys_array, &$array) { - foreach($keys_array as $key) { - if (array_key_exists($key, $array)) { - $array[$key]['down_payment_amount'] = floatval($array[$key]['down_payment_amount']) / 100; - foreach ($array[$key]['installments'] as $k => $value) { - $array[$key]['installments'][$k]['amount'] = floatval($value['amount']) / 100; - } - } - } - } - - public static function getISOCountryCode() - { - preg_match( '([a-z-]+)', get_locale(), $country ); - return strtoupper($country[0]); - } - - /** - * Get country of the payplug merchant account and save it to the database - * - * @return string payplug merchant account country - */ - public static function get_payplug_merchant_country() - { - $data = get_option('woocommerce_payplug_settings'); - - //in order to reduce the getAccount calls - if (isset($data['payplug_live_key'])) { - - if (!isset($data['payplug_merchant_country'])) { - return self::UpdateCountryOption($data); - } - - return $data['payplug_merchant_country']; - } - - $country = wc_get_base_location(); - return $country['country']; - - } - - /** - * Update payplug options and return the country - * - * @param $options - * @return string - * @throws \Payplug\Exception\ConfigurationException - */ - public static function UpdateCountryOption($options){ - - try { - - //fail safe for non activated account - if ((isset($options['mode'])) && $options['payplug_test_key']){ - $key = $options['mode'] === "yes" && !empty($options['payplug_live_key']) ? $options['payplug_live_key'] : $options['payplug_test_key']; - } - - if( empty($options['payplug_live_key'] )){ - $options['mode'] = "no"; - } - - if (isset($key) && !empty($key)){ - $response = self::get_account_data_from_options(); - } - - if (isset($response['httpResponse']['country'])) { - $options['payplug_merchant_country'] = $response['httpResponse']['country']; - update_option( 'woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options) ); - }else{ - - //default value for merchant country - $options['payplug_merchant_country'] = 'FR'; - } - - } catch (ForbiddenException $e) { - PayplugGateway::log('Error while getting account : ' . $e->getMessage(), 'error'); - \WC_Admin_Settings::add_error($e->getMessage()); - $options['payplug_merchant_country'] = 'FR'; - } - - return $options['payplug_merchant_country']; - - } - - public static function get_live_key() - { - $options = self::get_payplug_options(); - $live_key = $options['payplug_live_key']; - if (empty($live_key)) { - $live_key = $options['client_data']['jwt']['live']['access_token']; - } - return $live_key; - } - - public static function get_test_key() - { - $options = self::get_payplug_options(); - $test_key = $options['payplug_test_key']; - if (empty($test_key)) { - $test_key = $options['client_data']['jwt']['test']['access_token']; - } - return $test_key; - } - - /** - * - * Checks fi the user is logged in - * - * @return bool - */ - public static function user_logged_in() - { - $options = self::get_payplug_options(); - - if (isset($options['client_data']) && isset($options['client_data']['jwt']['test']['access_token'])) { - return true; - } - - return !empty($options['payplug_test_key']); - } - - public static function check_mode(){ - - if(empty(get_option( 'woocommerce_payplug_settings', [] ))){ - return false; - } - - return get_option( 'woocommerce_payplug_settings', [] )['mode'] === "yes" ? true : false; - } - - public static function payplug_logout() { - delete_option('woocommerce_payplug_settings'); - set_transient( PayplugWoocommerceHelper::get_transient_key(get_option('woocommerce_payplug_settings', [])), null ); - } - - public static function plugin_deactivation(){ - $option_name = 'woocommerce_payplug_settings'; - delete_option( $option_name ); - // for site options in Multisite - delete_site_option( $option_name ); - \Payplug\PayplugWoocommerce\Model\Lock::delete_lock_table(); - } - - public static function available_shipping_methods($carriers = []) { - $shippings = WC()->shipping()->get_shipping_methods(); - $shippings_methods = []; - foreach ($shippings as $shipping) { - array_push($shippings_methods,[ - "id_carrier" => $shipping->id, - "name" => $shipping->method_title, - "checked" => in_array($shipping->id, $carriers) - ]); - } - return $shippings_methods; - } - - public static function get_payplug_options() { - return get_option('woocommerce_payplug_settings', []); - } - - public static function get_applepay_options() { - $options = self::get_payplug_options(); - $applepay = [ - "enabled" => (!empty($options['apple_pay'])) ? $options['apple_pay'] : false, - "checkout" => (!empty($options['applepay_checkout'])) ? $options['applepay_checkout'] : false, - "cart" => (!empty($options['applepay_cart'])) ? $options['applepay_cart'] : false, - "carriers" => (!empty($options['applepay_carriers'])) ? $options['applepay_carriers'] : [], - - ]; - - return $applepay; - } - - public static function is_checkout_block() { - return WC_Blocks_Utils::has_block_in_page( wc_get_page_id('checkout'), 'woocommerce/checkout' ); - } - - public static function is_cart_block() { - return WC_Blocks_Utils::has_block_in_page( wc_get_page_id('cart'), 'woocommerce/cart' ); - } - - public static function is_product_block() { - return WC_Blocks_Utils::has_block_in_page( wc_get_page_id('product'), 'woocommerce/product' ); - } - - /** - * Checks if subscriptions are enabled on the site. - * - * @since 5.6.0 - * - * @return bool Whether subscriptions is enabled or not. - */ - public static function is_subscriptions_enabled() { - return class_exists( 'WC_Subscriptions' ) && class_exists( 'WC_Subscription' ) && version_compare( WC_Subscriptions::$version, '2.2.0', '>=' ); - } - - /** - * Cart has any subscriptions - * @return bool - */ - public static function is_subscription() { - - if ( is_null( WC()->cart ) ) { - wc_load_cart(); - WC()->cart->get_cart_from_session(); - - } - - if ( empty( WC()->cart ) || empty( WC()->cart->get_cart() ) ) { - return false; - } - - foreach ( WC()->cart->get_cart() as $prod ) { - if ( empty( $prod["product_id"] ) ) { - return false; - } - - $pid = $prod["product_id"]; - $product = wc_get_product( $pid ); - - if ( $product->is_type( 'subscription' ) ) { - return true; - } - } - - return false; - } - - /** - * Handling 400 errors from API (get_account, get_permissions) and return JSON rest response - * - * @param $title - * @param $msg - * - * @return false - */ - public static function exception_handler_400_logout($error_code, $title, $msg){ - - if( !empty($error_code) && ($error_code === 401 || $error_code === 403) ){ - - PayplugWoocommerceHelper::payplug_logout(); - wp_send_json_error( array( - "title" => $title, - 'msg' => $msg, - "close" => __( 'payplug_ok', 'payplug' ) - )); - } - - return false; - } - +class PayplugWoocommerceHelper +{ + /** + * Check if current WooCommerce version is below 3.0.0. + * + * @return bool + */ + public static function is_pre_30() + { + $wc = function_exists('WC') ? WC() : $GLOBALS['woocommerce']; + + return version_compare($wc->version, '3.0.0', '<'); + } + + /** + * Get a URL to the PayPlug gateway settings page. + * + * @return string + */ + public static function get_setting_link() + { + $use_id_as_section = function_exists('WC') ? version_compare(WC()->version, '2.6', '>=') : false; + $section_slug = $use_id_as_section ? 'payplug' : strtolower('PayplugGateway'); + + return admin_url('admin.php?page=wc-settings&tab=checkout§ion=' . $section_slug); + } + + /** + * Get all country code supported by PayPlug. + * + * Those are ISO 3166-1 alpha-2. You can find more information on https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + * + * @return array + */ + public static function get_supported_countries() + { + return [ + 'AD', + 'AO', + 'AX', + 'BG', + 'BO', + 'BY', + 'CH', + 'CR', + 'DE', + 'EE', + 'FI', + 'GB', + 'GL', + 'GT', + 'HR', + 'IN', + 'JM', + 'KM', + 'KZ', + 'LS', + 'MD', + 'MM', + 'MT', + 'NA', + 'NO', + 'PE', + 'PN', + 'RE', + 'SC', + 'SK', + 'ST', + 'TF', + 'TN', + 'UA', + 'VC', + 'WS', + 'AE', + 'AQ', + 'AZ', + 'BH', + 'BQ', + 'BZ', + 'CI', + 'CU', + 'DJ', + 'EG', + 'FJ', + 'GD', + 'GM', + 'GU', + 'HT', + 'IO', + 'JO', + 'KN', + 'LA', + 'LT', + 'ME', + 'MN', + 'MU', + 'NC', + 'NP', + 'PF', + 'PR', + 'RO', + 'SD', + 'SL', + 'SV', + 'TG', + 'TO', + 'UG', + 'VE', + 'YE', + 'AM', + 'AW', + 'BF', + 'BN', + 'BW', + 'CG', + 'CO', + 'AF', + 'CZ', + 'EC', + 'EU', + 'GA', + 'GI', + 'GS', + 'HN', + 'IM', + 'JE', + 'KI', + 'KY', + 'LR', + 'MC', + 'ML', + 'MS', + 'MZ', + 'NL', + 'PA', + 'PM', + 'QA', + 'SB', + 'SJ', + 'SS', + 'TD', + 'TM', + 'TZ', + 'VA', + 'WF', + 'AR', + 'BA', + 'BI', + 'BR', + 'CA', + 'CK', + 'CV', + 'DK', + 'EH', + 'FK', + 'GE', + 'GN', + 'GW', + 'HU', + 'IQ', + 'JP', + 'KP', + 'LB', + 'LU', + 'MF', + 'MO', + 'MV', + 'NE', + 'NR', + 'PG', + 'PS', + 'RS', + 'SE', + 'SM', + 'SX', + 'TH', + 'TR', + 'UM', + 'VG', + 'YT', + 'AL', + 'AU', + 'BE', + 'BM', + 'BV', + 'CF', + 'CN', + 'CY', + 'DZ', + 'ET', + 'FR', + 'GH', + 'GR', + 'HM', + 'IL', + 'IT', + 'KH', + 'KW', + 'LK', + 'MA', + 'MK', + 'MR', + 'MY', + 'NI', + 'OM', + 'PL', + 'PY', + 'SA', + 'SI', + 'SR', + 'TC', + 'TL', + 'TW', + 'UZ', + 'VU', + 'ZW', + 'AI', + 'AT', + 'BD', + 'BL', + 'BT', + 'CD', + 'CM', + 'CX', + 'DO', + 'ES', + 'FO', + 'GG', + 'GQ', + 'HK', + 'IE', + 'IS', + 'KG', + 'KS', + 'LI', + 'LY', + 'MH', + 'MQ', + 'MX', + 'NG', + 'NZ', + 'PK', + 'PW', + 'RW', + 'SH', + 'SO', + 'SZ', + 'TK', + 'TV', + 'UY', + 'VN', + 'ZM', + 'AG', + 'AS', + 'BB', + 'BJ', + 'BS', + 'CC', + 'CL', + 'CW', + 'DM', + 'ER', + 'FM', + 'GF', + 'GP', + 'GY', + 'ID', + 'IR', + 'KE', + 'KR', + 'LC', + 'LV', + 'MG', + 'MP', + 'MW', + 'NF', + 'NU', + 'PH', + 'PT', + 'RU', + 'SG', + 'SN', + 'SY', + 'TJ', + 'TT', + 'US', + 'VI', + 'ZA', + ]; + } + + /** + * Ensure country code is supported by PayPlug. + * + * @param string $country The ISO 3166-1 alpha-2 code for the country + * + * @return bool + * + * @author Clément Boirie + */ + public static function is_country_supported($country) + { + $country = trim($country); + if (empty($country)) { + return false; + } + + return in_array(strtoupper($country), self::get_supported_countries()); + } + + /** + * Get default country. + * + * @return string + */ + public static function get_default_country() + { + $country = \WC()->countries->get_base_country(); + + return (self::is_country_supported($country)) ? strtoupper($country) : 'FR'; + } + + /** + * Get minimum amount allowed by PayPlug. + * + * This amount is in cents. + * + * @return int + */ + public static function get_minimum_amount() + { + return 99; + } + + /** + * Get maximum amount allowed by PayPlug. + * + * This amount is in cents. + * + * @return int + */ + public static function get_maximum_amount() + { + return 2000000; + } + + /** + * Convert amount in cents. + * + * @param float $amount + * + * @return int + */ + public static function get_payplug_amount($amount) + { + if (is_null($amount)) { + return $amount; + } + + return absint(wc_format_decimal(((float) $amount * 100), wc_get_price_decimals())); + } + + /** + * Extract useful metadata from PayPlug response. + * + * @param APIResource $resource + * + * @return array + */ + public static function extract_transaction_metadata($resource) + { + return [ + 'transaction_id' => sanitize_text_field($resource->id), + 'paid' => (bool) $resource->is_paid, + 'refunded' => (bool) $resource->is_refunded, + 'amount' => sanitize_text_field($resource->amount), + 'amount_refunded' => sanitize_text_field($resource->amount_refunded), + '3ds' => (bool) $resource->is_3ds, + 'live' => (bool) $resource->is_live, + 'paid_at' => isset($resource->hosted_payment->paid_at) ? sanitize_text_field($resource->hosted_payment->paid_at) : sanitize_text_field($resource->created_at), + 'card_last4' => sanitize_text_field($resource->card->last4), + 'card_exp_month' => sanitize_text_field($resource->card->exp_month), + 'card_exp_year' => sanitize_text_field($resource->card->exp_year), + 'card_brand' => sanitize_text_field($resource->card->brand), + 'card_country' => sanitize_text_field($resource->card->country), + ]; + } + + /** + * @param \WC_Order $order + * + * @return array|bool + * + * @author Clément Boirie + */ + public static function get_transaction_metadata($order) + { + if (PayplugWoocommerceHelper::is_pre_30()) { + return get_post_meta($order->id, '_payplug_metadata', true); + } + + return $order->get_meta('_payplug_metadata', true); + } + + /** + * Save transaction metadata extracted from PayPlug response. + * + * @param \WC_Order $order + * @param array $metadata + */ + public static function save_transaction_metadata($order, $metadata) + { + if (PayplugWoocommerceHelper::is_pre_30()) { + update_post_meta($order->id, '_payplug_metadata', $metadata); + } else { + $order->add_meta_data('_payplug_metadata', $metadata, true); + $order->save_meta_data(); + } + } + + /** + * Set flag ipn ( in progress / over ) on order. + * + * @param \WC_Order $order + * @param array $metadata + * @param bool $flag + */ + public static function set_flag_ipn_order($order, $metadata, $flag) + { + $metadata['transaction_in_progress'] = $flag; + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); + } + + /** + * Get transient key from payplug option. + * + * @param mixed $options + * + * @return string + */ + public static function get_transient_key($options) + { + return PayplugGateway::OPTION_NAME . (array_key_exists('mode', $options) && 'yes' === $options['mode'] ? '_live' : '_test'); + } + + /** + * Get transient live key from payplug option. + * + * @return string + */ + public static function get_live_transient_key() + { + return PayplugGateway::OPTION_NAME . '_live'; + } + + /** + * Set transient data for payplug account. + * + * @param mixed $data + * @param mixed|null $options + * + * @return string + */ + public static function set_transient_data($data, $options = null) + { + $options = $options ? $options : get_option('woocommerce_payplug_settings', []); + $transient_key = PayplugWoocommerceHelper::get_transient_key($options); + set_transient($transient_key, isset($data['httpResponse']) ? $data['httpResponse'] : []); + } + + /** + * Get current option from payplug settings. + * + * @return array + */ + public static function get_account_data_from_options() + { + $options = get_option('woocommerce_payplug_settings', []); + $transient_key = self::get_transient_key($options); + $account = get_transient($transient_key); + + if (empty($account) || !is_array($account)) { + self::set_account_data_from_options(); + $account = get_transient($transient_key); + } + + return $account; + } + + /** + * Get current option from payplug settings + *this should replace get_account_data_from_options. + * + * @param mixed $gateway_id + * + * @return array + */ + public static function generic_get_account_data_from_options($gateway_id) + { + $options = get_option('woocommerce_payplug_settings', []); + $transient_key = self::get_transient_key($options); + $account = get_transient($transient_key); + + //if transient is empty, it goes and get the permissions for the customer to populate it + if (empty($account) || !is_array($account)) { + self::set_account_data_from_options(); + $account = get_transient($transient_key); + } + + if (isset($options[$gateway_id]) && 'yes' == $options[$gateway_id]) { + $account['permissions'][$gateway_id] = true; + } + + return $account; + } + + /** + * Set current option from payplug settings and api call. + */ + public static function set_account_data_from_options() + { + $options = get_option('woocommerce_payplug_settings', []); + $payplug_test_key = !empty($options['payplug_test_key']) ? $options['payplug_test_key'] : ''; + $payplug_live_key = !empty($options['payplug_live_key']) ? $options['payplug_live_key'] : ''; + + if (empty($payplug_test_key) && isset($options['client_data']['jwt']['test']['access_token'])) { + $payplug_test_key = $options['client_data']['jwt']['test']['access_token']; + } + if (empty($payplug_live_key) && isset($options['client_data']['jwt']['live']['access_token'])) { + $payplug_live_key = $options['client_data']['jwt']['live']['access_token']; + } + if (empty($payplug_test_key) && empty($payplug_live_key)) { + return []; + } + + if ('yes' === $options['mode'] && empty($payplug_live_key)) { + return []; + } + + if ('yes' != $options['mode'] && empty($payplug_test_key)) { + return []; + } + + try { + $parameters_account = Authentication::getAccount(new Payplug('yes' === $options['mode'] ? $payplug_live_key : $payplug_test_key)); + self::set_transient_data($parameters_account, $options); + } catch (\Payplug\Exception\UnauthorizedException $e) { + self::exception_handler_400_logout($e->getCode(), __('payplug_enable_feature', 'payplug'), sprintf('Account request error from PayPlug API : %s
    ' . __('Successfully logged out.', 'payplug') . '', wc_print_r($e->getMessage(), true))); + } catch (\Payplug\Exception\ConfigurationNotSetException $e) { + } catch (\Payplug\Exception\ForbiddenException $e) { + } catch (\Payplug\Exception\ForbiddenException $e) { + return []; + } + } + + /** + * Get min and max for oney payment. + * + * @return array + */ + public static function get_min_max_oney() + { + $account = self::get_account_data_from_options(); + if (!$account) { + return []; + } + + return [ + 'min' => floatval($account['configuration']['oney']['min_amounts']['EUR']) / 100, + 'max' => floatval($account['configuration']['oney']['max_amounts']['EUR']) / 100, + ]; + } + + /** + * Check if oney is available with current settings. + * + * @return bool + */ + public static function is_oney_available() + { + $account = self::get_account_data_from_options(); + if (!$account) { + return false; + } + + $options = self::get_payplug_options(); + $oney_active = (isset($options['oney']) && !empty($options['oney'])) ? $options['oney'] : ''; + + return ($account && '1' == $account['permissions'][PayplugPermissions::USE_ONEY] && 'yes' === $oney_active); + } + + /** + * Hide popup for if country_code != payplug country + * https://payplug-prod.atlassian.net/browse/WOOC-249. + * + * @return bool + */ + public static function show_oney_popup() + { + $account = self::get_account_data_from_options(); + if ($account && true == $account['permissions'][PayplugPermissions::USE_ONEY] && $account['country'] == self::getISOCountryCode()) { + return true; + } + + return false; + } + + /** + * @param mixed $order_total + * + * @return bool + */ + public static function check_order_max_amount($order_total) + { + if ($order_total < PayplugGatewayOney3x::MIN_AMOUNT || $order_total > PayplugGatewayOney3x::MAX_AMOUNT) { + return false; + } + + return true; + } + + /** + * Load translations from plugin languages folder. + * + * @param string $plugin_rel_path + * + * @return bool + */ + public static function load_plugin_textdomain($plugin_rel_path) + { + $domain = 'payplug'; + + $locale = apply_filters('plugin_locale', is_admin() ? get_user_locale() : get_locale(), $domain); + + $mofile = $domain . '-' . $locale . '.mo'; + + $path = WP_PLUGIN_DIR . '/' . trim($plugin_rel_path, '/'); + + return load_textdomain($domain, $path . '/' . $mofile); + } + + /** + * Check and update value for oney simulation. + * + * @param mixed $keys_array + * @param mixed $array + */ + public static function oney_simulation_values($keys_array, &$array) + { + foreach ($keys_array as $key) { + if (array_key_exists($key, $array)) { + $array[$key]['down_payment_amount'] = floatval($array[$key]['down_payment_amount']) / 100; + foreach ($array[$key]['installments'] as $k => $value) { + $array[$key]['installments'][$k]['amount'] = floatval($value['amount']) / 100; + } + } + } + } + + public static function getISOCountryCode() + { + preg_match('([a-z-]+)', get_locale(), $country); + + return strtoupper($country[0]); + } + + /** + * Get country of the payplug merchant account and save it to the database. + * + * @return string payplug merchant account country + */ + public static function get_payplug_merchant_country() + { + $data = get_option('woocommerce_payplug_settings'); + + //in order to reduce the getAccount calls + if (isset($data['payplug_live_key'])) { + if (!isset($data['payplug_merchant_country'])) { + return self::UpdateCountryOption($data); + } + + return $data['payplug_merchant_country']; + } + + $country = wc_get_base_location(); + + return $country['country']; + } + + /** + * Update payplug options and return the country. + * + * @param $options + * + * @throws \Payplug\Exception\ConfigurationException + * + * @return string + */ + public static function UpdateCountryOption($options) + { + try { + //fail safe for non activated account + if ((isset($options['mode'])) && $options['payplug_test_key']) { + $key = 'yes' === $options['mode'] && !empty($options['payplug_live_key']) ? $options['payplug_live_key'] : $options['payplug_test_key']; + } + + if (empty($options['payplug_live_key'])) { + $options['mode'] = 'no'; + } + + if (isset($key) && !empty($key)) { + $response = self::get_account_data_from_options(); + } + + if (isset($response['httpResponse']['country'])) { + $options['payplug_merchant_country'] = $response['httpResponse']['country']; + update_option('woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options)); + } else { + //default value for merchant country + $options['payplug_merchant_country'] = 'FR'; + } + } catch (ForbiddenException $e) { + PayplugGateway::log('Error while getting account : ' . $e->getMessage(), 'error'); + \WC_Admin_Settings::add_error($e->getMessage()); + $options['payplug_merchant_country'] = 'FR'; + } + + return $options['payplug_merchant_country']; + } + + public static function get_live_key() + { + $options = self::get_payplug_options(); + $live_key = $options['payplug_live_key']; + if (empty($live_key)) { + $live_key = $options['client_data']['jwt']['live']['access_token']; + } + + return $live_key; + } + + public static function get_test_key() + { + $options = self::get_payplug_options(); + $test_key = $options['payplug_test_key']; + if (empty($test_key)) { + $test_key = $options['client_data']['jwt']['test']['access_token']; + } + + return $test_key; + } + + /** + * Checks fi the user is logged in. + * + * @return bool + */ + public static function user_logged_in() + { + $options = self::get_payplug_options(); + + if (isset($options['client_data'], $options['client_data']['jwt']['test']['access_token'])) { + return true; + } + + return !empty($options['payplug_test_key']); + } + + public static function check_mode() + { + if (empty(get_option('woocommerce_payplug_settings', []))) { + return false; + } + + return 'yes' === get_option('woocommerce_payplug_settings', [])['mode'] ? true : false; + } + + public static function payplug_logout() + { + delete_option('woocommerce_payplug_settings'); + set_transient(PayplugWoocommerceHelper::get_transient_key(get_option('woocommerce_payplug_settings', [])), null); + } + + public static function plugin_deactivation() + { + $option_name = 'woocommerce_payplug_settings'; + delete_option($option_name); + // for site options in Multisite + delete_site_option($option_name); + \Payplug\PayplugWoocommerce\Model\Lock::delete_lock_table(); + } + + public static function available_shipping_methods($carriers = []) + { + $shippings = WC()->shipping()->get_shipping_methods(); + $shippings_methods = []; + foreach ($shippings as $shipping) { + array_push($shippings_methods, [ + 'id_carrier' => $shipping->id, + 'name' => $shipping->method_title, + 'checked' => in_array($shipping->id, $carriers), + ]); + } + + return $shippings_methods; + } + + public static function get_payplug_options() + { + return get_option('woocommerce_payplug_settings', []); + } + + public static function get_applepay_options() + { + $options = self::get_payplug_options(); + + return [ + 'enabled' => (!empty($options['apple_pay'])) ? $options['apple_pay'] : false, + 'checkout' => (!empty($options['applepay_checkout'])) ? $options['applepay_checkout'] : false, + 'cart' => (!empty($options['applepay_cart'])) ? $options['applepay_cart'] : false, + 'carriers' => (!empty($options['applepay_carriers'])) ? $options['applepay_carriers'] : [], + ]; + } + + public static function is_checkout_block() + { + return WC_Blocks_Utils::has_block_in_page(wc_get_page_id('checkout'), 'woocommerce/checkout'); + } + + public static function is_cart_block() + { + return WC_Blocks_Utils::has_block_in_page(wc_get_page_id('cart'), 'woocommerce/cart'); + } + + public static function is_product_block() + { + return WC_Blocks_Utils::has_block_in_page(wc_get_page_id('product'), 'woocommerce/product'); + } + + /** + * Checks if subscriptions are enabled on the site. + * + * @since 5.6.0 + * + * @return bool whether subscriptions is enabled or not + */ + public static function is_subscriptions_enabled() + { + return class_exists('WC_Subscriptions') && class_exists('WC_Subscription') && version_compare(WC_Subscriptions::$version, '2.2.0', '>='); + } + + /** + * Cart has any subscriptions. + * + * @return bool + */ + public static function is_subscription() + { + if (is_null(WC()->cart)) { + wc_load_cart(); + WC()->cart->get_cart_from_session(); + } + + if (empty(WC()->cart) || empty(WC()->cart->get_cart())) { + return false; + } + + foreach (WC()->cart->get_cart() as $prod) { + if (empty($prod['product_id'])) { + return false; + } + + $pid = $prod['product_id']; + $product = wc_get_product($pid); + + if ($product->is_type('subscription')) { + return true; + } + } + + return false; + } + + /** + * Handling 400 errors from API (get_account, get_permissions) and return JSON rest response. + * + * @param $title + * @param $msg + * @param mixed $error_code + * + * @return false + */ + public static function exception_handler_400_logout($error_code, $title, $msg) + { + if (!empty($error_code) && (401 === $error_code || 403 === $error_code)) { + PayplugWoocommerceHelper::payplug_logout(); + wp_send_json_error([ + 'title' => $title, + 'msg' => $msg, + 'close' => __('payplug_ok', 'payplug'), + ]); + } + + return false; + } } diff --git a/src/PayplugWoocommerceRequest.php b/src/PayplugWoocommerceRequest.php index 54416d4c..fb5c0bbb 100644 --- a/src/PayplugWoocommerceRequest.php +++ b/src/PayplugWoocommerceRequest.php @@ -3,486 +3,471 @@ namespace Payplug\PayplugWoocommerce; // Exit if accessed directly -use Payplug\PayplugWoocommerce\Controller\WC_Payplug_Intent_Controller as PayplugIntent; +use Automattic\WooCommerce\Utilities\OrderUtil; use Payplug\PayplugWoocommerce\Gateway\PayplugAddressData; use Payplug\PayplugWoocommerce\Gateway\PayplugGateway; -use WC_Payment_Tokens; -use WP_REST_Request; -use Automattic\WooCommerce\Utilities\OrderUtil; -if ( ! defined( 'ABSPATH' ) ) { - exit; +if (!defined('ABSPATH')) { + exit; } /** - * Class PayplugWoocommerceRequest - * @package Payplug\PayplugWoocommerce + * Class PayplugWoocommerceRequest. */ -class PayplugWoocommerceRequest { - - /** - * Gateway settings. - * - * @var array - */ - protected $settings; - - /** - * @var PayplugGateway - */ - protected $gateway; - - /** - * PayplugWoocommerceRequest constructor. - */ - public function __construct() { - $this->settings = get_option( 'woocommerce_payplug_settings', [] ); - if ( empty( $this->settings ) || ! isset( $this->settings['enabled'] ) || 'yes' !== $this->settings['enabled'] ) { - return; - } - - // Don't load for change payment method page. - if ( isset( $_GET['change_payment_method'] ) ) { - return; - } - - add_action( 'template_redirect', [ $this, 'set_session' ] ); - add_action( 'wc_ajax_payplug_create_order', [ $this, 'ajax_create_order' ] ); - add_action( 'wc_ajax_applepay_update_payment', [ $this, 'applepay_update_payment' ] ); - add_action( 'wc_ajax_applepay_get_order_totals', [ $this, 'applepay_get_order_totals' ] ); - add_action( 'wc_ajax_payplug_order_review_url', [ $this, 'ajax_create_payment' ] ); - add_action( 'wc_ajax_payplug_check_payment', [$this, 'check_payment']); - add_action( 'wc_ajax_payplug_create_intent', [$this, 'create_payment_intent']); - - } - - /** - * Sets the WC customer session if one is not set. - * This is needed so nonces can be verified by AJAX Request. - */ - public function set_session() { - if ( ! is_product() || ( isset( WC()->session ) && WC()->session->has_session() ) ) { - return; - } - - $session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' ); - $wc_session = new $session_class(); - - if ( version_compare( WC_VERSION, '3.3', '>=' ) ) { - $wc_session->init(); - } - - $wc_session->set_customer_session_cookie( true ); - } - - /** - * Create the woocommerce order in the BO - * - */ - public function ajax_create_order() { - if ( WC()->cart->is_empty() ) { - wp_send_json_error( __( 'Empty cart', 'payplug' ) ); - } - - if ( ! defined( 'WOOCOMMERCE_CHECKOUT' ) ) { - define( 'WOOCOMMERCE_CHECKOUT', true ); - } - - WC()->checkout()->process_checkout(); - - die( 0 ); - } - - /** - * Create the woocommerce order in the BO - * - */ - public function ajax_create_payment() { - - global $wp; - - if ( WC()->cart->is_empty() ) { - wp_send_json_error( __( 'Empty cart', 'payplug' ) ); - } - - if ( ! defined( 'WOOCOMMERCE_CHECKOUT' ) ) { - define( 'WOOCOMMERCE_CHECKOUT', true ); - } - - $payment_method = $_POST['payment_method']; - - if($payment_method === 'payplug' || $payment_method === 'american_express'){ - $settings = get_option('woocommerce_payplug_settings', []); - $method = $settings['payment_method']; - - if($method !== "integrated" && $method !== "popup" ){ - $this->ajax_create_order(); - } - - }else{ - $this->ajax_create_order(); - } - - $https_referer = $_POST['_wp_http_referer']; - $path = parse_url($https_referer); - wp_parse_str($path['query'], $output); - - if (isset($output['order-pay'])) { - $order_id = $output['order-pay']; - } else { - preg_match("/(?<=order-pay\/)\d*/", $path['path'], $matches); - $order_id = $matches[0]; - } - - - $this->process_order_payment($order_id, $payment_method); - - } - - /** - * wordpress class-wc-checkout.php - * We don't need all the other verifications, at this point customer already had the checkout and it's all valid, the order already exists - * We can+t use WP method because it's protected - * Process an order that does require payment. - * - * @since 3.0.0 - * @param int $order_id Order ID. - * @param string $payment_method Payment method. - */ - protected function process_order_payment( $order_id, $payment_method ) { - $available_gateways = WC()->payment_gateways->get_available_payment_gateways(); - - if ( ! isset( $available_gateways[ $payment_method ] ) ) { - return; - } - - // Store Order ID in session so it can be re-used after payment failure. - WC()->session->set( 'order_awaiting_payment', $order_id ); - - // Process Payment. - $result = $available_gateways[ $payment_method ]->process_payment( $order_id ); - - // Redirect to success/confirmation/payment page. - if ( isset( $result['result'] ) && 'success' === $result['result'] ) { - $result['order_id'] = $order_id; - - $result = apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ); - - if ( ! wp_doing_ajax() ) { - // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect - wp_redirect( $result['redirect'] ); - exit; - } - - wp_send_json( $result ); - } - } - - - - /** - * Update Payplug API Payment for Apple Pay - */ - public function applepay_update_payment() { - - $payment_id = $_POST['payment_id']; - - try{ - \Payplug\Payplug::init(array( - 'secretKey' => PayplugWoocommerceHelper::get_live_key(), - 'apiVersion' => "2019-08-06", - )); - - $apple_pay = array(); - $apple_pay['payment_token'] = $_POST['payment_token']; - $payment = \Payplug\Payment::retrieve($payment_id); - - $data = array( 'apple_pay' => $apple_pay ); - $update = $payment->update($data); - - wp_send_json_success([ "result" => $update->is_paid ]); - - }catch (\Exception $e){ - wp_send_json_error($e->getMessage()); - } - } - - public function applepay_get_order_totals() - { - try { - wp_send_json_success(WC()->cart->total); - - } catch (\Exception $e) { - PayplugGateway::log($e->getMessage()); - wp_send_json_error($e->getMessage()); - } - } - - /** - * Empty cart for Apple Pay on product page - */ - public function applepay_empty_cart() { - try { - WC()->cart->empty_cart(); - wp_send_json_success(); - } catch (\Exception $e) { - wp_send_json_error([ - 'message' => __('Your order was cancelled.', 'woocommerce') - ]); - } - } - - /** - * Add the product on the current page to the cart for Apple Pay on product page - */ - public function applepay_add_to_cart() { - try { - if (!empty($_POST['product_id'])) { - $product_id = $_POST['product_id']; - } else { - $product_id = $_POST['product_variation_id']; - } - - $product_quantity = !empty($_POST['product_quantity']) ? $_POST['product_quantity'] : 1; - - WC()->cart->add_to_cart($product_id, $product_quantity); - wp_send_json_success([ - 'total' => WC()->cart->total - WC()->cart->shipping_total - ]); - } catch (\Exception $e) { - wp_send_json_error([ - 'message' => __('Your order was cancelled.', 'woocommerce') - ]); - } - } - - /** - * Limit string length. - * - * @param string $value - * @param int $maxlength - * - * @return string - */ - public function limit_length($value, $maxlength = 100) - { - return (strlen($value) > $maxlength) ? substr($value, 0, $maxlength) : $value; - } - - public function check_payment() { - - global $wpdb; - - $payment_id = $_POST['payment_id']; - - if(empty($payment_id)){ - wp_send_json_error( __("Invalid request.", "payplug") ); - } - - - if (PayplugWoocommerceHelper::check_mode()) { - $key = PayplugWoocommerceHelper::get_live_key(); - } else { - $key = PayplugWoocommerceHelper::get_test_key(); - } - - try { - \Payplug\Payplug::init(array( - 'secretKey' => $key, - 'apiVersion' => "2019-08-06", - )); - - $payment =\Payplug\Payment::retrieve($payment_id); - - } catch ( \Exception $e ) { - - $order_id = $this->getOrderFromPaymentId($payment_id); - $order = wc_get_order($order_id); - - PayplugGateway::log( - sprintf( - 'Order #%s : An error occurred while retrieving the payment data with the message : %s', - $order_id, - $e->getMessage() - ) - ); - - wp_send_json_error( $e->getMessage()); - } - - $order_id = $this->getOrderFromPaymentId($payment_id); - $order = wc_get_order($order_id); - $return_url = esc_url_raw($order->get_checkout_order_received_url()); - - if ((isset($payment->failure)) && (!empty($payment->failure)) || ($payment->is_paid === false && is_null($payment->paid_at))) { - - $order->update_status( 'failed', __( 'Order cancelled by customer.', 'woocommerce' ) ); - - wp_send_json_error( - [ - 'code' => isset($payment->failure->code) ? $payment->failure->code : 500, - 'message' => !empty($payment->failure->message) ? $payment->failure->message :__("payplug_integrated_payment_error", "payplug"), - 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()) - ] - ); - } - - - wp_send_json_success(array( - 'payment_id' => $payment->id, - 'result' => 'success', - 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, - 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null - )); - - } - - /** - * @param $payment_id - * @return int|string|null - */ - private function getOrderFromPaymentId( $payment_id){ - global $wpdb; - - if ( OrderUtil::custom_orders_table_usage_is_enabled() ) { - $orders = wc_get_orders( - array( - 'field_query' => array( - array( - 'key' => 'transaction_id', - 'comparison' => $payment_id - ), - ), - ) - ); - $order = $orders[0]; - $order_id = $order->get_id(); - - }else{ - - $sql = "SELECT post_id - FROM $wpdb->postmeta +class PayplugWoocommerceRequest +{ + /** + * Gateway settings. + * + * @var array + */ + protected $settings; + + /** + * @var PayplugGateway + */ + protected $gateway; + + /** + * PayplugWoocommerceRequest constructor. + */ + public function __construct() + { + $this->settings = get_option('woocommerce_payplug_settings', []); + if (empty($this->settings) || !isset($this->settings['enabled']) || 'yes' !== $this->settings['enabled']) { + return; + } + + // Don't load for change payment method page. + if (isset($_GET['change_payment_method'])) { + return; + } + + add_action('template_redirect', [$this, 'set_session']); + add_action('wc_ajax_payplug_create_order', [$this, 'ajax_create_order']); + add_action('wc_ajax_applepay_update_payment', [$this, 'applepay_update_payment']); + add_action('wc_ajax_applepay_get_order_totals', [$this, 'applepay_get_order_totals']); + add_action('wc_ajax_payplug_order_review_url', [$this, 'ajax_create_payment']); + add_action('wc_ajax_payplug_check_payment', [$this, 'check_payment']); + add_action('wc_ajax_payplug_create_intent', [$this, 'create_payment_intent']); + } + + /** + * Sets the WC customer session if one is not set. + * This is needed so nonces can be verified by AJAX Request. + */ + public function set_session() + { + if (!is_product() || (isset(WC()->session) && WC()->session->has_session())) { + return; + } + + $session_class = apply_filters('woocommerce_session_handler', 'WC_Session_Handler'); + $wc_session = new $session_class(); + + if (version_compare(WC_VERSION, '3.3', '>=')) { + $wc_session->init(); + } + + $wc_session->set_customer_session_cookie(true); + } + + /** + * Create the woocommerce order in the BO. + */ + public function ajax_create_order() + { + if (WC()->cart->is_empty()) { + wp_send_json_error(__('Empty cart', 'payplug')); + } + + if (!defined('WOOCOMMERCE_CHECKOUT')) { + define('WOOCOMMERCE_CHECKOUT', true); + } + + WC()->checkout()->process_checkout(); + + exit(0); + } + + /** + * Create the woocommerce order in the BO. + */ + public function ajax_create_payment() + { + global $wp; + + if (WC()->cart->is_empty()) { + wp_send_json_error(__('Empty cart', 'payplug')); + } + + if (!defined('WOOCOMMERCE_CHECKOUT')) { + define('WOOCOMMERCE_CHECKOUT', true); + } + + $payment_method = $_POST['payment_method']; + + if ('payplug' === $payment_method || 'american_express' === $payment_method) { + $settings = get_option('woocommerce_payplug_settings', []); + $method = $settings['payment_method']; + + if ('integrated' !== $method && 'popup' !== $method) { + $this->ajax_create_order(); + } + } else { + $this->ajax_create_order(); + } + + $https_referer = $_POST['_wp_http_referer']; + $path = parse_url($https_referer); + wp_parse_str($path['query'], $output); + + if (isset($output['order-pay'])) { + $order_id = $output['order-pay']; + } else { + preg_match('/(?<=order-pay\\/)\\d*/', $path['path'], $matches); + $order_id = $matches[0]; + } + + $this->process_order_payment($order_id, $payment_method); + } + + /** + * Update Payplug API Payment for Apple Pay. + */ + public function applepay_update_payment() + { + $payment_id = $_POST['payment_id']; + + try { + \Payplug\Payplug::init([ + 'secretKey' => PayplugWoocommerceHelper::get_live_key(), + 'apiVersion' => '2019-08-06', + ]); + + $apple_pay = []; + $apple_pay['payment_token'] = $_POST['payment_token']; + $payment = \Payplug\Payment::retrieve($payment_id); + + $data = ['apple_pay' => $apple_pay]; + $update = $payment->update($data); + + wp_send_json_success(['result' => $update->is_paid]); + } catch (\Exception $e) { + wp_send_json_error($e->getMessage()); + } + } + + public function applepay_get_order_totals() + { + try { + wp_send_json_success(WC()->cart->total); + } catch (\Exception $e) { + PayplugGateway::log($e->getMessage()); + wp_send_json_error($e->getMessage()); + } + } + + /** + * Empty cart for Apple Pay on product page. + */ + public function applepay_empty_cart() + { + try { + WC()->cart->empty_cart(); + wp_send_json_success(); + } catch (\Exception $e) { + wp_send_json_error([ + 'message' => __('Your order was cancelled.', 'woocommerce'), + ]); + } + } + + /** + * Add the product on the current page to the cart for Apple Pay on product page. + */ + public function applepay_add_to_cart() + { + try { + if (!empty($_POST['product_id'])) { + $product_id = $_POST['product_id']; + } else { + $product_id = $_POST['product_variation_id']; + } + + $product_quantity = !empty($_POST['product_quantity']) ? $_POST['product_quantity'] : 1; + + WC()->cart->add_to_cart($product_id, $product_quantity); + wp_send_json_success([ + 'total' => WC()->cart->total - WC()->cart->shipping_total, + ]); + } catch (\Exception $e) { + wp_send_json_error([ + 'message' => __('Your order was cancelled.', 'woocommerce'), + ]); + } + } + + /** + * Limit string length. + * + * @param string $value + * @param int $maxlength + * + * @return string + */ + public function limit_length($value, $maxlength = 100) + { + return (strlen($value) > $maxlength) ? substr($value, 0, $maxlength) : $value; + } + + public function check_payment() + { + global $wpdb; + + $payment_id = $_POST['payment_id']; + + if (empty($payment_id)) { + wp_send_json_error(__('Invalid request.', 'payplug')); + } + + if (PayplugWoocommerceHelper::check_mode()) { + $key = PayplugWoocommerceHelper::get_live_key(); + } else { + $key = PayplugWoocommerceHelper::get_test_key(); + } + + try { + \Payplug\Payplug::init([ + 'secretKey' => $key, + 'apiVersion' => '2019-08-06', + ]); + + $payment = \Payplug\Payment::retrieve($payment_id); + } catch (\Exception $e) { + $order_id = $this->getOrderFromPaymentId($payment_id); + $order = wc_get_order($order_id); + + PayplugGateway::log( + sprintf( + 'Order #%s : An error occurred while retrieving the payment data with the message : %s', + $order_id, + $e->getMessage() + ) + ); + + wp_send_json_error($e->getMessage()); + } + + $order_id = $this->getOrderFromPaymentId($payment_id); + $order = wc_get_order($order_id); + $return_url = esc_url_raw($order->get_checkout_order_received_url()); + + if ((isset($payment->failure)) && (!empty($payment->failure)) || (false === $payment->is_paid && is_null($payment->paid_at))) { + $order->update_status('failed', __('Order cancelled by customer.', 'woocommerce')); + + wp_send_json_error( + [ + 'code' => isset($payment->failure->code) ? $payment->failure->code : 500, + 'message' => !empty($payment->failure->message) ? $payment->failure->message : __('payplug_integrated_payment_error', 'payplug'), + 'cancel_url' => esc_url_raw($order->get_cancel_order_url_raw()), + ] + ); + } + + wp_send_json_success([ + 'payment_id' => $payment->id, + 'result' => 'success', + 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, + 'cancel' => !empty($payment->hosted_payment->cancel_url) ? $payment->hosted_payment->cancel_url : null, + ]); + } + + public function create_payment_intent() + { + $order_id = $_POST['order_id']; + $this->gateway = $this->get_payplug_gateway($_POST['gateway']); + $order = wc_get_order($order_id); + $customer_id = PayplugWoocommerceHelper::is_pre_30() ? $order->customer_user : $order->get_customer_id(); + $return_url = esc_url_raw($order->get_checkout_order_received_url()); + $address_data = PayplugAddressData::from_order($order); + $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($order->get_total()); + $amount = $this->gateway->validate_order_amount($amount); + + $payment_data = [ + 'amount' => $amount, + 'currency' => get_woocommerce_currency(), + 'allow_save_card' => $this->gateway->oneclick_available() && (int) $customer_id > 0, + 'billing' => $address_data->get_billing(), + 'shipping' => $address_data->get_shipping(), + 'hosted_payment' => [ + 'return_url' => $return_url, + ], + 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), + 'metadata' => [ + 'order_id' => $order_id, + 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', + 'domain' => $this->limit_length(esc_url_raw(home_url()), 500), + ], + ]; + + if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { + $payment_data['metadata']['woocommerce_block'] = 'CHECKOUT'; + } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { + $payment_data['metadata']['woocommerce_block'] = 'CART'; + } + + if ('apple_pay' === $this->gateway->id) { + unset($payment_data['allow_save_card']); + + $payment_data['payment_method'] = $this->gateway->id; + $payment_data['payment_context'] = [ + 'apple_pay' => [ + 'domain_name' => $this->gateway->domain_name, + 'application_data' => base64_encode(json_encode([ + 'apple_pay_domain' => $this->gateway->domain_name, + ])), + ], + ]; + $payment_data['hosted_payment']['cancel_url'] = esc_url_raw($order->get_cancel_order_url_raw()); + $payment_data['metadata']['applepay_workflow'] = 'checkout'; + } + + if ('integrated' === $this->gateway->get_option('payment_method') && 'payplug' === $this->gateway->id) { + $payment_data['initiator'] = 'PAYER'; + $payment_data['integration'] = 'INTEGRATED_PAYMENT'; + unset($payment_data['hosted_payment']['cancel_url']); + } + + if ('popup' === $this->gateway->get_option('payment_method') && 'american_express' === $this->gateway->id) { + $payment_data['payment_method'] = $this->gateway->id; + } + + /** + * Filter the payment data before it's used. + * + * @param array $payment_data + * @param int $order_id + * @param array $customer_details + * @param PayplugAddressData $address_data + */ + $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); + + $payment = $this->gateway->api->payment_create($payment_data); + + // Save transaction id on the order + PayplugWoocommerceHelper::is_pre_30() ? update_post_meta($order_id, '_transaction_id', $payment->id) : $order->set_transaction_id($payment->id); + + if (is_callable([$order, 'save'])) { + $order->save(); + } + + $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); + PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); + + wp_send_json_success([ + 'payment_id' => $payment->id, + 'merchant_session' => isset($payment->payment_method['merchant_session']) ? $payment->payment_method['merchant_session'] : null, + 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, + 'cancel' => esc_url_raw($order->get_cancel_order_url_raw()), + ]); + } + + /** + * wordpress class-wc-checkout.php + * We don't need all the other verifications, at this point customer already had the checkout and it's all valid, the order already exists + * We can+t use WP method because it's protected + * Process an order that does require payment. + * + * @since 3.0.0 + * + * @param int $order_id order ID + * @param string $payment_method payment method + */ + protected function process_order_payment($order_id, $payment_method) + { + $available_gateways = WC()->payment_gateways->get_available_payment_gateways(); + + if (!isset($available_gateways[$payment_method])) { + return; + } + + // Store Order ID in session so it can be re-used after payment failure. + WC()->session->set('order_awaiting_payment', $order_id); + + // Process Payment. + $result = $available_gateways[$payment_method]->process_payment($order_id); + + // Redirect to success/confirmation/payment page. + if (isset($result['result']) && 'success' === $result['result']) { + $result['order_id'] = $order_id; + + $result = apply_filters('woocommerce_payment_successful_result', $result, $order_id); + + if (!wp_doing_ajax()) { + // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect + wp_redirect($result['redirect']); + + exit; + } + + wp_send_json($result); + } + } + + /** + * Returns an instantiated gateway. + * + * @param mixed $id + * + * @return PayplugGateway + */ + protected function get_payplug_gateway($id) + { + if (!isset($this->gateway)) { + $gateways = WC()->payment_gateways()->payment_gateways(); + foreach ($gateways as $gateway) { + if ($gateway->id === $id) { + return $gateway; + } + } + } + } + + /** + * @param $payment_id + * + * @return int|string|null + */ + private function getOrderFromPaymentId($payment_id) + { + global $wpdb; + + if (OrderUtil::custom_orders_table_usage_is_enabled()) { + $orders = wc_get_orders( + [ + 'field_query' => [ + [ + 'key' => 'transaction_id', + 'comparison' => $payment_id, + ], + ], + ] + ); + $order = $orders[0]; + $order_id = $order->get_id(); + } else { + $sql = "SELECT post_id + FROM {$wpdb->postmeta} WHERE meta_key = '_transaction_id' AND meta_value = %s"; - $order_id = $wpdb->get_var( - $wpdb->prepare( - $sql, - $payment_id - ) - ); - } - - return $order_id; - } - - public function create_payment_intent(){ - - $order_id = $_POST["order_id"]; - $this->gateway = $this->get_payplug_gateway($_POST['gateway']); - $order = wc_get_order($order_id); - $customer_id = PayplugWoocommerceHelper::is_pre_30() ? $order->customer_user : $order->get_customer_id(); - $return_url = esc_url_raw($order->get_checkout_order_received_url()); - $address_data = PayplugAddressData::from_order($order); - $amount = (int) PayplugWoocommerceHelper::get_payplug_amount($order->get_total()); - $amount = $this->gateway->validate_order_amount($amount); - - $payment_data = [ - 'amount' => $amount, - 'currency' => get_woocommerce_currency(), - 'allow_save_card' => $this->gateway->oneclick_available() && (int) $customer_id > 0, - 'billing' => $address_data->get_billing(), - 'shipping' => $address_data->get_shipping(), - 'hosted_payment' => [ - 'return_url' => $return_url, - ], - 'notification_url' => esc_url_raw(WC()->api_request_url('PayplugGateway')), - 'metadata' => [ - 'order_id' => $order_id, - 'customer_id' => ((int) $customer_id > 0) ? $customer_id : 'guest', - 'domain' => $this->limit_length(esc_url_raw(home_url()), 500) - ], - ]; - - if (PayplugWoocommerceHelper::is_checkout_block() && is_checkout()) { - $payment_data['metadata']['woocommerce_block'] = "CHECKOUT"; - - } elseif (PayplugWoocommerceHelper::is_cart_block() && is_cart()) { - $payment_data['metadata']['woocommerce_block'] = "CART"; - } - - if($this->gateway->id === "apple_pay"){ - unset($payment_data["allow_save_card"]); - - $payment_data["payment_method"] = $this->gateway->id; - $payment_data["payment_context"] = array( - 'apple_pay' => array( - 'domain_name' => $this->gateway->domain_name, - 'application_data' => base64_encode(json_encode(array( - 'apple_pay_domain' => $this->gateway->domain_name, - ))) - ) - ); - $payment_data["hosted_payment"]["cancel_url"] = esc_url_raw($order->get_cancel_order_url_raw()); - $payment_data["metadata"]["applepay_workflow"] = "checkout"; - } - - if($this->gateway->get_option('payment_method') === 'integrated' && $this->gateway->id === "payplug") { - $payment_data['initiator'] = 'PAYER'; - $payment_data['integration'] = 'INTEGRATED_PAYMENT'; - unset($payment_data['hosted_payment']['cancel_url']); - } - - if($this->gateway->get_option('payment_method') === 'popup' && $this->gateway->id === "american_express") { - $payment_data['payment_method'] = $this->gateway->id; - } - - /** - * Filter the payment data before it's used - * - * @param array $payment_data - * @param int $order_id - * @param array $customer_details - * @param PayplugAddressData $address_data - */ - $payment_data = apply_filters('payplug_gateway_payment_data', $payment_data, $order_id, [], $address_data); - - /** - * - */ - $payment = $this->gateway->api->payment_create($payment_data); - - // Save transaction id on the order - PayplugWoocommerceHelper::is_pre_30() ? update_post_meta($order_id, '_transaction_id', $payment->id) : $order->set_transaction_id($payment->id); - - if (is_callable([$order, 'save'])) { - $order->save(); - } - - $metadata = PayplugWoocommerceHelper::extract_transaction_metadata($payment); - PayplugWoocommerceHelper::save_transaction_metadata($order, $metadata); - - wp_send_json_success(array( - 'payment_id' => $payment->id, - 'merchant_session' => isset($payment->payment_method["merchant_session"]) ? $payment->payment_method["merchant_session"]: null, - 'redirect' => !empty($payment->hosted_payment->payment_url) ? $payment->hosted_payment->payment_url : $return_url, - 'cancel' => esc_url_raw($order->get_cancel_order_url_raw()) - )); - } - - - /** - * Returns an instantiated gateway. - * @return PayplugGateway - */ - protected function get_payplug_gateway($id) { - if ( ! isset( $this->gateway ) ) { - $gateways = WC()->payment_gateways()->payment_gateways(); - foreach($gateways as $gateway){ - if($gateway->id === $id){ - return $gateway; - } - } - } - } - - + $order_id = $wpdb->get_var( + $wpdb->prepare( + $sql, + $payment_id + ) + ); + } + + return $order_id; + } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index df1cdf5a..bac61178 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,16 +1,14 @@ array( - "id" => "american_express", - "title" => "Pay with Amex", - "method_title" => "Pay with Amex", - "description" => "", - "method_description" => "", - "has_fields" => false, - "image" => 'american_express Icon', - "enable" => "no", - "enable_on_test_mode" => false, - ), - "apple_pay" => array( - "id" => "apple_pay", - "title" => "Pay with Apple Pay", - "method_title" => "Pay with Apple Pay", - "description" => '
    ', - "method_description" => "", - "has_fields" => false, - "image" => 'Apple Pay', - "enable" => "no", - "enable_on_test_mode" => false, - ), - "bancontact" => array( - "id" => "bancontact", - "title" => "Pay with Bancontact", - "method_title" => "Pay with Bancontact", - "description" => "", - "method_description" => "Activate Bancontact payments.", - "has_fields" => false, - "image" => 'bancontact Icon', - "enable" => "no", - "enable_on_test_mode" => false, - ), - "payplug" => array( - "id" => "payplug", - "title" => "Credit card checkout", - "method_title" => "PayPlug", - "description" => "You are in TEST MODE. In test mode you can use the card 4242424242424242 with any valid expiration date and CVC.", - "method_description" => "Enable PayPlug for your customers.", - "has_fields" => false, - "image" => 'Visa & Mastercard', - "enable" => "no", - "enable_on_test_mode" => true, - ), - "oney_x3_with_fees" => array( - "id" => "oney_x3_with_fees", - "title" => "Pay by card in 3x with Oney", - "method_title" => "PayPlug Oney 3x", - "description" => "", - "method_description" => "Enable PayPlug Oney 3x for your customers.", - "has_fields" => false, - "image" => "x3_with_fees.svg", - "enable" => "no", - "enable_on_test_mode" => true, - ), - "oney_x3_without_fees" => array( - "id" => "oney_x3_without_fees", - "title" => "Pay by credit card in 3x installments without fees with Oney", - "method_title" => "PayPlug Oney 3x", - "description" => "", - "method_description" => "Enable PayPlug Oney 3x for your customers.", - "has_fields" => false, - "image" => "x3_without_fees.svg", - "enable" => "no", - "enable_on_test_mode" => true, - ), - "oney_x4_with_fees" => array( - "id" => "oney_x4_with_fees", - "title" => "Pay by card in 4x with Oney", - "method_title" => "PayPlug Oney 4x", - "description" => "", - "method_description" => "Enable PayPlug Oney 4x for your customers.", - "has_fields" => false, - "image" => "x4_with_fees.svg", - "enable" => "no", - "enable_on_test_mode" => true, - ), - "oney_x4_without_fees" => array( - "id" => "oney_x4_without_fees", - "title" => "Pay by credit card in 4x installments without fees with Oney", - "method_title" => "PayPlug Oney 4x", - "description" => "", - "method_description" => "Enable PayPlug Oney 4x for your customers.", - "has_fields" => false, - "image" => "x4_without_fees.svg", - "enable" => "no", - "enable_on_test_mode" => true, - ), - "ideal" => array( - "id" => "ideal", - "title" => "Pay with iDEAL", - "method_title" => "Pay with iDEAL", - "description" => "", - "method_description" => "", - "has_fields" => false, - "image" => 'ideal Icon', - "enable" => "no", - "enable_on_test_mode" => false, - ), - "mybank" => array( - "id" => "mybank", - "title" => "Pay with MyBank", - "method_title" => "Pay with MyBank", - "description" => "", - "method_description" => "", - "has_fields" => false, - "image" => 'mybank Icon', - "enable" => "no", - "enable_on_test_mode" => false, - ), - "satispay" => array( - "id" => "satispay", - "title" => "Pay with Satispay", - "method_title" => "Pay with Satispay", - "description" => "", - "method_description" => "", - "has_fields" => false, - "image" => 'satispay Icon', - "enable" => "no", - "enable_on_test_mode" => false, - ) - ); - +class PaymentGateways +{ + public static $gateways = [ + 'american_express' => [ + 'id' => 'american_express', + 'title' => 'Pay with Amex', + 'method_title' => 'Pay with Amex', + 'description' => '', + 'method_description' => '', + 'has_fields' => false, + 'image' => 'american_express Icon', + 'enable' => 'no', + 'enable_on_test_mode' => false, + ], + 'apple_pay' => [ + 'id' => 'apple_pay', + 'title' => 'Pay with Apple Pay', + 'method_title' => 'Pay with Apple Pay', + 'description' => '
    ', + 'method_description' => '', + 'has_fields' => false, + 'image' => 'Apple Pay', + 'enable' => 'no', + 'enable_on_test_mode' => false, + ], + 'bancontact' => [ + 'id' => 'bancontact', + 'title' => 'Pay with Bancontact', + 'method_title' => 'Pay with Bancontact', + 'description' => '', + 'method_description' => 'Activate Bancontact payments.', + 'has_fields' => false, + 'image' => 'bancontact Icon', + 'enable' => 'no', + 'enable_on_test_mode' => false, + ], + 'payplug' => [ + 'id' => 'payplug', + 'title' => 'Credit card checkout', + 'method_title' => 'PayPlug', + 'description' => 'You are in TEST MODE. In test mode you can use the card 4242424242424242 with any valid expiration date and CVC.', + 'method_description' => 'Enable PayPlug for your customers.', + 'has_fields' => false, + 'image' => 'Visa & Mastercard', + 'enable' => 'no', + 'enable_on_test_mode' => true, + ], + 'oney_x3_with_fees' => [ + 'id' => 'oney_x3_with_fees', + 'title' => 'Pay by card in 3x with Oney', + 'method_title' => 'PayPlug Oney 3x', + 'description' => '', + 'method_description' => 'Enable PayPlug Oney 3x for your customers.', + 'has_fields' => false, + 'image' => 'x3_with_fees.svg', + 'enable' => 'no', + 'enable_on_test_mode' => true, + ], + 'oney_x3_without_fees' => [ + 'id' => 'oney_x3_without_fees', + 'title' => 'Pay by credit card in 3x installments without fees with Oney', + 'method_title' => 'PayPlug Oney 3x', + 'description' => '', + 'method_description' => 'Enable PayPlug Oney 3x for your customers.', + 'has_fields' => false, + 'image' => 'x3_without_fees.svg', + 'enable' => 'no', + 'enable_on_test_mode' => true, + ], + 'oney_x4_with_fees' => [ + 'id' => 'oney_x4_with_fees', + 'title' => 'Pay by card in 4x with Oney', + 'method_title' => 'PayPlug Oney 4x', + 'description' => '', + 'method_description' => 'Enable PayPlug Oney 4x for your customers.', + 'has_fields' => false, + 'image' => 'x4_with_fees.svg', + 'enable' => 'no', + 'enable_on_test_mode' => true, + ], + 'oney_x4_without_fees' => [ + 'id' => 'oney_x4_without_fees', + 'title' => 'Pay by credit card in 4x installments without fees with Oney', + 'method_title' => 'PayPlug Oney 4x', + 'description' => '', + 'method_description' => 'Enable PayPlug Oney 4x for your customers.', + 'has_fields' => false, + 'image' => 'x4_without_fees.svg', + 'enable' => 'no', + 'enable_on_test_mode' => true, + ], + 'ideal' => [ + 'id' => 'ideal', + 'title' => 'Pay with iDEAL', + 'method_title' => 'Pay with iDEAL', + 'description' => '', + 'method_description' => '', + 'has_fields' => false, + 'image' => 'ideal Icon', + 'enable' => 'no', + 'enable_on_test_mode' => false, + ], + 'mybank' => [ + 'id' => 'mybank', + 'title' => 'Pay with MyBank', + 'method_title' => 'Pay with MyBank', + 'description' => '', + 'method_description' => '', + 'has_fields' => false, + 'image' => 'mybank Icon', + 'enable' => 'no', + 'enable_on_test_mode' => false, + ], + 'satispay' => [ + 'id' => 'satispay', + 'title' => 'Pay with Satispay', + 'method_title' => 'Pay with Satispay', + 'description' => '', + 'method_description' => '', + 'has_fields' => false, + 'image' => 'satispay Icon', + 'enable' => 'no', + 'enable_on_test_mode' => false, + ], + ]; } - - - diff --git a/tests/phpunit/PayplugWoocommerce_test.php b/tests/phpunit/PayplugWoocommerce_test.php index 1ec64e18..23bed4ef 100644 --- a/tests/phpunit/PayplugWoocommerce_test.php +++ b/tests/phpunit/PayplugWoocommerce_test.php @@ -4,130 +4,128 @@ use Payplug\PayplugWoocommerce\Front\PayplugOney\Country\OneyFR; use Payplug\PayplugWoocommerce\PayplugWoocommerce; -use phpDocumentor\Reflection\Types\Void_; -use PHPUnit\Framework\TestCase; -use SebastianBergmann\Type\VoidType; use function PHPUnit\Framework\assertTrue; +use PHPUnit\Framework\TestCase; -class PayplugWoocommerce_test extends TestCase{ - - private $payplug_woocommerce; - - protected function setUp(): void { - $this->payplug_woocommerce = PayplugWoocommerce::get_instance(); - parent::setUp(); - } - - /** - * test if there's an active woocommerce version - */ - public function test_woocommerce_version(){ - $wc = function_exists( 'WC' ) ? WC() : $GLOBALS['woocommerce']; - self::assertNotEmpty($wc->version); - self::assertNotEmpty(defined( 'WC_VERSION' )); - self::assertIsString($wc->version); - - } - - /** - * test oney animation is disabled if empty options - */ - public function test_disable_empty_options_animation_handlers(){ - $mockPayplugWoocommerce = $this->createMock(PayplugWoocommerce::class); - $mockPayplugWoocommerce - ->method('animationHandlers') - ->willReturn(false); - - update_option("woocommerce_payplug_settings", []); - self::assertFalse( $mockPayplugWoocommerce->animationHandlers() ); - - } - - /** - * test oney animation is disabled without merchant country - */ - public function test_disable_empty_merchant_country_animation_handlers(){ - $mockPayplugWoocommerce = $this->createMock(PayplugWoocommerce::class); - $mockPayplugWoocommerce - ->method('animationHandlers') - ->willReturn(false); - - update_option("woocommerce_payplug_settings", ["payplug_merchant_country"=>"", "oney_type"=>"something"]); - self::assertFalse( $mockPayplugWoocommerce->animationHandlers() ); - - } - - /** - * test oney animation is disabled without oney type - */ - public function test_disable_empty_oney_type_animation_handlers(){ - $mockPayplugWoocommerce = $this->createMock(PayplugWoocommerce::class); - $mockPayplugWoocommerce - ->method('animationHandlers') - ->willReturn(false); - - update_option("woocommerce_payplug_settings", ["payplug_merchant_country"=>"something", "oney_type"=>""]); - self::assertFalse( $mockPayplugWoocommerce->animationHandlers() ); - - } - - /** - * test if oney animations are being instatiated - * OneyAnimation - * OneyFR - */ - public function test_animation_handlers(){ - $mockPayplugWoocommerce = $this->createMock(PayplugWoocommerce::class); - $mockPayplugWoocommerce - ->method('animationHandlers') - ->willReturn(true); - - update_option("woocommerce_payplug_settings", ["payplug_merchant_country" => "FR", "oney_type"=>"without_fees"]); - self::assertTrue( $mockPayplugWoocommerce->animationHandlers() ); - - } - - /** - * assert all classes we're loading exists - * assert we're loading all gateways - */ - public function test_register_payplug_gateway_exists(){ - $results = $this->payplug_woocommerce->register_payplug_gateway([]); - $gateways = 0; - foreach ($results as $k => $class){ - self::assertTrue(class_exists($class)); - $gateways++; - } - - self::assertTrue( $gateways === 11 ); - } - - /** - * tested on e2e side, this is simply to declare actions to load - */ - public function test_woocommerce_gateways_block_support(){ - assertTrue(true); - } - - /** - * assert added plugin_action_links - */ - public function test_plugin_action_links(){ - self::assertIsArray($this->payplug_woocommerce->plugin_action_links()); - self::assertNotEmpty($this->payplug_woocommerce->plugin_action_links()); - - foreach ($this->payplug_woocommerce->plugin_action_links() as $k){ - self::assertIsString($k); - } - - try { - $this->payplug_woocommerce->plugin_action_links(""); - } - catch( \Exception $e) - { - $this->assertInstanceOf(\Exception::class, $e); - } - - } - +class PayplugWoocommerce_test extends TestCase +{ + private $payplug_woocommerce; + + protected function setUp(): void + { + $this->payplug_woocommerce = PayplugWoocommerce::get_instance(); + parent::setUp(); + } + + /** + * test if there's an active woocommerce version. + */ + public function testWoocommerceVersion() + { + $wc = function_exists('WC') ? WC() : $GLOBALS['woocommerce']; + self::assertNotEmpty($wc->version); + self::assertNotEmpty(defined('WC_VERSION')); + self::assertIsString($wc->version); + } + + /** + * test oney animation is disabled if empty options. + */ + public function testDisableEmptyOptionsAnimationHandlers() + { + $mockPayplugWoocommerce = $this->createMock(PayplugWoocommerce::class); + $mockPayplugWoocommerce + ->method('animationHandlers') + ->willReturn(false); + + update_option('woocommerce_payplug_settings', []); + self::assertFalse($mockPayplugWoocommerce->animationHandlers()); + } + + /** + * test oney animation is disabled without merchant country. + */ + public function testDisableEmptyMerchantCountryAnimationHandlers() + { + $mockPayplugWoocommerce = $this->createMock(PayplugWoocommerce::class); + $mockPayplugWoocommerce + ->method('animationHandlers') + ->willReturn(false); + + update_option('woocommerce_payplug_settings', ['payplug_merchant_country' => '', 'oney_type' => 'something']); + self::assertFalse($mockPayplugWoocommerce->animationHandlers()); + } + + /** + * test oney animation is disabled without oney type. + */ + public function testDisableEmptyOneyTypeAnimationHandlers() + { + $mockPayplugWoocommerce = $this->createMock(PayplugWoocommerce::class); + $mockPayplugWoocommerce + ->method('animationHandlers') + ->willReturn(false); + + update_option('woocommerce_payplug_settings', ['payplug_merchant_country' => 'something', 'oney_type' => '']); + self::assertFalse($mockPayplugWoocommerce->animationHandlers()); + } + + /** + * test if oney animations are being instatiated + * OneyAnimation + * OneyFR. + */ + public function testAnimationHandlers() + { + $mockPayplugWoocommerce = $this->createMock(PayplugWoocommerce::class); + $mockPayplugWoocommerce + ->method('animationHandlers') + ->willReturn(true); + + update_option('woocommerce_payplug_settings', ['payplug_merchant_country' => 'FR', 'oney_type' => 'without_fees']); + self::assertTrue($mockPayplugWoocommerce->animationHandlers()); + } + + /** + * assert all classes we're loading exists + * assert we're loading all gateways. + */ + public function testRegisterPayplugGatewayExists() + { + $results = $this->payplug_woocommerce->register_payplug_gateway([]); + $gateways = 0; + foreach ($results as $k => $class) { + self::assertTrue(class_exists($class)); + ++$gateways; + } + + self::assertTrue(11 === $gateways); + } + + /** + * tested on e2e side, this is simply to declare actions to load. + */ + public function testWoocommerceGatewaysBlockSupport() + { + assertTrue(true); + } + + /** + * assert added plugin_action_links. + */ + public function testPluginActionLinks() + { + self::assertIsArray($this->payplug_woocommerce->plugin_action_links()); + self::assertNotEmpty($this->payplug_woocommerce->plugin_action_links()); + + foreach ($this->payplug_woocommerce->plugin_action_links() as $k) { + self::assertIsString($k); + } + + try { + $this->payplug_woocommerce->plugin_action_links(''); + } catch (\Exception $e) { + $this->assertInstanceOf(\Exception::class, $e); + } + } } diff --git a/tests/phpunit/src/Gateway/PaymentGateway.php b/tests/phpunit/src/Gateway/PaymentGateway.php index f51bcd85..cd19c2de 100644 --- a/tests/phpunit/src/Gateway/PaymentGateway.php +++ b/tests/phpunit/src/Gateway/PaymentGateway.php @@ -3,41 +3,40 @@ namespace Payplug\PayplugWoocommerce\Tests\phpunit\src\Gateway; use Monolog\Test\TestCase; - use Payplug\PayplugWoocommerce\PayplugWoocommerce; use Payplug\PayplugWoocommerce\Tests\phpunit\Mocks\PaymentGateways; -class PaymentGateway extends TestCase { - - private $payment_gateways = array(); - - protected function setUp(): void { - $this->mock_payment_gateways = PaymentGateways::$gateways; - $payplug = PayplugWoocommerce::get_instance(); - $this->payment_gateways = $payplug->register_payplug_gateway([]); - } - - public function test_standard_gateway_properties(){ - foreach ($this->payment_gateways as $class){ - $gateway = new $class; - $gateway_mock = $this->mock_payment_gateways[$gateway->id]; - - self::assertTrue(!empty($this->mock_payment_gateways[$gateway->id])); - self::assertTrue($gateway_mock['id'] === $gateway->id ); - self::assertTrue($gateway_mock['title'] === $gateway->get_title() ); - self::assertTrue($gateway_mock['method_title'] === $gateway->get_method_title() ); - self::assertTrue($gateway_mock['description'] === $gateway->get_description() ); - self::assertTrue($gateway_mock['method_description'] === $gateway->get_method_description() ); - self::assertTrue($gateway_mock['has_fields'] === $gateway->has_fields() ); - self::assertTrue($gateway_mock['enable'] === $gateway->enabled ); - self::assertTrue($gateway_mock['enable_on_test_mode'] === $gateway::ENABLE_ON_TEST_MODE ); - - //TODO:: untestable method on oney refact - if(!in_array($gateway->id, ['oney_x3_with_fees', 'oney_x3_without_fees', 'oney_x4_with_fees', 'oney_x4_without_fees'] )){ - self::assertTrue($gateway_mock['image'] === $gateway->get_icon() ); - } - - } - } - +class PaymentGateway extends TestCase +{ + private $payment_gateways = []; + + protected function setUp(): void + { + $this->mock_payment_gateways = PaymentGateways::$gateways; + $payplug = PayplugWoocommerce::get_instance(); + $this->payment_gateways = $payplug->register_payplug_gateway([]); + } + + public function testStandardGatewayProperties() + { + foreach ($this->payment_gateways as $class) { + $gateway = new $class(); + $gateway_mock = $this->mock_payment_gateways[$gateway->id]; + + self::assertTrue(!empty($this->mock_payment_gateways[$gateway->id])); + self::assertTrue($gateway_mock['id'] === $gateway->id); + self::assertTrue($gateway_mock['title'] === $gateway->get_title()); + self::assertTrue($gateway_mock['method_title'] === $gateway->get_method_title()); + self::assertTrue($gateway_mock['description'] === $gateway->get_description()); + self::assertTrue($gateway_mock['method_description'] === $gateway->get_method_description()); + self::assertTrue($gateway_mock['has_fields'] === $gateway->has_fields()); + self::assertTrue($gateway_mock['enable'] === $gateway->enabled); + self::assertTrue($gateway_mock['enable_on_test_mode'] === $gateway::ENABLE_ON_TEST_MODE); + + //TODO:: untestable method on oney refact + if (!in_array($gateway->id, ['oney_x3_with_fees', 'oney_x3_without_fees', 'oney_x4_with_fees', 'oney_x4_without_fees'])) { + self::assertTrue($gateway_mock['image'] === $gateway->get_icon()); + } + } + } } diff --git a/tests/phpunit/src/Gateway/PayplugGenericGatewayTest.php b/tests/phpunit/src/Gateway/PayplugGenericGatewayTest.php index dc64c291..74e99a2e 100644 --- a/tests/phpunit/src/Gateway/PayplugGenericGatewayTest.php +++ b/tests/phpunit/src/Gateway/PayplugGenericGatewayTest.php @@ -1,64 +1,59 @@ $gateway_config) { - // Create a mock for WC_Order - $order = $this->createMock(\WC_Order::class); - - // Configure the mock to return the gateway ID when get_payment_method is called - $order->method('get_payment_method') - ->willReturn($gateway_id); - - // Create an instance of the gateway with correct ID - $gateway = new PayplugGenericGateway(); - $gateway->id = $gateway_id; - $gateway->enable_refund = false; - - // Start output buffering to capture the echo output - ob_start(); - - // Call the method - $gateway->refund_not_available($order); - - // Get the output and clean the buffer - $output = ob_get_clean(); - - // Assert that the output contains the expected error message with gateway ID - $this->assertStringContainsString( - "

    " . __('payplug_refund_disabled_error', 'payplug') . "

    ", - $output, - "Failed asserting that refund_not_available works for gateway: $gateway_id" - ); - } - } - - - /** - * Clean up the test environment - */ - public function tearDown(): void - { - parent::tearDown(); - } + /** + * Clean up the test environment. + */ + public function tearDown(): void + { + parent::tearDown(); + } + + /** + * Test that refund is not available when disabled for all available gateways. + */ + public function testRefundNotAvailable() + { + // Get all available gateways from our mock + $available_gateways = PaymentGateways::$gateways; + + // Test each gateway + foreach ($available_gateways as $gateway_id => $gateway_config) { + // Create a mock for WC_Order + $order = $this->createMock(\WC_Order::class); + + // Configure the mock to return the gateway ID when get_payment_method is called + $order->method('get_payment_method') + ->willReturn($gateway_id); + + // Create an instance of the gateway with correct ID + $gateway = new PayplugGenericGateway(); + $gateway->id = $gateway_id; + $gateway->enable_refund = false; + + // Start output buffering to capture the echo output + ob_start(); + + // Call the method + $gateway->refund_not_available($order); + + // Get the output and clean the buffer + $output = ob_get_clean(); + + // Assert that the output contains the expected error message with gateway ID + $this->assertStringContainsString( + "

    " . __('payplug_refund_disabled_error', 'payplug') . '

    ', + $output, + "Failed asserting that refund_not_available works for gateway: {$gateway_id}" + ); + } + } } diff --git a/uninstall.php b/uninstall.php index f6e4b26a..91b286d5 100644 --- a/uninstall.php +++ b/uninstall.php @@ -1,18 +1,16 @@ 'print_r', - 'args' => array( $expression, true ), - ), - array( - 'func' => 'var_export', - 'args' => array( $expression, true ), - ), - array( - 'func' => 'json_encode', - 'args' => array( $expression ), - ), - array( - 'func' => 'serialize', - 'args' => array( $expression ), - ), - ); +if (!function_exists('wc_print_r')) { + /** + * Prints human-readable information about a variable. + * + * Some server environments blacklist some debugging functions. This function provides a safe way to + * turn an expression into a printable, readable form without calling blacklisted functions. + * + * @since 3.0 + * + * @param mixed $expression the expression to be printed + * @param bool $return Optional. Default false. Set to true to return the human-readable string. + * + * @return bool|string False if expression could not be printed. True if the expression was printed. + * If $return is true, a string representation will be returned. + */ + function wc_print_r($expression, $return = false) + { + $alternatives = [ + [ + 'func' => 'print_r', + 'args' => [$expression, true], + ], + [ + 'func' => 'var_export', + 'args' => [$expression, true], + ], + [ + 'func' => 'json_encode', + 'args' => [$expression], + ], + [ + 'func' => 'serialize', + 'args' => [$expression], + ], + ]; - $alternatives = apply_filters( 'woocommerce_print_r_alternatives', $alternatives, $expression ); + $alternatives = apply_filters('woocommerce_print_r_alternatives', $alternatives, $expression); - foreach ( $alternatives as $alternative ) { - if ( function_exists( $alternative['func'] ) ) { - $res = call_user_func_array( $alternative['func'], $alternative['args'] ); - if ( $return ) { - return $res; - } else { - echo $res; // WPCS: XSS ok. + foreach ($alternatives as $alternative) { + if (function_exists($alternative['func'])) { + $res = call_user_func_array($alternative['func'], $alternative['args']); + if ($return) { + return $res; + } + echo $res; // WPCS: XSS ok. - return true; - } - } - } + return true; + } + } - return false; - } -} \ No newline at end of file + return false; + } +}