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

filter: Statementstmt 100% 25 / 25 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 97.1% 34 / 35 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/GF.pm ↑ Summary blib/lib/Number/Phone/StubCountry/IQ.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::GP;
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.20260904101550;
26  
27 3 my $formatters = [
28 {
29 'format' => '$1 $2 $3 $4',
30 'leading_digits' => '
31 [5-79]|
32 80[6-9]
33 ',
34 'national_rule' => '0$1',
35 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})'
36 },
37 {
38 'format' => '$1 $2 $3 $4',
39 'leading_digits' => '8',
40 'national_rule' => '0$1',
41 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})'
42 }
43 ];
44  
45 3 my $validators = {
46 'fixed_line' => '
47 (?:
48 59(?:
49 0(?:
50 0[1-68]|
51 [14][0-24-9]|
52 2[0-68]|
53 3[1-9]|
54 5[3-579]|
55 [68][0-689]|
56 7[08]|
57 9\\d
58 )|
59 87\\d
60 )|
61 80[6-9]\\d\\d
62 )\\d{4}
63 ',
64 'geographic' => '
65 (?:
66 59(?:
67 0(?:
68 0[1-68]|
69 [14][0-24-9]|
70 2[0-68]|
71 3[1-9]|
72 5[3-579]|
73 [68][0-689]|
74 7[08]|
75 9\\d
76 )|
77 87\\d
78 )|
79 80[6-9]\\d\\d
80 )\\d{4}
81 ',
82 'mobile' => '
83 (?:
84 69(?:
85 0\\d\\d|
86 1(?:
87 2[2-9]|
88 3[0-5]
89 )
90 )|
91 7090[0-4]
92 )\\d{4}
93 ',
94 'pager' => '',
95 'personal_number' => '',
96 'specialrate' => '(8[129]\\d{7})',
97 'toll_free' => '80[0-5]\\d{6}',
98 'voip' => '
99 9(?:
100 (?:
101 39[5-7]|
102 76[018]
103 )\\d|
104 475[0-6]
105 )\\d{4}
106 '
107 };
108 3 my $timezones = {
109 '' => [
110 'America/Guadeloupe'
111 ]
112 };
113  
114 71 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
115 71 my $class = shift;
116 71 my $number = shift;
117 71 $number =~ s/(^\+590|\D)//g;
118 71 my $self = bless({ country_code => '590', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, }, $class);
119 71 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 62 9 71
120 9 $number =~ s/^(?:0)//;
121 9 $self = bless({ country_code => '590', number => $number, formatters => $formatters, validators => $validators, }, $class);
122 9 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 9 9
123 }
124 3 1;
« blib/lib/Number/Phone/StubCountry/GF.pm ↑ Summary blib/lib/Number/Phone/StubCountry/IQ.pm »