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

filter: Statementstmt 100% 25 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 33 / 33 CC 2 SCAR 2.9
CC
2
Cov
100%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Number/Phone/StubCountry/PL.pm ↑ Summary blib/lib/Number/Phone/StubCountry/PW.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::PT;
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.20260904101551;
26  
27 2 my $formatters = [
28 {
29 'format' => '$1 $2 $3',
30 'leading_digits' => '2[12]',
31 'pattern' => '(\\d{2})(\\d{3})(\\d{4})'
32 },
33 {
34 'format' => '$1 $2 $3',
35 'leading_digits' => '
36 16|
37 [236-9]
38 ',
39 'pattern' => '(\\d{3})(\\d{3})(\\d{3})'
40 }
41 ];
42  
43 2 my $validators = {
44 'fixed_line' => '
45 2(?:
46 [12]\\d|
47 3[1-689]|
48 4[1-59]|
49 [57][1-9]|
50 6[1-35689]|
51 8[1-69]|
52 9[1256]
53 )\\d{6}
54 ',
55 'geographic' => '
56 2(?:
57 [12]\\d|
58 3[1-689]|
59 4[1-59]|
60 [57][1-9]|
61 6[1-35689]|
62 8[1-69]|
63 9[1256]
64 )\\d{6}
65 ',
66 'mobile' => '
67 6(?:
68 [06]92(?:
69 30|
70 9\\d
71 )|
72 [35]92(?:
73 [049]\\d|
74 3[034]
75 )
76 )\\d{3}|
77 (?:
78 (?:
79 16|
80 6[0356]
81 )93|
82 9(?:
83 [1-36]\\d\\d|
84 480
85 )
86 )\\d{5}
87 ',
88 'pager' => '
89 6(?:
90 222\\d|
91 89(?:
92 00|
93 88|
94 99
95 )
96 )\\d{4}
97 ',
98 'personal_number' => '884[0-4689]\\d{5}',
99 'specialrate' => '(
100 80(?:
101 8\\d|
102 9[1579]
103 )\\d{5}
104 )|(
105 (?:
106 6(?:
107 0[178]|
108 4[68]
109 )\\d|
110 76(?:
111 0[1-57]|
112 1[2-47]|
113 2[237]
114 )
115 )\\d{5}
116 )|(
117 70(?:
118 38[01]|
119 596|
120 (?:
121 7\\d|
122 8[17]
123 )\\d
124 )\\d{4}
125 )',
126 'toll_free' => '80[02]\\d{6}',
127 'voip' => '30\\d{7}'
128 };
129 2 my %areanames = ();
130 2 $areanames{en} = {"351266", "Évora",
131 "351278", "Mirandela",
132 "351277", "Idanha\-a\-Nova",
133 "351265", "Setúbal",
134 "351283", "Odemira",
135 "351272", "Castelo\ Branco",
136 "351234", "Aveiro",
137 "351261", "Torres\ Vedras",
138 "351244", "Leiria",
139 "351292", "Horta",
140 "351253", "Braga",
141 "351269", "Santiago\ do\ Cacém",
142 "351276", "Chaves",
143 "351243", "Santarém",
144 "351254", "Peso\ da\ Régua",
145 "351275", "Covilhã",
146 "351291", "Funchal",
147 "351268", "Estremoz",
148 "351233", "Figueira\ da\ Foz",
149 "351262", "Caldas\ da\ Rainha",
150 "351284", "Beja",
151 "351296", "Ponta\ Delgada",
152 "351295", "Angra\ do\ Heroísmo",
153 "351271", "Guarda",
154 "35122", "Porto",
155 "351279", "Moncorvo",
156 "351289", "Faro",
157 "351255", "Penafiel",
158 "351274", "Proença\-a\-Nova",
159 "351281", "Tavira",
160 "351256", "S\.\ João\ da\ Madeira",
161 "351263", "Vila\ Franca\ de\ Xira",
162 "351232", "Viseu",
163 "351259", "Vila\ Real",
164 "351251", "Valença",
165 "351242", "Ponte\ de\ Sôr",
166 "351286", "Castro\ Verde",
167 "351238", "Seia",
168 "351285", "Moura",
169 "351252", "V\.\ N\.\ de\ Famalicão",
170 "351241", "Abrantes",
171 "351239", "Coimbra",
172 "351257", "Braga",
173 "351258", "Viana\ do\ Castelo",
174 "351231", "Mealhada",
175 "351249", "Torres\ Novas",
176 "35121", "Lisbon",
177 "351282", "Portimão",
178 "351273", "Bragança",
179 "351245", "Portalegre",
180 "351236", "Pombal",
181 "351235", "Arganil",};
182 2 $areanames{pt} = {"35121", "Lisboa",};
183 2 my $timezones = {
184 '' => [
185 'Atlantic/Azores',
186 'Europe/Lisbon'
187 ],
188 '1' => [
189 'Atlantic/Azores',
190 'Europe/Lisbon'
191 ],
192 '2' => [
193 'Europe/Lisbon'
194 ],
195 '292' => [
196 'Atlantic/Azores'
197 ],
198 '295' => [
199 'Atlantic/Azores'
200 ],
201 '296' => [
202 'Atlantic/Azores'
203 ],
204 '3' => [
205 'Atlantic/Azores',
206 'Europe/Lisbon'
207 ],
208 '6' => [
209 'Atlantic/Azores',
210 'Europe/Lisbon'
211 ],
212 '7' => [
213 'Atlantic/Azores',
214 'Europe/Lisbon'
215 ],
216 '8' => [
217 'Atlantic/Azores',
218 'Europe/Lisbon'
219 ],
220 '9' => [
221 'Atlantic/Azores',
222 'Europe/Lisbon'
223 ]
224 };
225  
226 28 ▶ sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
227 28 my $class = shift;
228 28 my $number = shift;
229 28 $number =~ s/(^\+351|\D)//g;
230 28 my $self = bless({ country_code => '351', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
231 28 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 27 1 28
232 }
233 2 1;
« blib/lib/Number/Phone/StubCountry/PL.pm ↑ Summary blib/lib/Number/Phone/StubCountry/PW.pm »