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::BS; |
20
|
2
|
|
|
2
|
|
1066
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
233
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
48
|
|
23
|
2
|
|
|
2
|
|
25
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
65
|
|
24
|
2
|
|
|
2
|
|
18
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
20
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174401; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1-$2', |
30
|
|
|
|
|
|
|
'leading_digits' => '310', |
31
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
'format' => '$1-$2', |
35
|
|
|
|
|
|
|
'intl_format' => 'NA', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
[24-9]| |
38
|
|
|
|
|
|
|
3(?: |
39
|
|
|
|
|
|
|
[02-9]| |
40
|
|
|
|
|
|
|
1[1-9] |
41
|
|
|
|
|
|
|
) |
42
|
|
|
|
|
|
|
', |
43
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
{ |
46
|
|
|
|
|
|
|
'format' => '($1) $2-$3', |
47
|
|
|
|
|
|
|
'intl_format' => '$1-$2-$3', |
48
|
|
|
|
|
|
|
'leading_digits' => '[2-9]', |
49
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{4})' |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
]; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $validators = { |
54
|
|
|
|
|
|
|
'fixed_line' => ' |
55
|
|
|
|
|
|
|
242(?: |
56
|
|
|
|
|
|
|
3(?: |
57
|
|
|
|
|
|
|
02| |
58
|
|
|
|
|
|
|
[236][1-9]| |
59
|
|
|
|
|
|
|
4[0-24-9]| |
60
|
|
|
|
|
|
|
5[0-68]| |
61
|
|
|
|
|
|
|
7[347]| |
62
|
|
|
|
|
|
|
8[0-4]| |
63
|
|
|
|
|
|
|
9[2-467] |
64
|
|
|
|
|
|
|
)| |
65
|
|
|
|
|
|
|
461| |
66
|
|
|
|
|
|
|
502| |
67
|
|
|
|
|
|
|
6(?: |
68
|
|
|
|
|
|
|
0[1-5]| |
69
|
|
|
|
|
|
|
12| |
70
|
|
|
|
|
|
|
2[013]| |
71
|
|
|
|
|
|
|
[45]0| |
72
|
|
|
|
|
|
|
7[67]| |
73
|
|
|
|
|
|
|
8[78]| |
74
|
|
|
|
|
|
|
9[89] |
75
|
|
|
|
|
|
|
)| |
76
|
|
|
|
|
|
|
7(?: |
77
|
|
|
|
|
|
|
02| |
78
|
|
|
|
|
|
|
88 |
79
|
|
|
|
|
|
|
) |
80
|
|
|
|
|
|
|
)\\d{4} |
81
|
|
|
|
|
|
|
', |
82
|
|
|
|
|
|
|
'geographic' => ' |
83
|
|
|
|
|
|
|
242(?: |
84
|
|
|
|
|
|
|
3(?: |
85
|
|
|
|
|
|
|
02| |
86
|
|
|
|
|
|
|
[236][1-9]| |
87
|
|
|
|
|
|
|
4[0-24-9]| |
88
|
|
|
|
|
|
|
5[0-68]| |
89
|
|
|
|
|
|
|
7[347]| |
90
|
|
|
|
|
|
|
8[0-4]| |
91
|
|
|
|
|
|
|
9[2-467] |
92
|
|
|
|
|
|
|
)| |
93
|
|
|
|
|
|
|
461| |
94
|
|
|
|
|
|
|
502| |
95
|
|
|
|
|
|
|
6(?: |
96
|
|
|
|
|
|
|
0[1-5]| |
97
|
|
|
|
|
|
|
12| |
98
|
|
|
|
|
|
|
2[013]| |
99
|
|
|
|
|
|
|
[45]0| |
100
|
|
|
|
|
|
|
7[67]| |
101
|
|
|
|
|
|
|
8[78]| |
102
|
|
|
|
|
|
|
9[89] |
103
|
|
|
|
|
|
|
)| |
104
|
|
|
|
|
|
|
7(?: |
105
|
|
|
|
|
|
|
02| |
106
|
|
|
|
|
|
|
88 |
107
|
|
|
|
|
|
|
) |
108
|
|
|
|
|
|
|
)\\d{4} |
109
|
|
|
|
|
|
|
', |
110
|
|
|
|
|
|
|
'mobile' => ' |
111
|
|
|
|
|
|
|
242(?: |
112
|
|
|
|
|
|
|
3(?: |
113
|
|
|
|
|
|
|
5[79]| |
114
|
|
|
|
|
|
|
7[56]| |
115
|
|
|
|
|
|
|
95 |
116
|
|
|
|
|
|
|
)| |
117
|
|
|
|
|
|
|
4(?: |
118
|
|
|
|
|
|
|
[23][1-9]| |
119
|
|
|
|
|
|
|
4[1-35-9]| |
120
|
|
|
|
|
|
|
5[1-8]| |
121
|
|
|
|
|
|
|
6[2-8]| |
122
|
|
|
|
|
|
|
7\\d| |
123
|
|
|
|
|
|
|
81 |
124
|
|
|
|
|
|
|
)| |
125
|
|
|
|
|
|
|
5(?: |
126
|
|
|
|
|
|
|
2[45]| |
127
|
|
|
|
|
|
|
3[35]| |
128
|
|
|
|
|
|
|
44| |
129
|
|
|
|
|
|
|
5[1-46-9]| |
130
|
|
|
|
|
|
|
65| |
131
|
|
|
|
|
|
|
77 |
132
|
|
|
|
|
|
|
)| |
133
|
|
|
|
|
|
|
6[34]6| |
134
|
|
|
|
|
|
|
7(?: |
135
|
|
|
|
|
|
|
27| |
136
|
|
|
|
|
|
|
38 |
137
|
|
|
|
|
|
|
)| |
138
|
|
|
|
|
|
|
8(?: |
139
|
|
|
|
|
|
|
0[1-9]| |
140
|
|
|
|
|
|
|
1[02-9]| |
141
|
|
|
|
|
|
|
2\\d| |
142
|
|
|
|
|
|
|
[89]9 |
143
|
|
|
|
|
|
|
) |
144
|
|
|
|
|
|
|
)\\d{4} |
145
|
|
|
|
|
|
|
', |
146
|
|
|
|
|
|
|
'pager' => '', |
147
|
|
|
|
|
|
|
'personal_number' => ' |
148
|
|
|
|
|
|
|
52(?: |
149
|
|
|
|
|
|
|
3(?: |
150
|
|
|
|
|
|
|
[2-46-9][02-9]\\d| |
151
|
|
|
|
|
|
|
5(?: |
152
|
|
|
|
|
|
|
[02-46-9]\\d| |
153
|
|
|
|
|
|
|
5[0-46-9] |
154
|
|
|
|
|
|
|
) |
155
|
|
|
|
|
|
|
)| |
156
|
|
|
|
|
|
|
4(?: |
157
|
|
|
|
|
|
|
[2-478][02-9]\\d| |
158
|
|
|
|
|
|
|
5(?: |
159
|
|
|
|
|
|
|
[034]\\d| |
160
|
|
|
|
|
|
|
2[024-9]| |
161
|
|
|
|
|
|
|
5[0-46-9] |
162
|
|
|
|
|
|
|
)| |
163
|
|
|
|
|
|
|
6(?: |
164
|
|
|
|
|
|
|
0[1-9]| |
165
|
|
|
|
|
|
|
[2-9]\\d |
166
|
|
|
|
|
|
|
)| |
167
|
|
|
|
|
|
|
9(?: |
168
|
|
|
|
|
|
|
[05-9]\\d| |
169
|
|
|
|
|
|
|
2[0-5]| |
170
|
|
|
|
|
|
|
49 |
171
|
|
|
|
|
|
|
) |
172
|
|
|
|
|
|
|
) |
173
|
|
|
|
|
|
|
)\\d{4}| |
174
|
|
|
|
|
|
|
52[34][2-9]1[02-9]\\d{4}| |
175
|
|
|
|
|
|
|
5(?: |
176
|
|
|
|
|
|
|
00| |
177
|
|
|
|
|
|
|
2[125-9]| |
178
|
|
|
|
|
|
|
33| |
179
|
|
|
|
|
|
|
44| |
180
|
|
|
|
|
|
|
66| |
181
|
|
|
|
|
|
|
77| |
182
|
|
|
|
|
|
|
88 |
183
|
|
|
|
|
|
|
)[2-9]\\d{6} |
184
|
|
|
|
|
|
|
', |
185
|
|
|
|
|
|
|
'specialrate' => '(900[2-9]\\d{6})|(242225\\d{4})', |
186
|
|
|
|
|
|
|
'toll_free' => ' |
187
|
|
|
|
|
|
|
242300\\d{4}| |
188
|
|
|
|
|
|
|
8(?: |
189
|
|
|
|
|
|
|
00| |
190
|
|
|
|
|
|
|
33| |
191
|
|
|
|
|
|
|
44| |
192
|
|
|
|
|
|
|
55| |
193
|
|
|
|
|
|
|
66| |
194
|
|
|
|
|
|
|
77| |
195
|
|
|
|
|
|
|
88 |
196
|
|
|
|
|
|
|
)[2-9]\\d{6} |
197
|
|
|
|
|
|
|
', |
198
|
|
|
|
|
|
|
'voip' => '' |
199
|
|
|
|
|
|
|
}; |
200
|
2
|
|
|
2
|
|
316
|
use Number::Phone::NANP::Data; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
370
|
|
201
|
|
|
|
|
|
|
sub areaname { |
202
|
|
|
|
|
|
|
# uncoverable subroutine - no data for most NANP countries |
203
|
|
|
|
|
|
|
# uncoverable statement |
204
|
0
|
|
|
0
|
1
|
0
|
Number::Phone::NANP::Data::_areaname('1'.shift()->{number}); } |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
sub new { |
207
|
16
|
|
|
16
|
1
|
40
|
my $class = shift; |
208
|
16
|
|
|
|
|
27
|
my $number = shift; |
209
|
16
|
|
|
|
|
108
|
$number =~ s/(^\+1|\D)//g; |
210
|
16
|
|
|
|
|
96
|
my $self = bless({ country_code => '1', number => $number, formatters => $formatters, validators => $validators, }, $class); |
211
|
16
|
100
|
|
|
|
94
|
return $self->is_valid() ? $self : undef; |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
1; |