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

filter: Statementstmt 100% 29 / 29 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 97.4% 38 / 39 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/LU.pm ↑ Summary blib/lib/Number/Phone/StubCountry/RU.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::MD;
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',
30 'leading_digits' => '[89]',
31 'national_rule' => '0$1',
32 'pattern' => '(\\d{3})(\\d{5})'
33 },
34 {
35 'format' => '$1 $2 $3',
36 'leading_digits' => '
37 22|
38 3
39 ',
40 'national_rule' => '0$1',
41 'pattern' => '(\\d{2})(\\d{3})(\\d{3})'
42 },
43 {
44 'format' => '$1 $2 $3',
45 'leading_digits' => '[25-7]',
46 'national_rule' => '0$1',
47 'pattern' => '(\\d{3})(\\d{2})(\\d{3})'
48 }
49 ];
50  
51 2 my $validators = {
52 'fixed_line' => '
53 (?:
54 (?:
55 2[1-9]|
56 3[1-79]
57 )\\d|
58 5(?:
59 33|
60 5[257]
61 )
62 )\\d{5}
63 ',
64 'geographic' => '
65 (?:
66 (?:
67 2[1-9]|
68 3[1-79]
69 )\\d|
70 5(?:
71 33|
72 5[257]
73 )
74 )\\d{5}
75 ',
76 'mobile' => '
77 562\\d{5}|
78 (?:
79 6\\d|
80 7[16-9]
81 )\\d{6}
82 ',
83 'pager' => '',
84 'personal_number' => '',
85 'specialrate' => '(808\\d{5})|(90[056]\\d{5})|(803\\d{5})',
86 'toll_free' => '800\\d{5}',
87 'voip' => '3[08]\\d{6}'
88 };
89 2 my %areanames = ();
90 2 $areanames{ro} = {"37322", "Chişinău",
91 "373250", "Floreşti",
92 "373258", "Teleneşti",
93 "373262", "Sîngerei",
94 "373215", "Dubăsari",
95 "373555", "Rîbniţa",
96 "373231", "Bălţi",
97 "373293", "Vulcăneşti",
98 "373243", "Căuşeni",
99 "373291", "Ceadîr\ Lunga",
100 "373241", "Cimişlia",
101 "373242", "Ştefan\ Vodă",
102 "373251", "Donduşeni",
103 "373244", "Călăraşi",
104 "373237", "Străşeni",
105 "373269", "Hînceşti",
106 "373259", "Făleşti",
107 "373272", "Şoldăneşti",
108 "373256", "Rîşcani",};
109 2 $areanames{ru} = {"373265", "Анений\ Ной",
110 "373230", "Сорока",
111 "373552", "Бендер",
112 "373256", "Рышкань",
113 "373557", "Слобозия",
114 "373272", "Шолдэнешть",
115 "373247", "Бричень",
116 "373248", "Криулень",
117 "373298", "Комрат",
118 "373297", "Басарабяска",
119 "373210", "Григориополь",
120 "373259", "Фэлешть",
121 "373263", "Леова",
122 "373237", "Стрэшень",
123 "373269", "Хынчешть",
124 "37353", "Тираспол",
125 "373294", "Тараклия",
126 "373242", "Штефан\ Водэ",
127 "373251", "Дондушень",
128 "373244", "Кэлэрашь",
129 "373268", "Яловень",
130 "373291", "Чадыр\-Лунга",
131 "373254", "Резина",
132 "373241", "Чимишлия",
133 "373252", "Дрокия",
134 "373293", "Вулкэнешть",
135 "373243", "Кэушень",
136 "373299", "Кагул",
137 "373555", "Рыбница",
138 "373249", "Глодень",
139 "373231", "Бэлць",
140 "373216", "Каменка",
141 "373258", "Теленешть",
142 "373264", "Ниспорень",
143 "373215", "Дубэсарь",
144 "373262", "Сынжерей",
145 "373271", "Окница",
146 "373273", "Кантемир",
147 "373246", "Единец",
148 "373219", "Днестровск",
149 "373250", "Флорешть",
150 "373235", "Орхей",
151 "37322", "Кишинэу",
152 "373236", "Унгень",};
153 2 $areanames{en} = {"373299", "Cahul",
154 "373216", "Camenca",
155 "373249", "Glodeni",
156 "373231", "Balţi",
157 "373555", "Ribnita",
158 "373258", "Telenesti",
159 "373262", "Singerei",
160 "373215", "Dubasari",
161 "373264", "Nisporeni",
162 "373291", "Ceadir\ Lunga",
163 "373268", "Ialoveni",
164 "373252", "Drochia",
165 "373241", "Cimislia",
166 "373254", "Rezina",
167 "373293", "Vulcanesti",
168 "373243", "Causeni",
169 "373235", "Orhei",
170 "37322", "Chisinau",
171 "373236", "Ungheni",
172 "373271", "Ocniţa",
173 "373273", "Cantemir",
174 "373219", "Dnestrovsk",
175 "373246", "Edineţ",
176 "373250", "Floresti",
177 "373256", "Riscani",
178 "373557", "Slobozia",
179 "373272", "Soldanesti",
180 "373265", "Anenii\ Noi",
181 "373230", "Soroca",
182 "373552", "Bender",
183 "373237", "Straseni",
184 "37353", "Tiraspol",
185 "373269", "Hincesti",
186 "373294", "Taraclia",
187 "373244", "Calarasi",
188 "373251", "Donduseni",
189 "373242", "Stefan\ Voda",
190 "373248", "Criuleni",
191 "373247", "Briceni",
192 "373297", "Basarabeasca",
193 "373298", "Comrat",
194 "373210", "Grigoriopol",
195 "373263", "Leova",
196 "373259", "Falesti",};
197 2 my $timezones = {
198 '' => [
199 'Europe/Chisinau'
200 ]
201 };
202  
203 22 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
204 22 my $class = shift;
205 22 my $number = shift;
206 22 $number =~ s/(^\+373|\D)//g;
207 22 my $self = bless({ country_code => '373', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
208 22 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 21 1 22
209 1 $number =~ s/^(?:0)//;
210 1 $self = bless({ country_code => '373', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
211 1 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 1 1
212 }
213 2 1;
« blib/lib/Number/Phone/StubCountry/LU.pm ↑ Summary blib/lib/Number/Phone/StubCountry/RU.pm »