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