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