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
|
|
1310
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
216
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
34
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
45
|
|
23
|
2
|
|
|
2
|
|
16
|
use warnings; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
14
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
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} = {"23445", "Ogoja", |
155
|
|
|
|
|
|
|
"23498", "Abuja", |
156
|
|
|
|
|
|
|
"23468", "Birnin\-Kebbi", |
157
|
|
|
|
|
|
|
"23434", "Akura", |
158
|
|
|
|
|
|
|
"23493", "Abuja", |
159
|
|
|
|
|
|
|
"23489", "Yenegoa", |
160
|
|
|
|
|
|
|
"23463", "Gusau", |
161
|
|
|
|
|
|
|
"2347020", "Pank\ Shin", |
162
|
|
|
|
|
|
|
"23459", "Okitipupa", |
163
|
|
|
|
|
|
|
"23438", "Oyo", |
164
|
|
|
|
|
|
|
"23450", "Ikare", |
165
|
|
|
|
|
|
|
"23494", "Abuja", |
166
|
|
|
|
|
|
|
"23433", "New\ Bussa", |
167
|
|
|
|
|
|
|
"23479", "Jalingo", |
168
|
|
|
|
|
|
|
"23464", "Kano", |
169
|
|
|
|
|
|
|
"23488", "Umuahia", |
170
|
|
|
|
|
|
|
"23447", "Lafia", |
171
|
|
|
|
|
|
|
"23454", "Sapele", |
172
|
|
|
|
|
|
|
"23483", "Owerri", |
173
|
|
|
|
|
|
|
"23469", "Zaria", |
174
|
|
|
|
|
|
|
"23474", "Damaturu", |
175
|
|
|
|
|
|
|
"23460", "Sokobo", |
176
|
|
|
|
|
|
|
"23499", "Abuja", |
177
|
|
|
|
|
|
|
"23446", "Onitsha", |
178
|
|
|
|
|
|
|
"23478", "Hadejia", |
179
|
|
|
|
|
|
|
"23453", "Warri", |
180
|
|
|
|
|
|
|
"23442", "Enugu", |
181
|
|
|
|
|
|
|
"23473", "Jos", |
182
|
|
|
|
|
|
|
"23430", "Ado\ Ekiti", |
183
|
|
|
|
|
|
|
"23484", "Port\ Harcourt", |
184
|
|
|
|
|
|
|
"23441", "Wukari", |
185
|
|
|
|
|
|
|
"23458", "Lokoja", |
186
|
|
|
|
|
|
|
"23439", "Abeokuta", |
187
|
|
|
|
|
|
|
"23475", "Yola", |
188
|
|
|
|
|
|
|
"23496", "Abuja", |
189
|
|
|
|
|
|
|
"23466", "Minna", |
190
|
|
|
|
|
|
|
"23437", "Ijebu\ Ode", |
191
|
|
|
|
|
|
|
"23461", "Kafanchau", |
192
|
|
|
|
|
|
|
"23492", "Abuja", |
193
|
|
|
|
|
|
|
"23462", "Kaduna", |
194
|
|
|
|
|
|
|
"23455", "Agbor", |
195
|
|
|
|
|
|
|
"234907", "Abuja", |
196
|
|
|
|
|
|
|
"23491", "Abuja", |
197
|
|
|
|
|
|
|
"23485", "Uyo", |
198
|
|
|
|
|
|
|
"23467", "Kontagora", |
199
|
|
|
|
|
|
|
"23436", "Ile\ Ife", |
200
|
|
|
|
|
|
|
"23497", "Abuja", |
201
|
|
|
|
|
|
|
"23431", "Ilorin", |
202
|
|
|
|
|
|
|
"23486", "Ahoada", |
203
|
|
|
|
|
|
|
"234908", "Abuja", |
204
|
|
|
|
|
|
|
"23435", "Oshogbo", |
205
|
|
|
|
|
|
|
"23477", "Bauchi", |
206
|
|
|
|
|
|
|
"234909", "Abuja", |
207
|
|
|
|
|
|
|
"2341", "Lagos", |
208
|
|
|
|
|
|
|
"23482", "Aba", |
209
|
|
|
|
|
|
|
"23457", "Auchi", |
210
|
|
|
|
|
|
|
"23444", "Makurdi", |
211
|
|
|
|
|
|
|
"234906", "Abuja", |
212
|
|
|
|
|
|
|
"234903", "Abuja", |
213
|
|
|
|
|
|
|
"23476", "Maiduguri", |
214
|
|
|
|
|
|
|
"23451", "Owo", |
215
|
|
|
|
|
|
|
"23495", "Abuja", |
216
|
|
|
|
|
|
|
"23448", "Awka", |
217
|
|
|
|
|
|
|
"2342", "Ibadan", |
218
|
|
|
|
|
|
|
"234905", "Abuja", |
219
|
|
|
|
|
|
|
"23465", "Katsina", |
220
|
|
|
|
|
|
|
"23487", "Calabar", |
221
|
|
|
|
|
|
|
"23452", "Benin", |
222
|
|
|
|
|
|
|
"23443", "Abakaliki", |
223
|
|
|
|
|
|
|
"23472", "Gombe", |
224
|
|
|
|
|
|
|
"23471", "Azare", |
225
|
|
|
|
|
|
|
"23456", "Asaba", |
226
|
|
|
|
|
|
|
"234904", "Abuja",}; |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
sub new { |
229
|
13
|
|
|
13
|
1
|
36
|
my $class = shift; |
230
|
13
|
|
|
|
|
24
|
my $number = shift; |
231
|
13
|
|
|
|
|
91
|
$number =~ s/(^\+234|\D)//g; |
232
|
13
|
|
|
|
|
71
|
my $self = bless({ country_code => '234', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
233
|
13
|
100
|
|
|
|
68
|
return $self if ($self->is_valid()); |
234
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
235
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '234', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
236
|
1
|
50
|
|
|
|
6
|
return $self->is_valid() ? $self : undef; |
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
1; |