blib/lib/Number/Phone/StubCountry/RE.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/PM.pm ↑ Summary blib/lib/Number/Phone/StubCountry/RW.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::RE;
20 3 ▶use base qw(Number::Phone::StubCountry);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 3 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 3 our $VERSION = 1.20260904101551;
26  
27 3 my $formatters = [
28 {
29 'format' => '$1 $2 $3 $4',
30 'leading_digits' => '[26-9]',
31 'national_rule' => '0$1',
32 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})'
33 }
34 ];
35  
36 3 my $validators = {
37 'fixed_line' => '
38 2631[0-6]\\d{4}|
39 26(?:
40 2\\d|
41 30|
42 88
43 )\\d{5}
44 ',
45 'geographic' => '
46 2631[0-6]\\d{4}|
47 26(?:
48 2\\d|
49 30|
50 88
51 )\\d{5}
52 ',
53 'mobile' => '
54 (?:
55 69(?:
56 2\\d\\d|
57 3(?:
58 [06][0-6]|
59 1[0-3]|
60 2[0-2]|
61 3[0-39]|
62 4\\d|
63 5[0-5]|
64 7[0-37]|
65 8[0-8]|
66 9[0-479]
67 )
68 )|
69 7092[0-3]
70 )\\d{4}
71 ',
72 'pager' => '',
73 'personal_number' => '',
74 'specialrate' => '(
75 8(?:
76 1[019]|
77 2[0156]|
78 84|
79 90
80 )\\d{6}
81 )|(89[1-37-9]\\d{6})',
82 'toll_free' => '80\\d{7}',
83 'voip' => '
84 9(?:
85 399[0-3]|
86 479[0-6]|
87 76(?:
88 2[278]|
89 3[0-37]
90 )
91 )\\d{4}
92 '
93 };
94 3 my $timezones = {
95 '' => [
96 'Indian/Mayotte',
97 'Indian/Reunion'
98 ],
99 '262' => [
100 'Indian/Reunion'
101 ],
102 '263' => [
103 'Indian/Reunion'
104 ],
105 '2688' => [
106 'Indian/Reunion'
107 ],
108 '2689' => [
109 'Indian/Mayotte'
110 ],
111 '269' => [
112 'Indian/Mayotte'
113 ],
114 '63' => [
115 'Indian/Mayotte'
116 ],
117 '69' => [
118 'Indian/Reunion'
119 ],
120 '7092' => [
121 'Indian/Reunion'
122 ],
123 '7093' => [
124 'Indian/Mayotte'
125 ],
126 '80' => [
127 'Indian/Mayotte',
128 'Indian/Reunion'
129 ],
130 '81' => [
131 'Indian/Reunion'
132 ],
133 '82' => [
134 'Indian/Reunion'
135 ],
136 '88' => [
137 'Indian/Reunion'
138 ],
139 '89' => [
140 'Indian/Reunion'
141 ],
142 '9398' => [
143 'Indian/Mayotte'
144 ],
145 '9399' => [
146 'Indian/Reunion'
147 ],
148 '9478' => [
149 'Indian/Mayotte'
150 ],
151 '9479' => [
152 'Indian/Reunion'
153 ],
154 '9762' => [
155 'Indian/Reunion'
156 ],
157 '9763' => [
158 'Indian/Reunion'
159 ],
160 '9769' => [
161 'Indian/Mayotte'
162 ]
163 };
164  
165 46 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
166 46 my $class = shift;
167 46 my $number = shift;
168 46 $number =~ s/(^\+262|\D)//g;
169 46 my $self = bless({ country_code => '262', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, }, $class);
170 46 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 40 6 46
171 6 $number =~ s/^(?:0)//;
172 6 $self = bless({ country_code => '262', number => $number, formatters => $formatters, validators => $validators, }, $class);
173 6 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 6 6
174 }
175 3 1;
« blib/lib/Number/Phone/StubCountry/PM.pm ↑ Summary blib/lib/Number/Phone/StubCountry/RW.pm »