| 1 | # automatically generated file, don't edit | ||||||||||
| 2 | |||||||||||
| 3 | |||||||||||
| 4 | |||||||||||
| 5 | # Copyright 2026 David Cantrell, derived from data from libphonenumber | ||||||||||
| 6 | # http://code.google.com/p/libphonenumber/ | ||||||||||
| 7 | # | ||||||||||
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||
| 9 | # you may not use this file except in compliance with the License. | ||||||||||
| 10 | # You may obtain a copy of the License at | ||||||||||
| 11 | # | ||||||||||
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||
| 13 | # | ||||||||||
| 14 | # Unless required by applicable law or agreed to in writing, software | ||||||||||
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, | ||||||||||
| 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||||
| 17 | # See the License for the specific language governing permissions and | ||||||||||
| 18 | # limitations under the License. | ||||||||||
| 19 | package Number::Phone::StubCountry::MQ; | ||||||||||
| 20 | 3 | ▶ | use base qw(Number::Phone::StubCountry); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 3 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 3 | our $VERSION = 1.20260904101550; | |||||||||
| 26 | |||||||||||
| 27 | 3 | my $formatters = [ | |||||||||
| 28 | { | ||||||||||
| 29 | 'format' => '$1 $2 $3 $4', | ||||||||||
| 30 | 'leading_digits' => ' | ||||||||||
| 31 | [5-79]| | ||||||||||
| 32 | 8(?: | ||||||||||
| 33 | 0[6-9]| | ||||||||||
| 34 | [36] | ||||||||||
| 35 | ) | ||||||||||
| 36 | ', | ||||||||||
| 37 | 'national_rule' => '0$1', | ||||||||||
| 38 | 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})' | ||||||||||
| 39 | }, | ||||||||||
| 40 | { | ||||||||||
| 41 | 'format' => '$1 $2 $3 $4', | ||||||||||
| 42 | 'leading_digits' => '8', | ||||||||||
| 43 | 'national_rule' => '0$1', | ||||||||||
| 44 | 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})' | ||||||||||
| 45 | } | ||||||||||
| 46 | ]; | ||||||||||
| 47 | |||||||||||
| 48 | 3 | my $validators = { | |||||||||
| 49 | 'fixed_line' => ' | ||||||||||
| 50 | (?: | ||||||||||
| 51 | 59(?: | ||||||||||
| 52 | 6(?: | ||||||||||
| 53 | [03-7]\\d| | ||||||||||
| 54 | 1[05]| | ||||||||||
| 55 | 2[7-9]| | ||||||||||
| 56 | 8[0-39]| | ||||||||||
| 57 | 9[04-9] | ||||||||||
| 58 | )| | ||||||||||
| 59 | 89\\d | ||||||||||
| 60 | )| | ||||||||||
| 61 | 80[6-9]\\d\\d| | ||||||||||
| 62 | 9(?: | ||||||||||
| 63 | 477[6-9]| | ||||||||||
| 64 | 767[4589] | ||||||||||
| 65 | ) | ||||||||||
| 66 | )\\d{4} | ||||||||||
| 67 | ', | ||||||||||
| 68 | 'geographic' => ' | ||||||||||
| 69 | (?: | ||||||||||
| 70 | 59(?: | ||||||||||
| 71 | 6(?: | ||||||||||
| 72 | [03-7]\\d| | ||||||||||
| 73 | 1[05]| | ||||||||||
| 74 | 2[7-9]| | ||||||||||
| 75 | 8[0-39]| | ||||||||||
| 76 | 9[04-9] | ||||||||||
| 77 | )| | ||||||||||
| 78 | 89\\d | ||||||||||
| 79 | )| | ||||||||||
| 80 | 80[6-9]\\d\\d| | ||||||||||
| 81 | 9(?: | ||||||||||
| 82 | 477[6-9]| | ||||||||||
| 83 | 767[4589] | ||||||||||
| 84 | ) | ||||||||||
| 85 | )\\d{4} | ||||||||||
| 86 | ', | ||||||||||
| 87 | 'mobile' => ' | ||||||||||
| 88 | (?: | ||||||||||
| 89 | 69[67]\\d\\d| | ||||||||||
| 90 | 7091[0-3] | ||||||||||
| 91 | )\\d{4} | ||||||||||
| 92 | ', | ||||||||||
| 93 | 'pager' => '', | ||||||||||
| 94 | 'personal_number' => '', | ||||||||||
| 95 | 'specialrate' => '(8[129]\\d{7})', | ||||||||||
| 96 | 'toll_free' => '80[0-5]\\d{6}', | ||||||||||
| 97 | 'voip' => ' | ||||||||||
| 98 | 9(?: | ||||||||||
| 99 | 397[0-3]| | ||||||||||
| 100 | 477[0-5]| | ||||||||||
| 101 | 76(?: | ||||||||||
| 102 | 6\\d| | ||||||||||
| 103 | 7[0-367] | ||||||||||
| 104 | ) | ||||||||||
| 105 | )\\d{4} | ||||||||||
| 106 | ' | ||||||||||
| 107 | }; | ||||||||||
| 108 | 3 | my $timezones = { | |||||||||
| 109 | '' => [ | ||||||||||
| 110 | 'America/Martinique' | ||||||||||
| 111 | ] | ||||||||||
| 112 | }; | ||||||||||
| 113 | |||||||||||
| 114 | 33 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 115 | 33 | my $class = shift; | |||||||||
| 116 | 33 | my $number = shift; | |||||||||
| 117 | 33 | $number =~ s/(^\+596|\D)//g; | |||||||||
| 118 | 33 | my $self = bless({ country_code => '596', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, }, $class); | |||||||||
| 119 | 33 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 120 | 3 | $number =~ s/^(?:0)//; | |||||||||
| 121 | 3 | $self = bless({ country_code => '596', number => $number, formatters => $formatters, validators => $validators, }, $class); | |||||||||
| 122 | 3 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 123 | } | ||||||||||
| 124 | 3 | 1; | |||||||||