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