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::PH; |
20
|
2
|
|
|
2
|
|
1170
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
221
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
33
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
50
|
|
23
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
59
|
|
24
|
2
|
|
|
2
|
|
15
|
use utf8; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
16
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => '2', |
31
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{5})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
3(?: |
38
|
|
|
|
|
|
|
230| |
39
|
|
|
|
|
|
|
397| |
40
|
|
|
|
|
|
|
461 |
41
|
|
|
|
|
|
|
)| |
42
|
|
|
|
|
|
|
4(?: |
43
|
|
|
|
|
|
|
2(?: |
44
|
|
|
|
|
|
|
35| |
45
|
|
|
|
|
|
|
[46]4| |
46
|
|
|
|
|
|
|
51 |
47
|
|
|
|
|
|
|
)| |
48
|
|
|
|
|
|
|
396| |
49
|
|
|
|
|
|
|
4(?: |
50
|
|
|
|
|
|
|
22| |
51
|
|
|
|
|
|
|
63 |
52
|
|
|
|
|
|
|
)| |
53
|
|
|
|
|
|
|
59[347]| |
54
|
|
|
|
|
|
|
76[15] |
55
|
|
|
|
|
|
|
)| |
56
|
|
|
|
|
|
|
5(?: |
57
|
|
|
|
|
|
|
221| |
58
|
|
|
|
|
|
|
446 |
59
|
|
|
|
|
|
|
)| |
60
|
|
|
|
|
|
|
642[23]| |
61
|
|
|
|
|
|
|
8(?: |
62
|
|
|
|
|
|
|
622| |
63
|
|
|
|
|
|
|
8(?: |
64
|
|
|
|
|
|
|
[24]2| |
65
|
|
|
|
|
|
|
5[13] |
66
|
|
|
|
|
|
|
) |
67
|
|
|
|
|
|
|
) |
68
|
|
|
|
|
|
|
', |
69
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
70
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{4,6})' |
71
|
|
|
|
|
|
|
}, |
72
|
|
|
|
|
|
|
{ |
73
|
|
|
|
|
|
|
'format' => '$1 $2', |
74
|
|
|
|
|
|
|
'leading_digits' => ' |
75
|
|
|
|
|
|
|
3469| |
76
|
|
|
|
|
|
|
4(?: |
77
|
|
|
|
|
|
|
279| |
78
|
|
|
|
|
|
|
9(?: |
79
|
|
|
|
|
|
|
30| |
80
|
|
|
|
|
|
|
56 |
81
|
|
|
|
|
|
|
) |
82
|
|
|
|
|
|
|
)| |
83
|
|
|
|
|
|
|
8834 |
84
|
|
|
|
|
|
|
', |
85
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
86
|
|
|
|
|
|
|
'pattern' => '(\\d{5})(\\d{4})' |
87
|
|
|
|
|
|
|
}, |
88
|
|
|
|
|
|
|
{ |
89
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
90
|
|
|
|
|
|
|
'leading_digits' => '2', |
91
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
92
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{4})(\\d{4})' |
93
|
|
|
|
|
|
|
}, |
94
|
|
|
|
|
|
|
{ |
95
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
96
|
|
|
|
|
|
|
'leading_digits' => ' |
97
|
|
|
|
|
|
|
[3-7]| |
98
|
|
|
|
|
|
|
8[2-8] |
99
|
|
|
|
|
|
|
', |
100
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
101
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
102
|
|
|
|
|
|
|
}, |
103
|
|
|
|
|
|
|
{ |
104
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
105
|
|
|
|
|
|
|
'leading_digits' => '[89]', |
106
|
|
|
|
|
|
|
'national_rule' => '0$1', |
107
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{4})' |
108
|
|
|
|
|
|
|
}, |
109
|
|
|
|
|
|
|
{ |
110
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
111
|
|
|
|
|
|
|
'leading_digits' => '1', |
112
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})(\\d{4})' |
113
|
|
|
|
|
|
|
}, |
114
|
|
|
|
|
|
|
{ |
115
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
116
|
|
|
|
|
|
|
'leading_digits' => '1', |
117
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})' |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
]; |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
my $validators = { |
122
|
|
|
|
|
|
|
'fixed_line' => ' |
123
|
|
|
|
|
|
|
(?: |
124
|
|
|
|
|
|
|
(?: |
125
|
|
|
|
|
|
|
2[3-8]| |
126
|
|
|
|
|
|
|
3[2-68]| |
127
|
|
|
|
|
|
|
4[2-9]| |
128
|
|
|
|
|
|
|
5[2-6]| |
129
|
|
|
|
|
|
|
6[2-58]| |
130
|
|
|
|
|
|
|
7[24578] |
131
|
|
|
|
|
|
|
)\\d{3}| |
132
|
|
|
|
|
|
|
88(?: |
133
|
|
|
|
|
|
|
22\\d\\d| |
134
|
|
|
|
|
|
|
42 |
135
|
|
|
|
|
|
|
) |
136
|
|
|
|
|
|
|
)\\d{4}| |
137
|
|
|
|
|
|
|
(?: |
138
|
|
|
|
|
|
|
2| |
139
|
|
|
|
|
|
|
8[2-8]\\d\\d |
140
|
|
|
|
|
|
|
)\\d{5} |
141
|
|
|
|
|
|
|
', |
142
|
|
|
|
|
|
|
'geographic' => ' |
143
|
|
|
|
|
|
|
(?: |
144
|
|
|
|
|
|
|
(?: |
145
|
|
|
|
|
|
|
2[3-8]| |
146
|
|
|
|
|
|
|
3[2-68]| |
147
|
|
|
|
|
|
|
4[2-9]| |
148
|
|
|
|
|
|
|
5[2-6]| |
149
|
|
|
|
|
|
|
6[2-58]| |
150
|
|
|
|
|
|
|
7[24578] |
151
|
|
|
|
|
|
|
)\\d{3}| |
152
|
|
|
|
|
|
|
88(?: |
153
|
|
|
|
|
|
|
22\\d\\d| |
154
|
|
|
|
|
|
|
42 |
155
|
|
|
|
|
|
|
) |
156
|
|
|
|
|
|
|
)\\d{4}| |
157
|
|
|
|
|
|
|
(?: |
158
|
|
|
|
|
|
|
2| |
159
|
|
|
|
|
|
|
8[2-8]\\d\\d |
160
|
|
|
|
|
|
|
)\\d{5} |
161
|
|
|
|
|
|
|
', |
162
|
|
|
|
|
|
|
'mobile' => ' |
163
|
|
|
|
|
|
|
(?: |
164
|
|
|
|
|
|
|
8(?: |
165
|
|
|
|
|
|
|
1[37]| |
166
|
|
|
|
|
|
|
9[5-8] |
167
|
|
|
|
|
|
|
)| |
168
|
|
|
|
|
|
|
9(?: |
169
|
|
|
|
|
|
|
0[5-9]| |
170
|
|
|
|
|
|
|
1[0-24-9]| |
171
|
|
|
|
|
|
|
[235-7]\\d| |
172
|
|
|
|
|
|
|
4[2-9]| |
173
|
|
|
|
|
|
|
8[135-9]| |
174
|
|
|
|
|
|
|
9[1-9] |
175
|
|
|
|
|
|
|
) |
176
|
|
|
|
|
|
|
)\\d{7} |
177
|
|
|
|
|
|
|
', |
178
|
|
|
|
|
|
|
'pager' => '', |
179
|
|
|
|
|
|
|
'personal_number' => '', |
180
|
|
|
|
|
|
|
'specialrate' => '', |
181
|
|
|
|
|
|
|
'toll_free' => '1800\\d{7,9}', |
182
|
|
|
|
|
|
|
'voip' => '' |
183
|
|
|
|
|
|
|
}; |
184
|
|
|
|
|
|
|
my %areanames = (); |
185
|
|
|
|
|
|
|
$areanames{en} = {"634264", "Quezon", |
186
|
|
|
|
|
|
|
"634396", "Batangas", |
187
|
|
|
|
|
|
|
"634279", "Quezon", |
188
|
|
|
|
|
|
|
"636422", "North\ Cotabato", |
189
|
|
|
|
|
|
|
"6372", "La\ Union", |
190
|
|
|
|
|
|
|
"6382", "Davao\ del\ Sur\/Davao", |
191
|
|
|
|
|
|
|
"638842", "Misamis\ Oriental", |
192
|
|
|
|
|
|
|
"6365", "Zamboanga\ del\ Norte\/Zamboanga\ del\ Sur", |
193
|
|
|
|
|
|
|
"6353", "Leyte", |
194
|
|
|
|
|
|
|
"634251", "Quezon", |
195
|
|
|
|
|
|
|
"634244", "Quezon", |
196
|
|
|
|
|
|
|
"634593", "Pampanga", |
197
|
|
|
|
|
|
|
"6377", "Ilocos\ Sur\/Ilocos\ Norte", |
198
|
|
|
|
|
|
|
"6387", "Davao\ Oriental", |
199
|
|
|
|
|
|
|
"6332", "Cebu", |
200
|
|
|
|
|
|
|
"6348", "Palawan", |
201
|
|
|
|
|
|
|
"633461", "Negros\ Occidental", |
202
|
|
|
|
|
|
|
"6356", "Sorsogon\/Masbate", |
203
|
|
|
|
|
|
|
"638822", "Misamis\ Oriental", |
204
|
|
|
|
|
|
|
"634765", "Zambales", |
205
|
|
|
|
|
|
|
"638853", "Bukidnon", |
206
|
|
|
|
|
|
|
"638851", "Bukidnon", |
207
|
|
|
|
|
|
|
"6384", "Davao\ del\ Norte", |
208
|
|
|
|
|
|
|
"6374", "Abra\/Benguet\/Kalinga\-Apayao\/Ifugao\/Mountain\ Province", |
209
|
|
|
|
|
|
|
"6346", "Cavite", |
210
|
|
|
|
|
|
|
"634422", "Bulacan", |
211
|
|
|
|
|
|
|
"6363", "Lanao\ del\ Norte\/Lanao\ del\ Sur", |
212
|
|
|
|
|
|
|
"638622", "Surigao\ del\ Sur", |
213
|
|
|
|
|
|
|
"6355", "Western\ Samar", |
214
|
|
|
|
|
|
|
"635221", "Albay", |
215
|
|
|
|
|
|
|
"6336", "Antique\/Aklan\/Capiz", |
216
|
|
|
|
|
|
|
"636423", "North\ Cotabato", |
217
|
|
|
|
|
|
|
"634463", "Bulacan", |
218
|
|
|
|
|
|
|
"634597", "Pampanga", |
219
|
|
|
|
|
|
|
"6383", "South\ Cotabato", |
220
|
|
|
|
|
|
|
"6338", "Bohol", |
221
|
|
|
|
|
|
|
"6335", "Negros\ Oriental", |
222
|
|
|
|
|
|
|
"638834", "Misamis\ Occidental", |
223
|
|
|
|
|
|
|
"634594", "Pampanga", |
224
|
|
|
|
|
|
|
"6362", "Zamboanga\ del\ Sur", |
225
|
|
|
|
|
|
|
"6333", "Iloilo", |
226
|
|
|
|
|
|
|
"635446", "Camarines\ Sur", |
227
|
|
|
|
|
|
|
"634235", "Quezon", |
228
|
|
|
|
|
|
|
"6378", "Isabela\/Quirino\/Batanes\/Nueva\ Vizcaya\/Cagayan\ Valley", |
229
|
|
|
|
|
|
|
"6375", "Pangasinan", |
230
|
|
|
|
|
|
|
"634761", "Zambales", |
231
|
|
|
|
|
|
|
"6385", "Agusan\ del\ Sur\/Agusan\ del\ Norte",}; |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
sub new { |
234
|
10
|
|
|
10
|
1
|
35
|
my $class = shift; |
235
|
10
|
|
|
|
|
33
|
my $number = shift; |
236
|
10
|
|
|
|
|
82
|
$number =~ s/(^\+63|\D)//g; |
237
|
10
|
|
|
|
|
61
|
my $self = bless({ country_code => '63', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
238
|
10
|
100
|
|
|
|
64
|
return $self if ($self->is_valid()); |
239
|
1
|
|
|
|
|
8
|
$number =~ s/^(?:0)//; |
240
|
1
|
|
|
|
|
10
|
$self = bless({ country_code => '63', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
241
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
1; |