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