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
|
|
1282
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
298
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
51
|
|
23
|
2
|
|
|
2
|
|
17
|
use warnings; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
69
|
|
24
|
2
|
|
|
2
|
|
17
|
use utf8; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
28
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230614174404; |
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} = {"256465", "Masindi", |
117
|
|
|
|
|
|
|
"256464", "Mubende", |
118
|
|
|
|
|
|
|
"256486", "Kabale\/Rukungiri\/Kisoro", |
119
|
|
|
|
|
|
|
"256476", "Arua", |
120
|
|
|
|
|
|
|
"256483", "Fort\ Portal", |
121
|
|
|
|
|
|
|
"256481", "Masaka", |
122
|
|
|
|
|
|
|
"25641", "Kampala", |
123
|
|
|
|
|
|
|
"25645", "Mbale", |
124
|
|
|
|
|
|
|
"256471", "Gulu", |
125
|
|
|
|
|
|
|
"256473", "Lira", |
126
|
|
|
|
|
|
|
"25643", "Jinja", |
127
|
|
|
|
|
|
|
"25646", "Mityana", |
128
|
|
|
|
|
|
|
"256485", "Mbarara",}; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub new { |
131
|
13
|
|
|
13
|
1
|
47
|
my $class = shift; |
132
|
13
|
|
|
|
|
31
|
my $number = shift; |
133
|
13
|
|
|
|
|
85
|
$number =~ s/(^\+256|\D)//g; |
134
|
13
|
|
|
|
|
76
|
my $self = bless({ country_code => '256', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
135
|
13
|
100
|
|
|
|
71
|
return $self if ($self->is_valid()); |
136
|
1
|
|
|
|
|
16
|
$number =~ s/^(?:0)//; |
137
|
1
|
|
|
|
|
18
|
$self = bless({ country_code => '256', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
138
|
1
|
50
|
|
|
|
6
|
return $self->is_valid() ? $self : undef; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
1; |