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
|
|
1202
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
243
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
55
|
|
23
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
61
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
20
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
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} = {"6365", "Zamboanga\ del\ Norte\/Zamboanga\ del\ Sur", |
186
|
|
|
|
|
|
|
"6333", "Iloilo", |
187
|
|
|
|
|
|
|
"6378", "Isabela\/Quirino\/Batanes\/Nueva\ Vizcaya\/Cagayan\ Valley", |
188
|
|
|
|
|
|
|
"6375", "Pangasinan", |
189
|
|
|
|
|
|
|
"6384", "Davao\ del\ Norte", |
190
|
|
|
|
|
|
|
"6346", "Cavite", |
191
|
|
|
|
|
|
|
"6382", "Davao\ del\ Sur\/Davao", |
192
|
|
|
|
|
|
|
"638834", "Misamis\ Occidental", |
193
|
|
|
|
|
|
|
"6336", "Antique\/Aklan\/Capiz", |
194
|
|
|
|
|
|
|
"6377", "Ilocos\ Sur\/Ilocos\ Norte", |
195
|
|
|
|
|
|
|
"635221", "Albay", |
196
|
|
|
|
|
|
|
"6335", "Negros\ Oriental", |
197
|
|
|
|
|
|
|
"638842", "Misamis\ Oriental", |
198
|
|
|
|
|
|
|
"6363", "Lanao\ del\ Norte\/Lanao\ del\ Sur", |
199
|
|
|
|
|
|
|
"634244", "Quezon", |
200
|
|
|
|
|
|
|
"634235", "Quezon", |
201
|
|
|
|
|
|
|
"634761", "Zambales", |
202
|
|
|
|
|
|
|
"6348", "Palawan", |
203
|
|
|
|
|
|
|
"6338", "Bohol", |
204
|
|
|
|
|
|
|
"634765", "Zambales", |
205
|
|
|
|
|
|
|
"636423", "North\ Cotabato", |
206
|
|
|
|
|
|
|
"634251", "Quezon", |
207
|
|
|
|
|
|
|
"634593", "Pampanga", |
208
|
|
|
|
|
|
|
"6362", "Zamboanga\ del\ Sur", |
209
|
|
|
|
|
|
|
"6356", "Sorsogon\/Masbate", |
210
|
|
|
|
|
|
|
"6387", "Davao\ Oriental", |
211
|
|
|
|
|
|
|
"634594", "Pampanga", |
212
|
|
|
|
|
|
|
"6385", "Agusan\ del\ Sur\/Agusan\ del\ Norte", |
213
|
|
|
|
|
|
|
"6353", "Leyte", |
214
|
|
|
|
|
|
|
"638622", "Surigao\ del\ Sur", |
215
|
|
|
|
|
|
|
"6374", "Abra\/Benguet\/Kalinga\-Apayao\/Ifugao\/Mountain\ Province", |
216
|
|
|
|
|
|
|
"6372", "La\ Union", |
217
|
|
|
|
|
|
|
"634422", "Bulacan", |
218
|
|
|
|
|
|
|
"635446", "Camarines\ Sur", |
219
|
|
|
|
|
|
|
"634463", "Bulacan", |
220
|
|
|
|
|
|
|
"638851", "Bukidnon", |
221
|
|
|
|
|
|
|
"634597", "Pampanga", |
222
|
|
|
|
|
|
|
"634396", "Batangas", |
223
|
|
|
|
|
|
|
"6332", "Cebu", |
224
|
|
|
|
|
|
|
"638853", "Bukidnon", |
225
|
|
|
|
|
|
|
"636422", "North\ Cotabato", |
226
|
|
|
|
|
|
|
"634264", "Quezon", |
227
|
|
|
|
|
|
|
"6355", "Western\ Samar", |
228
|
|
|
|
|
|
|
"6383", "South\ Cotabato", |
229
|
|
|
|
|
|
|
"634279", "Quezon", |
230
|
|
|
|
|
|
|
"638822", "Misamis\ Oriental", |
231
|
|
|
|
|
|
|
"633461", "Negros\ Occidental",}; |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
sub new { |
234
|
10
|
|
|
10
|
1
|
42
|
my $class = shift; |
235
|
10
|
|
|
|
|
19
|
my $number = shift; |
236
|
10
|
|
|
|
|
70
|
$number =~ s/(^\+63|\D)//g; |
237
|
10
|
|
|
|
|
62
|
my $self = bless({ country_code => '63', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
238
|
10
|
100
|
|
|
|
62
|
return $self if ($self->is_valid()); |
239
|
1
|
|
|
|
|
7
|
$number =~ s/^(?:0)//; |
240
|
1
|
|
|
|
|
10
|
$self = bless({ country_code => '63', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
241
|
1
|
50
|
|
|
|
6
|
return $self->is_valid() ? $self : undef; |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
1; |