line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 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::CU; |
20
|
2
|
|
|
2
|
|
1218
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
232
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
50
|
|
23
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
57
|
|
24
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
12
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181419; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2', |
30
|
|
|
|
|
|
|
'leading_digits' => ' |
31
|
|
|
|
|
|
|
2[1-4]| |
32
|
|
|
|
|
|
|
[34] |
33
|
|
|
|
|
|
|
', |
34
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
35
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{4,6})' |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
{ |
38
|
|
|
|
|
|
|
'format' => '$1 $2', |
39
|
|
|
|
|
|
|
'leading_digits' => '7', |
40
|
|
|
|
|
|
|
'national_rule' => '(0$1)', |
41
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{6,7})' |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
'format' => '$1 $2', |
45
|
|
|
|
|
|
|
'leading_digits' => '5', |
46
|
|
|
|
|
|
|
'national_rule' => '0$1', |
47
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{7})' |
48
|
|
|
|
|
|
|
}, |
49
|
|
|
|
|
|
|
{ |
50
|
|
|
|
|
|
|
'format' => '$1 $2', |
51
|
|
|
|
|
|
|
'leading_digits' => '8', |
52
|
|
|
|
|
|
|
'national_rule' => '0$1', |
53
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{7})' |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
]; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $validators = { |
58
|
|
|
|
|
|
|
'fixed_line' => ' |
59
|
|
|
|
|
|
|
(?: |
60
|
|
|
|
|
|
|
3[23]| |
61
|
|
|
|
|
|
|
48 |
62
|
|
|
|
|
|
|
)\\d{4,6}| |
63
|
|
|
|
|
|
|
(?: |
64
|
|
|
|
|
|
|
31| |
65
|
|
|
|
|
|
|
4[36]| |
66
|
|
|
|
|
|
|
8(?: |
67
|
|
|
|
|
|
|
0[25]| |
68
|
|
|
|
|
|
|
78 |
69
|
|
|
|
|
|
|
)\\d |
70
|
|
|
|
|
|
|
)\\d{6}| |
71
|
|
|
|
|
|
|
(?: |
72
|
|
|
|
|
|
|
2[1-4]| |
73
|
|
|
|
|
|
|
4[1257]| |
74
|
|
|
|
|
|
|
7\\d |
75
|
|
|
|
|
|
|
)\\d{5,6} |
76
|
|
|
|
|
|
|
', |
77
|
|
|
|
|
|
|
'geographic' => ' |
78
|
|
|
|
|
|
|
(?: |
79
|
|
|
|
|
|
|
3[23]| |
80
|
|
|
|
|
|
|
48 |
81
|
|
|
|
|
|
|
)\\d{4,6}| |
82
|
|
|
|
|
|
|
(?: |
83
|
|
|
|
|
|
|
31| |
84
|
|
|
|
|
|
|
4[36]| |
85
|
|
|
|
|
|
|
8(?: |
86
|
|
|
|
|
|
|
0[25]| |
87
|
|
|
|
|
|
|
78 |
88
|
|
|
|
|
|
|
)\\d |
89
|
|
|
|
|
|
|
)\\d{6}| |
90
|
|
|
|
|
|
|
(?: |
91
|
|
|
|
|
|
|
2[1-4]| |
92
|
|
|
|
|
|
|
4[1257]| |
93
|
|
|
|
|
|
|
7\\d |
94
|
|
|
|
|
|
|
)\\d{5,6} |
95
|
|
|
|
|
|
|
', |
96
|
|
|
|
|
|
|
'mobile' => '5\\d{7}', |
97
|
|
|
|
|
|
|
'pager' => '', |
98
|
|
|
|
|
|
|
'personal_number' => '', |
99
|
|
|
|
|
|
|
'specialrate' => '(807\\d{7})', |
100
|
|
|
|
|
|
|
'toll_free' => '800\\d{7}', |
101
|
|
|
|
|
|
|
'voip' => '' |
102
|
|
|
|
|
|
|
}; |
103
|
|
|
|
|
|
|
my %areanames = (); |
104
|
|
|
|
|
|
|
$areanames{en} = {"5332", "Camagüey\ Province", |
105
|
|
|
|
|
|
|
"5348", "Pinar\ del\ Río\ Province", |
106
|
|
|
|
|
|
|
"5323", "Granma\ Province", |
107
|
|
|
|
|
|
|
"5324", "Holguín\ Province", |
108
|
|
|
|
|
|
|
"5343", "Cienfuegos\ Province", |
109
|
|
|
|
|
|
|
"5331", "Las\ Tunas\ Province", |
110
|
|
|
|
|
|
|
"5345", "Matanzas\ Province", |
111
|
|
|
|
|
|
|
"5347", "Mayabeque\ and\ Artemisa", |
112
|
|
|
|
|
|
|
"5342", "Villa\ Clara\ Province", |
113
|
|
|
|
|
|
|
"5346", "Isle\ of\ Youth", |
114
|
|
|
|
|
|
|
"5333", "Ciego\ de\ Ávila\ Province", |
115
|
|
|
|
|
|
|
"5322", "Santiago\ de\ Cuba\ Province", |
116
|
|
|
|
|
|
|
"5341", "Sancti\ Spíritus\ Province", |
117
|
|
|
|
|
|
|
"5321", "Guantánamo\ Province", |
118
|
|
|
|
|
|
|
"537", "Havana\ City",}; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub new { |
121
|
13
|
|
|
13
|
1
|
32
|
my $class = shift; |
122
|
13
|
|
|
|
|
24
|
my $number = shift; |
123
|
13
|
|
|
|
|
82
|
$number =~ s/(^\+53|\D)//g; |
124
|
13
|
|
|
|
|
97
|
my $self = bless({ country_code => '53', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
125
|
13
|
100
|
|
|
|
62
|
return $self if ($self->is_valid()); |
126
|
1
|
|
|
|
|
7
|
$number =~ s/^(?:0)//; |
127
|
1
|
|
|
|
|
12
|
$self = bless({ country_code => '53', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
128
|
1
|
50
|
|
|
|
10
|
return $self->is_valid() ? $self : undef; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
1; |