| 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::TR; | ||||||||||
| 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 | 'intl_format' => 'NA', | ||||||||||
| 31 | 'leading_digits' => '444', | ||||||||||
| 32 | 'pattern' => '(\\d{3})(\\d)(\\d{3})' | ||||||||||
| 33 | }, | ||||||||||
| 34 | { | ||||||||||
| 35 | 'format' => '$1 $2 $3', | ||||||||||
| 36 | 'leading_digits' => ' | ||||||||||
| 37 | 512| | ||||||||||
| 38 | 8[01589]| | ||||||||||
| 39 | 90 | ||||||||||
| 40 | ', | ||||||||||
| 41 | 'national_rule' => '0$1', | ||||||||||
| 42 | 'pattern' => '(\\d{3})(\\d{3})(\\d{4})' | ||||||||||
| 43 | }, | ||||||||||
| 44 | { | ||||||||||
| 45 | 'format' => '$1 $2 $3 $4', | ||||||||||
| 46 | 'leading_digits' => '5', | ||||||||||
| 47 | 'national_rule' => '0$1', | ||||||||||
| 48 | 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})' | ||||||||||
| 49 | }, | ||||||||||
| 50 | { | ||||||||||
| 51 | 'format' => '$1 $2 $3 $4', | ||||||||||
| 52 | 'leading_digits' => ' | ||||||||||
| 53 | [24][1-8]| | ||||||||||
| 54 | 3[1-9] | ||||||||||
| 55 | ', | ||||||||||
| 56 | 'national_rule' => '(0$1)', | ||||||||||
| 57 | 'pattern' => '(\\d{3})(\\d{3})(\\d{2})(\\d{2})' | ||||||||||
| 58 | }, | ||||||||||
| 59 | { | ||||||||||
| 60 | 'format' => '$1 $2 $3', | ||||||||||
| 61 | 'leading_digits' => '80', | ||||||||||
| 62 | 'national_rule' => '0$1', | ||||||||||
| 63 | 'pattern' => '(\\d{3})(\\d{3})(\\d{6,7})' | ||||||||||
| 64 | } | ||||||||||
| 65 | ]; | ||||||||||
| 66 | |||||||||||
| 67 | 2 | my $validators = { | |||||||||
| 68 | 'fixed_line' => ' | ||||||||||
| 69 | (?: | ||||||||||
| 70 | 2(?: | ||||||||||
| 71 | 1[26]| | ||||||||||
| 72 | [28][2468]| | ||||||||||
| 73 | [3-5][268]| | ||||||||||
| 74 | [67][246] | ||||||||||
| 75 | )| | ||||||||||
| 76 | 3(?: | ||||||||||
| 77 | [13][28]| | ||||||||||
| 78 | [24-6][2468]| | ||||||||||
| 79 | [78][02468]| | ||||||||||
| 80 | 92 | ||||||||||
| 81 | )| | ||||||||||
| 82 | 4(?: | ||||||||||
| 83 | [16][246]| | ||||||||||
| 84 | [23578][2468]| | ||||||||||
| 85 | 4[26] | ||||||||||
| 86 | ) | ||||||||||
| 87 | )\\d{7} | ||||||||||
| 88 | ', | ||||||||||
| 89 | 'geographic' => ' | ||||||||||
| 90 | (?: | ||||||||||
| 91 | 2(?: | ||||||||||
| 92 | 1[26]| | ||||||||||
| 93 | [28][2468]| | ||||||||||
| 94 | [3-5][268]| | ||||||||||
| 95 | [67][246] | ||||||||||
| 96 | )| | ||||||||||
| 97 | 3(?: | ||||||||||
| 98 | [13][28]| | ||||||||||
| 99 | [24-6][2468]| | ||||||||||
| 100 | [78][02468]| | ||||||||||
| 101 | 92 | ||||||||||
| 102 | )| | ||||||||||
| 103 | 4(?: | ||||||||||
| 104 | [16][246]| | ||||||||||
| 105 | [23578][2468]| | ||||||||||
| 106 | 4[26] | ||||||||||
| 107 | ) | ||||||||||
| 108 | )\\d{7} | ||||||||||
| 109 | ', | ||||||||||
| 110 | 'mobile' => ' | ||||||||||
| 111 | 5(?: | ||||||||||
| 112 | 61(?: | ||||||||||
| 113 | 011| | ||||||||||
| 114 | 61\\d | ||||||||||
| 115 | )| | ||||||||||
| 116 | 82[2-4]\\d\\d | ||||||||||
| 117 | )\\d{4}| | ||||||||||
| 118 | 5(?: | ||||||||||
| 119 | [03-5]\\d| | ||||||||||
| 120 | 1[06]| | ||||||||||
| 121 | 24| | ||||||||||
| 122 | 6[24]| | ||||||||||
| 123 | 7[245]| | ||||||||||
| 124 | 9[46] | ||||||||||
| 125 | )\\d{7} | ||||||||||
| 126 | ', | ||||||||||
| 127 | 'pager' => '512\\d{7}', | ||||||||||
| 128 | 'personal_number' => ' | ||||||||||
| 129 | 592(?: | ||||||||||
| 130 | 21[12]| | ||||||||||
| 131 | 461 | ||||||||||
| 132 | )\\d{4} | ||||||||||
| 133 | ', | ||||||||||
| 134 | 'specialrate' => '( | ||||||||||
| 135 | (?: | ||||||||||
| 136 | 8[89]8| | ||||||||||
| 137 | 900 | ||||||||||
| 138 | )\\d{7} | ||||||||||
| 139 | )|(444\\d{4})', | ||||||||||
| 140 | 'toll_free' => ' | ||||||||||
| 141 | 8(?: | ||||||||||
| 142 | 00\\d{7}(?: | ||||||||||
| 143 | \\d{2,3} | ||||||||||
| 144 | )?| | ||||||||||
| 145 | 11\\d{7} | ||||||||||
| 146 | ) | ||||||||||
| 147 | ', | ||||||||||
| 148 | 'voip' => '850\\d{7}' | ||||||||||
| 149 | }; | ||||||||||
| 150 | 2 | my %areanames = (); | |||||||||
| 151 | 2 | $areanames{tr} = {"90276", "Uşak", | |||||||||
| 152 | "90282", "Tekirdağ", | ||||||||||
| 153 | "90484", "Siirt", | ||||||||||
| 154 | "90384", "Nevşehir", | ||||||||||
| 155 | "90426", "Bingöl", | ||||||||||
| 156 | "90376", "Çankırı", | ||||||||||
| 157 | "90476", "Iğdır", | ||||||||||
| 158 | "90252", "Muğla", | ||||||||||
| 159 | "90436", "Muş", | ||||||||||
| 160 | "90288", "Kırklareli", | ||||||||||
| 161 | "9039", "Kuzey\ Kıbrıs", | ||||||||||
| 162 | "90388", "Niğde", | ||||||||||
| 163 | "90264", "Sakarya\ \(Adapazarı\)", | ||||||||||
| 164 | "90416", "Adıyaman", | ||||||||||
| 165 | "90370", "Karabük", | ||||||||||
| 166 | "90364", "Çorum", | ||||||||||
| 167 | "90262", "Kocaeli\ \(İzmit\)", | ||||||||||
| 168 | "90266", "Balıkesir", | ||||||||||
| 169 | "90212", "Istanbul\ \(Avrupa\)", | ||||||||||
| 170 | "90414", "Şanlıurfa", | ||||||||||
| 171 | "90412", "Diyarbakır", | ||||||||||
| 172 | "90344", "Kahramanmaraş", | ||||||||||
| 173 | "90380", "Düzce", | ||||||||||
| 174 | "90378", "Bartın", | ||||||||||
| 175 | "90428", "Tunceli", | ||||||||||
| 176 | "90456", "Gümüşhane", | ||||||||||
| 177 | "90232", "İzmir", | ||||||||||
| 178 | "90256", "Aydın", | ||||||||||
| 179 | "90318", "Kırıkkale", | ||||||||||
| 180 | "90472", "Ağrı", | ||||||||||
| 181 | "90372", "Zonguldak", | ||||||||||
| 182 | "90274", "Kütahya", | ||||||||||
| 183 | "90222", "Eskisehir", | ||||||||||
| 184 | "90324", "Mersin", | ||||||||||
| 185 | "90424", "Elazığ", | ||||||||||
| 186 | "90386", "Kırşehir", | ||||||||||
| 187 | "90486", "Şırnak", | ||||||||||
| 188 | "90286", "Çanakkale",}; | ||||||||||
| 189 | 2 | $areanames{en} = {"90464", "Rize", | |||||||||
| 190 | "90364", "Corum", | ||||||||||
| 191 | "90446", "Erzincan", | ||||||||||
| 192 | "90346", "Sivas", | ||||||||||
| 193 | "90262", "Kocaeli", | ||||||||||
| 194 | "90358", "Amasya", | ||||||||||
| 195 | "90458", "Bayburt", | ||||||||||
| 196 | "90216", "Istanbul\ \(Anatolia\)", | ||||||||||
| 197 | "90258", "Denizli", | ||||||||||
| 198 | "90370", "Karabuk", | ||||||||||
| 199 | "90416", "Adiyaman", | ||||||||||
| 200 | "90264", "Sakarya", | ||||||||||
| 201 | "90462", "Trabzon", | ||||||||||
| 202 | "90362", "Samsun", | ||||||||||
| 203 | "90246", "Isparta", | ||||||||||
| 204 | "90488", "Batman", | ||||||||||
| 205 | "90388", "Nigde", | ||||||||||
| 206 | "9039", "Northern\ Cyprus", | ||||||||||
| 207 | "90288", "Kirklareli", | ||||||||||
| 208 | "90352", "Kayseri", | ||||||||||
| 209 | "90452", "Ordu", | ||||||||||
| 210 | "90236", "Manisa", | ||||||||||
| 211 | "90368", "Sinop", | ||||||||||
| 212 | "90436", "Mus", | ||||||||||
| 213 | "90454", "Giresun", | ||||||||||
| 214 | "90354", "Yozgat", | ||||||||||
| 215 | "90252", "Mugla", | ||||||||||
| 216 | "90476", "Igdir", | ||||||||||
| 217 | "90376", "Cankiri", | ||||||||||
| 218 | "90382", "Aksaray", | ||||||||||
| 219 | "90482", "Mardin", | ||||||||||
| 220 | "90284", "Edirne", | ||||||||||
| 221 | "90226", "Yalova", | ||||||||||
| 222 | "90282", "Tekirdag", | ||||||||||
| 223 | "90326", "Hatay", | ||||||||||
| 224 | "90426", "Bingol", | ||||||||||
| 225 | "90484", "Stirt", | ||||||||||
| 226 | "90384", "Nevsehir", | ||||||||||
| 227 | "90276", "Usak", | ||||||||||
| 228 | "90272", "Afyon", | ||||||||||
| 229 | "90374", "Bolu", | ||||||||||
| 230 | "90474", "Kars", | ||||||||||
| 231 | "90422", "Malatya", | ||||||||||
| 232 | "90322", "Adana", | ||||||||||
| 233 | "90224", "Bursa", | ||||||||||
| 234 | "90286", "Canakkale", | ||||||||||
| 235 | "90222", "Esksehir", | ||||||||||
| 236 | "90386", "Kirsehir", | ||||||||||
| 237 | "90486", "Sirnak", | ||||||||||
| 238 | "90324", "Icel", | ||||||||||
| 239 | "90424", "Elazig", | ||||||||||
| 240 | "90472", "Agri", | ||||||||||
| 241 | "90372", "Zongdulak", | ||||||||||
| 242 | "90274", "Kutahya", | ||||||||||
| 243 | "90256", "Aydin", | ||||||||||
| 244 | "90318", "Kirikkale", | ||||||||||
| 245 | "90432", "Van", | ||||||||||
| 246 | "90332", "Konya", | ||||||||||
| 247 | "90248", "Burdur", | ||||||||||
| 248 | "90232", "Izmir", | ||||||||||
| 249 | "90434", "Bitlis", | ||||||||||
| 250 | "90348", "Kilis", | ||||||||||
| 251 | "90456", "Gumushane", | ||||||||||
| 252 | "90356", "Tokat", | ||||||||||
| 253 | "90328", "Osmaniye", | ||||||||||
| 254 | "90428", "Tuniceli", | ||||||||||
| 255 | "90378", "Bartin", | ||||||||||
| 256 | "90478", "Ardahan", | ||||||||||
| 257 | "90228", "Bilecik", | ||||||||||
| 258 | "90242", "Antalya", | ||||||||||
| 259 | "90366", "Kastamonu", | ||||||||||
| 260 | "90466", "Artvin", | ||||||||||
| 261 | "90380", "Duzce", | ||||||||||
| 262 | "90438", "Hakkari", | ||||||||||
| 263 | "90338", "Karaman", | ||||||||||
| 264 | "90344", "K\.\ Maras", | ||||||||||
| 265 | "90312", "Ankara", | ||||||||||
| 266 | "90412", "Diyarbakir", | ||||||||||
| 267 | "90212", "Istanbul\ \(Europe\)", | ||||||||||
| 268 | "90414", "Sanliurfa", | ||||||||||
| 269 | "90266", "Balikesir", | ||||||||||
| 270 | "90442", "Erzurum", | ||||||||||
| 271 | "90342", "Gaziantep",}; | ||||||||||
| 272 | 2 | my $timezones = { | |||||||||
| 273 | '' => [ | ||||||||||
| 274 | 'Europe/Istanbul' | ||||||||||
| 275 | ] | ||||||||||
| 276 | }; | ||||||||||
| 277 | |||||||||||
| 278 | 25 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 279 | 25 | my $class = shift; | |||||||||
| 280 | 25 | my $number = shift; | |||||||||
| 281 | 25 | $number =~ s/(^\+90|\D)//g; | |||||||||
| 282 | 25 | my $self = bless({ country_code => '90', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 283 | 25 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 284 | 1 | $number =~ s/^(?:0)//; | |||||||||
| 285 | 1 | $self = bless({ country_code => '90', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 286 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 287 | } | ||||||||||
| 288 | 2 | 1; | |||||||||