blib/lib/Number/Phone/StubCountry/IR.pm

filter: Statementstmt 100% 28 / 28 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 97.3% 37 / 38 CC 3 SCAR 6.2
CC
3
Cov
97%
new
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« blib/lib/Number/Phone/StubCountry/IN.pm ↑ Summary blib/lib/Number/Phone/StubCountry/JO.pm »
1 # automatically generated file, don't edit
2  
3  
4  
5 # Copyright 2026 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::IR;
20 2 ▶use base qw(Number::Phone::StubCountry);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 our $VERSION = 1.20260904101550;
26  
27 2 my $formatters = [
28 {
29 'format' => '$1',
30 'leading_digits' => '96',
31 'national_rule' => '0$1',
32 'pattern' => '(\\d{4,5})'
33 },
34 {
35 'format' => '$1 $2',
36 'leading_digits' => '
37 (?:
38 1[137]|
39 2[13-68]|
40 3[1458]|
41 4[145]|
42 5[1468]|
43 6[16]|
44 7[1467]|
45 8[13467]
46 )[12689]
47 ',
48 'national_rule' => '0$1',
49 'pattern' => '(\\d{2})(\\d{4,5})'
50 },
51 {
52 'format' => '$1 $2 $3',
53 'leading_digits' => '9',
54 'national_rule' => '0$1',
55 'pattern' => '(\\d{3})(\\d{3})(\\d{3,4})'
56 },
57 {
58 'format' => '$1 $2 $3',
59 'leading_digits' => '[1-8]',
60 'national_rule' => '0$1',
61 'pattern' => '(\\d{2})(\\d{4})(\\d{4})'
62 }
63 ];
64  
65 2 my $validators = {
66 'fixed_line' => '
67 (?:
68 1[137]|
69 2[13-68]|
70 3[1458]|
71 4[145]|
72 5[1468]|
73 6[16]|
74 7[1467]|
75 8[13467]
76 )(?:
77 [03-57]\\d{7}|
78 [16]\\d{3}(?:
79 \\d{4}
80 )?|
81 [289]\\d{3}(?:
82 \\d(?:
83 \\d{3}
84 )?
85 )?
86 )|
87 94(?:
88 000[09]|
89 (?:
90 12\\d|
91 30[0-2]
92 )\\d|
93 2(?:
94 [02689]0\\d|
95 121
96 )|
97 4(?:
98 111|
99 40\\d
100 )
101 )\\d{4}
102 ',
103 'geographic' => '
104 (?:
105 1[137]|
106 2[13-68]|
107 3[1458]|
108 4[145]|
109 5[1468]|
110 6[16]|
111 7[1467]|
112 8[13467]
113 )(?:
114 [03-57]\\d{7}|
115 [16]\\d{3}(?:
116 \\d{4}
117 )?|
118 [289]\\d{3}(?:
119 \\d(?:
120 \\d{3}
121 )?
122 )?
123 )|
124 94(?:
125 000[09]|
126 (?:
127 12\\d|
128 30[0-2]
129 )\\d|
130 2(?:
131 [02689]0\\d|
132 121
133 )|
134 4(?:
135 111|
136 40\\d
137 )
138 )\\d{4}
139 ',
140 'mobile' => '
141 9(?:
142 (?:
143 0[0-5]|
144 [13]\\d|
145 2[0-3]
146 )\\d\\d|
147 9(?:
148 [0-46]\\d\\d|
149 5(?:
150 10|
151 5\\d
152 )|
153 8(?:
154 [12]\\d|
155 3[0-2]|
156 88
157 )|
158 9(?:
159 [01359]\\d|
160 21|
161 69|
162 77|
163 8[7-9]
164 )
165 )
166 )\\d{5}
167 ',
168 'pager' => '',
169 'personal_number' => '',
170 'specialrate' => '(
171 96(?:
172 0[12]|
173 2[16-8]|
174 3(?:
175 08|
176 [14]5|
177 [23]|
178 66
179 )|
180 4(?:
181 0|
182 80
183 )|
184 5[01]|
185 6[89]|
186 86|
187 9[19]
188 )
189 )',
190 'toll_free' => '',
191 'voip' => ''
192 };
193 2 my %areanames = ();
194 2 $areanames{fa} = {"9825", "استان\ قم",
195 "9854", "سیستان\ و\ بلوچستان",
196 "9813", "گیلان",
197 "9858", "خراسان\ شمالی",
198 "9851", "خراسان\ رضوی",
199 "9861", "خوزستان",
200 "9845", "استان\ اردبیل",
201 "9835", "استان\ یزد",
202 "9884", "استان\ ایلام",
203 "9834", "استان\ کرمان",
204 "9844", "آذربایجان\ غربی",
205 "9828", "استان\ قزوین",
206 "9821", "استان\ تهران",
207 "9877", "استان\ بوشهر",
208 "9881", "استان\ همدان",
209 "9838", "چهارمحال\ و\ بختیاری",
210 "9831", "استان\ اصفهان",
211 "9841", "آذربایجان\ شرقی",
212 "9876", "هرمزگان",
213 "9817", "گلستان",
214 "9824", "استان\ زنجان",
215 "9871", "فارس",
216 "9887", "کردستان",
217 "9886", "مرکزی",
218 "9811", "مازندران",
219 "9874", "کهگیلویه\ و\ بویراحمد",
220 "9826", "البرز",
221 "9866", "لرستان",
222 "9856", "خراسان\ جنوبی",
223 "9823", "استان\ سمنان",
224 "9883", "استان\ کرمانشاه",};
225 2 $areanames{en} = {"9874", "Kohgiluyeh\ and\ Boyer\-Ahmad",
226 "9826", "Alborz",
227 "9871", "Fars",
228 "9887", "Kurdistan",
229 "9886", "Markazi",
230 "9811", "Mazandaran",
231 "9883", "Kermanshah\ province",
232 "9866", "Lorestan",
233 "9856", "South\ Khorasan",
234 "9823", "Semnan\ province",
235 "9851", "Razavi\ Khorasan",
236 "9858", "North\ Khorasan",
237 "9861", "Khuzestan",
238 "9835", "Yazd\ province",
239 "9845", "Ardabil\ province",
240 "9854", "Sistan\ and\ Baluchestan",
241 "9825", "Qom\ province",
242 "9813", "Gilan",
243 "9877", "Bushehr\ province",
244 "9881", "Hamadan\ province",
245 "9831", "Isfahan\ province",
246 "9838", "Chahar\-mahal\ and\ Bakhtiari",
247 "9841", "East\ Azarbaijan",
248 "9876", "Hormozgan",
249 "9817", "Golestan",
250 "9824", "Zanjan\ province",
251 "9884", "Ilam\ province",
252 "9844", "West\ Azarbaijan",
253 "9834", "Kerman\ province",
254 "9828", "Qazvin\ province",
255 "9821", "Tehran\ province",};
256 2 my $timezones = {
257 '' => [
258 'Asia/Tehran'
259 ]
260 };
261  
262 10 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
263 10 my $class = shift;
264 10 my $number = shift;
265 10 $number =~ s/(^\+98|\D)//g;
266 10 my $self = bless({ country_code => '98', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
267 10 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 9 1 10
268 1 $number =~ s/^(?:0)//;
269 1 $self = bless({ country_code => '98', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
270 1 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 1 1
271 }
272 2 1;
« blib/lib/Number/Phone/StubCountry/IN.pm ↑ Summary blib/lib/Number/Phone/StubCountry/JO.pm »