« blib/lib/Number/Phone/StubCountry/SV.pm
↑ Summary
blib/lib/Number/Phone/StubCountry/SharedCostServices.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::SZ; | ||||||||||
| 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' => '[0237]', | ||||||||||
| 31 | 'pattern' => '(\\d{4})(\\d{4})' | ||||||||||
| 32 | }, | ||||||||||
| 33 | { | ||||||||||
| 34 | 'format' => '$1 $2', | ||||||||||
| 35 | 'leading_digits' => '9', | ||||||||||
| 36 | 'pattern' => '(\\d{5})(\\d{4})' | ||||||||||
| 37 | } | ||||||||||
| 38 | ]; | ||||||||||
| 39 | |||||||||||
| 40 | 2 | my $validators = { | |||||||||
| 41 | 'fixed_line' => '[23][2-5]\\d{6}', | ||||||||||
| 42 | 'geographic' => '[23][2-5]\\d{6}', | ||||||||||
| 43 | 'mobile' => '7[5-9]\\d{6}', | ||||||||||
| 44 | 'pager' => '', | ||||||||||
| 45 | 'personal_number' => '', | ||||||||||
| 46 | 'specialrate' => '(900\\d{6})', | ||||||||||
| 47 | 'toll_free' => '0800\\d{4}', | ||||||||||
| 48 | 'voip' => '70\\d{6}' | ||||||||||
| 49 | }; | ||||||||||
| 50 | 2 | my %areanames = (); | |||||||||
| 51 | 2 | $areanames{en} = {"2682538", "Mankayane\,\ Manzini\ district", | |||||||||
| 52 | "26835", "Manzini", | ||||||||||
| 53 | "2682405", "Mbabane\,\ Hhohho\ district", | ||||||||||
| 54 | "2682518", "Matsapha\,\ Manzini\ district", | ||||||||||
| 55 | "2682453", "Bhunya\,\ Hhohho\ district", | ||||||||||
| 56 | "2682312", "Mhlume\,\ Lubombo\ district", | ||||||||||
| 57 | "2682363", "Big\ Bend\,\ Lubombo\ district", | ||||||||||
| 58 | "2682344", "Siphofaneni\,\ Lubombo\ district", | ||||||||||
| 59 | "2682207", "Nhlangano\,\ Shiselweni\ district", | ||||||||||
| 60 | "2682404", "Mbabane\,\ Hhohho\ district", | ||||||||||
| 61 | "2682452", "Bhunya\,\ Hhohho\ district", | ||||||||||
| 62 | "2682406", "Mbabane\,\ Hhohho\ district", | ||||||||||
| 63 | "2682517", "Matsapha\,\ Manzini\ district", | ||||||||||
| 64 | "2682227", "Hluthi\,\ Shiselweni\ district", | ||||||||||
| 65 | "2682333", "Mpaka\,\ Lubombo\ district", | ||||||||||
| 66 | "2682313", "Mhlume\,\ Lubombo\ district", | ||||||||||
| 67 | "2682343", "Siteki\,\ Lubombo\ district", | ||||||||||
| 68 | "2682237", "Mahamba\,\ Shiselweni\ district", | ||||||||||
| 69 | "2682323", "Tshaneni\,\ Lubombo\ district", | ||||||||||
| 70 | "2682217", "Hlathikulu\,\ Shiselweni\ district", | ||||||||||
| 71 | "2682364", "Big\ Bend\,\ Lubombo\ district", | ||||||||||
| 72 | "2682506", "Manzini", | ||||||||||
| 73 | "2682383", "Simunye\,\ Lubombo\ district", | ||||||||||
| 74 | "2682437", "Pigg\'s\ Peak\,\ Hhohho\ district", | ||||||||||
| 75 | "2682373", "Maphiveni\,\ Lubombo\ district", | ||||||||||
| 76 | "2682482", "Siphocosini\,\ Hhohho\ district", | ||||||||||
| 77 | "26832", "Shiselweni", | ||||||||||
| 78 | "2682472", "Mahwalala\,\ Hhohho\ district", | ||||||||||
| 79 | "2682303", "Nsoko\,\ Lubombo\ district", | ||||||||||
| 80 | "2682322", "Tshaneni\,\ Lubombo\ district", | ||||||||||
| 81 | "26833", "Lubombo", | ||||||||||
| 82 | "2682548", "Ludzeludze\,\ Manzini\ district", | ||||||||||
| 83 | "2682382", "Simunye\,\ Lubombo\ district", | ||||||||||
| 84 | "2682528", "Malkerns\,\ Manzini\ district", | ||||||||||
| 85 | "2682467", "Mhlambanyatsi\,\ Hhohho\ district", | ||||||||||
| 86 | "26834", "Hhohho", | ||||||||||
| 87 | "2682505", "Manzini", | ||||||||||
| 88 | "2682416", "Lobamba\,\ Hhohho\ district", | ||||||||||
| 89 | "2682442", "Ngwenya\,\ Hhohho\ district", | ||||||||||
| 90 | "2682422", "Sidwashini\,\ Hhohho\ district",}; | ||||||||||
| 91 | 2 | my $timezones = { | |||||||||
| 92 | '' => [ | ||||||||||
| 93 | 'Africa/Mbabane' | ||||||||||
| 94 | ] | ||||||||||
| 95 | }; | ||||||||||
| 96 | |||||||||||
| 97 | 16 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 98 | 16 | my $class = shift; | |||||||||
| 99 | 16 | my $number = shift; | |||||||||
| 100 | 16 | $number =~ s/(^\+268|\D)//g; | |||||||||
| 101 | 16 | my $self = bless({ country_code => '268', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 102 | 16 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 103 | } | ||||||||||
| 104 | 2 | 1; | |||||||||