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::PG; |
20
|
2
|
|
|
2
|
|
1155
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
239
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
19
|
use strict; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
50
|
|
23
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
53
|
|
24
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
14
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174404; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => ' |
31
|
|
|
|
|
|
|
18| |
32
|
|
|
|
|
|
|
[2-69]| |
33
|
|
|
|
|
|
|
85 |
34
|
|
|
|
|
|
|
', |
35
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
{ |
38
|
|
|
|
|
|
|
'format' => '$1 $2', |
39
|
|
|
|
|
|
|
'leading_digits' => '[78]', |
40
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{4})' |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
]; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $validators = { |
45
|
|
|
|
|
|
|
'fixed_line' => ' |
46
|
|
|
|
|
|
|
(?: |
47
|
|
|
|
|
|
|
(?: |
48
|
|
|
|
|
|
|
3[0-2]| |
49
|
|
|
|
|
|
|
4[257]| |
50
|
|
|
|
|
|
|
5[34]| |
51
|
|
|
|
|
|
|
9[78] |
52
|
|
|
|
|
|
|
)\\d| |
53
|
|
|
|
|
|
|
64[1-9]| |
54
|
|
|
|
|
|
|
85[02-46-9] |
55
|
|
|
|
|
|
|
)\\d{4} |
56
|
|
|
|
|
|
|
', |
57
|
|
|
|
|
|
|
'geographic' => ' |
58
|
|
|
|
|
|
|
(?: |
59
|
|
|
|
|
|
|
(?: |
60
|
|
|
|
|
|
|
3[0-2]| |
61
|
|
|
|
|
|
|
4[257]| |
62
|
|
|
|
|
|
|
5[34]| |
63
|
|
|
|
|
|
|
9[78] |
64
|
|
|
|
|
|
|
)\\d| |
65
|
|
|
|
|
|
|
64[1-9]| |
66
|
|
|
|
|
|
|
85[02-46-9] |
67
|
|
|
|
|
|
|
)\\d{4} |
68
|
|
|
|
|
|
|
', |
69
|
|
|
|
|
|
|
'mobile' => ' |
70
|
|
|
|
|
|
|
(?: |
71
|
|
|
|
|
|
|
7\\d| |
72
|
|
|
|
|
|
|
8[128] |
73
|
|
|
|
|
|
|
)\\d{6} |
74
|
|
|
|
|
|
|
', |
75
|
|
|
|
|
|
|
'pager' => '27[01]\\d{4}', |
76
|
|
|
|
|
|
|
'personal_number' => '', |
77
|
|
|
|
|
|
|
'specialrate' => '', |
78
|
|
|
|
|
|
|
'toll_free' => '180\\d{4}', |
79
|
|
|
|
|
|
|
'voip' => ' |
80
|
|
|
|
|
|
|
2(?: |
81
|
|
|
|
|
|
|
0[0-57]| |
82
|
|
|
|
|
|
|
7[568] |
83
|
|
|
|
|
|
|
)\\d{4} |
84
|
|
|
|
|
|
|
' |
85
|
|
|
|
|
|
|
}; |
86
|
|
|
|
|
|
|
my %areanames = (); |
87
|
|
|
|
|
|
|
$areanames{en} = {"6753", "NCD", |
88
|
|
|
|
|
|
|
"67547", "Morobe", |
89
|
|
|
|
|
|
|
"67545", "Sepik", |
90
|
|
|
|
|
|
|
"6759", "Islands", |
91
|
|
|
|
|
|
|
"6756", "MP\/Gulf\/Tabubil\/Kiunga", |
92
|
|
|
|
|
|
|
"67542", "Madang", |
93
|
|
|
|
|
|
|
"6755", "Highlands",}; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub new { |
96
|
16
|
|
|
16
|
1
|
59
|
my $class = shift; |
97
|
16
|
|
|
|
|
32
|
my $number = shift; |
98
|
16
|
|
|
|
|
99
|
$number =~ s/(^\+675|\D)//g; |
99
|
16
|
|
|
|
|
96
|
my $self = bless({ country_code => '675', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
100
|
16
|
100
|
|
|
|
81
|
return $self->is_valid() ? $self : undef; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
1; |