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
|
|
1254
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
227
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
48
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
49
|
|
24
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
14
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174404; |
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} = {"42147", "Lucenec", |
136
|
|
|
|
|
|
|
"42153", "Spisska\ Nova\ Ves", |
137
|
|
|
|
|
|
|
"42155", "Kosice", |
138
|
|
|
|
|
|
|
"42132", "Trencin", |
139
|
|
|
|
|
|
|
"42134", "Senica", |
140
|
|
|
|
|
|
|
"42131", "Dunajska\ Streda", |
141
|
|
|
|
|
|
|
"42156", "Michalovce", |
142
|
|
|
|
|
|
|
"4212", "Bratislava", |
143
|
|
|
|
|
|
|
"42135", "Nove\ Zamky", |
144
|
|
|
|
|
|
|
"42154", "Bardejov", |
145
|
|
|
|
|
|
|
"42152", "Poprad", |
146
|
|
|
|
|
|
|
"421601", "Roznava", |
147
|
|
|
|
|
|
|
"42133", "Trnava", |
148
|
|
|
|
|
|
|
"42148", "Banska\ Bystrica", |
149
|
|
|
|
|
|
|
"42136", "Levice", |
150
|
|
|
|
|
|
|
"42151", "Presov", |
151
|
|
|
|
|
|
|
"42145", "Zvolen", |
152
|
|
|
|
|
|
|
"42157", "Humenne", |
153
|
|
|
|
|
|
|
"42143", "Martin", |
154
|
|
|
|
|
|
|
"42138", "Topolcany", |
155
|
|
|
|
|
|
|
"42146", "Prievidza", |
156
|
|
|
|
|
|
|
"42137", "Nitra", |
157
|
|
|
|
|
|
|
"42158", "Roznava", |
158
|
|
|
|
|
|
|
"42142", "Povazska\ Bystrica", |
159
|
|
|
|
|
|
|
"42144", "Liptovsky\ Mikulas", |
160
|
|
|
|
|
|
|
"42141", "Zilina",}; |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
sub new { |
163
|
25
|
|
|
25
|
1
|
46
|
my $class = shift; |
164
|
25
|
|
|
|
|
38
|
my $number = shift; |
165
|
25
|
|
|
|
|
160
|
$number =~ s/(^\+421|\D)//g; |
166
|
25
|
|
|
|
|
148
|
my $self = bless({ country_code => '421', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
167
|
25
|
100
|
|
|
|
125
|
return $self if ($self->is_valid()); |
168
|
1
|
|
|
|
|
2
|
$number =~ s/^(?:0)//; |
169
|
1
|
|
|
|
|
10
|
$self = bless({ country_code => '421', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
170
|
1
|
50
|
|
|
|
4
|
return $self->is_valid() ? $self : undef; |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
1; |