blib/lib/Number/Phone/StubCountry/SI.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/SE.pm ↑ Summary blib/lib/Number/Phone/StubCountry/SK.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::SI;
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.20260904101551;
26  
27 2 my $formatters = [
28 {
29 'format' => '$1 $2',
30 'leading_digits' => '
31 8[09]|
32 9
33 ',
34 'national_rule' => '0$1',
35 'pattern' => '(\\d{2})(\\d{3,6})'
36 },
37 {
38 'format' => '$1 $2',
39 'leading_digits' => '
40 59|
41 8
42 ',
43 'national_rule' => '0$1',
44 'pattern' => '(\\d{3})(\\d{5})'
45 },
46 {
47 'format' => '$1 $2 $3',
48 'leading_digits' => '
49 [37][01]|
50 4[013]|
51 51|
52 6
53 ',
54 'national_rule' => '0$1',
55 'pattern' => '(\\d{2})(\\d{3})(\\d{3})'
56 },
57 {
58 'format' => '$1 $2 $3 $4',
59 'leading_digits' => '[1-57]',
60 'national_rule' => '(0$1)',
61 'pattern' => '(\\d)(\\d{3})(\\d{2})(\\d{2})'
62 }
63 ];
64  
65 2 my $validators = {
66 'fixed_line' => '
67 (?:
68 [1-357][2-8]|
69 4[24-8]
70 )\\d{6}
71 ',
72 'geographic' => '
73 (?:
74 [1-357][2-8]|
75 4[24-8]
76 )\\d{6}
77 ',
78 'mobile' => '
79 65(?:
80 [178]\\d|
81 5[56]|
82 6[01]
83 )\\d{4}|
84 (?:
85 [37][01]|
86 4[013]|
87 51|
88 6[489]
89 )\\d{6}
90 ',
91 'pager' => '',
92 'personal_number' => '',
93 'specialrate' => '(
94 89[1-3]\\d{2,5}|
95 90\\d{4,6}
96 )',
97 'toll_free' => '80\\d{4,6}',
98 'voip' => '
99 (?:
100 59\\d\\d|
101 8(?:
102 1(?:
103 [67]\\d|
104 8[0-589]
105 )|
106 2(?:
107 0\\d|
108 2[0-37-9]|
109 8[0-2489]
110 )|
111 3[389]\\d
112 )
113 )\\d{4}
114 '
115 };
116 2 my %areanames = ();
117 2 $areanames{en} = {"38676", "Novo\ Mesto\/Krško",
118 "38644", "Kranj",
119 "38638", "Celje\/Trbovlje",
120 "38642", "Kranj",
121 "38675", "Novo\ Mesto\/Krško",
122 "38657", "Gorica\/Koper\/Postojna",
123 "38653", "Gorica\/Koper\/Postojna",
124 "38635", "Celje\/Trbovlje",
125 "38647", "Kranj",
126 "38652", "Gorica\/Koper\/Postojna",
127 "38654", "Gorica\/Koper\/Postojna",
128 "3861", "Ljubljana",
129 "38636", "Celje\/Trbovlje",
130 "38678", "Novo\ Mesto\/Krško",
131 "38632", "Celje\/Trbovlje",
132 "38655", "Gorica\/Koper\/Postojna",
133 "38677", "Novo\ Mesto\/Krško",
134 "38633", "Celje\/Trbovlje",
135 "38656", "Gorica\/Koper\/Postojna",
136 "3862", "Maribor\/Ravne\ na\ Koroškem\/Murska\ Sobota",
137 "38648", "Kranj",
138 "38634", "Celje\/Trbovlje",
139 "38658", "Gorica\/Koper\/Postojna",
140 "38646", "Kranj",
141 "38674", "Novo\ Mesto\/Krško",
142 "38672", "Novo\ Mesto\/Krško",
143 "38645", "Kranj",
144 "38637", "Celje\/Trbovlje",
145 "38673", "Novo\ Mesto\/Krško",};
146 2 my $timezones = {
147 '' => [
148 'Europe/Ljubljana'
149 ]
150 };
151  
152 16 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod documented
153 16 my $class = shift;
154 16 my $number = shift;
155 16 $number =~ s/(^\+386|\D)//g;
156 16 my $self = bless({ country_code => '386', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class);
157 16 ▶ return $self if ($self->is_valid());
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_valid 15 1 16
158 1 $number =~ s/^(?:0)//;
159 1 $self = bless({ country_code => '386', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class);
160 1 ▶ return $self->is_valid() ? $self : undef;
Branch: 1 branch
BranchTrueFalseTotal
$self->is_valid ? : 0 1 1
161 }
162 2 1;
« blib/lib/Number/Phone/StubCountry/SE.pm ↑ Summary blib/lib/Number/Phone/StubCountry/SK.pm »