| 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::MV; | ||||||||||
| 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', | ||||||||||
| 30 | 'leading_digits' => '[34679]', | ||||||||||
| 31 | 'pattern' => '(\\d{3})(\\d{4})' | ||||||||||
| 32 | }, | ||||||||||
| 33 | { | ||||||||||
| 34 | 'format' => '$1 $2 $3', | ||||||||||
| 35 | 'leading_digits' => '[89]', | ||||||||||
| 36 | 'pattern' => '(\\d{3})(\\d{3})(\\d{4})' | ||||||||||
| 37 | } | ||||||||||
| 38 | ]; | ||||||||||
| 39 | |||||||||||
| 40 | 2 | my $validators = { | |||||||||
| 41 | 'fixed_line' => ' | ||||||||||
| 42 | (?: | ||||||||||
| 43 | 3(?: | ||||||||||
| 44 | 0[0-4]| | ||||||||||
| 45 | 3[0-59] | ||||||||||
| 46 | )| | ||||||||||
| 47 | 6(?: | ||||||||||
| 48 | [58][024689]| | ||||||||||
| 49 | 6[024-68]| | ||||||||||
| 50 | 7[02468] | ||||||||||
| 51 | ) | ||||||||||
| 52 | )\\d{4} | ||||||||||
| 53 | ', | ||||||||||
| 54 | 'geographic' => ' | ||||||||||
| 55 | (?: | ||||||||||
| 56 | 3(?: | ||||||||||
| 57 | 0[0-4]| | ||||||||||
| 58 | 3[0-59] | ||||||||||
| 59 | )| | ||||||||||
| 60 | 6(?: | ||||||||||
| 61 | [58][024689]| | ||||||||||
| 62 | 6[024-68]| | ||||||||||
| 63 | 7[02468] | ||||||||||
| 64 | ) | ||||||||||
| 65 | )\\d{4} | ||||||||||
| 66 | ', | ||||||||||
| 67 | 'mobile' => ' | ||||||||||
| 68 | (?: | ||||||||||
| 69 | 46[46]| | ||||||||||
| 70 | [79]\\d\\d | ||||||||||
| 71 | )\\d{4} | ||||||||||
| 72 | ', | ||||||||||
| 73 | 'pager' => '', | ||||||||||
| 74 | 'personal_number' => '', | ||||||||||
| 75 | 'specialrate' => '(900\\d{7})|( | ||||||||||
| 76 | 4(?: | ||||||||||
| 77 | 0[01]| | ||||||||||
| 78 | 50 | ||||||||||
| 79 | )\\d{4} | ||||||||||
| 80 | )', | ||||||||||
| 81 | 'toll_free' => '800\\d{7}', | ||||||||||
| 82 | 'voip' => '' | ||||||||||
| 83 | }; | ||||||||||
| 84 | 2 | my %areanames = (); | |||||||||
| 85 | 2 | $areanames{en} = {"960666", "Alifu\ Alifu", | |||||||||
| 86 | "960678", "Thaa", | ||||||||||
| 87 | "960689", "Addu", | ||||||||||
| 88 | "960665", "Kaafu", | ||||||||||
| 89 | "960672", "Meemu", | ||||||||||
| 90 | "960302", "Malé\ Region", | ||||||||||
| 91 | "960332", "Malé\/Hulhulé\/Aarah", | ||||||||||
| 92 | "960674", "Faafu", | ||||||||||
| 93 | "960304", "Malé\ Region", | ||||||||||
| 94 | "960334", "Malé\/Hulhulé\/Aarah", | ||||||||||
| 95 | "960656", "Noonu", | ||||||||||
| 96 | "960659", "Raa", | ||||||||||
| 97 | "960686", "Gnaviyani", | ||||||||||
| 98 | "960670", "Vaavu", | ||||||||||
| 99 | "960300", "Malé\/Hulhulé\/Aarah", | ||||||||||
| 100 | "960330", "Malé\/Hulhulé\/Aarah", | ||||||||||
| 101 | "960676", "Dhaalu", | ||||||||||
| 102 | "960335", "Hulhumalé", | ||||||||||
| 103 | "960654", "Shaviyani", | ||||||||||
| 104 | "960680", "Laamu", | ||||||||||
| 105 | "960652", "Haa\ Dhaalu", | ||||||||||
| 106 | "960668", "Alifu\ Dhaalu", | ||||||||||
| 107 | "960664", "Kaafu", | ||||||||||
| 108 | "960662", "Lhaviyani", | ||||||||||
| 109 | "960658", "Raa", | ||||||||||
| 110 | "960682", "Gaafu\ Alifu", | ||||||||||
| 111 | "960650", "Haa\ Alifu", | ||||||||||
| 112 | "960684", "Gaafu\ Dhaalu", | ||||||||||
| 113 | "960333", "Malé\/Hulhulé\/Aarah", | ||||||||||
| 114 | "960303", "Malé\ Region", | ||||||||||
| 115 | "960331", "Malé\/Hulhulé\/Aarah", | ||||||||||
| 116 | "960301", "Malé\/Hulhulé\/Aarah", | ||||||||||
| 117 | "960660", "Baa", | ||||||||||
| 118 | "960339", "Vilimalé", | ||||||||||
| 119 | "960688", "Addu",}; | ||||||||||
| 120 | 2 | my $timezones = { | |||||||||
| 121 | '' => [ | ||||||||||
| 122 | 'Indian/Maldives' | ||||||||||
| 123 | ] | ||||||||||
| 124 | }; | ||||||||||
| 125 | |||||||||||
| 126 | 16 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 127 | 16 | my $class = shift; | |||||||||
| 128 | 16 | my $number = shift; | |||||||||
| 129 | 16 | $number =~ s/(^\+960|\D)//g; | |||||||||
| 130 | 16 | my $self = bless({ country_code => '960', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 131 | 16 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 132 | } | ||||||||||
| 133 | 2 | 1; | |||||||||