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::YE; |
20
|
2
|
|
|
2
|
|
1137
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
222
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
27
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
47
|
|
23
|
2
|
|
|
2
|
|
18
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
55
|
|
24
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
13
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174405; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => ' |
31
|
|
|
|
|
|
|
[1-6]| |
32
|
|
|
|
|
|
|
7(?: |
33
|
|
|
|
|
|
|
[24-6]| |
34
|
|
|
|
|
|
|
8[0-7] |
35
|
|
|
|
|
|
|
) |
36
|
|
|
|
|
|
|
', |
37
|
|
|
|
|
|
|
'national_rule' => '0$1', |
38
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{3,4})' |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
42
|
|
|
|
|
|
|
'leading_digits' => '7', |
43
|
|
|
|
|
|
|
'national_rule' => '0$1', |
44
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3})' |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
]; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $validators = { |
49
|
|
|
|
|
|
|
'fixed_line' => ' |
50
|
|
|
|
|
|
|
78[0-7]\\d{4}| |
51
|
|
|
|
|
|
|
17\\d{6}| |
52
|
|
|
|
|
|
|
(?: |
53
|
|
|
|
|
|
|
[12][2-68]| |
54
|
|
|
|
|
|
|
3[2358]| |
55
|
|
|
|
|
|
|
4[2-58]| |
56
|
|
|
|
|
|
|
5[2-6]| |
57
|
|
|
|
|
|
|
6[3-58]| |
58
|
|
|
|
|
|
|
7[24-6] |
59
|
|
|
|
|
|
|
)\\d{5} |
60
|
|
|
|
|
|
|
', |
61
|
|
|
|
|
|
|
'geographic' => ' |
62
|
|
|
|
|
|
|
78[0-7]\\d{4}| |
63
|
|
|
|
|
|
|
17\\d{6}| |
64
|
|
|
|
|
|
|
(?: |
65
|
|
|
|
|
|
|
[12][2-68]| |
66
|
|
|
|
|
|
|
3[2358]| |
67
|
|
|
|
|
|
|
4[2-58]| |
68
|
|
|
|
|
|
|
5[2-6]| |
69
|
|
|
|
|
|
|
6[3-58]| |
70
|
|
|
|
|
|
|
7[24-6] |
71
|
|
|
|
|
|
|
)\\d{5} |
72
|
|
|
|
|
|
|
', |
73
|
|
|
|
|
|
|
'mobile' => '7[01378]\\d{7}', |
74
|
|
|
|
|
|
|
'pager' => '', |
75
|
|
|
|
|
|
|
'personal_number' => '', |
76
|
|
|
|
|
|
|
'specialrate' => '', |
77
|
|
|
|
|
|
|
'toll_free' => '', |
78
|
|
|
|
|
|
|
'voip' => '' |
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
my %areanames = (); |
81
|
|
|
|
|
|
|
$areanames{en} = {"9677870", "Hajjah", |
82
|
|
|
|
|
|
|
"9676860", "Al\ Baidha", |
83
|
|
|
|
|
|
|
"967785", "Saadah", |
84
|
|
|
|
|
|
|
"9677845", "Al\ Mahweet", |
85
|
|
|
|
|
|
|
"96774", "Al\ Mahweet", |
86
|
|
|
|
|
|
|
"9674842", "Taiz", |
87
|
|
|
|
|
|
|
"96742", "Taiz", |
88
|
|
|
|
|
|
|
"967483", "Taiz", |
89
|
|
|
|
|
|
|
"967286", "Abyan", |
90
|
|
|
|
|
|
|
"967636", "Maareb", |
91
|
|
|
|
|
|
|
"967656", "Al\ Baidha", |
92
|
|
|
|
|
|
|
"967683", "Maareb", |
93
|
|
|
|
|
|
|
"96754", "Hadhrmout", |
94
|
|
|
|
|
|
|
"9676861", "Dhamar", |
95
|
|
|
|
|
|
|
"967650", "Dhamar", |
96
|
|
|
|
|
|
|
"9673", "Hodaidah", |
97
|
|
|
|
|
|
|
"967282", "Aden", |
98
|
|
|
|
|
|
|
"967630", "Maareb", |
99
|
|
|
|
|
|
|
"9677871", "Hajjah", |
100
|
|
|
|
|
|
|
"967651", "Dhamar", |
101
|
|
|
|
|
|
|
"967484", "Ibb", |
102
|
|
|
|
|
|
|
"967657", "Al\ Baidha", |
103
|
|
|
|
|
|
|
"967485", "Ibb", |
104
|
|
|
|
|
|
|
"9672840", "Aden", |
105
|
|
|
|
|
|
|
"967280", "Aden", |
106
|
|
|
|
|
|
|
"967652", "Al\ Baidha", |
107
|
|
|
|
|
|
|
"967281", "Aden", |
108
|
|
|
|
|
|
|
"9674843", "Taiz", |
109
|
|
|
|
|
|
|
"96772", "Hajjah", |
110
|
|
|
|
|
|
|
"96744", "Ibb", |
111
|
|
|
|
|
|
|
"96726", "Abyan", |
112
|
|
|
|
|
|
|
"96725", "Lahj", |
113
|
|
|
|
|
|
|
"967639", "Dhamar", |
114
|
|
|
|
|
|
|
"96723", "Aden", |
115
|
|
|
|
|
|
|
"967566", "Soqatrah", |
116
|
|
|
|
|
|
|
"9677874", "Al\ Mahweet", |
117
|
|
|
|
|
|
|
"967638", "Maareb", |
118
|
|
|
|
|
|
|
"9676864", "Dhamar", |
119
|
|
|
|
|
|
|
"967684", "Dhamar", |
120
|
|
|
|
|
|
|
"9676853", "Al\ Baidha", |
121
|
|
|
|
|
|
|
"96764", "Dhamar", |
122
|
|
|
|
|
|
|
"96752", "Shabwah", |
123
|
|
|
|
|
|
|
"967653", "Al\ Baidha", |
124
|
|
|
|
|
|
|
"967633", "Maareb", |
125
|
|
|
|
|
|
|
"96775", "Saadah", |
126
|
|
|
|
|
|
|
"967283", "Aden", |
127
|
|
|
|
|
|
|
"96722", "Aden", |
128
|
|
|
|
|
|
|
"96776", "Amran", |
129
|
|
|
|
|
|
|
"9674841", "Taiz", |
130
|
|
|
|
|
|
|
"9677873", "Hajjah", |
131
|
|
|
|
|
|
|
"9677875", "Saadah", |
132
|
|
|
|
|
|
|
"9676863", "Maareb", |
133
|
|
|
|
|
|
|
"9676865", "Dhamar", |
134
|
|
|
|
|
|
|
"96755", "Hadhrmout", |
135
|
|
|
|
|
|
|
"9671", "Sanaa", |
136
|
|
|
|
|
|
|
"967433", "Ibb", |
137
|
|
|
|
|
|
|
"96753", "Hadhrmout", |
138
|
|
|
|
|
|
|
"9676867", "Dhamar", |
139
|
|
|
|
|
|
|
"9677877", "Amran", |
140
|
|
|
|
|
|
|
"9676866", "Dhamar", |
141
|
|
|
|
|
|
|
"9677876", "Amran", |
142
|
|
|
|
|
|
|
"96743", "Taiz", |
143
|
|
|
|
|
|
|
"9676862", "Al\ Baidha", |
144
|
|
|
|
|
|
|
"96745", "Ibb", |
145
|
|
|
|
|
|
|
"9677872", "Hajjah", |
146
|
|
|
|
|
|
|
"96724", "Dhalea", |
147
|
|
|
|
|
|
|
"967285", "Lahj", |
148
|
|
|
|
|
|
|
"9674840", "Taiz", |
149
|
|
|
|
|
|
|
"967284", "Dhalea", |
150
|
|
|
|
|
|
|
"967634", "Aljawf", |
151
|
|
|
|
|
|
|
"967655", "Al\ Baidha", |
152
|
|
|
|
|
|
|
"967654", "Al\ Baidha", |
153
|
|
|
|
|
|
|
"9677878", "Saadah", |
154
|
|
|
|
|
|
|
"9676869", "Al\ Baidha", |
155
|
|
|
|
|
|
|
"9676868", "Al\ Baidha", |
156
|
|
|
|
|
|
|
"9677879", "Al\ Mahweet", |
157
|
|
|
|
|
|
|
"9676850", "Al\ Baidha", |
158
|
|
|
|
|
|
|
"967786", "Amran", |
159
|
|
|
|
|
|
|
"967682", "Dhamar",}; |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
sub new { |
162
|
7
|
|
|
7
|
1
|
25
|
my $class = shift; |
163
|
7
|
|
|
|
|
13
|
my $number = shift; |
164
|
7
|
|
|
|
|
46
|
$number =~ s/(^\+967|\D)//g; |
165
|
7
|
|
|
|
|
44
|
my $self = bless({ country_code => '967', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
166
|
7
|
100
|
|
|
|
39
|
return $self if ($self->is_valid()); |
167
|
1
|
|
|
|
|
26
|
$number =~ s/^(?:0)//; |
168
|
1
|
|
|
|
|
12
|
$self = bless({ country_code => '967', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
169
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
1; |