blib/lib/Number/Phone/StubCountry/IL.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/ID.pm ↑ Summary blib/lib/Number/Phone/StubCountry/IN.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::IL;
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-$2',
30 'leading_digits' => '125',
31 'pattern' => '(\\d{4})(\\d{3})'
32 },
33 {
34 'format' => '$1-$2-$3',
35 'leading_digits' => '121',
36 'pattern' => '(\\d{4})(\\d{2})(\\d{2})'
37 },
38 {
39 'format' => '$1-$2-$3',
40 'leading_digits' => '[2-489]',
41 'national_rule' => '0$1',
42 'pattern' => '(\\d)(\\d{3})(\\d{4})'
43 },
44 {
45 'format' => '$1-$2-$3',
46 'leading_digits' => '[57]',
47 'national_rule' => '0$1',
48 'pattern' => '(\\d{2})(\\d{3})(\\d{4})'
49 },
50 {
51 'format' => '$1-$2-$3',
52 'leading_digits' => '12',
53 'pattern' => '(\\d{4})(\\d{3})(\\d{3})'
54 },
55 {
56 'format' => '$1-$2',
57 'leading_digits' => '159',
58 'pattern' => '(\\d{4})(\\d{6})'
59 },
60 {
61 'format' => '$1-$2-$3-$4',
62 'leading_digits' => '1[7-9]',
63 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{3})'
64 },
65 {
66 'format' => '$1-$2 $3-$4',
67 'leading_digits' => '15',
68 'pattern' => '(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})'
69 }
70 ];
71  
72 2 my $validators = {
73 'fixed_line' => '
74 153\\d{8,9}|
75 29[1-9]\\d{5}|
76 (?:
77 2[0-8]|
78 [3489]\\d
79 )\\d{6}
80 ',
81 'geographic' => '
82 153\\d{8,9}|
83 29[1-9]\\d{5}|
84 (?:
85 2[0-8]|
86 [3489]\\d
87 )\\d{6}
88 ',
89 'mobile' => '
90 55(?:
91 4(?:
92 0[0-3]|
93 10|
94 6[015-9]
95 )|
96 57[0-289]|
97 8[06][0-2]
98 )\\d{4}|
99 5(?:
100 (?:
101 [0-2][02-9]|
102 [36]\\d|
103 [49][2-9]|
104 8[3-7]
105 )\\d|
106 5(?:
107 01|
108 2\\d|
109 3[0-3]|
110 4[3-5]|
111 5[0-25689]|
112 6[6-8]|
113 7[0-267]|
114 8[7-9]|
115 9[1-9]
116 )
117 )\\d{5}
118 ',
119 'pager' => '',
120 'personal_number' => '',
121 'specialrate' => '(1700\\d{6})|(
122 1212\\d{4}|
123 1(?:
124 200|
125 9(?:
126 0[0-2]|
127 19|
128 9\\d
129 )
130 )\\d{6}
131 )|(1599\\d{6})',
132 'toll_free' => '
133 1(?:
134 255|
135 80[019]\\d{3}
136 )\\d{3}
137 ',
138 'voip' => '
139 7(?:
140 280[01]|
141 38(?:
142 [05]\\d|
143 8[01358]
144 )|
145 8(?:
146 33|
147 55|
148 77|
149 81
150 )\\d
151 )\\d{4}|
152 7(?:
153 18|
154 2[23]|
155 3[237]|
156 47|
157 6[258]|
158 7\\d|
159 82|
160 9[2-9]
161 )\\d{6}
162 '
163 };
164 2 my %areanames = ();
165 2 $areanames{iw} = {"9729", "השרון",
166 "9728", "השפלה\ והדרום",
167 "9724", "חיפה\ והצפון",
168 "9723", "תל\ אביב\-יפו\ והמרכז",
169 "9722", "ירושלים",};
170 2 $areanames{en} = {"9729", "Hasharon",
171 "9724", "Haifa\ and\ North\ Regions",
172 "9728", "Hashfela\ and\ South\ Regions",
173 "9722", "Jerusalem",
174 "9723", "Tel\ Aviv",};
175 2 my $timezones = {
176 '' => [
177 'Asia/Jerusalem'
178 ]
179 };
180  
181 22 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
182 22 my $class = shift;
183 22 my $number = shift;
184 22 $number =~ s/(^\+972|\D)//g;
185 22 my $self = bless({ country_code => '972', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
186 22 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 21 1 22
187 1 $number =~ s/^(?:0)//;
188 1 $self = bless({ country_code => '972', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
189 1 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 1 1
190 }
191 2 1;
« blib/lib/Number/Phone/StubCountry/ID.pm ↑ Summary blib/lib/Number/Phone/StubCountry/IN.pm »