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::HR; |
20
|
2
|
|
|
2
|
|
1140
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
226
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
19
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
47
|
|
23
|
2
|
|
|
2
|
|
22
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
17
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
15
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131447; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => '6[01]', |
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => '8', |
37
|
|
|
|
|
|
|
'national_rule' => '0$1', |
38
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{2})(\\d{2,3})' |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
42
|
|
|
|
|
|
|
'leading_digits' => '1', |
43
|
|
|
|
|
|
|
'national_rule' => '0$1', |
44
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{4})(\\d{3})' |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
48
|
|
|
|
|
|
|
'leading_digits' => '[67]', |
49
|
|
|
|
|
|
|
'national_rule' => '0$1', |
50
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})' |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
{ |
53
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
54
|
|
|
|
|
|
|
'leading_digits' => '9', |
55
|
|
|
|
|
|
|
'national_rule' => '0$1', |
56
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})' |
57
|
|
|
|
|
|
|
}, |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
60
|
|
|
|
|
|
|
'leading_digits' => '[2-5]', |
61
|
|
|
|
|
|
|
'national_rule' => '0$1', |
62
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3,4})' |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
66
|
|
|
|
|
|
|
'leading_digits' => '8', |
67
|
|
|
|
|
|
|
'national_rule' => '0$1', |
68
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3})' |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
]; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my $validators = { |
73
|
|
|
|
|
|
|
'fixed_line' => ' |
74
|
|
|
|
|
|
|
1\\d{7}| |
75
|
|
|
|
|
|
|
(?: |
76
|
|
|
|
|
|
|
2[0-3]| |
77
|
|
|
|
|
|
|
3[1-5]| |
78
|
|
|
|
|
|
|
4[02-47-9]| |
79
|
|
|
|
|
|
|
5[1-3] |
80
|
|
|
|
|
|
|
)\\d{6,7} |
81
|
|
|
|
|
|
|
', |
82
|
|
|
|
|
|
|
'geographic' => ' |
83
|
|
|
|
|
|
|
1\\d{7}| |
84
|
|
|
|
|
|
|
(?: |
85
|
|
|
|
|
|
|
2[0-3]| |
86
|
|
|
|
|
|
|
3[1-5]| |
87
|
|
|
|
|
|
|
4[02-47-9]| |
88
|
|
|
|
|
|
|
5[1-3] |
89
|
|
|
|
|
|
|
)\\d{6,7} |
90
|
|
|
|
|
|
|
', |
91
|
|
|
|
|
|
|
'mobile' => ' |
92
|
|
|
|
|
|
|
9(?: |
93
|
|
|
|
|
|
|
(?: |
94
|
|
|
|
|
|
|
0[1-9]| |
95
|
|
|
|
|
|
|
[12589]\\d |
96
|
|
|
|
|
|
|
)\\d\\d| |
97
|
|
|
|
|
|
|
7(?: |
98
|
|
|
|
|
|
|
[0679]\\d\\d| |
99
|
|
|
|
|
|
|
5(?: |
100
|
|
|
|
|
|
|
[01]\\d| |
101
|
|
|
|
|
|
|
44| |
102
|
|
|
|
|
|
|
77| |
103
|
|
|
|
|
|
|
9[67] |
104
|
|
|
|
|
|
|
) |
105
|
|
|
|
|
|
|
) |
106
|
|
|
|
|
|
|
)\\d{4}| |
107
|
|
|
|
|
|
|
98\\d{6} |
108
|
|
|
|
|
|
|
', |
109
|
|
|
|
|
|
|
'pager' => '', |
110
|
|
|
|
|
|
|
'personal_number' => '7[45]\\d{6}', |
111
|
|
|
|
|
|
|
'specialrate' => '( |
112
|
|
|
|
|
|
|
6[01459]\\d{6}| |
113
|
|
|
|
|
|
|
6[01]\\d{4,5} |
114
|
|
|
|
|
|
|
)|( |
115
|
|
|
|
|
|
|
62\\d{6,7}| |
116
|
|
|
|
|
|
|
72\\d{6} |
117
|
|
|
|
|
|
|
)', |
118
|
|
|
|
|
|
|
'toll_free' => '80[01]\\d{4,6}', |
119
|
|
|
|
|
|
|
'voip' => '' |
120
|
|
|
|
|
|
|
}; |
121
|
|
|
|
|
|
|
my %areanames = (); |
122
|
|
|
|
|
|
|
$areanames{en} = {"38533", "Virovitica\-Podravina", |
123
|
|
|
|
|
|
|
"38523", "Zadar", |
124
|
|
|
|
|
|
|
"38522", "Šibenik\-Knin", |
125
|
|
|
|
|
|
|
"38532", "Vukovar\-Srijem", |
126
|
|
|
|
|
|
|
"38520", "Dubrovnik\-Neretva", |
127
|
|
|
|
|
|
|
"38542", "Varaždin", |
128
|
|
|
|
|
|
|
"38540", "Međimurje", |
129
|
|
|
|
|
|
|
"38543", "Bjelovar\-Bilogora", |
130
|
|
|
|
|
|
|
"38531", "Osijek\-Baranja", |
131
|
|
|
|
|
|
|
"38521", "Split\-Dalmatia", |
132
|
|
|
|
|
|
|
"38549", "Krapina\-Zagorje", |
133
|
|
|
|
|
|
|
"38548", "Koprivnica\-Križevci", |
134
|
|
|
|
|
|
|
"38551", "Primorsko\-goranska", |
135
|
|
|
|
|
|
|
"38552", "Istra", |
136
|
|
|
|
|
|
|
"38553", "Lika\-Senj", |
137
|
|
|
|
|
|
|
"38544", "Sisak\-Moslavina", |
138
|
|
|
|
|
|
|
"38534", "Požega\-Slavonia", |
139
|
|
|
|
|
|
|
"38535", "Brod\-Posavina", |
140
|
|
|
|
|
|
|
"3851", "Zagreb", |
141
|
|
|
|
|
|
|
"38547", "Karlovac",}; |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
sub new { |
144
|
19
|
|
|
19
|
1
|
48
|
my $class = shift; |
145
|
19
|
|
|
|
|
32
|
my $number = shift; |
146
|
19
|
|
|
|
|
120
|
$number =~ s/(^\+385|\D)//g; |
147
|
19
|
|
|
|
|
133
|
my $self = bless({ country_code => '385', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
148
|
19
|
100
|
|
|
|
94
|
return $self if ($self->is_valid()); |
149
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
150
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '385', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
151
|
1
|
50
|
|
|
|
4
|
return $self->is_valid() ? $self : undef; |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
1; |