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::EH; |
20
|
3
|
|
|
3
|
|
1628
|
use base qw(Number::Phone::StubCountry); |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
306
|
|
21
|
|
|
|
|
|
|
|
22
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
18
|
|
|
3
|
|
|
|
|
66
|
|
23
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
101
|
|
24
|
3
|
|
|
3
|
|
16
|
use utf8; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
16
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181420; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = []; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $validators = { |
30
|
|
|
|
|
|
|
'fixed_line' => '528[89]\\d{5}', |
31
|
|
|
|
|
|
|
'geographic' => '528[89]\\d{5}', |
32
|
|
|
|
|
|
|
'mobile' => ' |
33
|
|
|
|
|
|
|
(?: |
34
|
|
|
|
|
|
|
6(?: |
35
|
|
|
|
|
|
|
[0-79]\\d| |
36
|
|
|
|
|
|
|
8[0-247-9] |
37
|
|
|
|
|
|
|
)| |
38
|
|
|
|
|
|
|
7(?: |
39
|
|
|
|
|
|
|
[017]\\d| |
40
|
|
|
|
|
|
|
2[0-2]| |
41
|
|
|
|
|
|
|
6[0-8]| |
42
|
|
|
|
|
|
|
8[0-3] |
43
|
|
|
|
|
|
|
) |
44
|
|
|
|
|
|
|
)\\d{6} |
45
|
|
|
|
|
|
|
', |
46
|
|
|
|
|
|
|
'pager' => '', |
47
|
|
|
|
|
|
|
'personal_number' => '', |
48
|
|
|
|
|
|
|
'specialrate' => '(89\\d{7})', |
49
|
|
|
|
|
|
|
'toll_free' => '80\\d{7}', |
50
|
|
|
|
|
|
|
'voip' => ' |
51
|
|
|
|
|
|
|
592(?: |
52
|
|
|
|
|
|
|
4[0-2]| |
53
|
|
|
|
|
|
|
93 |
54
|
|
|
|
|
|
|
)\\d{4} |
55
|
|
|
|
|
|
|
' |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
my %areanames = (); |
58
|
|
|
|
|
|
|
$areanames{en} = {"2125226", "Casablanca", |
59
|
|
|
|
|
|
|
"2125377", "Rabat", |
60
|
|
|
|
|
|
|
"2125286", "Tiznit", |
61
|
|
|
|
|
|
|
"2125395", "Larache", |
62
|
|
|
|
|
|
|
"2125233", "El\ Jedida\/Mohammedia", |
63
|
|
|
|
|
|
|
"2125220", "Casablanca", |
64
|
|
|
|
|
|
|
"2125366", "Figuig\/Oujda", |
65
|
|
|
|
|
|
|
"2125224", "Casablanca", |
66
|
|
|
|
|
|
|
"2125357", "Goulmima", |
67
|
|
|
|
|
|
|
"2125242", "El\ Kelaa\ des\ Sraghna", |
68
|
|
|
|
|
|
|
"212521", "Casablanca\/Central\ Morocco", |
69
|
|
|
|
|
|
|
"2125355", "Meknès", |
70
|
|
|
|
|
|
|
"2125375", "Khémisset", |
71
|
|
|
|
|
|
|
"2125397", "Tétouan", |
72
|
|
|
|
|
|
|
"2125290", "Casablanca", |
73
|
|
|
|
|
|
|
"2125398", "Al\ Hoceima\/Chefchaouen", |
74
|
|
|
|
|
|
|
"2125393", "Tangier", |
75
|
|
|
|
|
|
|
"21252980", "Marrakech\ area", |
76
|
|
|
|
|
|
|
"2125235", "Oued\ Zem", |
77
|
|
|
|
|
|
|
"2125282", "Agadir\/Ait\ Meloul\/Inezgane", |
78
|
|
|
|
|
|
|
"2125222", "Casablanca", |
79
|
|
|
|
|
|
|
"2125373", "Kénitra", |
80
|
|
|
|
|
|
|
"2125358", "Ifrane", |
81
|
|
|
|
|
|
|
"2125229", "Casablanca", |
82
|
|
|
|
|
|
|
"2125244", "Marrakech", |
83
|
|
|
|
|
|
|
"2125289", "Dakhla\/Laayoune", |
84
|
|
|
|
|
|
|
"2125237", "Settat", |
85
|
|
|
|
|
|
|
"212520", "Casablanca", |
86
|
|
|
|
|
|
|
"2125388", "Tangier\ area", |
87
|
|
|
|
|
|
|
"2125362", "Berkane", |
88
|
|
|
|
|
|
|
"212532", "Fès\/Errachidia\/Meknès\/Nador\/Oujda\/Taza", |
89
|
|
|
|
|
|
|
"2125378", "Salé", |
90
|
|
|
|
|
|
|
"2125353", "Midelt", |
91
|
|
|
|
|
|
|
"21253890", "Fès\/Meknès\ areas", |
92
|
|
|
|
|
|
|
"2125246", "El\ Youssoufia\/Safi", |
93
|
|
|
|
|
|
|
"2125283", "Inezgane\/Taroudant", |
94
|
|
|
|
|
|
|
"2125372", "Rabat", |
95
|
|
|
|
|
|
|
"2125223", "Casablanca", |
96
|
|
|
|
|
|
|
"2125368", "Figuig", |
97
|
|
|
|
|
|
|
"212525", "Southern\ Morocco", |
98
|
|
|
|
|
|
|
"2125379", "Souk\ Larbaa", |
99
|
|
|
|
|
|
|
"212530", "Rabat\/Kènitra", |
100
|
|
|
|
|
|
|
"2125288", "Agadir\/Es\-Semara\/Tarfaya", |
101
|
|
|
|
|
|
|
"2125359", "Fès", |
102
|
|
|
|
|
|
|
"2125228", "Casablanca", |
103
|
|
|
|
|
|
|
"2125363", "Nador", |
104
|
|
|
|
|
|
|
"2125352", "Taza", |
105
|
|
|
|
|
|
|
"2125234", "Settai", |
106
|
|
|
|
|
|
|
"2125247", "Essaouira", |
107
|
|
|
|
|
|
|
"21252990", "Agadir\ area", |
108
|
|
|
|
|
|
|
"2125399", "Al\ Hoceima\/Larache\/Tangier", |
109
|
|
|
|
|
|
|
"212531", "Tangier\/Al\ Hoceima\/Larache\/Tètouan\/Chefchaouen", |
110
|
|
|
|
|
|
|
"2125394", "Asilah", |
111
|
|
|
|
|
|
|
"2125365", "Oujda", |
112
|
|
|
|
|
|
|
"2125225", "Casablanca", |
113
|
|
|
|
|
|
|
"2125285", "Oulad\ Teima\/Taroudant", |
114
|
|
|
|
|
|
|
"2125396", "Fnideq\/Martil\/Mdiq", |
115
|
|
|
|
|
|
|
"2125376", "Rabat\/Témara", |
116
|
|
|
|
|
|
|
"2125287", "Guelmim\/Tan\ Tan", |
117
|
|
|
|
|
|
|
"2125227", "Casablanca", |
118
|
|
|
|
|
|
|
"2125354", "Meknès", |
119
|
|
|
|
|
|
|
"2125380", "Rabat\ area", |
120
|
|
|
|
|
|
|
"2125248", "Ouarzazate", |
121
|
|
|
|
|
|
|
"2125232", "Mohammedia", |
122
|
|
|
|
|
|
|
"2125367", "Bouarfa\/Oujda", |
123
|
|
|
|
|
|
|
"2125374", "Ouazzane", |
124
|
|
|
|
|
|
|
"2125243", "Marrakech", |
125
|
|
|
|
|
|
|
"2125356", "Fès",}; |
126
|
|
|
|
|
|
|
$areanames{fr} = {"212530", "Rabat\/Kénitra", |
127
|
|
|
|
|
|
|
"212525", "Maroc\ Sud", |
128
|
|
|
|
|
|
|
"2125283", "Inezgane\/Taroudannt", |
129
|
|
|
|
|
|
|
"2125234", "Settat", |
130
|
|
|
|
|
|
|
"2125288", "Es\-Semara\/Agadir\/Tarfaya", |
131
|
|
|
|
|
|
|
"21252990", "Agadir\ et\ alentours", |
132
|
|
|
|
|
|
|
"2125399", "Tanger\/Larache\/Al\ Hoceima", |
133
|
|
|
|
|
|
|
"212531", "Tanger\/Tétouan\/Larache\/Al\ Hoceima\/Cherfchaouen", |
134
|
|
|
|
|
|
|
"2125285", "Taroudannt\/Oulad\ Teima", |
135
|
|
|
|
|
|
|
"2125380", "Rabat\ et\ alentours", |
136
|
|
|
|
|
|
|
"2125367", "Oujda\/Bouarfa", |
137
|
|
|
|
|
|
|
"2125233", "Mohammedia\/El\ Jadida", |
138
|
|
|
|
|
|
|
"2125366", "Oujda\/Figuig", |
139
|
|
|
|
|
|
|
"212521", "Casablanca\/Maroc\ Central", |
140
|
|
|
|
|
|
|
"21252980", "Marrakech\ et\ alentours", |
141
|
|
|
|
|
|
|
"2125393", "Tanger", |
142
|
|
|
|
|
|
|
"2125289", "Laayoune\/Dakhla", |
143
|
|
|
|
|
|
|
"2125282", "Agadir\/Inezgane\/Ait\ Melou", |
144
|
|
|
|
|
|
|
"21253890", "Fès\/Maknès\ et\ alentours", |
145
|
|
|
|
|
|
|
"2125246", "Safi\/El\ Youssoufia", |
146
|
|
|
|
|
|
|
"212532", "Fès\/Oujda\/Meknès\/Taza\/Nador\/Errachidia", |
147
|
|
|
|
|
|
|
"2125388", "Tanger\ et\ alentours",}; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
sub new { |
150
|
15
|
|
|
15
|
1
|
42
|
my $class = shift; |
151
|
15
|
|
|
|
|
28
|
my $number = shift; |
152
|
15
|
|
|
|
|
100
|
$number =~ s/(^\+212|\D)//g; |
153
|
15
|
|
|
|
|
94
|
my $self = bless({ country_code => '212', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
154
|
15
|
100
|
|
|
|
109
|
return $self if ($self->is_valid()); |
155
|
4
|
|
|
|
|
27
|
$number =~ s/^(?:0)//; |
156
|
4
|
|
|
|
|
41
|
$self = bless({ country_code => '212', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
157
|
4
|
50
|
|
|
|
23
|
return $self->is_valid() ? $self : undef; |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
1; |