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