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

filter: Statementstmt 100% 29 / 29 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 97.4% 38 / 39 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/RU.pm ↑ Summary blib/lib/Number/Phone/StubCountry/BA.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::XK;
20 3 ▶use base qw(Number::Phone::StubCountry);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 3 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 3 our $VERSION = 1.20260904101552;
26  
27 3 my $formatters = [
28 {
29 'format' => '$1 $2',
30 'leading_digits' => '[89]',
31 'national_rule' => '0$1',
32 'pattern' => '(\\d{3})(\\d{5})'
33 },
34 {
35 'format' => '$1 $2 $3',
36 'leading_digits' => '[2-4]',
37 'national_rule' => '0$1',
38 'pattern' => '(\\d{2})(\\d{3})(\\d{3})'
39 },
40 {
41 'format' => '$1 $2 $3',
42 'leading_digits' => '
43 2|
44 39
45 ',
46 'national_rule' => '0$1',
47 'pattern' => '(\\d{3})(\\d{3})(\\d{3})'
48 },
49 {
50 'format' => '$1 $2',
51 'leading_digits' => '3',
52 'national_rule' => '0$1',
53 'pattern' => '(\\d{2})(\\d{7,10})'
54 }
55 ];
56  
57 3 my $validators = {
58 'fixed_line' => '
59 38\\d{6,10}|
60 (?:
61 2[89]|
62 39
63 )(?:
64 0\\d{5,6}|
65 [1-9]\\d{5}
66 )
67 ',
68 'geographic' => '
69 38\\d{6,10}|
70 (?:
71 2[89]|
72 39
73 )(?:
74 0\\d{5,6}|
75 [1-9]\\d{5}
76 )
77 ',
78 'mobile' => '4[3-9]\\d{6}',
79 'pager' => '',
80 'personal_number' => '',
81 'specialrate' => '(900\\d{5})',
82 'toll_free' => '800\\d{5}',
83 'voip' => ''
84 };
85 3 my %areanames = ();
86 3 $areanames{sr} = {"38328", "Косовска\ Митровица",
87 "38338", "Приштина",
88 "383390", "Ђаковица",
89 "383290", "Урошевац",
90 "38329", "Призрен",
91 "38339", "Пећ",
92 "383280", "Гњилане",};
93 3 $areanames{en} = {"383280", "Gjilan",
94 "38329", "Prizren",
95 "38339", "Peja",
96 "383390", "Gjakova",
97 "383290", "Ferizaj",
98 "38338", "Prishtina",
99 "38328", "Mitrovica",};
100 3 $areanames{sq} = {"38338", "Prishtinë",
101 "38328", "Mitrovicë",
102 "383390", "Gjakovë",
103 "38339", "Pejë",};
104 3 my $timezones = {
105 '' => [
106 'Europe/Belgrade'
107 ]
108 };
109  
110 19 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
111 19 my $class = shift;
112 19 my $number = shift;
113 19 $number =~ s/(^\+383|\D)//g;
114 19 my $self = bless({ country_code => '383', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
115 19 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 14 5 19
116 5 $number =~ s/^(?:0)//;
117 5 $self = bless({ country_code => '383', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
118 5 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 5 5
119 }
120 3 1;
« blib/lib/Number/Phone/StubCountry/RU.pm ↑ Summary blib/lib/Number/Phone/StubCountry/BA.pm »