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

filter: Statementstmt 100% 25 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 33 / 33 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/BI.pm ↑ Summary blib/lib/Number/Phone/StubCountry/BN.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::BJ;
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 $3 $4',
30 'leading_digits' => '8',
31 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})'
32 },
33 {
34 'format' => '$1 $2 $3 $4 $5',
35 'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})'
36 }
37 ];
38  
39 2 my $validators = {
40 'fixed_line' => '012\\d{7}',
41 'geographic' => '012\\d{7}',
42 'mobile' => '
43 01(?:
44 2[5-9]|
45 [4-69]\\d
46 )\\d{6}
47 ',
48 'pager' => '',
49 'personal_number' => '',
50 'specialrate' => '(81\\d{6})',
51 'toll_free' => '',
52 'voip' => '857[58]\\d{4}'
53 };
54 2 my %areanames = ();
55 2 $areanames{fr} = {};
56 2 $areanames{en} = {"229012029", "Ouémé\/Plateau\ departments",
57 "229012382", "Natitingou",
58 "229012253", "Dassa\-Zoumé",
59 "229012130", "Cadjehoun",
60 "229012243", "Come",
61 "229012134", "Ouidah",
62 "229012255", "Savè",
63 "229012254", "Savalou",
64 "2290124", "Tanguiéta",
65 "229012362", "Nikki\/Ndali",
66 "229012135", "Godomey",
67 "229012022", "Kandiévé",
68 "229012361", "Parakou",
69 "229012021", "Ongala",
70 "229012250", "Abomey",
71 "229012026", "Sakété\/Igolo",
72 "229012137", "Allada",
73 "229012133", "Akpakpa",
74 "229012139", "Littoral\/Atlantique\ departments",
75 "229012251", "Bohicon",
76 "229012138", "Kouhounou",
77 "229012241", "Lokossa",
78 "229012252", "Covè",
79 "229012383", "Tanguiéta",
80 "229012024", "Sèmè",
81 "229012246", "Dogbo",
82 "229012132", "Jéricho",
83 "229012249", "Mono\/Kouffo\/Zou\/Collines\ departments",
84 "229012365", "Banikoara",
85 "229012025", "Pobè\/Kétou",
86 "229012380", "Djougou",
87 "229012027", "Adjohoun",
88 "229012136", "Abomey\-Calaci",
89 "229012367", "Malanville",
90 "229012363", "Kandi\/Gogounou\/Ségbana",
91 "229012131", "Ganhi",
92 "229012259", "Mono\/Kouffo\/Zou\/Collines\ departments",};
93 2 my $timezones = {
94 '' => [
95 'Africa/Porto-Novo'
96 ]
97 };
98  
99 13 ▶ sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
100 13 my $class = shift;
101 13 my $number = shift;
102 13 $number =~ s/(^\+229|\D)//g;
103 13 my $self = bless({ country_code => '229', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
104 13 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 12 1 13
105 }
106 2 1;
« blib/lib/Number/Phone/StubCountry/BI.pm ↑ Summary blib/lib/Number/Phone/StubCountry/BN.pm »