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