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
|
|
1350
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
282
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
23
|
use strict; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
55
|
|
23
|
2
|
|
|
2
|
|
18
|
use warnings; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
62
|
|
24
|
2
|
|
|
2
|
|
18
|
use utf8; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
19
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131447; |
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' => '[56]', |
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
|
|
|
|
|
|
|
4[89] |
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
|
|
|
|
|
|
|
4[89] |
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' => ' |
97
|
|
|
|
|
|
|
(?: |
98
|
|
|
|
|
|
|
5\\d| |
99
|
|
|
|
|
|
|
63 |
100
|
|
|
|
|
|
|
)\\d{6} |
101
|
|
|
|
|
|
|
', |
102
|
|
|
|
|
|
|
'pager' => '', |
103
|
|
|
|
|
|
|
'personal_number' => '', |
104
|
|
|
|
|
|
|
'specialrate' => '(807\\d{7})', |
105
|
|
|
|
|
|
|
'toll_free' => '800\\d{7}', |
106
|
|
|
|
|
|
|
'voip' => '' |
107
|
|
|
|
|
|
|
}; |
108
|
|
|
|
|
|
|
my %areanames = (); |
109
|
|
|
|
|
|
|
$areanames{en} = {"5323", "Granma\ Province", |
110
|
|
|
|
|
|
|
"5322", "Santiago\ de\ Cuba\ Province", |
111
|
|
|
|
|
|
|
"5324", "Holguín\ Province", |
112
|
|
|
|
|
|
|
"5331", "Las\ Tunas\ Province", |
113
|
|
|
|
|
|
|
"5341", "Sancti\ Spíritus\ Province", |
114
|
|
|
|
|
|
|
"5346", "Isle\ of\ Youth", |
115
|
|
|
|
|
|
|
"5349", "Artemisa\ Province", |
116
|
|
|
|
|
|
|
"5348", "Pinar\ del\ Río\ Province", |
117
|
|
|
|
|
|
|
"5345", "Matanzas\ Province", |
118
|
|
|
|
|
|
|
"5321", "Guantánamo\ Province", |
119
|
|
|
|
|
|
|
"5332", "Camagüey\ Province", |
120
|
|
|
|
|
|
|
"5333", "Ciego\ de\ Ávila\ Province", |
121
|
|
|
|
|
|
|
"5343", "Cienfuegos\ Province", |
122
|
|
|
|
|
|
|
"5342", "Villa\ Clara\ Province", |
123
|
|
|
|
|
|
|
"5347", "Mayabeque\ and\ Artemisa", |
124
|
|
|
|
|
|
|
"537", "Havana\ City",}; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub new { |
127
|
13
|
|
|
13
|
1
|
29
|
my $class = shift; |
128
|
13
|
|
|
|
|
23
|
my $number = shift; |
129
|
13
|
|
|
|
|
86
|
$number =~ s/(^\+53|\D)//g; |
130
|
13
|
|
|
|
|
79
|
my $self = bless({ country_code => '53', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
131
|
13
|
100
|
|
|
|
65
|
return $self if ($self->is_valid()); |
132
|
1
|
|
|
|
|
12
|
$number =~ s/^(?:0)//; |
133
|
1
|
|
|
|
|
12
|
$self = bless({ country_code => '53', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
134
|
1
|
50
|
|
|
|
8
|
return $self->is_valid() ? $self : undef; |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
1; |