blib/lib/Number/Phone/StubCountry/KH.pm

filter: Statementstmt 100% 25 / 25 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 97.1% 34 / 35 CC 3 SCAR 6.2
CC
3
Cov
97%
new
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« blib/lib/Number/Phone/StubCountry/IQ.pm ↑ Summary blib/lib/Number/Phone/StubCountry/LA.pm »
1 # automatically generated file, don't edit
2  
3  
4  
5 # Copyright 2026 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 ▶use base qw(Number::Phone::StubCountry);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 our $VERSION = 1.20260904101550;
26  
27 2 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 2 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 2 my $timezones = {
133 '' => [
134 'Asia/Phnom_Penh'
135 ]
136 };
137  
138 13 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
139 13 my $class = shift;
140 13 my $number = shift;
141 13 $number =~ s/(^\+855|\D)//g;
142 13 my $self = bless({ country_code => '855', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, }, $class);
143 13 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 12 1 13
144 1 $number =~ s/^(?:0)//;
145 1 $self = bless({ country_code => '855', number => $number, formatters => $formatters, validators => $validators, }, $class);
146 1 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 1 1
147 }
148 2 1;
« blib/lib/Number/Phone/StubCountry/IQ.pm ↑ Summary blib/lib/Number/Phone/StubCountry/LA.pm »