| 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::LT; | ||||||||||
| 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.20260904101550; | |||||||||
| 26 | |||||||||||
| 27 | 2 | my $formatters = [ | |||||||||
| 28 | { | ||||||||||
| 29 | 'format' => '$1 $2 $3', | ||||||||||
| 30 | 'leading_digits' => '52[0-7]', | ||||||||||
| 31 | 'national_rule' => '(0-$1)', | ||||||||||
| 32 | 'pattern' => '(\\d)(\\d{3})(\\d{4})' | ||||||||||
| 33 | }, | ||||||||||
| 34 | { | ||||||||||
| 35 | 'format' => '$1 $2 $3', | ||||||||||
| 36 | 'leading_digits' => '[7-9]', | ||||||||||
| 37 | 'national_rule' => '0 $1', | ||||||||||
| 38 | 'pattern' => '(\\d{3})(\\d{2})(\\d{3})' | ||||||||||
| 39 | }, | ||||||||||
| 40 | { | ||||||||||
| 41 | 'format' => '$1 $2', | ||||||||||
| 42 | 'leading_digits' => ' | ||||||||||
| 43 | 37| | ||||||||||
| 44 | 4(?: | ||||||||||
| 45 | [15]| | ||||||||||
| 46 | 6[1-8] | ||||||||||
| 47 | ) | ||||||||||
| 48 | ', | ||||||||||
| 49 | 'national_rule' => '(0-$1)', | ||||||||||
| 50 | 'pattern' => '(\\d{2})(\\d{6})' | ||||||||||
| 51 | }, | ||||||||||
| 52 | { | ||||||||||
| 53 | 'format' => '$1 $2', | ||||||||||
| 54 | 'leading_digits' => '[3-6]', | ||||||||||
| 55 | 'national_rule' => '(0-$1)', | ||||||||||
| 56 | 'pattern' => '(\\d{3})(\\d{5})' | ||||||||||
| 57 | } | ||||||||||
| 58 | ]; | ||||||||||
| 59 | |||||||||||
| 60 | 2 | my $validators = { | |||||||||
| 61 | 'fixed_line' => ' | ||||||||||
| 62 | (?: | ||||||||||
| 63 | 3[1478]| | ||||||||||
| 64 | 4[124-6]| | ||||||||||
| 65 | 52 | ||||||||||
| 66 | )\\d{6} | ||||||||||
| 67 | ', | ||||||||||
| 68 | 'geographic' => ' | ||||||||||
| 69 | (?: | ||||||||||
| 70 | 3[1478]| | ||||||||||
| 71 | 4[124-6]| | ||||||||||
| 72 | 52 | ||||||||||
| 73 | )\\d{6} | ||||||||||
| 74 | ', | ||||||||||
| 75 | 'mobile' => '6\\d{7}', | ||||||||||
| 76 | 'pager' => '', | ||||||||||
| 77 | 'personal_number' => '70[05]\\d{5}', | ||||||||||
| 78 | 'specialrate' => '(808\\d{5})|( | ||||||||||
| 79 | 9(?: | ||||||||||
| 80 | 0[0239]| | ||||||||||
| 81 | 10 | ||||||||||
| 82 | )\\d{5} | ||||||||||
| 83 | )|(70[67]\\d{5})', | ||||||||||
| 84 | 'toll_free' => '80[02]\\d{5}', | ||||||||||
| 85 | 'voip' => '[89]01\\d{5}' | ||||||||||
| 86 | }; | ||||||||||
| 87 | 2 | my %areanames = (); | |||||||||
| 88 | 2 | $areanames{en} = {"370444", "Telšiai", | |||||||||
| 89 | "370319", "Birštonas\/Prienai", | ||||||||||
| 90 | "370469", "Neringa", | ||||||||||
| 91 | "370520", "Vilnius", | ||||||||||
| 92 | "370315", "Alytus", | ||||||||||
| 93 | "370527", "Vilnius", | ||||||||||
| 94 | "370528", "Trakai", | ||||||||||
| 95 | "370522", "Vilnius", | ||||||||||
| 96 | "370343", "Marijampolė", | ||||||||||
| 97 | "37045", "Panevėžys", | ||||||||||
| 98 | "370521", "Vilnius", | ||||||||||
| 99 | "370310", "Varėna", | ||||||||||
| 100 | "370460", "Palanga", | ||||||||||
| 101 | "370318", "Lazdijai", | ||||||||||
| 102 | "370383", "Molėtai", | ||||||||||
| 103 | "370443", "Mažeikiai", | ||||||||||
| 104 | "370526", "Vilnius", | ||||||||||
| 105 | "370525", "Vilnius", | ||||||||||
| 106 | "370459", "Kupiškis", | ||||||||||
| 107 | "370448", "Plungė", | ||||||||||
| 108 | "370313", "Druskininkai", | ||||||||||
| 109 | "370447", "Jurbarkas", | ||||||||||
| 110 | "370422", "Radviliškis", | ||||||||||
| 111 | "370387", "Švenčionys", | ||||||||||
| 112 | "370451", "Pasvalys", | ||||||||||
| 113 | "370428", "Raseiniai", | ||||||||||
| 114 | "370427", "Kelmė", | ||||||||||
| 115 | "370382", "Širvintos", | ||||||||||
| 116 | "370346", "Kaišiadorys", | ||||||||||
| 117 | "370345", "Šakiai", | ||||||||||
| 118 | "37046", "Klaipėda", | ||||||||||
| 119 | "370349", "Jonava", | ||||||||||
| 120 | "37037", "Kaunas", | ||||||||||
| 121 | "370524", "Vilnius", | ||||||||||
| 122 | "370440", "Skuodas", | ||||||||||
| 123 | "370380", "Šalčininkai", | ||||||||||
| 124 | "370523", "Vilnius", | ||||||||||
| 125 | "370450", "Biržai", | ||||||||||
| 126 | "370342", "Vilkaviškis", | ||||||||||
| 127 | "370446", "Tauragė", | ||||||||||
| 128 | "370386", "Ignalina\/Visaginas", | ||||||||||
| 129 | "370385", "Zarasai", | ||||||||||
| 130 | "370445", "Kretinga", | ||||||||||
| 131 | "370425", "Akmenė", | ||||||||||
| 132 | "370426", "Joniškis", | ||||||||||
| 133 | "370347", "Kėdainiai", | ||||||||||
| 134 | "370340", "Ukmergė", | ||||||||||
| 135 | "370381", "Anykščiai", | ||||||||||
| 136 | "370441", "Šilutė", | ||||||||||
| 137 | "370421", "Pakruojis", | ||||||||||
| 138 | "370458", "Rokiškis", | ||||||||||
| 139 | "370449", "Šilalė", | ||||||||||
| 140 | "370389", "Utena", | ||||||||||
| 141 | "37041", "Šiauliai",}; | ||||||||||
| 142 | 2 | my $timezones = { | |||||||||
| 143 | '' => [ | ||||||||||
| 144 | 'Europe/Bucharest' | ||||||||||
| 145 | ] | ||||||||||
| 146 | }; | ||||||||||
| 147 | |||||||||||
| 148 | 25 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 149 | 25 | my $class = shift; | |||||||||
| 150 | 25 | my $number = shift; | |||||||||
| 151 | 25 | $number =~ s/(^\+370|\D)//g; | |||||||||
| 152 | 25 | my $self = bless({ country_code => '370', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 153 | 25 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 154 | 1 | $number =~ s/^(?:[08])//; | |||||||||
| 155 | 1 | $self = bless({ country_code => '370', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 156 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 157 | } | ||||||||||
| 158 | 2 | 1; | |||||||||