line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 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::MU; |
20
|
2
|
|
|
2
|
|
1252
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
232
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
24
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
53
|
|
23
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
66
|
|
24
|
2
|
|
|
2
|
|
26
|
use utf8; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
15
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => ' |
31
|
|
|
|
|
|
|
[2-46]| |
32
|
|
|
|
|
|
|
8[013] |
33
|
|
|
|
|
|
|
', |
34
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
{ |
37
|
|
|
|
|
|
|
'format' => '$1 $2', |
38
|
|
|
|
|
|
|
'leading_digits' => '[57]', |
39
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{4})' |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
{ |
42
|
|
|
|
|
|
|
'format' => '$1 $2', |
43
|
|
|
|
|
|
|
'leading_digits' => '8', |
44
|
|
|
|
|
|
|
'pattern' => '(\\d{5})(\\d{5})' |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
]; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $validators = { |
49
|
|
|
|
|
|
|
'fixed_line' => ' |
50
|
|
|
|
|
|
|
(?: |
51
|
|
|
|
|
|
|
2(?: |
52
|
|
|
|
|
|
|
[0346-8]\\d| |
53
|
|
|
|
|
|
|
1[0-7] |
54
|
|
|
|
|
|
|
)| |
55
|
|
|
|
|
|
|
4(?: |
56
|
|
|
|
|
|
|
[013568]\\d| |
57
|
|
|
|
|
|
|
2[4-8] |
58
|
|
|
|
|
|
|
)| |
59
|
|
|
|
|
|
|
54(?: |
60
|
|
|
|
|
|
|
[3-5]\\d| |
61
|
|
|
|
|
|
|
71 |
62
|
|
|
|
|
|
|
)| |
63
|
|
|
|
|
|
|
6\\d\\d| |
64
|
|
|
|
|
|
|
8(?: |
65
|
|
|
|
|
|
|
14| |
66
|
|
|
|
|
|
|
3[129] |
67
|
|
|
|
|
|
|
) |
68
|
|
|
|
|
|
|
)\\d{4} |
69
|
|
|
|
|
|
|
', |
70
|
|
|
|
|
|
|
'geographic' => ' |
71
|
|
|
|
|
|
|
(?: |
72
|
|
|
|
|
|
|
2(?: |
73
|
|
|
|
|
|
|
[0346-8]\\d| |
74
|
|
|
|
|
|
|
1[0-7] |
75
|
|
|
|
|
|
|
)| |
76
|
|
|
|
|
|
|
4(?: |
77
|
|
|
|
|
|
|
[013568]\\d| |
78
|
|
|
|
|
|
|
2[4-8] |
79
|
|
|
|
|
|
|
)| |
80
|
|
|
|
|
|
|
54(?: |
81
|
|
|
|
|
|
|
[3-5]\\d| |
82
|
|
|
|
|
|
|
71 |
83
|
|
|
|
|
|
|
)| |
84
|
|
|
|
|
|
|
6\\d\\d| |
85
|
|
|
|
|
|
|
8(?: |
86
|
|
|
|
|
|
|
14| |
87
|
|
|
|
|
|
|
3[129] |
88
|
|
|
|
|
|
|
) |
89
|
|
|
|
|
|
|
)\\d{4} |
90
|
|
|
|
|
|
|
', |
91
|
|
|
|
|
|
|
'mobile' => ' |
92
|
|
|
|
|
|
|
5(?: |
93
|
|
|
|
|
|
|
4(?: |
94
|
|
|
|
|
|
|
2[1-389]| |
95
|
|
|
|
|
|
|
7[1-9] |
96
|
|
|
|
|
|
|
)| |
97
|
|
|
|
|
|
|
87[15-8] |
98
|
|
|
|
|
|
|
)\\d{4}| |
99
|
|
|
|
|
|
|
(?: |
100
|
|
|
|
|
|
|
5(?: |
101
|
|
|
|
|
|
|
2[5-9]| |
102
|
|
|
|
|
|
|
4[3-689]| |
103
|
|
|
|
|
|
|
[57]\\d| |
104
|
|
|
|
|
|
|
8[0-689]| |
105
|
|
|
|
|
|
|
9[0-8] |
106
|
|
|
|
|
|
|
)| |
107
|
|
|
|
|
|
|
7(?: |
108
|
|
|
|
|
|
|
0[0-2]| |
109
|
|
|
|
|
|
|
3[013] |
110
|
|
|
|
|
|
|
) |
111
|
|
|
|
|
|
|
)\\d{5} |
112
|
|
|
|
|
|
|
', |
113
|
|
|
|
|
|
|
'pager' => '', |
114
|
|
|
|
|
|
|
'personal_number' => '', |
115
|
|
|
|
|
|
|
'specialrate' => '(30\\d{5})', |
116
|
|
|
|
|
|
|
'toll_free' => ' |
117
|
|
|
|
|
|
|
802\\d{7}| |
118
|
|
|
|
|
|
|
80[0-2]\\d{4} |
119
|
|
|
|
|
|
|
', |
120
|
|
|
|
|
|
|
'voip' => ' |
121
|
|
|
|
|
|
|
3(?: |
122
|
|
|
|
|
|
|
20| |
123
|
|
|
|
|
|
|
9\\d |
124
|
|
|
|
|
|
|
)\\d{4} |
125
|
|
|
|
|
|
|
' |
126
|
|
|
|
|
|
|
}; |
127
|
|
|
|
|
|
|
my %areanames = (); |
128
|
|
|
|
|
|
|
$areanames{fr} = {"2306", "Région\ Sud", |
129
|
|
|
|
|
|
|
"2302", "Région\ Nord", |
130
|
|
|
|
|
|
|
"2304", "Région\ Centrale",}; |
131
|
|
|
|
|
|
|
$areanames{es} = {"2304", "Región\ Central", |
132
|
|
|
|
|
|
|
"2302", "Región\ Norte", |
133
|
|
|
|
|
|
|
"2306", "Región\ Sur",}; |
134
|
|
|
|
|
|
|
$areanames{en} = {"2304", "Central\ Region", |
135
|
|
|
|
|
|
|
"23083", "Rodrigues", |
136
|
|
|
|
|
|
|
"2302", "North\ Region", |
137
|
|
|
|
|
|
|
"23081", "Agalega", |
138
|
|
|
|
|
|
|
"2306", "South\ Region",}; |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub new { |
141
|
16
|
|
|
16
|
1
|
41
|
my $class = shift; |
142
|
16
|
|
|
|
|
34
|
my $number = shift; |
143
|
16
|
|
|
|
|
100
|
$number =~ s/(^\+230|\D)//g; |
144
|
16
|
|
|
|
|
90
|
my $self = bless({ country_code => '230', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
145
|
16
|
100
|
|
|
|
80
|
return $self->is_valid() ? $self : undef; |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
1; |