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::SG; |
20
|
2
|
|
|
2
|
|
1404
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
249
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
23
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
63
|
|
23
|
2
|
|
|
2
|
|
17
|
use warnings; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
54
|
|
24
|
2
|
|
|
2
|
|
14
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
15
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181422; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1', |
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
31
|
|
|
|
|
|
|
'leading_digits' => ' |
32
|
|
|
|
|
|
|
1(?: |
33
|
|
|
|
|
|
|
[013-8]| |
34
|
|
|
|
|
|
|
9(?: |
35
|
|
|
|
|
|
|
0[1-9]| |
36
|
|
|
|
|
|
|
[1-9] |
37
|
|
|
|
|
|
|
) |
38
|
|
|
|
|
|
|
)| |
39
|
|
|
|
|
|
|
77 |
40
|
|
|
|
|
|
|
', |
41
|
|
|
|
|
|
|
'pattern' => '(\\d{4,5})' |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
'format' => '$1 $2', |
45
|
|
|
|
|
|
|
'leading_digits' => ' |
46
|
|
|
|
|
|
|
[369]| |
47
|
|
|
|
|
|
|
8(?: |
48
|
|
|
|
|
|
|
0[1-6]| |
49
|
|
|
|
|
|
|
[1-9] |
50
|
|
|
|
|
|
|
) |
51
|
|
|
|
|
|
|
', |
52
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{4})' |
53
|
|
|
|
|
|
|
}, |
54
|
|
|
|
|
|
|
{ |
55
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
56
|
|
|
|
|
|
|
'leading_digits' => '8', |
57
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})(\\d{4})' |
58
|
|
|
|
|
|
|
}, |
59
|
|
|
|
|
|
|
{ |
60
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
61
|
|
|
|
|
|
|
'leading_digits' => '7', |
62
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{4})(\\d{3})' |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
66
|
|
|
|
|
|
|
'leading_digits' => '1', |
67
|
|
|
|
|
|
|
'pattern' => '(\\d{4})(\\d{3})(\\d{4})' |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
]; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
my $validators = { |
72
|
|
|
|
|
|
|
'fixed_line' => ' |
73
|
|
|
|
|
|
|
662[0-24-9]\\d{4}| |
74
|
|
|
|
|
|
|
6(?: |
75
|
|
|
|
|
|
|
[0-578]\\d| |
76
|
|
|
|
|
|
|
6[013-57-9]| |
77
|
|
|
|
|
|
|
9[0-35-9] |
78
|
|
|
|
|
|
|
)\\d{5} |
79
|
|
|
|
|
|
|
', |
80
|
|
|
|
|
|
|
'geographic' => ' |
81
|
|
|
|
|
|
|
662[0-24-9]\\d{4}| |
82
|
|
|
|
|
|
|
6(?: |
83
|
|
|
|
|
|
|
[0-578]\\d| |
84
|
|
|
|
|
|
|
6[013-57-9]| |
85
|
|
|
|
|
|
|
9[0-35-9] |
86
|
|
|
|
|
|
|
)\\d{5} |
87
|
|
|
|
|
|
|
', |
88
|
|
|
|
|
|
|
'mobile' => ' |
89
|
|
|
|
|
|
|
8(?: |
90
|
|
|
|
|
|
|
06[0-6]| |
91
|
|
|
|
|
|
|
95[0-2] |
92
|
|
|
|
|
|
|
)\\d{4}| |
93
|
|
|
|
|
|
|
(?: |
94
|
|
|
|
|
|
|
8(?: |
95
|
|
|
|
|
|
|
0[1-5]| |
96
|
|
|
|
|
|
|
[1-8]\\d| |
97
|
|
|
|
|
|
|
9[0-4] |
98
|
|
|
|
|
|
|
)| |
99
|
|
|
|
|
|
|
9[0-8]\\d |
100
|
|
|
|
|
|
|
)\\d{5} |
101
|
|
|
|
|
|
|
', |
102
|
|
|
|
|
|
|
'pager' => '', |
103
|
|
|
|
|
|
|
'personal_number' => '', |
104
|
|
|
|
|
|
|
'specialrate' => '(1900\\d{7})|(7000\\d{7})', |
105
|
|
|
|
|
|
|
'toll_free' => ' |
106
|
|
|
|
|
|
|
(?: |
107
|
|
|
|
|
|
|
18| |
108
|
|
|
|
|
|
|
8 |
109
|
|
|
|
|
|
|
)00\\d{7} |
110
|
|
|
|
|
|
|
', |
111
|
|
|
|
|
|
|
'voip' => ' |
112
|
|
|
|
|
|
|
(?: |
113
|
|
|
|
|
|
|
3[12]\\d| |
114
|
|
|
|
|
|
|
666 |
115
|
|
|
|
|
|
|
)\\d{5} |
116
|
|
|
|
|
|
|
' |
117
|
|
|
|
|
|
|
}; |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub new { |
120
|
19
|
|
|
19
|
1
|
49
|
my $class = shift; |
121
|
19
|
|
|
|
|
57
|
my $number = shift; |
122
|
19
|
|
|
|
|
126
|
$number =~ s/(^\+65|\D)//g; |
123
|
19
|
|
|
|
|
90
|
my $self = bless({ country_code => '65', number => $number, formatters => $formatters, validators => $validators, }, $class); |
124
|
19
|
100
|
|
|
|
98
|
return $self->is_valid() ? $self : undef; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
1; |