blib/lib/Number/Phone/StubCountry/BH.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/BF.pm ↑ Summary blib/lib/Number/Phone/StubCountry/BI.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::BH;
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.20260904101547;
26  
27 2 my $formatters = [
28 {
29 'format' => '$1 $2',
30 'leading_digits' => '
31 [13679]|
32 8[02-4679]
33 ',
34 'pattern' => '(\\d{4})(\\d{4})'
35 }
36 ];
37  
38 2 my $validators = {
39 'fixed_line' => '
40 (?:
41 1(?:
42 3[1356]|
43 6[0156]|
44 7\\d
45 )\\d|
46 6(?:
47 1[16]\\d|
48 500|
49 6(?:
50 0\\d|
51 3[12]|
52 44|
53 55|
54 7[7-9]|
55 88
56 )|
57 9[69][69]
58 )|
59 7(?:
60 [07]\\d\\d|
61 1(?:
62 11|
63 78
64 )
65 )
66 )\\d{4}
67 ',
68 'geographic' => '
69 (?:
70 1(?:
71 3[1356]|
72 6[0156]|
73 7\\d
74 )\\d|
75 6(?:
76 1[16]\\d|
77 500|
78 6(?:
79 0\\d|
80 3[12]|
81 44|
82 55|
83 7[7-9]|
84 88
85 )|
86 9[69][69]
87 )|
88 7(?:
89 [07]\\d\\d|
90 1(?:
91 11|
92 78
93 )
94 )
95 )\\d{4}
96 ',
97 'mobile' => '
98 (?:
99 3(?:
100 [0-79]\\d|
101 8[0-57-9]
102 )\\d|
103 6(?:
104 3(?:
105 00|
106 33|
107 6[16]
108 )|
109 441|
110 6(?:
111 3[03-9]|
112 [69]\\d|
113 7[0-689]
114 )
115 )
116 )\\d{4}
117 ',
118 'pager' => '',
119 'personal_number' => '',
120 'specialrate' => '(84\\d{6})|(
121 (?:
122 87|
123 9[0-8]
124 )\\d{6}
125 )',
126 'toll_free' => '8[02369]\\d{6}',
127 'voip' => ''
128 };
129 2 my $timezones = {
130 '' => [
131 'Asia/Bahrain'
132 ]
133 };
134  
135 16 ▶ sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
136 16 my $class = shift;
137 16 my $number = shift;
138 16 $number =~ s/(^\+973|\D)//g;
139 16 my $self = bless({ country_code => '973', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, }, $class);
140 16 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 15 1 16
141 }
142 2 1;
« blib/lib/Number/Phone/StubCountry/BF.pm ↑ Summary blib/lib/Number/Phone/StubCountry/BI.pm »