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
|
|
1169
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
220
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
965
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
52
|
|
24
|
2
|
|
|
2
|
|
16
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
14
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
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} = {"4031", "București\ și\ județul\ Ilfov", |
101
|
|
|
|
|
|
|
"4021", "București\ și\ județul\ Ilfov",}; |
102
|
|
|
|
|
|
|
$areanames{en} = {"40343", "Ialomița", |
103
|
|
|
|
|
|
|
"40234", "Bacău", |
104
|
|
|
|
|
|
|
"40364", "Cluj", |
105
|
|
|
|
|
|
|
"40337", "Vrancea", |
106
|
|
|
|
|
|
|
"40245", "Dâmbovița", |
107
|
|
|
|
|
|
|
"40267", "Covasna", |
108
|
|
|
|
|
|
|
"40369", "Sibiu", |
109
|
|
|
|
|
|
|
"40241", "Constanța", |
110
|
|
|
|
|
|
|
"40239", "Brăila", |
111
|
|
|
|
|
|
|
"40252", "Mehedinți", |
112
|
|
|
|
|
|
|
"40356", "Timiș", |
113
|
|
|
|
|
|
|
"40248", "Argeș", |
114
|
|
|
|
|
|
|
"40366", "Harghita", |
115
|
|
|
|
|
|
|
"40332", "Iași", |
116
|
|
|
|
|
|
|
"40236", "Galați", |
117
|
|
|
|
|
|
|
"40262", "Maramureș", |
118
|
|
|
|
|
|
|
"40257", "Arad", |
119
|
|
|
|
|
|
|
"40240", "Tulcea", |
120
|
|
|
|
|
|
|
"4031", "Bucharest\ and\ Ilfov\ County", |
121
|
|
|
|
|
|
|
"40359", "Bihor", |
122
|
|
|
|
|
|
|
"40354", "Hunedoara", |
123
|
|
|
|
|
|
|
"40266", "Harghita", |
124
|
|
|
|
|
|
|
"40232", "Iași", |
125
|
|
|
|
|
|
|
"40362", "Maramureș", |
126
|
|
|
|
|
|
|
"40336", "Galați", |
127
|
|
|
|
|
|
|
"40254", "Hunedoara", |
128
|
|
|
|
|
|
|
"4021", "Bucharest\ and\ Ilfov\ County", |
129
|
|
|
|
|
|
|
"40259", "Bihor", |
130
|
|
|
|
|
|
|
"40357", "Arad", |
131
|
|
|
|
|
|
|
"40340", "Tulcea", |
132
|
|
|
|
|
|
|
"40269", "Sibiu", |
133
|
|
|
|
|
|
|
"40341", "Constanța", |
134
|
|
|
|
|
|
|
"40339", "Brăila", |
135
|
|
|
|
|
|
|
"40237", "Vrancea", |
136
|
|
|
|
|
|
|
"40367", "Covasna", |
137
|
|
|
|
|
|
|
"40345", "Dâmbovița", |
138
|
|
|
|
|
|
|
"40334", "Bacău", |
139
|
|
|
|
|
|
|
"40264", "Cluj", |
140
|
|
|
|
|
|
|
"40243", "Ialomița", |
141
|
|
|
|
|
|
|
"40348", "Argeș", |
142
|
|
|
|
|
|
|
"40352", "Mehedinți", |
143
|
|
|
|
|
|
|
"40256", "Timiș", |
144
|
|
|
|
|
|
|
"40258", "Alba", |
145
|
|
|
|
|
|
|
"40346", "Giurgiu", |
146
|
|
|
|
|
|
|
"40242", "Călărași", |
147
|
|
|
|
|
|
|
"40330", "Suceava", |
148
|
|
|
|
|
|
|
"40255", "Caraș\-Severin", |
149
|
|
|
|
|
|
|
"40260", "Sălaj", |
150
|
|
|
|
|
|
|
"40251", "Dolj", |
151
|
|
|
|
|
|
|
"40353", "Gorj", |
152
|
|
|
|
|
|
|
"40363", "Bistrița\-Năsăud", |
153
|
|
|
|
|
|
|
"40233", "Neamț", |
154
|
|
|
|
|
|
|
"40344", "Prahova", |
155
|
|
|
|
|
|
|
"40250", "Vâlcea", |
156
|
|
|
|
|
|
|
"40335", "Vaslui", |
157
|
|
|
|
|
|
|
"40247", "Teleorman", |
158
|
|
|
|
|
|
|
"40265", "Mureș", |
159
|
|
|
|
|
|
|
"40261", "Satu\ Mare", |
160
|
|
|
|
|
|
|
"40349", "Olt", |
161
|
|
|
|
|
|
|
"40331", "Botoșani", |
162
|
|
|
|
|
|
|
"40268", "Brașov", |
163
|
|
|
|
|
|
|
"40338", "Buzău", |
164
|
|
|
|
|
|
|
"40361", "Satu\ Mare", |
165
|
|
|
|
|
|
|
"40249", "Olt", |
166
|
|
|
|
|
|
|
"40231", "Botoșani", |
167
|
|
|
|
|
|
|
"40350", "Vâlcea", |
168
|
|
|
|
|
|
|
"40235", "Vaslui", |
169
|
|
|
|
|
|
|
"40365", "Mureș", |
170
|
|
|
|
|
|
|
"40347", "Teleorman", |
171
|
|
|
|
|
|
|
"40244", "Prahova", |
172
|
|
|
|
|
|
|
"40263", "Bistrița\-Năsăud", |
173
|
|
|
|
|
|
|
"40333", "Neamț", |
174
|
|
|
|
|
|
|
"40368", "Brașov", |
175
|
|
|
|
|
|
|
"40238", "Buzău", |
176
|
|
|
|
|
|
|
"40246", "Giurgiu", |
177
|
|
|
|
|
|
|
"40342", "Călărași", |
178
|
|
|
|
|
|
|
"40358", "Alba", |
179
|
|
|
|
|
|
|
"40253", "Gorj", |
180
|
|
|
|
|
|
|
"40351", "Dolj", |
181
|
|
|
|
|
|
|
"40230", "Suceava", |
182
|
|
|
|
|
|
|
"40355", "Caraș\-Severin", |
183
|
|
|
|
|
|
|
"40360", "Sălaj",}; |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
sub new { |
186
|
19
|
|
|
19
|
1
|
49
|
my $class = shift; |
187
|
19
|
|
|
|
|
31
|
my $number = shift; |
188
|
19
|
|
|
|
|
124
|
$number =~ s/(^\+40|\D)//g; |
189
|
19
|
|
|
|
|
122
|
my $self = bless({ country_code => '40', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
190
|
19
|
100
|
|
|
|
88
|
return $self if ($self->is_valid()); |
191
|
1
|
|
|
|
|
5
|
$number =~ s/^(?:0)//; |
192
|
1
|
|
|
|
|
11
|
$self = bless({ country_code => '40', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
193
|
1
|
50
|
|
|
|
8
|
return $self->is_valid() ? $self : undef; |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
1; |