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

filter: Statementstmt 100% 27 / 27 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 97.3% 36 / 37 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/YT.pm ↑ Summary blib/lib/Number/Phone/StubCountry/AF.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::AE;
20 2 ▶use base qw(Number::Phone::StubCountry);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 our $VERSION = 1.20260904101547;
26  
27 2 my $formatters = [
28 {
29 'format' => '$1 $2',
30 'leading_digits' => '
31 60|
32 8
33 ',
34 'pattern' => '(\\d{3})(\\d{2,9})'
35 },
36 {
37 'format' => '$1 $2 $3',
38 'leading_digits' => '
39 [236]|
40 [479][2-8]
41 ',
42 'national_rule' => '0$1',
43 'pattern' => '(\\d)(\\d{3})(\\d{4})'
44 },
45 {
46 'format' => '$1 $2 $3',
47 'leading_digits' => '[479]',
48 'pattern' => '(\\d{3})(\\d)(\\d{5})'
49 },
50 {
51 'format' => '$1 $2 $3',
52 'leading_digits' => '5',
53 'national_rule' => '0$1',
54 'pattern' => '(\\d{2})(\\d{3})(\\d{4})'
55 }
56 ];
57  
58 2 my $validators = {
59 'fixed_line' => '[2-4679][2-8]\\d{6}',
60 'geographic' => '[2-4679][2-8]\\d{6}',
61 'mobile' => '5[02-68]\\d{7}',
62 'pager' => '',
63 'personal_number' => '',
64 'specialrate' => '(700[05]\\d{5})|(900[02]\\d{5})|(600[25]\\d{5})',
65 'toll_free' => '
66 400\\d{6}|
67 800\\d{2,9}
68 ',
69 'voip' => ''
70 };
71 2 my %areanames = ();
72 2 $areanames{en} = {"97162", "Sharjah\,\ Ajman\,\ Umm\ Al\-Qaiwain",
73 "97145", "Dubai",
74 "97172", "Ras\ Alkhaimah",
75 "97194", "Fujairah",
76 "97173", "Ras\ Alkhaimah",
77 "97163", "Sharjah\,\ Ajman\,\ Umm\ Al\-Qaiwain",
78 "9713", "Al\ Ain",
79 "97192", "Fujairah",
80 "97193", "Fujairah",
81 "97174", "Ras\ Alkhaimah",
82 "97146", "Dubai",
83 "97164", "Sharjah\,\ Ajman\,\ Umm\ Al\-Qaiwain",
84 "97148", "Dubai",
85 "9712", "Abu\ dhabi",
86 "97197", "Fujairah",
87 "97167", "Sharjah\,\ Ajman\,\ Umm\ Al\-Qaiwain",
88 "97177", "Ras\ Alkhaimah",
89 "97178", "Ras\ Alkhaimah",
90 "97168", "Sharjah\,\ Ajman\,\ Umm\ Al\-Qaiwain",
91 "97198", "Fujairah",
92 "97147", "Dubai",
93 "97175", "Ras\ Alkhaimah",
94 "97142", "Dubai",
95 "97165", "Sharjah\,\ Ajman\,\ Umm\ Al\-Qaiwain",
96 "97196", "Fujairah",
97 "97143", "Dubai",
98 "97195", "Fujairah",
99 "97144", "Dubai",
100 "97176", "Ras\ Alkhaimah",
101 "97166", "Sharjah\,\ Ajman\,\ Umm\ Al\-Qaiwain",};
102 2 my $timezones = {
103 '' => [
104 'Asia/Dubai'
105 ]
106 };
107  
108 19 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
109 19 my $class = shift;
110 19 my $number = shift;
111 19 $number =~ s/(^\+971|\D)//g;
112 19 my $self = bless({ country_code => '971', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
113 19 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 18 1 19
114 1 $number =~ s/^(?:0)//;
115 1 $self = bless({ country_code => '971', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
116 1 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 1 1
117 }
118 2 1;
« blib/lib/Number/Phone/StubCountry/YT.pm ↑ Summary blib/lib/Number/Phone/StubCountry/AF.pm »