blib/lib/Number/Phone/StubCountry/BO.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/BL.pm ↑ Summary blib/lib/Number/Phone/StubCountry/CR.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::BO;
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.20260904101547;
26  
27 2 my $formatters = [
28 {
29 'format' => '$1 $2',
30 'leading_digits' => '
31 [23]|
32 4[46]|
33 50
34 ',
35 'pattern' => '(\\d)(\\d{7})'
36 },
37 {
38 'format' => '$1',
39 'leading_digits' => '[5-7]',
40 'pattern' => '(\\d{8})'
41 },
42 {
43 'format' => '$1 $2 $3',
44 'leading_digits' => '8',
45 'pattern' => '(\\d{3})(\\d{2})(\\d{4})'
46 }
47 ];
48  
49 2 my $validators = {
50 'fixed_line' => '
51 (?:
52 2(?:
53 2\\d\\d|
54 5(?:
55 11|
56 [258]\\d|
57 9[67]
58 )|
59 6(?:
60 12|
61 2\\d|
62 9[34]
63 )|
64 8(?:
65 2[34]|
66 39|
67 62
68 )
69 )|
70 3(?:
71 3\\d\\d|
72 4(?:
73 6\\d|
74 8[24]
75 )|
76 8(?:
77 25|
78 42|
79 5[257]|
80 86|
81 9[25]
82 )|
83 9(?:
84 [27]\\d|
85 3[2-4]|
86 4[248]|
87 5[24]|
88 6[2-6]
89 )
90 )|
91 4(?:
92 4\\d\\d|
93 6(?:
94 11|
95 [24689]\\d|
96 72
97 )
98 )
99 )\\d{4}
100 ',
101 'geographic' => '
102 (?:
103 2(?:
104 2\\d\\d|
105 5(?:
106 11|
107 [258]\\d|
108 9[67]
109 )|
110 6(?:
111 12|
112 2\\d|
113 9[34]
114 )|
115 8(?:
116 2[34]|
117 39|
118 62
119 )
120 )|
121 3(?:
122 3\\d\\d|
123 4(?:
124 6\\d|
125 8[24]
126 )|
127 8(?:
128 25|
129 42|
130 5[257]|
131 86|
132 9[25]
133 )|
134 9(?:
135 [27]\\d|
136 3[2-4]|
137 4[248]|
138 5[24]|
139 6[2-6]
140 )
141 )|
142 4(?:
143 4\\d\\d|
144 6(?:
145 11|
146 [24689]\\d|
147 72
148 )
149 )
150 )\\d{4}
151 ',
152 'mobile' => '
153 (?:
154 57|
155 [67]\\d
156 )\\d{6}
157 ',
158 'pager' => '',
159 'personal_number' => '',
160 'specialrate' => '',
161 'toll_free' => '8001[07]\\d{4}',
162 'voip' => '50\\d{6}'
163 };
164 2 my $timezones = {
165 '' => [
166 'America/La_Paz'
167 ]
168 };
169  
170 13 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
171 13 my $class = shift;
172 13 my $number = shift;
173 13 $number =~ s/(^\+591|\D)//g;
174 13 my $self = bless({ country_code => '591', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, }, $class);
175 13 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 12 1 13
176 1 $number =~ s/^(?:0(1\d)?)//;
177 1 $self = bless({ country_code => '591', number => $number, formatters => $formatters, validators => $validators, }, $class);
178 1 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 1 1
179 }
180 2 1;
« blib/lib/Number/Phone/StubCountry/BL.pm ↑ Summary blib/lib/Number/Phone/StubCountry/CR.pm »