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::TO; |
20
|
2
|
|
|
2
|
|
1187
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
215
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
46
|
|
23
|
2
|
|
|
2
|
|
32
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
53
|
|
24
|
2
|
|
|
2
|
|
19
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
20
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1-$2', |
30
|
|
|
|
|
|
|
'leading_digits' => ' |
31
|
|
|
|
|
|
|
[2-4]| |
32
|
|
|
|
|
|
|
50| |
33
|
|
|
|
|
|
|
6[09]| |
34
|
|
|
|
|
|
|
7[0-24-69]| |
35
|
|
|
|
|
|
|
8[05] |
36
|
|
|
|
|
|
|
', |
37
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})' |
38
|
|
|
|
|
|
|
}, |
39
|
|
|
|
|
|
|
{ |
40
|
|
|
|
|
|
|
'format' => '$1 $2', |
41
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})' |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
'format' => '$1 $2', |
45
|
|
|
|
|
|
|
'leading_digits' => '[5-9]', |
46
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
]; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $validators = { |
51
|
|
|
|
|
|
|
'fixed_line' => ' |
52
|
|
|
|
|
|
|
(?: |
53
|
|
|
|
|
|
|
2\\d| |
54
|
|
|
|
|
|
|
3[0-8]| |
55
|
|
|
|
|
|
|
4[0-4]| |
56
|
|
|
|
|
|
|
50| |
57
|
|
|
|
|
|
|
6[09]| |
58
|
|
|
|
|
|
|
7[0-24-69]| |
59
|
|
|
|
|
|
|
8[05] |
60
|
|
|
|
|
|
|
)\\d{3} |
61
|
|
|
|
|
|
|
', |
62
|
|
|
|
|
|
|
'geographic' => ' |
63
|
|
|
|
|
|
|
(?: |
64
|
|
|
|
|
|
|
2\\d| |
65
|
|
|
|
|
|
|
3[0-8]| |
66
|
|
|
|
|
|
|
4[0-4]| |
67
|
|
|
|
|
|
|
50| |
68
|
|
|
|
|
|
|
6[09]| |
69
|
|
|
|
|
|
|
7[0-24-69]| |
70
|
|
|
|
|
|
|
8[05] |
71
|
|
|
|
|
|
|
)\\d{3} |
72
|
|
|
|
|
|
|
', |
73
|
|
|
|
|
|
|
'mobile' => ' |
74
|
|
|
|
|
|
|
(?: |
75
|
|
|
|
|
|
|
55[4-6]| |
76
|
|
|
|
|
|
|
6(?: |
77
|
|
|
|
|
|
|
[09]\\d| |
78
|
|
|
|
|
|
|
3[02]| |
79
|
|
|
|
|
|
|
8[15-9] |
80
|
|
|
|
|
|
|
)| |
81
|
|
|
|
|
|
|
(?: |
82
|
|
|
|
|
|
|
7\\d| |
83
|
|
|
|
|
|
|
8[46-9] |
84
|
|
|
|
|
|
|
)\\d| |
85
|
|
|
|
|
|
|
999 |
86
|
|
|
|
|
|
|
)\\d{4} |
87
|
|
|
|
|
|
|
', |
88
|
|
|
|
|
|
|
'pager' => '', |
89
|
|
|
|
|
|
|
'personal_number' => '', |
90
|
|
|
|
|
|
|
'specialrate' => '', |
91
|
|
|
|
|
|
|
'toll_free' => '0800\\d{3}', |
92
|
|
|
|
|
|
|
'voip' => '55[0-37-9]\\d{4}' |
93
|
|
|
|
|
|
|
}; |
94
|
|
|
|
|
|
|
my %areanames = (); |
95
|
|
|
|
|
|
|
$areanames{en} = {"67629", "Pea", |
96
|
|
|
|
|
|
|
"67633", "Kolonga", |
97
|
|
|
|
|
|
|
"67636", "Nakolo", |
98
|
|
|
|
|
|
|
"67650", "\‘Eua", |
99
|
|
|
|
|
|
|
"67680", "Niuas", |
100
|
|
|
|
|
|
|
"67640", "Kolovai", |
101
|
|
|
|
|
|
|
"67676", "Vava\’u", |
102
|
|
|
|
|
|
|
"67634", "Kolonga", |
103
|
|
|
|
|
|
|
"67642", "Masilamea", |
104
|
|
|
|
|
|
|
"6762", "Nuku\'alofa", |
105
|
|
|
|
|
|
|
"67685", "Niuas", |
106
|
|
|
|
|
|
|
"67641", "Masilamea", |
107
|
|
|
|
|
|
|
"67660", "Ha\’apai", |
108
|
|
|
|
|
|
|
"67674", "Vava\’u", |
109
|
|
|
|
|
|
|
"67679", "Vava\’u", |
110
|
|
|
|
|
|
|
"67637", "Vaini", |
111
|
|
|
|
|
|
|
"67669", "Ha\’apai", |
112
|
|
|
|
|
|
|
"67643", "Matangiake", |
113
|
|
|
|
|
|
|
"67670", "Vava\’u", |
114
|
|
|
|
|
|
|
"67630", "Pea", |
115
|
|
|
|
|
|
|
"67635", "Nakolo", |
116
|
|
|
|
|
|
|
"67631", "Muʻa", |
117
|
|
|
|
|
|
|
"67632", "Muʻa", |
118
|
|
|
|
|
|
|
"67671", "Vava\’u", |
119
|
|
|
|
|
|
|
"67672", "Vava\’u", |
120
|
|
|
|
|
|
|
"67638", "Vaini", |
121
|
|
|
|
|
|
|
"67675", "Vava\’u",}; |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub new { |
124
|
13
|
|
|
13
|
1
|
31
|
my $class = shift; |
125
|
13
|
|
|
|
|
21
|
my $number = shift; |
126
|
13
|
|
|
|
|
82
|
$number =~ s/(^\+676|\D)//g; |
127
|
13
|
|
|
|
|
77
|
my $self = bless({ country_code => '676', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
128
|
13
|
100
|
|
|
|
58
|
return $self->is_valid() ? $self : undef; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
1; |