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
|
|
1177
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
217
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
51
|
|
23
|
2
|
|
|
2
|
|
15
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
48
|
|
24
|
2
|
|
|
2
|
|
17
|
use utf8; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
19
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181420; |
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
|
|
|
|
|
|
|
98\\d{6,7}| |
93
|
|
|
|
|
|
|
975(?: |
94
|
|
|
|
|
|
|
1\\d| |
95
|
|
|
|
|
|
|
77| |
96
|
|
|
|
|
|
|
9[67] |
97
|
|
|
|
|
|
|
)\\d{4}| |
98
|
|
|
|
|
|
|
9(?: |
99
|
|
|
|
|
|
|
0[1-9]| |
100
|
|
|
|
|
|
|
[1259]\\d| |
101
|
|
|
|
|
|
|
7[0679] |
102
|
|
|
|
|
|
|
)\\d{6} |
103
|
|
|
|
|
|
|
', |
104
|
|
|
|
|
|
|
'pager' => '', |
105
|
|
|
|
|
|
|
'personal_number' => '7[45]\\d{6}', |
106
|
|
|
|
|
|
|
'specialrate' => '( |
107
|
|
|
|
|
|
|
6[01459]\\d{6}| |
108
|
|
|
|
|
|
|
6[01]\\d{4,5} |
109
|
|
|
|
|
|
|
)|( |
110
|
|
|
|
|
|
|
62\\d{6,7}| |
111
|
|
|
|
|
|
|
72\\d{6} |
112
|
|
|
|
|
|
|
)', |
113
|
|
|
|
|
|
|
'toll_free' => '80[01]\\d{4,6}', |
114
|
|
|
|
|
|
|
'voip' => '' |
115
|
|
|
|
|
|
|
}; |
116
|
|
|
|
|
|
|
my %areanames = (); |
117
|
|
|
|
|
|
|
$areanames{en} = {"38548", "Koprivnica\-Križevci", |
118
|
|
|
|
|
|
|
"3851", "Zagreb", |
119
|
|
|
|
|
|
|
"38520", "Dubrovnik\-Neretva", |
120
|
|
|
|
|
|
|
"38552", "Istra", |
121
|
|
|
|
|
|
|
"38551", "Primorsko\-goranska", |
122
|
|
|
|
|
|
|
"38542", "Varaždin", |
123
|
|
|
|
|
|
|
"38544", "Sisak\-Moslavina", |
124
|
|
|
|
|
|
|
"38523", "Zadar", |
125
|
|
|
|
|
|
|
"38535", "Brod\-Posavina", |
126
|
|
|
|
|
|
|
"38534", "Požega\-Slavonia", |
127
|
|
|
|
|
|
|
"38549", "Krapina\-Zagorje", |
128
|
|
|
|
|
|
|
"38532", "Vukovar\-Srijem", |
129
|
|
|
|
|
|
|
"38531", "Osijek\-Baranja", |
130
|
|
|
|
|
|
|
"38553", "Lika\-Senj", |
131
|
|
|
|
|
|
|
"38540", "Međimurje", |
132
|
|
|
|
|
|
|
"38543", "Bjelovar\-Bilogora", |
133
|
|
|
|
|
|
|
"38522", "Šibenik\-Knin", |
134
|
|
|
|
|
|
|
"38521", "Split\-Dalmatia", |
135
|
|
|
|
|
|
|
"38547", "Karlovac", |
136
|
|
|
|
|
|
|
"38533", "Virovitica\-Podravina",}; |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub new { |
139
|
19
|
|
|
19
|
1
|
42
|
my $class = shift; |
140
|
19
|
|
|
|
|
30
|
my $number = shift; |
141
|
19
|
|
|
|
|
117
|
$number =~ s/(^\+385|\D)//g; |
142
|
19
|
|
|
|
|
125
|
my $self = bless({ country_code => '385', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
143
|
19
|
100
|
|
|
|
93
|
return $self if ($self->is_valid()); |
144
|
1
|
|
|
|
|
5
|
$number =~ s/^(?:0)//; |
145
|
1
|
|
|
|
|
18
|
$self = bless({ country_code => '385', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
146
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
1; |