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::RO; |
20
|
2
|
|
|
2
|
|
1240
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
244
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
26
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
62
|
|
23
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
1128
|
|
24
|
2
|
|
|
2
|
|
15
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
12
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => '2[3-6]\\d9', |
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
219| |
38
|
|
|
|
|
|
|
31 |
39
|
|
|
|
|
|
|
', |
40
|
|
|
|
|
|
|
'national_rule' => '0$1', |
41
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{4})' |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
45
|
|
|
|
|
|
|
'leading_digits' => '[23]1', |
46
|
|
|
|
|
|
|
'national_rule' => '0$1', |
47
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
48
|
|
|
|
|
|
|
}, |
49
|
|
|
|
|
|
|
{ |
50
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
51
|
|
|
|
|
|
|
'leading_digits' => '[237-9]', |
52
|
|
|
|
|
|
|
'national_rule' => '0$1', |
53
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3})' |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
]; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $validators = { |
58
|
|
|
|
|
|
|
'fixed_line' => ' |
59
|
|
|
|
|
|
|
[23][13-6]\\d{7}| |
60
|
|
|
|
|
|
|
(?: |
61
|
|
|
|
|
|
|
2(?: |
62
|
|
|
|
|
|
|
19\\d| |
63
|
|
|
|
|
|
|
[3-6]\\d9 |
64
|
|
|
|
|
|
|
)| |
65
|
|
|
|
|
|
|
31\\d\\d |
66
|
|
|
|
|
|
|
)\\d\\d |
67
|
|
|
|
|
|
|
', |
68
|
|
|
|
|
|
|
'geographic' => ' |
69
|
|
|
|
|
|
|
[23][13-6]\\d{7}| |
70
|
|
|
|
|
|
|
(?: |
71
|
|
|
|
|
|
|
2(?: |
72
|
|
|
|
|
|
|
19\\d| |
73
|
|
|
|
|
|
|
[3-6]\\d9 |
74
|
|
|
|
|
|
|
)| |
75
|
|
|
|
|
|
|
31\\d\\d |
76
|
|
|
|
|
|
|
)\\d\\d |
77
|
|
|
|
|
|
|
', |
78
|
|
|
|
|
|
|
'mobile' => ' |
79
|
|
|
|
|
|
|
7020\\d{5}| |
80
|
|
|
|
|
|
|
7(?: |
81
|
|
|
|
|
|
|
0[013-9]| |
82
|
|
|
|
|
|
|
1[0-3]| |
83
|
|
|
|
|
|
|
[2-7]\\d| |
84
|
|
|
|
|
|
|
8[03-8]| |
85
|
|
|
|
|
|
|
9[0-29] |
86
|
|
|
|
|
|
|
)\\d{6} |
87
|
|
|
|
|
|
|
', |
88
|
|
|
|
|
|
|
'pager' => '', |
89
|
|
|
|
|
|
|
'personal_number' => '', |
90
|
|
|
|
|
|
|
'specialrate' => '(801\\d{6})|(90[0136]\\d{6})|( |
91
|
|
|
|
|
|
|
(?: |
92
|
|
|
|
|
|
|
37\\d| |
93
|
|
|
|
|
|
|
80[578] |
94
|
|
|
|
|
|
|
)\\d{6} |
95
|
|
|
|
|
|
|
)', |
96
|
|
|
|
|
|
|
'toll_free' => '800\\d{6}', |
97
|
|
|
|
|
|
|
'voip' => '' |
98
|
|
|
|
|
|
|
}; |
99
|
|
|
|
|
|
|
my %areanames = (); |
100
|
|
|
|
|
|
|
$areanames{ro} = {"4021", "București\ și\ județul\ Ilfov", |
101
|
|
|
|
|
|
|
"4031", "București\ și\ județul\ Ilfov",}; |
102
|
|
|
|
|
|
|
$areanames{en} = {"40343", "Ialomița", |
103
|
|
|
|
|
|
|
"40260", "Sălaj", |
104
|
|
|
|
|
|
|
"40356", "Timiș", |
105
|
|
|
|
|
|
|
"40269", "Sibiu", |
106
|
|
|
|
|
|
|
"40254", "Hunedoara", |
107
|
|
|
|
|
|
|
"40351", "Dolj", |
108
|
|
|
|
|
|
|
"40348", "Argeș", |
109
|
|
|
|
|
|
|
"40247", "Teleorman", |
110
|
|
|
|
|
|
|
"40365", "Mureș", |
111
|
|
|
|
|
|
|
"40352", "Mehedinți", |
112
|
|
|
|
|
|
|
"40239", "Brăila", |
113
|
|
|
|
|
|
|
"40357", "Arad", |
114
|
|
|
|
|
|
|
"40258", "Alba", |
115
|
|
|
|
|
|
|
"40241", "Constanța", |
116
|
|
|
|
|
|
|
"40344", "Prahova", |
117
|
|
|
|
|
|
|
"40230", "Suceava", |
118
|
|
|
|
|
|
|
"40242", "Călărași", |
119
|
|
|
|
|
|
|
"40335", "Vaslui", |
120
|
|
|
|
|
|
|
"40253", "Gorj", |
121
|
|
|
|
|
|
|
"40246", "Giurgiu", |
122
|
|
|
|
|
|
|
"4031", "Bucharest\ and\ Ilfov\ County", |
123
|
|
|
|
|
|
|
"40340", "Tulcea", |
124
|
|
|
|
|
|
|
"40332", "Iași", |
125
|
|
|
|
|
|
|
"40263", "Bistrița\-Năsăud", |
126
|
|
|
|
|
|
|
"40349", "Olt", |
127
|
|
|
|
|
|
|
"40331", "Botoșani", |
128
|
|
|
|
|
|
|
"40234", "Bacău", |
129
|
|
|
|
|
|
|
"40268", "Brașov", |
130
|
|
|
|
|
|
|
"40367", "Covasna", |
131
|
|
|
|
|
|
|
"40336", "Galați", |
132
|
|
|
|
|
|
|
"40245", "Dâmbovița", |
133
|
|
|
|
|
|
|
"40361", "Satu\ Mare", |
134
|
|
|
|
|
|
|
"40264", "Cluj", |
135
|
|
|
|
|
|
|
"40233", "Neamț", |
136
|
|
|
|
|
|
|
"40362", "Maramureș", |
137
|
|
|
|
|
|
|
"40355", "Caraș\-Severin", |
138
|
|
|
|
|
|
|
"40250", "Vâlcea", |
139
|
|
|
|
|
|
|
"40366", "Harghita", |
140
|
|
|
|
|
|
|
"40238", "Buzău", |
141
|
|
|
|
|
|
|
"40337", "Vrancea", |
142
|
|
|
|
|
|
|
"40259", "Bihor", |
143
|
|
|
|
|
|
|
"40342", "Călărași", |
144
|
|
|
|
|
|
|
"40330", "Suceava", |
145
|
|
|
|
|
|
|
"40244", "Prahova", |
146
|
|
|
|
|
|
|
"40341", "Constanța", |
147
|
|
|
|
|
|
|
"40358", "Alba", |
148
|
|
|
|
|
|
|
"40339", "Brăila", |
149
|
|
|
|
|
|
|
"40257", "Arad", |
150
|
|
|
|
|
|
|
"4021", "Bucharest\ and\ Ilfov\ County", |
151
|
|
|
|
|
|
|
"40346", "Giurgiu", |
152
|
|
|
|
|
|
|
"40353", "Gorj", |
153
|
|
|
|
|
|
|
"40235", "Vaslui", |
154
|
|
|
|
|
|
|
"40369", "Sibiu", |
155
|
|
|
|
|
|
|
"40256", "Timiș", |
156
|
|
|
|
|
|
|
"40360", "Sălaj", |
157
|
|
|
|
|
|
|
"40243", "Ialomița", |
158
|
|
|
|
|
|
|
"40252", "Mehedinți", |
159
|
|
|
|
|
|
|
"40265", "Mureș", |
160
|
|
|
|
|
|
|
"40347", "Teleorman", |
161
|
|
|
|
|
|
|
"40248", "Argeș", |
162
|
|
|
|
|
|
|
"40251", "Dolj", |
163
|
|
|
|
|
|
|
"40354", "Hunedoara", |
164
|
|
|
|
|
|
|
"40255", "Caraș\-Severin", |
165
|
|
|
|
|
|
|
"40333", "Neamț", |
166
|
|
|
|
|
|
|
"40262", "Maramureș", |
167
|
|
|
|
|
|
|
"40364", "Cluj", |
168
|
|
|
|
|
|
|
"40261", "Satu\ Mare", |
169
|
|
|
|
|
|
|
"40237", "Vrancea", |
170
|
|
|
|
|
|
|
"40359", "Bihor", |
171
|
|
|
|
|
|
|
"40338", "Buzău", |
172
|
|
|
|
|
|
|
"40266", "Harghita", |
173
|
|
|
|
|
|
|
"40350", "Vâlcea", |
174
|
|
|
|
|
|
|
"40334", "Bacău", |
175
|
|
|
|
|
|
|
"40231", "Botoșani", |
176
|
|
|
|
|
|
|
"40249", "Olt", |
177
|
|
|
|
|
|
|
"40363", "Bistrița\-Năsăud", |
178
|
|
|
|
|
|
|
"40232", "Iași", |
179
|
|
|
|
|
|
|
"40240", "Tulcea", |
180
|
|
|
|
|
|
|
"40345", "Dâmbovița", |
181
|
|
|
|
|
|
|
"40236", "Galați", |
182
|
|
|
|
|
|
|
"40267", "Covasna", |
183
|
|
|
|
|
|
|
"40368", "Brașov",}; |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
sub new { |
186
|
19
|
|
|
19
|
1
|
48
|
my $class = shift; |
187
|
19
|
|
|
|
|
28
|
my $number = shift; |
188
|
19
|
|
|
|
|
132
|
$number =~ s/(^\+40|\D)//g; |
189
|
19
|
|
|
|
|
101
|
my $self = bless({ country_code => '40', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
190
|
19
|
100
|
|
|
|
107
|
return $self if ($self->is_valid()); |
191
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
192
|
1
|
|
|
|
|
22
|
$self = bless({ country_code => '40', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
193
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
1; |