line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 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::SK; |
20
|
2
|
|
|
2
|
|
1312
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
282
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
19
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
48
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
54
|
|
24
|
2
|
|
|
2
|
|
20
|
use utf8; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
17
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => '21', |
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{2})(\\d{3,4})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => '[3-5][1-8]1[67]', |
37
|
|
|
|
|
|
|
'national_rule' => '0$1', |
38
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})' |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
'format' => '$1 $2', |
42
|
|
|
|
|
|
|
'intl_format' => 'NA', |
43
|
|
|
|
|
|
|
'leading_digits' => '9090', |
44
|
|
|
|
|
|
|
'national_rule' => '0$1', |
45
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})' |
46
|
|
|
|
|
|
|
}, |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
'format' => '$1/$2 $3 $4', |
49
|
|
|
|
|
|
|
'leading_digits' => '2', |
50
|
|
|
|
|
|
|
'national_rule' => '0$1', |
51
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})' |
52
|
|
|
|
|
|
|
}, |
53
|
|
|
|
|
|
|
{ |
54
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
55
|
|
|
|
|
|
|
'leading_digits' => '[689]', |
56
|
|
|
|
|
|
|
'national_rule' => '0$1', |
57
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3})' |
58
|
|
|
|
|
|
|
}, |
59
|
|
|
|
|
|
|
{ |
60
|
|
|
|
|
|
|
'format' => '$1/$2 $3 $4', |
61
|
|
|
|
|
|
|
'leading_digits' => '[3-5]', |
62
|
|
|
|
|
|
|
'national_rule' => '0$1', |
63
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})' |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
]; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
my $validators = { |
68
|
|
|
|
|
|
|
'fixed_line' => ' |
69
|
|
|
|
|
|
|
(?: |
70
|
|
|
|
|
|
|
2(?: |
71
|
|
|
|
|
|
|
16| |
72
|
|
|
|
|
|
|
[2-9]\\d{3} |
73
|
|
|
|
|
|
|
)| |
74
|
|
|
|
|
|
|
(?: |
75
|
|
|
|
|
|
|
(?: |
76
|
|
|
|
|
|
|
[3-5][1-8]\\d| |
77
|
|
|
|
|
|
|
819 |
78
|
|
|
|
|
|
|
)\\d| |
79
|
|
|
|
|
|
|
601[1-5] |
80
|
|
|
|
|
|
|
)\\d |
81
|
|
|
|
|
|
|
)\\d{4}| |
82
|
|
|
|
|
|
|
(?: |
83
|
|
|
|
|
|
|
2| |
84
|
|
|
|
|
|
|
[3-5][1-8] |
85
|
|
|
|
|
|
|
)1[67]\\d{3}| |
86
|
|
|
|
|
|
|
[3-5][1-8]16\\d\\d |
87
|
|
|
|
|
|
|
', |
88
|
|
|
|
|
|
|
'geographic' => ' |
89
|
|
|
|
|
|
|
(?: |
90
|
|
|
|
|
|
|
2(?: |
91
|
|
|
|
|
|
|
16| |
92
|
|
|
|
|
|
|
[2-9]\\d{3} |
93
|
|
|
|
|
|
|
)| |
94
|
|
|
|
|
|
|
(?: |
95
|
|
|
|
|
|
|
(?: |
96
|
|
|
|
|
|
|
[3-5][1-8]\\d| |
97
|
|
|
|
|
|
|
819 |
98
|
|
|
|
|
|
|
)\\d| |
99
|
|
|
|
|
|
|
601[1-5] |
100
|
|
|
|
|
|
|
)\\d |
101
|
|
|
|
|
|
|
)\\d{4}| |
102
|
|
|
|
|
|
|
(?: |
103
|
|
|
|
|
|
|
2| |
104
|
|
|
|
|
|
|
[3-5][1-8] |
105
|
|
|
|
|
|
|
)1[67]\\d{3}| |
106
|
|
|
|
|
|
|
[3-5][1-8]16\\d\\d |
107
|
|
|
|
|
|
|
', |
108
|
|
|
|
|
|
|
'mobile' => ' |
109
|
|
|
|
|
|
|
909[1-9]\\d{5}| |
110
|
|
|
|
|
|
|
9(?: |
111
|
|
|
|
|
|
|
0[1-8]| |
112
|
|
|
|
|
|
|
1[0-24-9]| |
113
|
|
|
|
|
|
|
4[03-57-9]| |
114
|
|
|
|
|
|
|
5\\d |
115
|
|
|
|
|
|
|
)\\d{6} |
116
|
|
|
|
|
|
|
', |
117
|
|
|
|
|
|
|
'pager' => '9090\\d{3}', |
118
|
|
|
|
|
|
|
'personal_number' => '', |
119
|
|
|
|
|
|
|
'specialrate' => '(8[5-9]\\d{7})|( |
120
|
|
|
|
|
|
|
9(?: |
121
|
|
|
|
|
|
|
00| |
122
|
|
|
|
|
|
|
[78]\\d |
123
|
|
|
|
|
|
|
)\\d{6} |
124
|
|
|
|
|
|
|
)|(96\\d{7})', |
125
|
|
|
|
|
|
|
'toll_free' => '800\\d{6}', |
126
|
|
|
|
|
|
|
'voip' => ' |
127
|
|
|
|
|
|
|
6(?: |
128
|
|
|
|
|
|
|
02| |
129
|
|
|
|
|
|
|
5[0-4]| |
130
|
|
|
|
|
|
|
9[0-6] |
131
|
|
|
|
|
|
|
)\\d{6} |
132
|
|
|
|
|
|
|
' |
133
|
|
|
|
|
|
|
}; |
134
|
|
|
|
|
|
|
my %areanames = (); |
135
|
|
|
|
|
|
|
$areanames{en} = {"42136", "Levice", |
136
|
|
|
|
|
|
|
"42138", "Topolcany", |
137
|
|
|
|
|
|
|
"42133", "Trnava", |
138
|
|
|
|
|
|
|
"42132", "Trencin", |
139
|
|
|
|
|
|
|
"42131", "Dunajska\ Streda", |
140
|
|
|
|
|
|
|
"42145", "Zvolen", |
141
|
|
|
|
|
|
|
"42137", "Nitra", |
142
|
|
|
|
|
|
|
"42134", "Senica", |
143
|
|
|
|
|
|
|
"42155", "Kosice", |
144
|
|
|
|
|
|
|
"4212", "Bratislava", |
145
|
|
|
|
|
|
|
"42148", "Banska\ Bystrica", |
146
|
|
|
|
|
|
|
"42146", "Prievidza", |
147
|
|
|
|
|
|
|
"42151", "Presov", |
148
|
|
|
|
|
|
|
"42152", "Poprad", |
149
|
|
|
|
|
|
|
"42153", "Spisska\ Nova\ Ves", |
150
|
|
|
|
|
|
|
"42142", "Povazska\ Bystrica", |
151
|
|
|
|
|
|
|
"42143", "Martin", |
152
|
|
|
|
|
|
|
"42158", "Roznava", |
153
|
|
|
|
|
|
|
"421601", "Roznava", |
154
|
|
|
|
|
|
|
"42156", "Michalovce", |
155
|
|
|
|
|
|
|
"42141", "Zilina", |
156
|
|
|
|
|
|
|
"42135", "Nove\ Zamky", |
157
|
|
|
|
|
|
|
"42154", "Bardejov", |
158
|
|
|
|
|
|
|
"42147", "Lucenec", |
159
|
|
|
|
|
|
|
"42144", "Liptovsky\ Mikulas", |
160
|
|
|
|
|
|
|
"42157", "Humenne",}; |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
sub new { |
163
|
25
|
|
|
25
|
1
|
55
|
my $class = shift; |
164
|
25
|
|
|
|
|
45
|
my $number = shift; |
165
|
25
|
|
|
|
|
161
|
$number =~ s/(^\+421|\D)//g; |
166
|
25
|
|
|
|
|
146
|
my $self = bless({ country_code => '421', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
167
|
25
|
100
|
|
|
|
113
|
return $self if ($self->is_valid()); |
168
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
169
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '421', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
170
|
1
|
50
|
|
|
|
6
|
return $self->is_valid() ? $self : undef; |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
1; |