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