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::NG; |
20
|
2
|
|
|
2
|
|
1677
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
330
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
76
|
use strict; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
56
|
|
23
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
50
|
|
24
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
14
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174404; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => '78', |
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{2})(\\d{3})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
[12]| |
38
|
|
|
|
|
|
|
9(?: |
39
|
|
|
|
|
|
|
0[3-9]| |
40
|
|
|
|
|
|
|
[1-9] |
41
|
|
|
|
|
|
|
) |
42
|
|
|
|
|
|
|
', |
43
|
|
|
|
|
|
|
'national_rule' => '0$1', |
44
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{3,4})' |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
48
|
|
|
|
|
|
|
'leading_digits' => ' |
49
|
|
|
|
|
|
|
[3-7]| |
50
|
|
|
|
|
|
|
8[2-9] |
51
|
|
|
|
|
|
|
', |
52
|
|
|
|
|
|
|
'national_rule' => '0$1', |
53
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{2,3})' |
54
|
|
|
|
|
|
|
}, |
55
|
|
|
|
|
|
|
{ |
56
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
57
|
|
|
|
|
|
|
'leading_digits' => '[7-9]', |
58
|
|
|
|
|
|
|
'national_rule' => '0$1', |
59
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})' |
60
|
|
|
|
|
|
|
}, |
61
|
|
|
|
|
|
|
{ |
62
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
63
|
|
|
|
|
|
|
'leading_digits' => '[78]', |
64
|
|
|
|
|
|
|
'national_rule' => '0$1', |
65
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})(\\d{4,5})' |
66
|
|
|
|
|
|
|
}, |
67
|
|
|
|
|
|
|
{ |
68
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
69
|
|
|
|
|
|
|
'leading_digits' => '[78]', |
70
|
|
|
|
|
|
|
'national_rule' => '0$1', |
71
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{5})(\\d{5,6})' |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
]; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
my $validators = { |
76
|
|
|
|
|
|
|
'fixed_line' => ' |
77
|
|
|
|
|
|
|
(?: |
78
|
|
|
|
|
|
|
(?: |
79
|
|
|
|
|
|
|
[1-356]\\d| |
80
|
|
|
|
|
|
|
4[02-8]| |
81
|
|
|
|
|
|
|
8[2-9] |
82
|
|
|
|
|
|
|
)\\d| |
83
|
|
|
|
|
|
|
9(?: |
84
|
|
|
|
|
|
|
0[3-9]| |
85
|
|
|
|
|
|
|
[1-9]\\d |
86
|
|
|
|
|
|
|
) |
87
|
|
|
|
|
|
|
)\\d{5}| |
88
|
|
|
|
|
|
|
7(?: |
89
|
|
|
|
|
|
|
0(?: |
90
|
|
|
|
|
|
|
[013-689]\\d| |
91
|
|
|
|
|
|
|
2[0-24-9] |
92
|
|
|
|
|
|
|
)\\d{3,4}| |
93
|
|
|
|
|
|
|
[1-79]\\d{6} |
94
|
|
|
|
|
|
|
)| |
95
|
|
|
|
|
|
|
(?: |
96
|
|
|
|
|
|
|
[12]\\d| |
97
|
|
|
|
|
|
|
4[147]| |
98
|
|
|
|
|
|
|
5[14579]| |
99
|
|
|
|
|
|
|
6[1578]| |
100
|
|
|
|
|
|
|
7[1-3578] |
101
|
|
|
|
|
|
|
)\\d{5} |
102
|
|
|
|
|
|
|
', |
103
|
|
|
|
|
|
|
'geographic' => ' |
104
|
|
|
|
|
|
|
(?: |
105
|
|
|
|
|
|
|
(?: |
106
|
|
|
|
|
|
|
[1-356]\\d| |
107
|
|
|
|
|
|
|
4[02-8]| |
108
|
|
|
|
|
|
|
8[2-9] |
109
|
|
|
|
|
|
|
)\\d| |
110
|
|
|
|
|
|
|
9(?: |
111
|
|
|
|
|
|
|
0[3-9]| |
112
|
|
|
|
|
|
|
[1-9]\\d |
113
|
|
|
|
|
|
|
) |
114
|
|
|
|
|
|
|
)\\d{5}| |
115
|
|
|
|
|
|
|
7(?: |
116
|
|
|
|
|
|
|
0(?: |
117
|
|
|
|
|
|
|
[013-689]\\d| |
118
|
|
|
|
|
|
|
2[0-24-9] |
119
|
|
|
|
|
|
|
)\\d{3,4}| |
120
|
|
|
|
|
|
|
[1-79]\\d{6} |
121
|
|
|
|
|
|
|
)| |
122
|
|
|
|
|
|
|
(?: |
123
|
|
|
|
|
|
|
[12]\\d| |
124
|
|
|
|
|
|
|
4[147]| |
125
|
|
|
|
|
|
|
5[14579]| |
126
|
|
|
|
|
|
|
6[1578]| |
127
|
|
|
|
|
|
|
7[1-3578] |
128
|
|
|
|
|
|
|
)\\d{5} |
129
|
|
|
|
|
|
|
', |
130
|
|
|
|
|
|
|
'mobile' => ' |
131
|
|
|
|
|
|
|
(?: |
132
|
|
|
|
|
|
|
702[0-24-9]| |
133
|
|
|
|
|
|
|
819[01] |
134
|
|
|
|
|
|
|
)\\d{6}| |
135
|
|
|
|
|
|
|
(?: |
136
|
|
|
|
|
|
|
70[13-689]| |
137
|
|
|
|
|
|
|
8(?: |
138
|
|
|
|
|
|
|
0[1-9]| |
139
|
|
|
|
|
|
|
1[0-8] |
140
|
|
|
|
|
|
|
)| |
141
|
|
|
|
|
|
|
9(?: |
142
|
|
|
|
|
|
|
0[1-9]| |
143
|
|
|
|
|
|
|
1[1-356] |
144
|
|
|
|
|
|
|
) |
145
|
|
|
|
|
|
|
)\\d{7} |
146
|
|
|
|
|
|
|
', |
147
|
|
|
|
|
|
|
'pager' => '', |
148
|
|
|
|
|
|
|
'personal_number' => '', |
149
|
|
|
|
|
|
|
'specialrate' => '(700\\d{7,11})', |
150
|
|
|
|
|
|
|
'toll_free' => '800\\d{7,11}', |
151
|
|
|
|
|
|
|
'voip' => '' |
152
|
|
|
|
|
|
|
}; |
153
|
|
|
|
|
|
|
my %areanames = (); |
154
|
|
|
|
|
|
|
$areanames{en} = {"23459", "Okitipupa", |
155
|
|
|
|
|
|
|
"23468", "Birnin\-Kebbi", |
156
|
|
|
|
|
|
|
"23444", "Makurdi", |
157
|
|
|
|
|
|
|
"23472", "Gombe", |
158
|
|
|
|
|
|
|
"23437", "Ijebu\ Ode", |
159
|
|
|
|
|
|
|
"23492", "Abuja", |
160
|
|
|
|
|
|
|
"23438", "Oyo", |
161
|
|
|
|
|
|
|
"23467", "Kontagora", |
162
|
|
|
|
|
|
|
"23479", "Jalingo", |
163
|
|
|
|
|
|
|
"23486", "Ahoada", |
164
|
|
|
|
|
|
|
"23483", "Owerri", |
165
|
|
|
|
|
|
|
"23448", "Awka", |
166
|
|
|
|
|
|
|
"23464", "Kano", |
167
|
|
|
|
|
|
|
"23452", "Benin", |
168
|
|
|
|
|
|
|
"23485", "Uyo", |
169
|
|
|
|
|
|
|
"23434", "Akura", |
170
|
|
|
|
|
|
|
"23499", "Abuja", |
171
|
|
|
|
|
|
|
"234906", "Abuja", |
172
|
|
|
|
|
|
|
"23447", "Lafia", |
173
|
|
|
|
|
|
|
"23469", "Zaria", |
174
|
|
|
|
|
|
|
"23442", "Enugu", |
175
|
|
|
|
|
|
|
"23474", "Damaturu", |
176
|
|
|
|
|
|
|
"23458", "Lokoja", |
177
|
|
|
|
|
|
|
"234909", "Abuja", |
178
|
|
|
|
|
|
|
"23494", "Abuja", |
179
|
|
|
|
|
|
|
"23439", "Abeokuta", |
180
|
|
|
|
|
|
|
"234907", "Abuja", |
181
|
|
|
|
|
|
|
"23457", "Auchi", |
182
|
|
|
|
|
|
|
"23497", "Abuja", |
183
|
|
|
|
|
|
|
"23462", "Kaduna", |
184
|
|
|
|
|
|
|
"23478", "Hadejia", |
185
|
|
|
|
|
|
|
"23454", "Sapele", |
186
|
|
|
|
|
|
|
"234908", "Abuja", |
187
|
|
|
|
|
|
|
"23498", "Abuja", |
188
|
|
|
|
|
|
|
"23477", "Bauchi", |
189
|
|
|
|
|
|
|
"23471", "Azare", |
190
|
|
|
|
|
|
|
"23460", "Sokobo", |
191
|
|
|
|
|
|
|
"23487", "Calabar", |
192
|
|
|
|
|
|
|
"234903", "Abuja", |
193
|
|
|
|
|
|
|
"23446", "Onitsha", |
194
|
|
|
|
|
|
|
"23488", "Umuahia", |
195
|
|
|
|
|
|
|
"23443", "Abakaliki", |
196
|
|
|
|
|
|
|
"23430", "Ado\ Ekiti", |
197
|
|
|
|
|
|
|
"23491", "Abuja", |
198
|
|
|
|
|
|
|
"23445", "Ogoja", |
199
|
|
|
|
|
|
|
"23451", "Owo", |
200
|
|
|
|
|
|
|
"23436", "Ile\ Ife", |
201
|
|
|
|
|
|
|
"23433", "New\ Bussa", |
202
|
|
|
|
|
|
|
"23435", "Oshogbo", |
203
|
|
|
|
|
|
|
"2342", "Ibadan", |
204
|
|
|
|
|
|
|
"23466", "Minna", |
205
|
|
|
|
|
|
|
"23463", "Gusau", |
206
|
|
|
|
|
|
|
"23484", "Port\ Harcourt", |
207
|
|
|
|
|
|
|
"23465", "Katsina", |
208
|
|
|
|
|
|
|
"23495", "Abuja", |
209
|
|
|
|
|
|
|
"23441", "Wukari", |
210
|
|
|
|
|
|
|
"23493", "Abuja", |
211
|
|
|
|
|
|
|
"23496", "Abuja", |
212
|
|
|
|
|
|
|
"234904", "Abuja", |
213
|
|
|
|
|
|
|
"23450", "Ikare", |
214
|
|
|
|
|
|
|
"234905", "Abuja", |
215
|
|
|
|
|
|
|
"23476", "Maiduguri", |
216
|
|
|
|
|
|
|
"23489", "Yenegoa", |
217
|
|
|
|
|
|
|
"23473", "Jos", |
218
|
|
|
|
|
|
|
"23475", "Yola", |
219
|
|
|
|
|
|
|
"2347020", "Pank\ Shin", |
220
|
|
|
|
|
|
|
"23461", "Kafanchau", |
221
|
|
|
|
|
|
|
"23456", "Asaba", |
222
|
|
|
|
|
|
|
"23431", "Ilorin", |
223
|
|
|
|
|
|
|
"23482", "Aba", |
224
|
|
|
|
|
|
|
"23455", "Agbor", |
225
|
|
|
|
|
|
|
"2341", "Lagos", |
226
|
|
|
|
|
|
|
"23453", "Warri",}; |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
sub new { |
229
|
13
|
|
|
13
|
1
|
31
|
my $class = shift; |
230
|
13
|
|
|
|
|
20
|
my $number = shift; |
231
|
13
|
|
|
|
|
85
|
$number =~ s/(^\+234|\D)//g; |
232
|
13
|
|
|
|
|
76
|
my $self = bless({ country_code => '234', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
233
|
13
|
100
|
|
|
|
64
|
return $self if ($self->is_valid()); |
234
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
235
|
1
|
|
|
|
|
14
|
$self = bless({ country_code => '234', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
236
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
1; |