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
|
|
1161
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
220
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
19
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
53
|
|
23
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
17
|
|
|
2
|
|
|
|
|
66
|
|
24
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
13
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181416; |
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} = {"9342", "Ghowr", |
66
|
|
|
|
|
|
|
"9334", "Helmand", |
67
|
|
|
|
|
|
|
"9365", "Paktika", |
68
|
|
|
|
|
|
|
"9353", "Takhar", |
69
|
|
|
|
|
|
|
"9350", "Balkh", |
70
|
|
|
|
|
|
|
"9322", "Kapisa", |
71
|
|
|
|
|
|
|
"9364", "Paktia", |
72
|
|
|
|
|
|
|
"9357", "Faryab", |
73
|
|
|
|
|
|
|
"9352", "Badkhshan", |
74
|
|
|
|
|
|
|
"9361", "Nurestan", |
75
|
|
|
|
|
|
|
"9323", "Bamian", |
76
|
|
|
|
|
|
|
"9320", "Kabul", |
77
|
|
|
|
|
|
|
"9343", "Farah", |
78
|
|
|
|
|
|
|
"9340", "Heart", |
79
|
|
|
|
|
|
|
"9327", "Khost", |
80
|
|
|
|
|
|
|
"9331", "Ghazni", |
81
|
|
|
|
|
|
|
"9358", "Baghlan", |
82
|
|
|
|
|
|
|
"9354", "Jowzjan", |
83
|
|
|
|
|
|
|
"9333", "Zabol", |
84
|
|
|
|
|
|
|
"9330", "Kandahar", |
85
|
|
|
|
|
|
|
"9326", "Dorkondi", |
86
|
|
|
|
|
|
|
"9341", "Badghis", |
87
|
|
|
|
|
|
|
"9321", "Parwan", |
88
|
|
|
|
|
|
|
"9363", "Laghman", |
89
|
|
|
|
|
|
|
"9355", "Samangan", |
90
|
|
|
|
|
|
|
"9360", "Nangarhar", |
91
|
|
|
|
|
|
|
"9332", "Uruzgan", |
92
|
|
|
|
|
|
|
"9356", "Sar\-E\ Pol", |
93
|
|
|
|
|
|
|
"9344", "Nimruz", |
94
|
|
|
|
|
|
|
"9324", "Wardak", |
95
|
|
|
|
|
|
|
"9328", "Panjshar", |
96
|
|
|
|
|
|
|
"9325", "Logar", |
97
|
|
|
|
|
|
|
"9351", "Kunduz", |
98
|
|
|
|
|
|
|
"9362", "Kunarha",}; |
99
|
|
|
|
|
|
|
$areanames{fa} = {"9324", "وردک", |
100
|
|
|
|
|
|
|
"9328", "پنجشیر", |
101
|
|
|
|
|
|
|
"9332", "ارزگان", |
102
|
|
|
|
|
|
|
"9344", "نیمروز", |
103
|
|
|
|
|
|
|
"9356", "سر\ پل", |
104
|
|
|
|
|
|
|
"9325", "لوگر", |
105
|
|
|
|
|
|
|
"9351", "قندوز", |
106
|
|
|
|
|
|
|
"9362", "کنرها", |
107
|
|
|
|
|
|
|
"9326", "دایکندی", |
108
|
|
|
|
|
|
|
"9330", "قندهار", |
109
|
|
|
|
|
|
|
"9333", "زابل", |
110
|
|
|
|
|
|
|
"9358", "بغلان", |
111
|
|
|
|
|
|
|
"9354", "جوزجان", |
112
|
|
|
|
|
|
|
"9321", "پروان", |
113
|
|
|
|
|
|
|
"9355", "سمنگان", |
114
|
|
|
|
|
|
|
"9363", "لغمان", |
115
|
|
|
|
|
|
|
"9360", "ننگرهار", |
116
|
|
|
|
|
|
|
"9341", "بادغیس", |
117
|
|
|
|
|
|
|
"9340", "هرات", |
118
|
|
|
|
|
|
|
"9343", "فراه", |
119
|
|
|
|
|
|
|
"9361", "نورستان", |
120
|
|
|
|
|
|
|
"9352", "بدخشان", |
121
|
|
|
|
|
|
|
"9320", "کابل", |
122
|
|
|
|
|
|
|
"9323", "بامیان", |
123
|
|
|
|
|
|
|
"9327", "خوست", |
124
|
|
|
|
|
|
|
"9331", "غزنی", |
125
|
|
|
|
|
|
|
"9365", "پکتیکا", |
126
|
|
|
|
|
|
|
"9353", "تخار", |
127
|
|
|
|
|
|
|
"9350", "بلخ", |
128
|
|
|
|
|
|
|
"9322", "کاپیسا", |
129
|
|
|
|
|
|
|
"9342", "غور", |
130
|
|
|
|
|
|
|
"9334", "هلمند", |
131
|
|
|
|
|
|
|
"9357", "فاریاب", |
132
|
|
|
|
|
|
|
"9364", "پکتیا",}; |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub new { |
135
|
7
|
|
|
7
|
1
|
16
|
my $class = shift; |
136
|
7
|
|
|
|
|
12
|
my $number = shift; |
137
|
7
|
|
|
|
|
40
|
$number =~ s/(^\+93|\D)//g; |
138
|
7
|
|
|
|
|
36
|
my $self = bless({ country_code => '93', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
139
|
7
|
100
|
|
|
|
35
|
return $self if ($self->is_valid()); |
140
|
1
|
|
|
|
|
14
|
$number =~ s/^(?:0)//; |
141
|
1
|
|
|
|
|
10
|
$self = bless({ country_code => '93', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
142
|
1
|
50
|
|
|
|
4
|
return $self->is_valid() ? $self : undef; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
1; |