| 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::SK; | ||||||||||
| 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 $3', | ||||||||||
| 30 | 'leading_digits' => '21', | ||||||||||
| 31 | 'national_rule' => '0$1', | ||||||||||
| 32 | 'pattern' => '(\\d)(\\d{2})(\\d{3,4})' | ||||||||||
| 33 | }, | ||||||||||
| 34 | { | ||||||||||
| 35 | 'format' => '$1 $2 $3', | ||||||||||
| 36 | 'leading_digits' => '[3-5][1-8]1[67]', | ||||||||||
| 37 | 'national_rule' => '0$1', | ||||||||||
| 38 | 'pattern' => '(\\d{2})(\\d{2})(\\d{2,3})' | ||||||||||
| 39 | }, | ||||||||||
| 40 | { | ||||||||||
| 41 | 'format' => '$1 $2', | ||||||||||
| 42 | 'intl_format' => 'NA', | ||||||||||
| 43 | 'leading_digits' => '9090', | ||||||||||
| 44 | 'national_rule' => '0$1', | ||||||||||
| 45 | 'pattern' => '(\\d{4})(\\d{3})' | ||||||||||
| 46 | }, | ||||||||||
| 47 | { | ||||||||||
| 48 | 'format' => '$1 $2 $3 $4', | ||||||||||
| 49 | 'leading_digits' => '2', | ||||||||||
| 50 | 'national_rule' => '0$1', | ||||||||||
| 51 | 'pattern' => '(\\d)(\\d{3})(\\d{3})(\\d{2})' | ||||||||||
| 52 | }, | ||||||||||
| 53 | { | ||||||||||
| 54 | 'format' => '$1 $2 $3', | ||||||||||
| 55 | 'leading_digits' => '[689]', | ||||||||||
| 56 | 'national_rule' => '0$1', | ||||||||||
| 57 | 'pattern' => '(\\d{3})(\\d{3})(\\d{3})' | ||||||||||
| 58 | }, | ||||||||||
| 59 | { | ||||||||||
| 60 | 'format' => '$1 $2 $3 $4', | ||||||||||
| 61 | 'leading_digits' => '[3-5]', | ||||||||||
| 62 | 'national_rule' => '0$1', | ||||||||||
| 63 | 'pattern' => '(\\d{2})(\\d{3})(\\d{2})(\\d{2})' | ||||||||||
| 64 | } | ||||||||||
| 65 | ]; | ||||||||||
| 66 | |||||||||||
| 67 | 2 | my $validators = { | |||||||||
| 68 | 'fixed_line' => ' | ||||||||||
| 69 | (?: | ||||||||||
| 70 | 2(?: | ||||||||||
| 71 | 16| | ||||||||||
| 72 | [2-9]\\d{3} | ||||||||||
| 73 | )| | ||||||||||
| 74 | (?: | ||||||||||
| 75 | (?: | ||||||||||
| 76 | [3-5][1-8]\\d| | ||||||||||
| 77 | 819 | ||||||||||
| 78 | )\\d| | ||||||||||
| 79 | 601[1-5] | ||||||||||
| 80 | )\\d | ||||||||||
| 81 | )\\d{4}| | ||||||||||
| 82 | (?: | ||||||||||
| 83 | 2| | ||||||||||
| 84 | [3-5][1-8] | ||||||||||
| 85 | )1[67]\\d{3}| | ||||||||||
| 86 | [3-5][1-8]16\\d\\d | ||||||||||
| 87 | ', | ||||||||||
| 88 | 'geographic' => ' | ||||||||||
| 89 | (?: | ||||||||||
| 90 | 2(?: | ||||||||||
| 91 | 16| | ||||||||||
| 92 | [2-9]\\d{3} | ||||||||||
| 93 | )| | ||||||||||
| 94 | (?: | ||||||||||
| 95 | (?: | ||||||||||
| 96 | [3-5][1-8]\\d| | ||||||||||
| 97 | 819 | ||||||||||
| 98 | )\\d| | ||||||||||
| 99 | 601[1-5] | ||||||||||
| 100 | )\\d | ||||||||||
| 101 | )\\d{4}| | ||||||||||
| 102 | (?: | ||||||||||
| 103 | 2| | ||||||||||
| 104 | [3-5][1-8] | ||||||||||
| 105 | )1[67]\\d{3}| | ||||||||||
| 106 | [3-5][1-8]16\\d\\d | ||||||||||
| 107 | ', | ||||||||||
| 108 | 'mobile' => ' | ||||||||||
| 109 | 909[1-9]\\d{5}| | ||||||||||
| 110 | 9(?: | ||||||||||
| 111 | 0[1-8]| | ||||||||||
| 112 | 1[0-24-9]| | ||||||||||
| 113 | 4[03-57-9]| | ||||||||||
| 114 | 5\\d | ||||||||||
| 115 | )\\d{6} | ||||||||||
| 116 | ', | ||||||||||
| 117 | 'pager' => '9090\\d{3}', | ||||||||||
| 118 | 'personal_number' => '', | ||||||||||
| 119 | 'specialrate' => '(8[5-9]\\d{7})|( | ||||||||||
| 120 | 9(?: | ||||||||||
| 121 | 00| | ||||||||||
| 122 | [78]\\d | ||||||||||
| 123 | )\\d{6} | ||||||||||
| 124 | )|(96\\d{7})', | ||||||||||
| 125 | 'toll_free' => '800\\d{6}', | ||||||||||
| 126 | 'voip' => ' | ||||||||||
| 127 | 6(?: | ||||||||||
| 128 | 02| | ||||||||||
| 129 | 5[0-4]| | ||||||||||
| 130 | 9[0-6] | ||||||||||
| 131 | )\\d{6} | ||||||||||
| 132 | ' | ||||||||||
| 133 | }; | ||||||||||
| 134 | 2 | my %areanames = (); | |||||||||
| 135 | 2 | $areanames{en} = {"42143", "Martin", | |||||||||
| 136 | "42142", "Povazska\ Bystrica", | ||||||||||
| 137 | "42157", "Humenne", | ||||||||||
| 138 | "42138", "Topolcany", | ||||||||||
| 139 | "42151", "Presov", | ||||||||||
| 140 | "42144", "Liptovsky\ Mikulas", | ||||||||||
| 141 | "42136", "Levice", | ||||||||||
| 142 | "42141", "Zilina", | ||||||||||
| 143 | "42154", "Bardejov", | ||||||||||
| 144 | "42147", "Lucenec", | ||||||||||
| 145 | "42152", "Poprad", | ||||||||||
| 146 | "42153", "Spisska\ Nova\ Ves", | ||||||||||
| 147 | "42135", "Nove\ Zamky", | ||||||||||
| 148 | "4212", "Bratislava", | ||||||||||
| 149 | "42148", "Banska\ Bystrica", | ||||||||||
| 150 | "42134", "Senica", | ||||||||||
| 151 | "42156", "Michalovce", | ||||||||||
| 152 | "421601", "Roznava", | ||||||||||
| 153 | "42155", "Kosice", | ||||||||||
| 154 | "42133", "Trnava", | ||||||||||
| 155 | "42132", "Trencin", | ||||||||||
| 156 | "42137", "Nitra", | ||||||||||
| 157 | "42145", "Zvolen", | ||||||||||
| 158 | "42146", "Prievidza", | ||||||||||
| 159 | "42158", "Roznava", | ||||||||||
| 160 | "42131", "Dunajska\ Streda",}; | ||||||||||
| 161 | 2 | my $timezones = { | |||||||||
| 162 | '' => [ | ||||||||||
| 163 | 'Europe/Bratislava' | ||||||||||
| 164 | ] | ||||||||||
| 165 | }; | ||||||||||
| 166 | |||||||||||
| 167 | 25 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 168 | 25 | my $class = shift; | |||||||||
| 169 | 25 | my $number = shift; | |||||||||
| 170 | 25 | $number =~ s/(^\+421|\D)//g; | |||||||||
| 171 | 25 | my $self = bless({ country_code => '421', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 172 | 25 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 173 | 1 | $number =~ s/^(?:0)//; | |||||||||
| 174 | 1 | $self = bless({ country_code => '421', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 175 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 176 | } | ||||||||||
| 177 | 2 | 1; | |||||||||