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

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 CC 2 SCAR 2.9
CC
2
Cov
100%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Number/Phone/StubCountry/InternationalFreephone.pm ↑ Summary blib/lib/Number/Phone/StubCountry/InternationalNetworks883.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::InternationalNetworks882;
20 3 ▶use base qw(Number::Phone::StubCountry);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 3 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 3 our $VERSION = 1.20260904101552;
26  
27 3 my $formatters = [
28 {
29 'format' => '$1 $2',
30 'leading_digits' => '
31 16|
32 342
33 ',
34 'pattern' => '(\\d{2})(\\d{5})'
35 },
36 {
37 'format' => '$1 $2',
38 'leading_digits' => '49',
39 'pattern' => '(\\d{2})(\\d{6})'
40 },
41 {
42 'format' => '$1 $2 $3',
43 'leading_digits' => '
44 1[36]|
45 9
46 ',
47 'pattern' => '(\\d{2})(\\d{2})(\\d{4})'
48 },
49 {
50 'format' => '$1 $2 $3',
51 'leading_digits' => '3[23]',
52 'pattern' => '(\\d{2})(\\d{4})(\\d{3})'
53 },
54 {
55 'format' => '$1 $2 $3',
56 'leading_digits' => '16',
57 'pattern' => '(\\d{2})(\\d{3,4})(\\d{4})'
58 },
59 {
60 'format' => '$1 $2 $3',
61 'leading_digits' => '
62 10|
63 23|
64 3(?:
65 [15]|
66 4[57]
67 )|
68 4|
69 5[12]
70 ',
71 'pattern' => '(\\d{2})(\\d{4})(\\d{4})'
72 },
73 {
74 'format' => '$1 $2 $3',
75 'leading_digits' => '34',
76 'pattern' => '(\\d{3})(\\d{4})(\\d{4})'
77 },
78 {
79 'format' => '$1 $2 $3',
80 'leading_digits' => '[1-35]',
81 'pattern' => '(\\d{2})(\\d{4,5})(\\d{5})'
82 }
83 ];
84  
85 3 my $validators = {
86 'fixed_line' => '',
87 'geographic' => '',
88 'mobile' => '
89 342\\d{4}|
90 (?:
91 337|
92 49
93 )\\d{6}|
94 (?:
95 3(?:
96 2|
97 47|
98 7\\d{3}
99 )|
100 5(?:
101 0\\d{3}|
102 2[0-2]
103 )
104 )\\d{7}
105 ',
106 'pager' => '',
107 'personal_number' => '',
108 'specialrate' => '',
109 'toll_free' => '',
110 'voip' => '
111 1(?:
112 3(?:
113 0[0347]|
114 [13][0139]|
115 2[035]|
116 4[013568]|
117 6[0459]|
118 7[06]|
119 8[15-8]|
120 9[0689]
121 )\\d{4}|
122 6\\d{5,10}
123 )|
124 (?:
125 345\\d|
126 9[89]
127 )\\d{6}|
128 (?:
129 10|
130 2(?:
131 3|
132 85\\d
133 )|
134 3(?:
135 [15]|
136 [69]\\d\\d
137 )|
138 4[15-8]|
139 51
140 )\\d{8}
141 '
142 };
143 3 my $timezones = {};
144  
145 32 ▶ sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
146 32 my $class = shift;
147 32 my $number = shift;
148 32 $number =~ s/(^\+882|\D)//g;
149 32 my $self = bless({ country_code => '882', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, }, $class);
150 32 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 28 4 32
151 }
152 3 1;
« blib/lib/Number/Phone/StubCountry/InternationalFreephone.pm ↑ Summary blib/lib/Number/Phone/StubCountry/InternationalNetworks883.pm »