| 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::FR; | ||||||||||
| 20 | 3 | ▶ | use base qw(Number::Phone::StubCountry); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | 3 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 3 | our $VERSION = 1.20260904101549; | |||||||||
| 26 | |||||||||||
| 27 | 3 | my $formatters = [ | |||||||||
| 28 | { | ||||||||||
| 29 | 'format' => '$1', | ||||||||||
| 30 | 'intl_format' => 'NA', | ||||||||||
| 31 | 'leading_digits' => '10', | ||||||||||
| 32 | 'pattern' => '(\\d{4})' | ||||||||||
| 33 | }, | ||||||||||
| 34 | { | ||||||||||
| 35 | 'format' => '$1 $2', | ||||||||||
| 36 | 'intl_format' => 'NA', | ||||||||||
| 37 | 'leading_digits' => '1', | ||||||||||
| 38 | 'pattern' => '(\\d{3})(\\d{3})' | ||||||||||
| 39 | }, | ||||||||||
| 40 | { | ||||||||||
| 41 | 'format' => '$1 $2 $3 $4', | ||||||||||
| 42 | 'leading_digits' => '8', | ||||||||||
| 43 | 'national_rule' => '0 $1', | ||||||||||
| 44 | 'pattern' => '(\\d{3})(\\d{2})(\\d{2})(\\d{2})' | ||||||||||
| 45 | }, | ||||||||||
| 46 | { | ||||||||||
| 47 | 'format' => '$1 $2 $3 $4 $5', | ||||||||||
| 48 | 'leading_digits' => '[1-79]', | ||||||||||
| 49 | 'national_rule' => '0$1', | ||||||||||
| 50 | 'pattern' => '(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})' | ||||||||||
| 51 | } | ||||||||||
| 52 | ]; | ||||||||||
| 53 | |||||||||||
| 54 | 3 | my $validators = { | |||||||||
| 55 | 'fixed_line' => ' | ||||||||||
| 56 | (?: | ||||||||||
| 57 | 26[013-9]| | ||||||||||
| 58 | 59[1-35-9] | ||||||||||
| 59 | )\\d{6}| | ||||||||||
| 60 | (?: | ||||||||||
| 61 | [13]\\d| | ||||||||||
| 62 | 2[0-57-9]| | ||||||||||
| 63 | 4[1-9]| | ||||||||||
| 64 | 5[0-8] | ||||||||||
| 65 | )\\d{7} | ||||||||||
| 66 | ', | ||||||||||
| 67 | 'geographic' => ' | ||||||||||
| 68 | (?: | ||||||||||
| 69 | 26[013-9]| | ||||||||||
| 70 | 59[1-35-9] | ||||||||||
| 71 | )\\d{6}| | ||||||||||
| 72 | (?: | ||||||||||
| 73 | [13]\\d| | ||||||||||
| 74 | 2[0-57-9]| | ||||||||||
| 75 | 4[1-9]| | ||||||||||
| 76 | 5[0-8] | ||||||||||
| 77 | )\\d{7} | ||||||||||
| 78 | ', | ||||||||||
| 79 | 'mobile' => ' | ||||||||||
| 80 | (?: | ||||||||||
| 81 | 6(?: | ||||||||||
| 82 | [0-24-8]\\d| | ||||||||||
| 83 | 3[0-8]| | ||||||||||
| 84 | 9[589] | ||||||||||
| 85 | )| | ||||||||||
| 86 | 7[3-9]\\d | ||||||||||
| 87 | )\\d{6} | ||||||||||
| 88 | ', | ||||||||||
| 89 | 'pager' => '', | ||||||||||
| 90 | 'personal_number' => '', | ||||||||||
| 91 | 'specialrate' => '( | ||||||||||
| 92 | 8(?: | ||||||||||
| 93 | 1[01]| | ||||||||||
| 94 | 2[0156]| | ||||||||||
| 95 | 4[024]| | ||||||||||
| 96 | 84 | ||||||||||
| 97 | )\\d{6} | ||||||||||
| 98 | )|( | ||||||||||
| 99 | 836(?: | ||||||||||
| 100 | 0[0-36-9]| | ||||||||||
| 101 | [1-9]\\d | ||||||||||
| 102 | )\\d{4}| | ||||||||||
| 103 | 8(?: | ||||||||||
| 104 | 1[2-9]| | ||||||||||
| 105 | 2[2-47-9]| | ||||||||||
| 106 | 3[0-57-9]| | ||||||||||
| 107 | [569]\\d| | ||||||||||
| 108 | 8[0-35-9] | ||||||||||
| 109 | )\\d{6} | ||||||||||
| 110 | )|(80[6-9]\\d{6})', | ||||||||||
| 111 | 'toll_free' => '80[0-5]\\d{6}', | ||||||||||
| 112 | 'voip' => '9\\d{8}' | ||||||||||
| 113 | }; | ||||||||||
| 114 | 3 | my $timezones = { | |||||||||
| 115 | '' => [ | ||||||||||
| 116 | 'Europe/Paris' | ||||||||||
| 117 | ] | ||||||||||
| 118 | }; | ||||||||||
| 119 | |||||||||||
| 120 | 25 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 121 | 25 | my $class = shift; | |||||||||
| 122 | 25 | my $number = shift; | |||||||||
| 123 | 25 | $number =~ s/(^\+33|\D)//g; | |||||||||
| 124 | 25 | my $self = bless({ country_code => '33', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, }, $class); | |||||||||
| 125 | 25 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 126 | 1 | $number =~ s/^(?:0)//; | |||||||||
| 127 | 1 | $self = bless({ country_code => '33', number => $number, formatters => $formatters, validators => $validators, }, $class); | |||||||||
| 128 | 1 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 129 | } | ||||||||||
| 130 | 3 | 1; | |||||||||