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::SO; |
20
|
2
|
|
|
2
|
|
1227
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
240
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
51
|
|
23
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
48
|
|
24
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => '8[125]', |
31
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{4})' |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
'format' => '$1', |
35
|
|
|
|
|
|
|
'leading_digits' => '[134]', |
36
|
|
|
|
|
|
|
'pattern' => '(\\d{6})' |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
{ |
39
|
|
|
|
|
|
|
'format' => '$1 $2', |
40
|
|
|
|
|
|
|
'leading_digits' => ' |
41
|
|
|
|
|
|
|
[15]| |
42
|
|
|
|
|
|
|
2[0-79]| |
43
|
|
|
|
|
|
|
3[0-46-8]| |
44
|
|
|
|
|
|
|
4[0-7] |
45
|
|
|
|
|
|
|
', |
46
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{6})' |
47
|
|
|
|
|
|
|
}, |
48
|
|
|
|
|
|
|
{ |
49
|
|
|
|
|
|
|
'format' => '$1 $2', |
50
|
|
|
|
|
|
|
'leading_digits' => ' |
51
|
|
|
|
|
|
|
(?: |
52
|
|
|
|
|
|
|
2| |
53
|
|
|
|
|
|
|
90 |
54
|
|
|
|
|
|
|
)4| |
55
|
|
|
|
|
|
|
[67] |
56
|
|
|
|
|
|
|
', |
57
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{7})' |
58
|
|
|
|
|
|
|
}, |
59
|
|
|
|
|
|
|
{ |
60
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
61
|
|
|
|
|
|
|
'leading_digits' => ' |
62
|
|
|
|
|
|
|
[3478]| |
63
|
|
|
|
|
|
|
64| |
64
|
|
|
|
|
|
|
90 |
65
|
|
|
|
|
|
|
', |
66
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{3})' |
67
|
|
|
|
|
|
|
}, |
68
|
|
|
|
|
|
|
{ |
69
|
|
|
|
|
|
|
'format' => '$1 $2', |
70
|
|
|
|
|
|
|
'leading_digits' => ' |
71
|
|
|
|
|
|
|
1| |
72
|
|
|
|
|
|
|
28| |
73
|
|
|
|
|
|
|
6(?: |
74
|
|
|
|
|
|
|
0[5-7]| |
75
|
|
|
|
|
|
|
[1-35-9] |
76
|
|
|
|
|
|
|
)| |
77
|
|
|
|
|
|
|
9[2-9] |
78
|
|
|
|
|
|
|
', |
79
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{5,7})' |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
]; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
my $validators = { |
84
|
|
|
|
|
|
|
'fixed_line' => ' |
85
|
|
|
|
|
|
|
(?: |
86
|
|
|
|
|
|
|
1\\d| |
87
|
|
|
|
|
|
|
2[0-79]| |
88
|
|
|
|
|
|
|
3[0-46-8]| |
89
|
|
|
|
|
|
|
4[0-7]| |
90
|
|
|
|
|
|
|
5[57-9] |
91
|
|
|
|
|
|
|
)\\d{5}| |
92
|
|
|
|
|
|
|
(?: |
93
|
|
|
|
|
|
|
[134]\\d| |
94
|
|
|
|
|
|
|
8[125] |
95
|
|
|
|
|
|
|
)\\d{4} |
96
|
|
|
|
|
|
|
', |
97
|
|
|
|
|
|
|
'geographic' => ' |
98
|
|
|
|
|
|
|
(?: |
99
|
|
|
|
|
|
|
1\\d| |
100
|
|
|
|
|
|
|
2[0-79]| |
101
|
|
|
|
|
|
|
3[0-46-8]| |
102
|
|
|
|
|
|
|
4[0-7]| |
103
|
|
|
|
|
|
|
5[57-9] |
104
|
|
|
|
|
|
|
)\\d{5}| |
105
|
|
|
|
|
|
|
(?: |
106
|
|
|
|
|
|
|
[134]\\d| |
107
|
|
|
|
|
|
|
8[125] |
108
|
|
|
|
|
|
|
)\\d{4} |
109
|
|
|
|
|
|
|
', |
110
|
|
|
|
|
|
|
'mobile' => ' |
111
|
|
|
|
|
|
|
(?: |
112
|
|
|
|
|
|
|
(?: |
113
|
|
|
|
|
|
|
15| |
114
|
|
|
|
|
|
|
(?: |
115
|
|
|
|
|
|
|
3[59]| |
116
|
|
|
|
|
|
|
4[89]| |
117
|
|
|
|
|
|
|
79| |
118
|
|
|
|
|
|
|
8[08] |
119
|
|
|
|
|
|
|
)\\d| |
120
|
|
|
|
|
|
|
6(?: |
121
|
|
|
|
|
|
|
0[5-7]| |
122
|
|
|
|
|
|
|
[1-9]\\d |
123
|
|
|
|
|
|
|
)| |
124
|
|
|
|
|
|
|
9(?: |
125
|
|
|
|
|
|
|
0\\d| |
126
|
|
|
|
|
|
|
[2-9] |
127
|
|
|
|
|
|
|
) |
128
|
|
|
|
|
|
|
)\\d| |
129
|
|
|
|
|
|
|
2(?: |
130
|
|
|
|
|
|
|
4\\d| |
131
|
|
|
|
|
|
|
8 |
132
|
|
|
|
|
|
|
) |
133
|
|
|
|
|
|
|
)\\d{5}| |
134
|
|
|
|
|
|
|
(?: |
135
|
|
|
|
|
|
|
[67]\\d\\d| |
136
|
|
|
|
|
|
|
904 |
137
|
|
|
|
|
|
|
)\\d{5} |
138
|
|
|
|
|
|
|
', |
139
|
|
|
|
|
|
|
'pager' => '', |
140
|
|
|
|
|
|
|
'personal_number' => '', |
141
|
|
|
|
|
|
|
'specialrate' => '', |
142
|
|
|
|
|
|
|
'toll_free' => '', |
143
|
|
|
|
|
|
|
'voip' => '' |
144
|
|
|
|
|
|
|
}; |
145
|
|
|
|
|
|
|
my %areanames = (); |
146
|
|
|
|
|
|
|
$areanames{en} = {"2523", "Hargeisa", |
147
|
|
|
|
|
|
|
"2524", "Garowe", |
148
|
|
|
|
|
|
|
"2521", "Mogadishu",}; |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
sub new { |
151
|
7
|
|
|
7
|
1
|
18
|
my $class = shift; |
152
|
7
|
|
|
|
|
19
|
my $number = shift; |
153
|
7
|
|
|
|
|
46
|
$number =~ s/(^\+252|\D)//g; |
154
|
7
|
|
|
|
|
42
|
my $self = bless({ country_code => '252', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
155
|
7
|
100
|
|
|
|
38
|
return $self if ($self->is_valid()); |
156
|
1
|
|
|
|
|
5
|
$number =~ s/^(?:0)//; |
157
|
1
|
|
|
|
|
9
|
$self = bless({ country_code => '252', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
158
|
1
|
50
|
|
|
|
16
|
return $self->is_valid() ? $self : undef; |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
1; |