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
|
|
1146
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
225
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
47
|
|
23
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
17
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
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[047] |
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[047]| |
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} = {"2272044", "Agadez", |
98
|
|
|
|
|
|
|
"2272045", "Arlit", |
99
|
|
|
|
|
|
|
"227203", "Niamey", |
100
|
|
|
|
|
|
|
"2272061", "Tahoua", |
101
|
|
|
|
|
|
|
"2272071", "Tillabéry", |
102
|
|
|
|
|
|
|
"2272054", "Diffa", |
103
|
|
|
|
|
|
|
"2272073", "Niamey", |
104
|
|
|
|
|
|
|
"2272077", "Filingué", |
105
|
|
|
|
|
|
|
"2272064", "Konni", |
106
|
|
|
|
|
|
|
"2272074", "Niamey", |
107
|
|
|
|
|
|
|
"2272051", "Zinder", |
108
|
|
|
|
|
|
|
"2272072", "Niamey", |
109
|
|
|
|
|
|
|
"227202", "Niamey", |
110
|
|
|
|
|
|
|
"2272078", "Say", |
111
|
|
|
|
|
|
|
"2272075", "Niamey", |
112
|
|
|
|
|
|
|
"2272065", "Dosso", |
113
|
|
|
|
|
|
|
"2272068", "Gaya", |
114
|
|
|
|
|
|
|
"2272041", "Maradi",}; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub new { |
117
|
13
|
|
|
13
|
1
|
33
|
my $class = shift; |
118
|
13
|
|
|
|
|
25
|
my $number = shift; |
119
|
13
|
|
|
|
|
84
|
$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
|
|
|
|
68
|
return $self->is_valid() ? $self : undef; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
1; |