blib/lib/Number/Phone/StubCountry/CD.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/BG.pm ↑ Summary blib/lib/Number/Phone/StubCountry/CN.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::CD;
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.20260904101548;
26  
27 2 my $formatters = [
28 {
29 'format' => '$1 $2 $3',
30 'leading_digits' => '88',
31 'national_rule' => '0$1',
32 'pattern' => '(\\d{2})(\\d{2})(\\d{3})'
33 },
34 {
35 'format' => '$1 $2',
36 'leading_digits' => '[1-6]',
37 'national_rule' => '0$1',
38 'pattern' => '(\\d{2})(\\d{5})'
39 },
40 {
41 'format' => '$1 $2 $3',
42 'leading_digits' => '2',
43 'national_rule' => '0$1',
44 'pattern' => '(\\d{2})(\\d{2})(\\d{4})'
45 },
46 {
47 'format' => '$1 $2 $3',
48 'leading_digits' => '1',
49 'national_rule' => '0$1',
50 'pattern' => '(\\d{2})(\\d{3})(\\d{4})'
51 },
52 {
53 'format' => '$1 $2 $3',
54 'leading_digits' => '[89]',
55 'national_rule' => '0$1',
56 'pattern' => '(\\d{3})(\\d{3})(\\d{3})'
57 },
58 {
59 'format' => '$1 $2 $3 $4',
60 'leading_digits' => '5',
61 'national_rule' => '0$1',
62 'pattern' => '(\\d{2})(\\d{2})(\\d{3})(\\d{3})'
63 }
64 ];
65  
66 2 my $validators = {
67 'fixed_line' => '
68 (?:
69 (?:
70 12|
71 573
72 )\\d\\d|
73 276
74 )\\d{5}|
75 [1-6]\\d{6}
76 ',
77 'geographic' => '
78 (?:
79 (?:
80 12|
81 573
82 )\\d\\d|
83 276
84 )\\d{5}|
85 [1-6]\\d{6}
86 ',
87 'mobile' => '
88 88\\d{5}|
89 (?:
90 8[0-69]|
91 9[016-9]
92 )\\d{7}
93 ',
94 'pager' => '',
95 'personal_number' => '',
96 'specialrate' => '',
97 'toll_free' => '',
98 'voip' => ''
99 };
100 2 my %areanames = ();
101 2 $areanames{fr} = {"2436", "Nord\-Kivu\/Sud\-Kivu\/Maniema",
102 "243573", "Oriental\ Province\ \(Kisanga\/Mbandaka\)",
103 "2435", "Province\ Orientale\ \(Kisanga\/Mbandaka\)",};
104 2 $areanames{en} = {"2436", "North\ Kivu\/South\ Kivu\/Maniema",
105 "2434", "Kasai\-Oriental\/Kasai\-Occidental",
106 "2433", "Bas\-Congo\/Bandundu",
107 "2432", "Katanga",
108 "2431", "Kinshasa",
109 "2435", "Oriental\ Province\ \(Kisanga\/Mbandaka\)",};
110 2 my $timezones = {
111 '' => [
112 'Africa/Kinshasa',
113 'Africa/Lubumbashi'
114 ],
115 '1' => [
116 'Africa/Kinshasa'
117 ],
118 '2' => [
119 'Africa/Lubumbashi'
120 ],
121 '3' => [
122 'Africa/Kinshasa'
123 ],
124 '4' => [
125 'Africa/Kinshasa'
126 ],
127 '5' => [
128 'Africa/Kinshasa'
129 ],
130 '6' => [
131 'Africa/Kinshasa'
132 ],
133 '8' => [
134 'Africa/Kinshasa',
135 'Africa/Lubumbashi'
136 ],
137 '9' => [
138 'Africa/Kinshasa',
139 'Africa/Lubumbashi'
140 ]
141 };
142  
143 7 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
144 7 my $class = shift;
145 7 my $number = shift;
146 7 $number =~ s/(^\+243|\D)//g;
147 7 my $self = bless({ country_code => '243', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
148 7 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 6 1 7
149 1 $number =~ s/^(?:0)//;
150 1 $self = bless({ country_code => '243', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
151 1 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 1 1
152 }
153 2 1;
« blib/lib/Number/Phone/StubCountry/BG.pm ↑ Summary blib/lib/Number/Phone/StubCountry/CN.pm »