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