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::KH; |
20
|
2
|
|
|
2
|
|
1207
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
271
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
52
|
|
23
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
61
|
|
24
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
19
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174403; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => '[1-9]', |
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => '1', |
37
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})(\\d{3})' |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
]; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $validators = { |
42
|
|
|
|
|
|
|
'fixed_line' => ' |
43
|
|
|
|
|
|
|
23(?: |
44
|
|
|
|
|
|
|
4(?: |
45
|
|
|
|
|
|
|
[2-4]| |
46
|
|
|
|
|
|
|
[56]\\d |
47
|
|
|
|
|
|
|
)| |
48
|
|
|
|
|
|
|
[568]\\d\\d |
49
|
|
|
|
|
|
|
)\\d{4}| |
50
|
|
|
|
|
|
|
23[236-9]\\d{5}| |
51
|
|
|
|
|
|
|
(?: |
52
|
|
|
|
|
|
|
2[4-6]| |
53
|
|
|
|
|
|
|
3[2-6]| |
54
|
|
|
|
|
|
|
4[2-4]| |
55
|
|
|
|
|
|
|
[5-7][2-5] |
56
|
|
|
|
|
|
|
)(?: |
57
|
|
|
|
|
|
|
(?: |
58
|
|
|
|
|
|
|
[237-9]| |
59
|
|
|
|
|
|
|
4[56]| |
60
|
|
|
|
|
|
|
5\\d |
61
|
|
|
|
|
|
|
)\\d{5}| |
62
|
|
|
|
|
|
|
6\\d{5,6} |
63
|
|
|
|
|
|
|
) |
64
|
|
|
|
|
|
|
', |
65
|
|
|
|
|
|
|
'geographic' => ' |
66
|
|
|
|
|
|
|
23(?: |
67
|
|
|
|
|
|
|
4(?: |
68
|
|
|
|
|
|
|
[2-4]| |
69
|
|
|
|
|
|
|
[56]\\d |
70
|
|
|
|
|
|
|
)| |
71
|
|
|
|
|
|
|
[568]\\d\\d |
72
|
|
|
|
|
|
|
)\\d{4}| |
73
|
|
|
|
|
|
|
23[236-9]\\d{5}| |
74
|
|
|
|
|
|
|
(?: |
75
|
|
|
|
|
|
|
2[4-6]| |
76
|
|
|
|
|
|
|
3[2-6]| |
77
|
|
|
|
|
|
|
4[2-4]| |
78
|
|
|
|
|
|
|
[5-7][2-5] |
79
|
|
|
|
|
|
|
)(?: |
80
|
|
|
|
|
|
|
(?: |
81
|
|
|
|
|
|
|
[237-9]| |
82
|
|
|
|
|
|
|
4[56]| |
83
|
|
|
|
|
|
|
5\\d |
84
|
|
|
|
|
|
|
)\\d{5}| |
85
|
|
|
|
|
|
|
6\\d{5,6} |
86
|
|
|
|
|
|
|
) |
87
|
|
|
|
|
|
|
', |
88
|
|
|
|
|
|
|
'mobile' => ' |
89
|
|
|
|
|
|
|
(?: |
90
|
|
|
|
|
|
|
(?: |
91
|
|
|
|
|
|
|
1[28]| |
92
|
|
|
|
|
|
|
3[18]| |
93
|
|
|
|
|
|
|
9[67] |
94
|
|
|
|
|
|
|
)\\d| |
95
|
|
|
|
|
|
|
6[016-9]| |
96
|
|
|
|
|
|
|
7(?: |
97
|
|
|
|
|
|
|
[07-9]| |
98
|
|
|
|
|
|
|
[16]\\d |
99
|
|
|
|
|
|
|
)| |
100
|
|
|
|
|
|
|
8(?: |
101
|
|
|
|
|
|
|
[013-79]| |
102
|
|
|
|
|
|
|
8\\d |
103
|
|
|
|
|
|
|
) |
104
|
|
|
|
|
|
|
)\\d{6}| |
105
|
|
|
|
|
|
|
(?: |
106
|
|
|
|
|
|
|
1\\d| |
107
|
|
|
|
|
|
|
9[0-57-9] |
108
|
|
|
|
|
|
|
)\\d{6}| |
109
|
|
|
|
|
|
|
(?: |
110
|
|
|
|
|
|
|
2[3-6]| |
111
|
|
|
|
|
|
|
3[2-6]| |
112
|
|
|
|
|
|
|
4[2-4]| |
113
|
|
|
|
|
|
|
[5-7][2-5] |
114
|
|
|
|
|
|
|
)48\\d{5} |
115
|
|
|
|
|
|
|
', |
116
|
|
|
|
|
|
|
'pager' => '', |
117
|
|
|
|
|
|
|
'personal_number' => '', |
118
|
|
|
|
|
|
|
'specialrate' => '( |
119
|
|
|
|
|
|
|
1900(?: |
120
|
|
|
|
|
|
|
1\\d| |
121
|
|
|
|
|
|
|
2[09] |
122
|
|
|
|
|
|
|
)\\d{4} |
123
|
|
|
|
|
|
|
)', |
124
|
|
|
|
|
|
|
'toll_free' => ' |
125
|
|
|
|
|
|
|
1800(?: |
126
|
|
|
|
|
|
|
1\\d| |
127
|
|
|
|
|
|
|
2[019] |
128
|
|
|
|
|
|
|
)\\d{4} |
129
|
|
|
|
|
|
|
', |
130
|
|
|
|
|
|
|
'voip' => '' |
131
|
|
|
|
|
|
|
}; |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub new { |
134
|
13
|
|
|
13
|
1
|
27
|
my $class = shift; |
135
|
13
|
|
|
|
|
23
|
my $number = shift; |
136
|
13
|
|
|
|
|
89
|
$number =~ s/(^\+855|\D)//g; |
137
|
13
|
|
|
|
|
80
|
my $self = bless({ country_code => '855', number => $number, formatters => $formatters, validators => $validators, }, $class); |
138
|
13
|
100
|
|
|
|
67
|
return $self if ($self->is_valid()); |
139
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
140
|
1
|
|
|
|
|
16
|
$self = bless({ country_code => '855', number => $number, formatters => $formatters, validators => $validators, }, $class); |
141
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
1; |