| 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::SO; | ||||||||||
| 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' => '8[125]', | ||||||||||
| 31 | 'pattern' => '(\\d{2})(\\d{4})' | ||||||||||
| 32 | }, | ||||||||||
| 33 | { | ||||||||||
| 34 | 'format' => '$1', | ||||||||||
| 35 | 'leading_digits' => '[134]', | ||||||||||
| 36 | 'pattern' => '(\\d{6})' | ||||||||||
| 37 | }, | ||||||||||
| 38 | { | ||||||||||
| 39 | 'format' => '$1 $2', | ||||||||||
| 40 | 'leading_digits' => ' | ||||||||||
| 41 | [15]| | ||||||||||
| 42 | 2[0-79]| | ||||||||||
| 43 | 3[0-46-8]| | ||||||||||
| 44 | 4[0-7] | ||||||||||
| 45 | ', | ||||||||||
| 46 | 'pattern' => '(\\d)(\\d{6})' | ||||||||||
| 47 | }, | ||||||||||
| 48 | { | ||||||||||
| 49 | 'format' => '$1 $2', | ||||||||||
| 50 | 'leading_digits' => ' | ||||||||||
| 51 | 1| | ||||||||||
| 52 | 28| | ||||||||||
| 53 | 9[2-9] | ||||||||||
| 54 | ', | ||||||||||
| 55 | 'pattern' => '(\\d{2})(\\d{5,7})' | ||||||||||
| 56 | }, | ||||||||||
| 57 | { | ||||||||||
| 58 | 'format' => '$1 $2', | ||||||||||
| 59 | 'leading_digits' => ' | ||||||||||
| 60 | [267]| | ||||||||||
| 61 | 904 | ||||||||||
| 62 | ', | ||||||||||
| 63 | 'pattern' => '(\\d)(\\d{7})' | ||||||||||
| 64 | }, | ||||||||||
| 65 | { | ||||||||||
| 66 | 'format' => '$1 $2 $3', | ||||||||||
| 67 | 'leading_digits' => '[346-9]', | ||||||||||
| 68 | 'pattern' => '(\\d{2})(\\d{3})(\\d{4})' | ||||||||||
| 69 | } | ||||||||||
| 70 | ]; | ||||||||||
| 71 | |||||||||||
| 72 | 2 | my $validators = { | |||||||||
| 73 | 'fixed_line' => ' | ||||||||||
| 74 | (?: | ||||||||||
| 75 | 1\\d| | ||||||||||
| 76 | 2[0-79]| | ||||||||||
| 77 | 3[0-46-8]| | ||||||||||
| 78 | 4[0-7]| | ||||||||||
| 79 | 5[57-9] | ||||||||||
| 80 | )\\d{5}| | ||||||||||
| 81 | (?: | ||||||||||
| 82 | [134]\\d| | ||||||||||
| 83 | 8[125] | ||||||||||
| 84 | )\\d{4} | ||||||||||
| 85 | ', | ||||||||||
| 86 | 'geographic' => ' | ||||||||||
| 87 | (?: | ||||||||||
| 88 | 1\\d| | ||||||||||
| 89 | 2[0-79]| | ||||||||||
| 90 | 3[0-46-8]| | ||||||||||
| 91 | 4[0-7]| | ||||||||||
| 92 | 5[57-9] | ||||||||||
| 93 | )\\d{5}| | ||||||||||
| 94 | (?: | ||||||||||
| 95 | [134]\\d| | ||||||||||
| 96 | 8[125] | ||||||||||
| 97 | )\\d{4} | ||||||||||
| 98 | ', | ||||||||||
| 99 | 'mobile' => ' | ||||||||||
| 100 | (?: | ||||||||||
| 101 | (?: | ||||||||||
| 102 | 15| | ||||||||||
| 103 | (?: | ||||||||||
| 104 | 3[59]| | ||||||||||
| 105 | 4[89]| | ||||||||||
| 106 | 6\\d| | ||||||||||
| 107 | 7[0-35-9]| | ||||||||||
| 108 | 8[08] | ||||||||||
| 109 | )\\d| | ||||||||||
| 110 | 9(?: | ||||||||||
| 111 | 0\\d| | ||||||||||
| 112 | [2-9] | ||||||||||
| 113 | ) | ||||||||||
| 114 | )\\d| | ||||||||||
| 115 | 2(?: | ||||||||||
| 116 | 4\\d| | ||||||||||
| 117 | 8 | ||||||||||
| 118 | ) | ||||||||||
| 119 | )\\d{5}| | ||||||||||
| 120 | (?: | ||||||||||
| 121 | [67]\\d\\d| | ||||||||||
| 122 | 904 | ||||||||||
| 123 | )\\d{5} | ||||||||||
| 124 | ', | ||||||||||
| 125 | 'pager' => '', | ||||||||||
| 126 | 'personal_number' => '', | ||||||||||
| 127 | 'specialrate' => '', | ||||||||||
| 128 | 'toll_free' => '', | ||||||||||
| 129 | 'voip' => '' | ||||||||||
| 130 | }; | ||||||||||
| 131 | 2 | my %areanames = (); | |||||||||
| 132 | 2 | $areanames{en} = {"2523", "Hargeisa", | |||||||||
| 133 | "2524", "Garowe", | ||||||||||
| 134 | "2521", "Mogadishu",}; | ||||||||||
| 135 | 2 | my $timezones = { | |||||||||
| 136 | '' => [ | ||||||||||
| 137 | 'Africa/Mogadishu' | ||||||||||
| 138 | ] | ||||||||||
| 139 | }; | ||||||||||
| 140 | |||||||||||
| 141 | 7 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 142 | 7 | my $class = shift; | |||||||||
| 143 | 7 | my $number = shift; | |||||||||
| 144 | 7 | $number =~ s/(^\+252|\D)//g; | |||||||||
| 145 | 7 | my $self = bless({ country_code => '252', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 146 | 7 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 147 | 1 | $number =~ s/^(?:0)//; | |||||||||
| 148 | 1 | $self = bless({ country_code => '252', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 149 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 150 | } | ||||||||||
| 151 | 2 | 1; | |||||||||