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::AF; |
20
|
2
|
|
|
2
|
|
1115
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
219
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
43
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
51
|
|
24
|
2
|
|
|
2
|
|
13
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
19
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131440; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
31
|
|
|
|
|
|
|
'leading_digits' => '[1-9]', |
32
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{4})' |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
36
|
|
|
|
|
|
|
'leading_digits' => '[2-7]', |
37
|
|
|
|
|
|
|
'national_rule' => '0$1', |
38
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{4})' |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
]; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $validators = { |
43
|
|
|
|
|
|
|
'fixed_line' => ' |
44
|
|
|
|
|
|
|
(?: |
45
|
|
|
|
|
|
|
[25][0-8]| |
46
|
|
|
|
|
|
|
[34][0-4]| |
47
|
|
|
|
|
|
|
6[0-5] |
48
|
|
|
|
|
|
|
)[2-9]\\d{6} |
49
|
|
|
|
|
|
|
', |
50
|
|
|
|
|
|
|
'geographic' => ' |
51
|
|
|
|
|
|
|
(?: |
52
|
|
|
|
|
|
|
[25][0-8]| |
53
|
|
|
|
|
|
|
[34][0-4]| |
54
|
|
|
|
|
|
|
6[0-5] |
55
|
|
|
|
|
|
|
)[2-9]\\d{6} |
56
|
|
|
|
|
|
|
', |
57
|
|
|
|
|
|
|
'mobile' => '7\\d{8}', |
58
|
|
|
|
|
|
|
'pager' => '', |
59
|
|
|
|
|
|
|
'personal_number' => '', |
60
|
|
|
|
|
|
|
'specialrate' => '', |
61
|
|
|
|
|
|
|
'toll_free' => '', |
62
|
|
|
|
|
|
|
'voip' => '' |
63
|
|
|
|
|
|
|
}; |
64
|
|
|
|
|
|
|
my %areanames = (); |
65
|
|
|
|
|
|
|
$areanames{en} = {"9350", "Balkh", |
66
|
|
|
|
|
|
|
"9322", "Kapisa", |
67
|
|
|
|
|
|
|
"9331", "Ghazni", |
68
|
|
|
|
|
|
|
"9324", "Wardak", |
69
|
|
|
|
|
|
|
"9327", "Khost", |
70
|
|
|
|
|
|
|
"9320", "Kabul", |
71
|
|
|
|
|
|
|
"9352", "Badkhshan", |
72
|
|
|
|
|
|
|
"9354", "Jowzjan", |
73
|
|
|
|
|
|
|
"9357", "Faryab", |
74
|
|
|
|
|
|
|
"9341", "Badghis", |
75
|
|
|
|
|
|
|
"9355", "Samangan", |
76
|
|
|
|
|
|
|
"9325", "Logar", |
77
|
|
|
|
|
|
|
"9363", "Laghman", |
78
|
|
|
|
|
|
|
"9351", "Kunduz", |
79
|
|
|
|
|
|
|
"9330", "Kandahar", |
80
|
|
|
|
|
|
|
"9328", "Panjshar", |
81
|
|
|
|
|
|
|
"9334", "Helmand", |
82
|
|
|
|
|
|
|
"9321", "Parwan", |
83
|
|
|
|
|
|
|
"9332", "Uruzgan", |
84
|
|
|
|
|
|
|
"9358", "Baghlan", |
85
|
|
|
|
|
|
|
"9340", "Heart", |
86
|
|
|
|
|
|
|
"9342", "Ghowr", |
87
|
|
|
|
|
|
|
"9344", "Nimruz", |
88
|
|
|
|
|
|
|
"9323", "Bamian", |
89
|
|
|
|
|
|
|
"9361", "Nurestan", |
90
|
|
|
|
|
|
|
"9353", "Takhar", |
91
|
|
|
|
|
|
|
"9362", "Kunarha", |
92
|
|
|
|
|
|
|
"9364", "Paktia", |
93
|
|
|
|
|
|
|
"9356", "Sar\-E\ Pol", |
94
|
|
|
|
|
|
|
"9360", "Nangarhar", |
95
|
|
|
|
|
|
|
"9333", "Zabol", |
96
|
|
|
|
|
|
|
"9326", "Dorkondi", |
97
|
|
|
|
|
|
|
"9343", "Farah", |
98
|
|
|
|
|
|
|
"9365", "Paktika",}; |
99
|
|
|
|
|
|
|
$areanames{fa} = {"9344", "نیمروز", |
100
|
|
|
|
|
|
|
"9342", "غور", |
101
|
|
|
|
|
|
|
"9340", "هرات", |
102
|
|
|
|
|
|
|
"9358", "بغلان", |
103
|
|
|
|
|
|
|
"9332", "ارزگان", |
104
|
|
|
|
|
|
|
"9334", "هلمند", |
105
|
|
|
|
|
|
|
"9321", "پروان", |
106
|
|
|
|
|
|
|
"9328", "پنجشیر", |
107
|
|
|
|
|
|
|
"9330", "قندهار", |
108
|
|
|
|
|
|
|
"9351", "قندوز", |
109
|
|
|
|
|
|
|
"9363", "لغمان", |
110
|
|
|
|
|
|
|
"9325", "لوگر", |
111
|
|
|
|
|
|
|
"9355", "سمنگان", |
112
|
|
|
|
|
|
|
"9341", "بادغیس", |
113
|
|
|
|
|
|
|
"9357", "فاریاب", |
114
|
|
|
|
|
|
|
"9354", "جوزجان", |
115
|
|
|
|
|
|
|
"9320", "کابل", |
116
|
|
|
|
|
|
|
"9352", "بدخشان", |
117
|
|
|
|
|
|
|
"9327", "خوست", |
118
|
|
|
|
|
|
|
"9324", "وردک", |
119
|
|
|
|
|
|
|
"9331", "غزنی", |
120
|
|
|
|
|
|
|
"9350", "بلخ", |
121
|
|
|
|
|
|
|
"9322", "کاپیسا", |
122
|
|
|
|
|
|
|
"9365", "پکتیکا", |
123
|
|
|
|
|
|
|
"9343", "فراه", |
124
|
|
|
|
|
|
|
"9326", "دایکندی", |
125
|
|
|
|
|
|
|
"9333", "زابل", |
126
|
|
|
|
|
|
|
"9360", "ننگرهار", |
127
|
|
|
|
|
|
|
"9356", "سر\ پل", |
128
|
|
|
|
|
|
|
"9364", "پکتیا", |
129
|
|
|
|
|
|
|
"9362", "کنرها", |
130
|
|
|
|
|
|
|
"9353", "تخار", |
131
|
|
|
|
|
|
|
"9361", "نورستان", |
132
|
|
|
|
|
|
|
"9323", "بامیان",}; |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub new { |
135
|
7
|
|
|
7
|
1
|
16
|
my $class = shift; |
136
|
7
|
|
|
|
|
11
|
my $number = shift; |
137
|
7
|
|
|
|
|
43
|
$number =~ s/(^\+93|\D)//g; |
138
|
7
|
|
|
|
|
66
|
my $self = bless({ country_code => '93', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
139
|
7
|
100
|
|
|
|
37
|
return $self if ($self->is_valid()); |
140
|
1
|
|
|
|
|
4
|
$number =~ s/^(?:0)//; |
141
|
1
|
|
|
|
|
17
|
$self = bless({ country_code => '93', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
142
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
1; |