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::LB; |
20
|
2
|
|
|
2
|
|
1133
|
use base qw(Number::Phone::StubCountry); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
219
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
50
|
|
23
|
2
|
|
|
2
|
|
52
|
use warnings; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
61
|
|
24
|
2
|
|
|
2
|
|
16
|
use utf8; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
12
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230903131448; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
28
|
|
|
|
|
|
|
{ |
29
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
30
|
|
|
|
|
|
|
'leading_digits' => ' |
31
|
|
|
|
|
|
|
[13-69]| |
32
|
|
|
|
|
|
|
7(?: |
33
|
|
|
|
|
|
|
[2-57]| |
34
|
|
|
|
|
|
|
62| |
35
|
|
|
|
|
|
|
8[0-7]| |
36
|
|
|
|
|
|
|
9[04-9] |
37
|
|
|
|
|
|
|
)| |
38
|
|
|
|
|
|
|
8[02-9] |
39
|
|
|
|
|
|
|
', |
40
|
|
|
|
|
|
|
'national_rule' => '0$1', |
41
|
|
|
|
|
|
|
'pattern' => '(\\d)(\\d{3})(\\d{3})' |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
45
|
|
|
|
|
|
|
'leading_digits' => '[27-9]', |
46
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3})' |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
]; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $validators = { |
51
|
|
|
|
|
|
|
'fixed_line' => ' |
52
|
|
|
|
|
|
|
7(?: |
53
|
|
|
|
|
|
|
62| |
54
|
|
|
|
|
|
|
8[0-7]| |
55
|
|
|
|
|
|
|
9[04-9] |
56
|
|
|
|
|
|
|
)\\d{4}| |
57
|
|
|
|
|
|
|
(?: |
58
|
|
|
|
|
|
|
[14-69]\\d| |
59
|
|
|
|
|
|
|
2(?: |
60
|
|
|
|
|
|
|
[14-69]\\d| |
61
|
|
|
|
|
|
|
[78][1-9] |
62
|
|
|
|
|
|
|
)| |
63
|
|
|
|
|
|
|
7[2-57]| |
64
|
|
|
|
|
|
|
8[02-9] |
65
|
|
|
|
|
|
|
)\\d{5} |
66
|
|
|
|
|
|
|
', |
67
|
|
|
|
|
|
|
'geographic' => ' |
68
|
|
|
|
|
|
|
7(?: |
69
|
|
|
|
|
|
|
62| |
70
|
|
|
|
|
|
|
8[0-7]| |
71
|
|
|
|
|
|
|
9[04-9] |
72
|
|
|
|
|
|
|
)\\d{4}| |
73
|
|
|
|
|
|
|
(?: |
74
|
|
|
|
|
|
|
[14-69]\\d| |
75
|
|
|
|
|
|
|
2(?: |
76
|
|
|
|
|
|
|
[14-69]\\d| |
77
|
|
|
|
|
|
|
[78][1-9] |
78
|
|
|
|
|
|
|
)| |
79
|
|
|
|
|
|
|
7[2-57]| |
80
|
|
|
|
|
|
|
8[02-9] |
81
|
|
|
|
|
|
|
)\\d{5} |
82
|
|
|
|
|
|
|
', |
83
|
|
|
|
|
|
|
'mobile' => ' |
84
|
|
|
|
|
|
|
793(?: |
85
|
|
|
|
|
|
|
[01]\\d| |
86
|
|
|
|
|
|
|
2[0-4] |
87
|
|
|
|
|
|
|
)\\d{3}| |
88
|
|
|
|
|
|
|
(?: |
89
|
|
|
|
|
|
|
(?: |
90
|
|
|
|
|
|
|
3| |
91
|
|
|
|
|
|
|
81 |
92
|
|
|
|
|
|
|
)\\d| |
93
|
|
|
|
|
|
|
7(?: |
94
|
|
|
|
|
|
|
[01]\\d| |
95
|
|
|
|
|
|
|
6[013-9]| |
96
|
|
|
|
|
|
|
8[89]| |
97
|
|
|
|
|
|
|
9[12] |
98
|
|
|
|
|
|
|
) |
99
|
|
|
|
|
|
|
)\\d{5} |
100
|
|
|
|
|
|
|
', |
101
|
|
|
|
|
|
|
'pager' => '', |
102
|
|
|
|
|
|
|
'personal_number' => '', |
103
|
|
|
|
|
|
|
'specialrate' => '(80\\d{6})|(9[01]\\d{6})', |
104
|
|
|
|
|
|
|
'toll_free' => '', |
105
|
|
|
|
|
|
|
'voip' => '' |
106
|
|
|
|
|
|
|
}; |
107
|
|
|
|
|
|
|
my %areanames = (); |
108
|
|
|
|
|
|
|
$areanames{en} = {"96124", "Metn", |
109
|
|
|
|
|
|
|
"96121", "Beirut", |
110
|
|
|
|
|
|
|
"96129", "Jbeil\ \&\ Keserwan", |
111
|
|
|
|
|
|
|
"96126", "North\ Lebanon", |
112
|
|
|
|
|
|
|
"96125", "Chouf", |
113
|
|
|
|
|
|
|
"96128", "Bekaa", |
114
|
|
|
|
|
|
|
"96127", "South\ Lebanon",}; |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub new { |
117
|
13
|
|
|
13
|
1
|
31
|
my $class = shift; |
118
|
13
|
|
|
|
|
24
|
my $number = shift; |
119
|
13
|
|
|
|
|
83
|
$number =~ s/(^\+961|\D)//g; |
120
|
13
|
|
|
|
|
76
|
my $self = bless({ country_code => '961', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
121
|
13
|
100
|
|
|
|
63
|
return $self if ($self->is_valid()); |
122
|
1
|
|
|
|
|
3
|
$number =~ s/^(?:0)//; |
123
|
1
|
|
|
|
|
12
|
$self = bless({ country_code => '961', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
124
|
1
|
50
|
|
|
|
5
|
return $self->is_valid() ? $self : undef; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
1; |