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::PR; |
20
|
2
|
|
|
2
|
|
1158
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
291
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
49
|
|
23
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
87
|
|
24
|
2
|
|
|
2
|
|
13
|
use utf8; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
16
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
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
|
|
|
|
|
|
|
'geographic' => '( |
55
|
|
|
|
|
|
|
(?: |
56
|
|
|
|
|
|
|
787| |
57
|
|
|
|
|
|
|
939 |
58
|
|
|
|
|
|
|
)[2-9]\\d{6} |
59
|
|
|
|
|
|
|
| |
60
|
|
|
|
|
|
|
(?: |
61
|
|
|
|
|
|
|
787| |
62
|
|
|
|
|
|
|
939 |
63
|
|
|
|
|
|
|
)[2-9]\\d{6} |
64
|
|
|
|
|
|
|
)', |
65
|
|
|
|
|
|
|
'pager' => '', |
66
|
|
|
|
|
|
|
'personal_number' => ' |
67
|
|
|
|
|
|
|
52(?: |
68
|
|
|
|
|
|
|
3(?: |
69
|
|
|
|
|
|
|
[2-46-9][02-9]\\d| |
70
|
|
|
|
|
|
|
5(?: |
71
|
|
|
|
|
|
|
[02-46-9]\\d| |
72
|
|
|
|
|
|
|
5[0-46-9] |
73
|
|
|
|
|
|
|
) |
74
|
|
|
|
|
|
|
)| |
75
|
|
|
|
|
|
|
4(?: |
76
|
|
|
|
|
|
|
[2-478][02-9]\\d| |
77
|
|
|
|
|
|
|
5(?: |
78
|
|
|
|
|
|
|
[034]\\d| |
79
|
|
|
|
|
|
|
2[024-9]| |
80
|
|
|
|
|
|
|
5[0-46-9] |
81
|
|
|
|
|
|
|
)| |
82
|
|
|
|
|
|
|
6(?: |
83
|
|
|
|
|
|
|
0[1-9]| |
84
|
|
|
|
|
|
|
[2-9]\\d |
85
|
|
|
|
|
|
|
)| |
86
|
|
|
|
|
|
|
9(?: |
87
|
|
|
|
|
|
|
[05-9]\\d| |
88
|
|
|
|
|
|
|
2[0-5]| |
89
|
|
|
|
|
|
|
49 |
90
|
|
|
|
|
|
|
) |
91
|
|
|
|
|
|
|
) |
92
|
|
|
|
|
|
|
)\\d{4}| |
93
|
|
|
|
|
|
|
52[34][2-9]1[02-9]\\d{4}| |
94
|
|
|
|
|
|
|
5(?: |
95
|
|
|
|
|
|
|
00| |
96
|
|
|
|
|
|
|
2[125-9]| |
97
|
|
|
|
|
|
|
33| |
98
|
|
|
|
|
|
|
44| |
99
|
|
|
|
|
|
|
66| |
100
|
|
|
|
|
|
|
77| |
101
|
|
|
|
|
|
|
88 |
102
|
|
|
|
|
|
|
)[2-9]\\d{6} |
103
|
|
|
|
|
|
|
', |
104
|
|
|
|
|
|
|
'specialrate' => '(900[2-9]\\d{6})', |
105
|
|
|
|
|
|
|
'toll_free' => ' |
106
|
|
|
|
|
|
|
8(?: |
107
|
|
|
|
|
|
|
00| |
108
|
|
|
|
|
|
|
33| |
109
|
|
|
|
|
|
|
44| |
110
|
|
|
|
|
|
|
55| |
111
|
|
|
|
|
|
|
66| |
112
|
|
|
|
|
|
|
77| |
113
|
|
|
|
|
|
|
88 |
114
|
|
|
|
|
|
|
)[2-9]\\d{6} |
115
|
|
|
|
|
|
|
', |
116
|
|
|
|
|
|
|
'voip' => '' |
117
|
|
|
|
|
|
|
}; |
118
|
2
|
|
|
2
|
|
290
|
use Number::Phone::NANP::Data; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
431
|
|
119
|
|
|
|
|
|
|
sub areaname { |
120
|
|
|
|
|
|
|
# uncoverable subroutine - no data for most NANP countries |
121
|
|
|
|
|
|
|
# uncoverable statement |
122
|
0
|
|
|
0
|
1
|
0
|
Number::Phone::NANP::Data::_areaname('1'.shift()->{number}); } |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub new { |
125
|
13
|
|
|
13
|
1
|
43
|
my $class = shift; |
126
|
13
|
|
|
|
|
26
|
my $number = shift; |
127
|
13
|
|
|
|
|
95
|
$number =~ s/(^\+1|\D)//g; |
128
|
13
|
|
|
|
|
75
|
my $self = bless({ country_code => '1', number => $number, formatters => $formatters, validators => $validators, }, $class); |
129
|
13
|
100
|
|
|
|
67
|
return $self->is_valid() ? $self : undef; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
1; |