blib/lib/Number/Phone/StubCountry/PL.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/PG.pm ↑ Summary blib/lib/Number/Phone/StubCountry/PT.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::PL;
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',
30 'leading_digits' => '19',
31 'pattern' => '(\\d{5})'
32 },
33 {
34 'format' => '$1 $2',
35 'leading_digits' => '
36 11|
37 20|
38 64
39 ',
40 'pattern' => '(\\d{3})(\\d{3})'
41 },
42 {
43 'format' => '$1 $2 $3',
44 'leading_digits' => '
45 30|
46 (?:
47 1[2-8]|
48 2[2-69]|
49 3[2-4]|
50 4[1-468]|
51 5[24-689]|
52 6[1-3578]|
53 7[14-7]|
54 8[1-79]|
55 9[145]
56 )19
57 ',
58 'pattern' => '(\\d{2})(\\d{2})(\\d{3})'
59 },
60 {
61 'format' => '$1 $2 $3',
62 'leading_digits' => '64',
63 'pattern' => '(\\d{3})(\\d{2})(\\d{2,3})'
64 },
65 {
66 'format' => '$1 $2 $3',
67 'leading_digits' => '
68 21|
69 39|
70 45|
71 5[0137]|
72 6[0469]|
73 7[02389]|
74 8(?:
75 0[14]|
76 8
77 )
78 ',
79 'pattern' => '(\\d{3})(\\d{3})(\\d{3})'
80 },
81 {
82 'format' => '$1 $2 $3 $4',
83 'leading_digits' => '
84 1[2-8]|
85 [2-7]|
86 8[1-79]|
87 9[145]
88 ',
89 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})'
90 },
91 {
92 'format' => '$1 $2 $3',
93 'leading_digits' => '8',
94 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})'
95 }
96 ];
97  
98 2 my $validators = {
99 'fixed_line' => '
100 (?:
101 30|
102 47\\d\\d
103 )\\d{5}|
104 (?:
105 1[2-8]|
106 2[2-69]|
107 3[2-4]|
108 4[1-468]|
109 5[24-689]|
110 6[1-3578]|
111 7[14-7]|
112 8[1-79]|
113 9[145]
114 )(?:
115 [02-9]\\d{6}|
116 1(?:
117 [0-8]\\d{5}|
118 9\\d{3}(?:
119 \\d{2}
120 )?
121 )
122 )
123 ',
124 'geographic' => '
125 (?:
126 30|
127 47\\d\\d
128 )\\d{5}|
129 (?:
130 1[2-8]|
131 2[2-69]|
132 3[2-4]|
133 4[1-468]|
134 5[24-689]|
135 6[1-3578]|
136 7[14-7]|
137 8[1-79]|
138 9[145]
139 )(?:
140 [02-9]\\d{6}|
141 1(?:
142 [0-8]\\d{5}|
143 9\\d{3}(?:
144 \\d{2}
145 )?
146 )
147 )
148 ',
149 'mobile' => '
150 21(?:
151 1[013-5]|
152 2\\d|
153 3[1-9]
154 )\\d{5}|
155 (?:
156 45|
157 5[0137]|
158 6[069]|
159 7[2389]|
160 88
161 )\\d{7}
162 ',
163 'pager' => '64\\d{4,7}',
164 'personal_number' => '',
165 'specialrate' => '(801\\d{6})|(70[01346-8]\\d{6})|(804\\d{6})',
166 'toll_free' => '800\\d{6,7}',
167 'voip' => '39\\d{7}'
168 };
169 2 my %areanames = ();
170 2 $areanames{pl} = {"4882", "Chełm",
171 "4874", "Wałbrzych",
172 "4887", "Suwałki",
173 "4871", "Wrocław",
174 "4859", "Słupsk",
175 "4883", "Biała\ Podlaska",
176 "4867", "Piła",
177 "4854", "Włocławek",
178 "4842", "Łódź",
179 "4886", "Łomża",
180 "4822", "Warszawa",
181 "4829", "Ostrołęka",
182 "4833", "Bielsko\-Biała",
183 "4885", "Białystok",
184 "4824", "Płock",};
185 2 $areanames{en} = {"4876", "Legnica",
186 "4841", "Kielce",
187 "4824", "Plock",
188 "4855", "Elbląg",
189 "4865", "Leszno",
190 "4817", "Rzeszów",
191 "4844", "Piotrków\ Trybunalski",
192 "4834", "Częstochowa",
193 "4812", "Kraków",
194 "4868", "Zielona\ Góra",
195 "4858", "Gdańsk",
196 "4885", "Bialystok",
197 "4813", "Krosno",
198 "4833", "Bielsko\-Biala",
199 "4843", "Sieradz",
200 "4856", "Toruń",
201 "4823", "Ciechanów",
202 "4875", "Jelenia\ Góra",
203 "4832", "Katowice",
204 "4842", "Lódź",
205 "4894", "Koszalin",
206 "4814", "Tarnów",
207 "4886", "Lomża",
208 "4822", "Warsaw",
209 "4829", "Ostrolęka",
210 "4891", "Szczecin",
211 "4848", "Radom",
212 "4881", "Lublin",
213 "4877", "Opole",
214 "4816", "Przemyśl",
215 "4830", "Kraków",
216 "4884", "Zamość",
217 "4861", "Poznań",
218 "4854", "Wloclawek",
219 "4825", "Siedlce",
220 "4862", "Kalisz",
221 "4859", "Slupsk",
222 "4883", "Biala\ Podlaska",
223 "4852", "Bydgoszcz",
224 "4815", "Tarnobrzeg",
225 "4867", "Pila",
226 "4895", "Gorzów\ Wielkopolski",
227 "4863", "Konin",
228 "4882", "Chelm",
229 "4889", "Olsztyn",
230 "4874", "Walbrzych",
231 "4846", "Skierniewice",
232 "4887", "Suwalki",
233 "4871", "Wroclaw",
234 "4818", "Nowy\ Sącz",};
235 2 my $timezones = {
236 '' => [
237 'Europe/Warsaw'
238 ]
239 };
240  
241 25 ▶ sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
242 25 my $class = shift;
243 25 my $number = shift;
244 25 $number =~ s/(^\+48|\D)//g;
245 25 my $self = bless({ country_code => '48', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
246 25 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 24 1 25
247 }
248 2 1;
« blib/lib/Number/Phone/StubCountry/PG.pm ↑ Summary blib/lib/Number/Phone/StubCountry/PT.pm »