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::NE; |
20
|
2
|
|
|
2
|
|
1245
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
231
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
22
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
50
|
|
23
|
2
|
|
|
2
|
|
17
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
58
|
|
24
|
2
|
|
|
2
|
|
19
|
use utf8; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
14
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181421; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => '08', |
31
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3})' |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
35
|
|
|
|
|
|
|
'leading_digits' => ' |
36
|
|
|
|
|
|
|
[089]| |
37
|
|
|
|
|
|
|
2[013]| |
38
|
|
|
|
|
|
|
7[04] |
39
|
|
|
|
|
|
|
', |
40
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})' |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
]; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $validators = { |
45
|
|
|
|
|
|
|
'fixed_line' => ' |
46
|
|
|
|
|
|
|
2(?: |
47
|
|
|
|
|
|
|
0(?: |
48
|
|
|
|
|
|
|
20| |
49
|
|
|
|
|
|
|
3[1-8]| |
50
|
|
|
|
|
|
|
4[13-5]| |
51
|
|
|
|
|
|
|
5[14]| |
52
|
|
|
|
|
|
|
6[14578]| |
53
|
|
|
|
|
|
|
7[1-578] |
54
|
|
|
|
|
|
|
)| |
55
|
|
|
|
|
|
|
1(?: |
56
|
|
|
|
|
|
|
4[145]| |
57
|
|
|
|
|
|
|
5[14]| |
58
|
|
|
|
|
|
|
6[14-68]| |
59
|
|
|
|
|
|
|
7[169]| |
60
|
|
|
|
|
|
|
88 |
61
|
|
|
|
|
|
|
) |
62
|
|
|
|
|
|
|
)\\d{4} |
63
|
|
|
|
|
|
|
', |
64
|
|
|
|
|
|
|
'geographic' => ' |
65
|
|
|
|
|
|
|
2(?: |
66
|
|
|
|
|
|
|
0(?: |
67
|
|
|
|
|
|
|
20| |
68
|
|
|
|
|
|
|
3[1-8]| |
69
|
|
|
|
|
|
|
4[13-5]| |
70
|
|
|
|
|
|
|
5[14]| |
71
|
|
|
|
|
|
|
6[14578]| |
72
|
|
|
|
|
|
|
7[1-578] |
73
|
|
|
|
|
|
|
)| |
74
|
|
|
|
|
|
|
1(?: |
75
|
|
|
|
|
|
|
4[145]| |
76
|
|
|
|
|
|
|
5[14]| |
77
|
|
|
|
|
|
|
6[14-68]| |
78
|
|
|
|
|
|
|
7[169]| |
79
|
|
|
|
|
|
|
88 |
80
|
|
|
|
|
|
|
) |
81
|
|
|
|
|
|
|
)\\d{4} |
82
|
|
|
|
|
|
|
', |
83
|
|
|
|
|
|
|
'mobile' => ' |
84
|
|
|
|
|
|
|
(?: |
85
|
|
|
|
|
|
|
23| |
86
|
|
|
|
|
|
|
7[04]| |
87
|
|
|
|
|
|
|
[89]\\d |
88
|
|
|
|
|
|
|
)\\d{6} |
89
|
|
|
|
|
|
|
', |
90
|
|
|
|
|
|
|
'pager' => '', |
91
|
|
|
|
|
|
|
'personal_number' => '', |
92
|
|
|
|
|
|
|
'specialrate' => '(09\\d{6})', |
93
|
|
|
|
|
|
|
'toll_free' => '08\\d{6}', |
94
|
|
|
|
|
|
|
'voip' => '' |
95
|
|
|
|
|
|
|
}; |
96
|
|
|
|
|
|
|
my %areanames = (); |
97
|
|
|
|
|
|
|
$areanames{en} = {"2272061", "Tahoua", |
98
|
|
|
|
|
|
|
"2272073", "Niamey", |
99
|
|
|
|
|
|
|
"2272041", "Maradi", |
100
|
|
|
|
|
|
|
"2272054", "Diffa", |
101
|
|
|
|
|
|
|
"227202", "Niamey", |
102
|
|
|
|
|
|
|
"2272078", "Say", |
103
|
|
|
|
|
|
|
"2272074", "Niamey", |
104
|
|
|
|
|
|
|
"2272075", "Niamey", |
105
|
|
|
|
|
|
|
"227203", "Niamey", |
106
|
|
|
|
|
|
|
"2272072", "Niamey", |
107
|
|
|
|
|
|
|
"2272077", "Filingué", |
108
|
|
|
|
|
|
|
"2272068", "Gaya", |
109
|
|
|
|
|
|
|
"2272064", "Konni", |
110
|
|
|
|
|
|
|
"2272065", "Dosso", |
111
|
|
|
|
|
|
|
"2272044", "Agadez", |
112
|
|
|
|
|
|
|
"2272051", "Zinder", |
113
|
|
|
|
|
|
|
"2272045", "Arlit", |
114
|
|
|
|
|
|
|
"2272071", "Tillabéry",}; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub new { |
117
|
13
|
|
|
13
|
1
|
49
|
my $class = shift; |
118
|
13
|
|
|
|
|
34
|
my $number = shift; |
119
|
13
|
|
|
|
|
92
|
$number =~ s/(^\+227|\D)//g; |
120
|
13
|
|
|
|
|
76
|
my $self = bless({ country_code => '227', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
121
|
13
|
100
|
|
|
|
67
|
return $self->is_valid() ? $self : undef; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
1; |