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::UG; |
20
|
2
|
|
|
2
|
|
1338
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
284
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
24
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
44
|
|
23
|
2
|
|
|
2
|
|
64
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
62
|
|
24
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => '2024', |
31
|
|
|
|
|
|
|
'national_rule' => '0$1', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{5})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2', |
36
|
|
|
|
|
|
|
'leading_digits' => ' |
37
|
|
|
|
|
|
|
[27-9]| |
38
|
|
|
|
|
|
|
4(?: |
39
|
|
|
|
|
|
|
6[45]| |
40
|
|
|
|
|
|
|
[7-9] |
41
|
|
|
|
|
|
|
) |
42
|
|
|
|
|
|
|
', |
43
|
|
|
|
|
|
|
'national_rule' => '0$1', |
44
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{6})' |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
{ |
47
|
|
|
|
|
|
|
'format' => '$1 $2', |
48
|
|
|
|
|
|
|
'leading_digits' => '[34]', |
49
|
|
|
|
|
|
|
'national_rule' => '0$1', |
50
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{7})' |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
]; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
my $validators = { |
55
|
|
|
|
|
|
|
'fixed_line' => ' |
56
|
|
|
|
|
|
|
20(?: |
57
|
|
|
|
|
|
|
(?: |
58
|
|
|
|
|
|
|
240| |
59
|
|
|
|
|
|
|
30[67] |
60
|
|
|
|
|
|
|
)\\d| |
61
|
|
|
|
|
|
|
6(?: |
62
|
|
|
|
|
|
|
00[0-2]| |
63
|
|
|
|
|
|
|
30[0-4] |
64
|
|
|
|
|
|
|
) |
65
|
|
|
|
|
|
|
)\\d{3}| |
66
|
|
|
|
|
|
|
(?: |
67
|
|
|
|
|
|
|
20(?: |
68
|
|
|
|
|
|
|
[017]\\d| |
69
|
|
|
|
|
|
|
2[5-9]| |
70
|
|
|
|
|
|
|
32| |
71
|
|
|
|
|
|
|
5[0-4]| |
72
|
|
|
|
|
|
|
6[15-9] |
73
|
|
|
|
|
|
|
)| |
74
|
|
|
|
|
|
|
[34]\\d{3} |
75
|
|
|
|
|
|
|
)\\d{5} |
76
|
|
|
|
|
|
|
', |
77
|
|
|
|
|
|
|
'geographic' => ' |
78
|
|
|
|
|
|
|
20(?: |
79
|
|
|
|
|
|
|
(?: |
80
|
|
|
|
|
|
|
240| |
81
|
|
|
|
|
|
|
30[67] |
82
|
|
|
|
|
|
|
)\\d| |
83
|
|
|
|
|
|
|
6(?: |
84
|
|
|
|
|
|
|
00[0-2]| |
85
|
|
|
|
|
|
|
30[0-4] |
86
|
|
|
|
|
|
|
) |
87
|
|
|
|
|
|
|
)\\d{3}| |
88
|
|
|
|
|
|
|
(?: |
89
|
|
|
|
|
|
|
20(?: |
90
|
|
|
|
|
|
|
[017]\\d| |
91
|
|
|
|
|
|
|
2[5-9]| |
92
|
|
|
|
|
|
|
32| |
93
|
|
|
|
|
|
|
5[0-4]| |
94
|
|
|
|
|
|
|
6[15-9] |
95
|
|
|
|
|
|
|
)| |
96
|
|
|
|
|
|
|
[34]\\d{3} |
97
|
|
|
|
|
|
|
)\\d{5} |
98
|
|
|
|
|
|
|
', |
99
|
|
|
|
|
|
|
'mobile' => ' |
100
|
|
|
|
|
|
|
726[01]\\d{5}| |
101
|
|
|
|
|
|
|
7(?: |
102
|
|
|
|
|
|
|
[01578]\\d| |
103
|
|
|
|
|
|
|
20| |
104
|
|
|
|
|
|
|
36| |
105
|
|
|
|
|
|
|
[46][0-4]| |
106
|
|
|
|
|
|
|
9[89] |
107
|
|
|
|
|
|
|
)\\d{6} |
108
|
|
|
|
|
|
|
', |
109
|
|
|
|
|
|
|
'pager' => '', |
110
|
|
|
|
|
|
|
'personal_number' => '', |
111
|
|
|
|
|
|
|
'specialrate' => '(90[1-3]\\d{6})', |
112
|
|
|
|
|
|
|
'toll_free' => '800[1-3]\\d{5}', |
113
|
|
|
|
|
|
|
'voip' => '' |
114
|
|
|
|
|
|
|
}; |
115
|
|
|
|
|
|
|
my %areanames = (); |
116
|
|
|
|
|
|
|
$areanames{en} = {"25646", "Mityana", |
117
|
|
|
|
|
|
|
"256465", "Masindi", |
118
|
|
|
|
|
|
|
"25643", "Jinja", |
119
|
|
|
|
|
|
|
"256481", "Masaka", |
120
|
|
|
|
|
|
|
"256486", "Kabale\/Rukungiri\/Kisoro", |
121
|
|
|
|
|
|
|
"256473", "Lira", |
122
|
|
|
|
|
|
|
"256464", "Mubende", |
123
|
|
|
|
|
|
|
"256476", "Arua", |
124
|
|
|
|
|
|
|
"256471", "Gulu", |
125
|
|
|
|
|
|
|
"25645", "Mbale", |
126
|
|
|
|
|
|
|
"256483", "Fort\ Portal", |
127
|
|
|
|
|
|
|
"25641", "Kampala", |
128
|
|
|
|
|
|
|
"256485", "Mbarara",}; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub new { |
131
|
13
|
|
|
13
|
1
|
30
|
my $class = shift; |
132
|
13
|
|
|
|
|
22
|
my $number = shift; |
133
|
13
|
|
|
|
|
84
|
$number =~ s/(^\+256|\D)//g; |
134
|
13
|
|
|
|
|
77
|
my $self = bless({ country_code => '256', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
135
|
13
|
100
|
|
|
|
107
|
return $self if ($self->is_valid()); |
136
|
1
|
|
|
|
|
2
|
$number =~ s/^(?:0)//; |
137
|
1
|
|
|
|
|
9
|
$self = bless({ country_code => '256', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
138
|
1
|
50
|
|
|
|
4
|
return $self->is_valid() ? $self : undef; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
1; |