| 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::RO; | ||||||||||
| 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' => '2[3-6]\\d9', | ||||||||||
| 31 | 'national_rule' => '0$1', | ||||||||||
| 32 | 'pattern' => '(\\d{3})(\\d{3})' | ||||||||||
| 33 | }, | ||||||||||
| 34 | { | ||||||||||
| 35 | 'format' => '$1 $2', | ||||||||||
| 36 | 'leading_digits' => ' | ||||||||||
| 37 | 219| | ||||||||||
| 38 | 31 | ||||||||||
| 39 | ', | ||||||||||
| 40 | 'national_rule' => '0$1', | ||||||||||
| 41 | 'pattern' => '(\\d{2})(\\d{4})' | ||||||||||
| 42 | }, | ||||||||||
| 43 | { | ||||||||||
| 44 | 'format' => '$1 $2 $3', | ||||||||||
| 45 | 'leading_digits' => '[23]1', | ||||||||||
| 46 | 'national_rule' => '0$1', | ||||||||||
| 47 | 'pattern' => '(\\d{2})(\\d{3})(\\d{4})' | ||||||||||
| 48 | }, | ||||||||||
| 49 | { | ||||||||||
| 50 | 'format' => '$1 $2 $3', | ||||||||||
| 51 | 'leading_digits' => '[236-9]', | ||||||||||
| 52 | 'national_rule' => '0$1', | ||||||||||
| 53 | 'pattern' => '(\\d{3})(\\d{3})(\\d{3})' | ||||||||||
| 54 | } | ||||||||||
| 55 | ]; | ||||||||||
| 56 | |||||||||||
| 57 | 2 | my $validators = { | |||||||||
| 58 | 'fixed_line' => ' | ||||||||||
| 59 | [23][13-6]\\d{7}| | ||||||||||
| 60 | (?: | ||||||||||
| 61 | 2(?: | ||||||||||
| 62 | 19\\d| | ||||||||||
| 63 | [3-6]\\d9 | ||||||||||
| 64 | )| | ||||||||||
| 65 | 31\\d\\d | ||||||||||
| 66 | )\\d\\d | ||||||||||
| 67 | ', | ||||||||||
| 68 | 'geographic' => ' | ||||||||||
| 69 | [23][13-6]\\d{7}| | ||||||||||
| 70 | (?: | ||||||||||
| 71 | 2(?: | ||||||||||
| 72 | 19\\d| | ||||||||||
| 73 | [3-6]\\d9 | ||||||||||
| 74 | )| | ||||||||||
| 75 | 31\\d\\d | ||||||||||
| 76 | )\\d\\d | ||||||||||
| 77 | ', | ||||||||||
| 78 | 'mobile' => ' | ||||||||||
| 79 | (?: | ||||||||||
| 80 | 630| | ||||||||||
| 81 | 702 | ||||||||||
| 82 | )0\\d{5}| | ||||||||||
| 83 | (?: | ||||||||||
| 84 | 6(?: | ||||||||||
| 85 | 00| | ||||||||||
| 86 | 2\\d | ||||||||||
| 87 | )| | ||||||||||
| 88 | 7(?: | ||||||||||
| 89 | 0[013-9]| | ||||||||||
| 90 | 1[0-3]| | ||||||||||
| 91 | [2-7]\\d| | ||||||||||
| 92 | 8[03-8]| | ||||||||||
| 93 | 9[0-39] | ||||||||||
| 94 | ) | ||||||||||
| 95 | )\\d{6} | ||||||||||
| 96 | ', | ||||||||||
| 97 | 'pager' => '', | ||||||||||
| 98 | 'personal_number' => '', | ||||||||||
| 99 | 'specialrate' => '(801\\d{6})|(90[0136]\\d{6})|( | ||||||||||
| 100 | (?: | ||||||||||
| 101 | 37\\d| | ||||||||||
| 102 | 80[578] | ||||||||||
| 103 | )\\d{6} | ||||||||||
| 104 | )', | ||||||||||
| 105 | 'toll_free' => '800\\d{6}', | ||||||||||
| 106 | 'voip' => '' | ||||||||||
| 107 | }; | ||||||||||
| 108 | 2 | my %areanames = (); | |||||||||
| 109 | 2 | $areanames{ro} = {"4021", "București\ și\ județul\ Ilfov", | |||||||||
| 110 | "4031", "București\ și\ județul\ Ilfov",}; | ||||||||||
| 111 | 2 | $areanames{en} = {"40335", "Vaslui", | |||||||||
| 112 | "40350", "Vâlcea", | ||||||||||
| 113 | "40259", "Bihor", | ||||||||||
| 114 | "40359", "Bihor", | ||||||||||
| 115 | "40235", "Vaslui", | ||||||||||
| 116 | "40250", "Vâlcea", | ||||||||||
| 117 | "40243", "Ialomița", | ||||||||||
| 118 | "40351", "Dolj", | ||||||||||
| 119 | "40338", "Buzău", | ||||||||||
| 120 | "40344", "Prahova", | ||||||||||
| 121 | "40257", "Arad", | ||||||||||
| 122 | "40242", "Călărași", | ||||||||||
| 123 | "40366", "Harghita", | ||||||||||
| 124 | "40244", "Prahova", | ||||||||||
| 125 | "40357", "Arad", | ||||||||||
| 126 | "40251", "Dolj", | ||||||||||
| 127 | "40238", "Buzău", | ||||||||||
| 128 | "40266", "Harghita", | ||||||||||
| 129 | "40342", "Călărași", | ||||||||||
| 130 | "40343", "Ialomița", | ||||||||||
| 131 | "40260", "Sălaj", | ||||||||||
| 132 | "40369", "Sibiu", | ||||||||||
| 133 | "40245", "Dâmbovița", | ||||||||||
| 134 | "40345", "Dâmbovița", | ||||||||||
| 135 | "40269", "Sibiu", | ||||||||||
| 136 | "40360", "Sălaj", | ||||||||||
| 137 | "40234", "Bacău", | ||||||||||
| 138 | "40248", "Argeș", | ||||||||||
| 139 | "40332", "Iași", | ||||||||||
| 140 | "40367", "Covasna", | ||||||||||
| 141 | "40333", "Neamț", | ||||||||||
| 142 | "40261", "Satu\ Mare", | ||||||||||
| 143 | "40256", "Timiș", | ||||||||||
| 144 | "40361", "Satu\ Mare", | ||||||||||
| 145 | "40267", "Covasna", | ||||||||||
| 146 | "40233", "Neamț", | ||||||||||
| 147 | "40356", "Timiș", | ||||||||||
| 148 | "40348", "Argeș", | ||||||||||
| 149 | "40334", "Bacău", | ||||||||||
| 150 | "40232", "Iași", | ||||||||||
| 151 | "40236", "Galați", | ||||||||||
| 152 | "4021", "Bucharest\ and\ Ilfov\ County", | ||||||||||
| 153 | "40353", "Gorj", | ||||||||||
| 154 | "40268", "Brașov", | ||||||||||
| 155 | "40352", "Mehedinți", | ||||||||||
| 156 | "40347", "Teleorman", | ||||||||||
| 157 | "40241", "Constanța", | ||||||||||
| 158 | "40254", "Hunedoara", | ||||||||||
| 159 | "40252", "Mehedinți", | ||||||||||
| 160 | "40247", "Teleorman", | ||||||||||
| 161 | "40354", "Hunedoara", | ||||||||||
| 162 | "40341", "Constanța", | ||||||||||
| 163 | "40336", "Galați", | ||||||||||
| 164 | "40253", "Gorj", | ||||||||||
| 165 | "40368", "Brașov", | ||||||||||
| 166 | "4031", "Bucharest\ and\ Ilfov\ County", | ||||||||||
| 167 | "40240", "Tulcea", | ||||||||||
| 168 | "40265", "Mureș", | ||||||||||
| 169 | "40349", "Olt", | ||||||||||
| 170 | "40365", "Mureș", | ||||||||||
| 171 | "40249", "Olt", | ||||||||||
| 172 | "40340", "Tulcea", | ||||||||||
| 173 | "40358", "Alba", | ||||||||||
| 174 | "40331", "Botoșani", | ||||||||||
| 175 | "40263", "Bistrița\-Năsăud", | ||||||||||
| 176 | "40237", "Vrancea", | ||||||||||
| 177 | "40346", "Giurgiu", | ||||||||||
| 178 | "40262", "Maramureș", | ||||||||||
| 179 | "40364", "Cluj", | ||||||||||
| 180 | "40362", "Maramureș", | ||||||||||
| 181 | "40246", "Giurgiu", | ||||||||||
| 182 | "40264", "Cluj", | ||||||||||
| 183 | "40258", "Alba", | ||||||||||
| 184 | "40363", "Bistrița\-Năsăud", | ||||||||||
| 185 | "40337", "Vrancea", | ||||||||||
| 186 | "40231", "Botoșani", | ||||||||||
| 187 | "40239", "Brăila", | ||||||||||
| 188 | "40330", "Suceava", | ||||||||||
| 189 | "40355", "Caraș\-Severin", | ||||||||||
| 190 | "40230", "Suceava", | ||||||||||
| 191 | "40255", "Caraș\-Severin", | ||||||||||
| 192 | "40339", "Brăila",}; | ||||||||||
| 193 | 2 | my $timezones = { | |||||||||
| 194 | '' => [ | ||||||||||
| 195 | 'Europe/Bucharest' | ||||||||||
| 196 | ] | ||||||||||
| 197 | }; | ||||||||||
| 198 | |||||||||||
| 199 | 19 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 200 | 19 | my $class = shift; | |||||||||
| 201 | 19 | my $number = shift; | |||||||||
| 202 | 19 | $number =~ s/(^\+40|\D)//g; | |||||||||
| 203 | 19 | my $self = bless({ country_code => '40', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 204 | 19 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 205 | 1 | $number =~ s/^(?:0)//; | |||||||||
| 206 | 1 | $self = bless({ country_code => '40', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 207 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 208 | } | ||||||||||
| 209 | 2 | 1; | |||||||||