| 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::NF; | ||||||||||
| 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' => '1[0-3]', | ||||||||||
| 31 | 'pattern' => '(\\d{2})(\\d{4})' | ||||||||||
| 32 | }, | ||||||||||
| 33 | { | ||||||||||
| 34 | 'format' => '$1 $2', | ||||||||||
| 35 | 'leading_digits' => '[13]', | ||||||||||
| 36 | 'pattern' => '(\\d)(\\d{5})' | ||||||||||
| 37 | } | ||||||||||
| 38 | ]; | ||||||||||
| 39 | |||||||||||
| 40 | 2 | my $validators = { | |||||||||
| 41 | 'fixed_line' => ' | ||||||||||
| 42 | (?: | ||||||||||
| 43 | 1(?: | ||||||||||
| 44 | 06| | ||||||||||
| 45 | 17| | ||||||||||
| 46 | 28| | ||||||||||
| 47 | 39 | ||||||||||
| 48 | )| | ||||||||||
| 49 | 3[0-2]\\d | ||||||||||
| 50 | )\\d{3} | ||||||||||
| 51 | ', | ||||||||||
| 52 | 'geographic' => ' | ||||||||||
| 53 | (?: | ||||||||||
| 54 | 1(?: | ||||||||||
| 55 | 06| | ||||||||||
| 56 | 17| | ||||||||||
| 57 | 28| | ||||||||||
| 58 | 39 | ||||||||||
| 59 | )| | ||||||||||
| 60 | 3[0-2]\\d | ||||||||||
| 61 | )\\d{3} | ||||||||||
| 62 | ', | ||||||||||
| 63 | 'mobile' => ' | ||||||||||
| 64 | (?: | ||||||||||
| 65 | 14| | ||||||||||
| 66 | 3[58] | ||||||||||
| 67 | )\\d{4} | ||||||||||
| 68 | ', | ||||||||||
| 69 | 'pager' => '', | ||||||||||
| 70 | 'personal_number' => '', | ||||||||||
| 71 | 'specialrate' => '', | ||||||||||
| 72 | 'toll_free' => '', | ||||||||||
| 73 | 'voip' => '' | ||||||||||
| 74 | }; | ||||||||||
| 75 | 2 | my %areanames = (); | |||||||||
| 76 | 2 | $areanames{en} = {"67210", "Davis", | |||||||||
| 77 | "67213", "Macquarie\ Island", | ||||||||||
| 78 | "67211", "Mawson", | ||||||||||
| 79 | "67212", "Casey",}; | ||||||||||
| 80 | 2 | my $timezones = { | |||||||||
| 81 | '' => [ | ||||||||||
| 82 | 'Pacific/Norfolk' | ||||||||||
| 83 | ] | ||||||||||
| 84 | }; | ||||||||||
| 85 | |||||||||||
| 86 | 6 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||
| 87 | 6 | my $class = shift; | |||||||||
| 88 | 6 | my $number = shift; | |||||||||
| 89 | 6 | $number =~ s/(^\+672|\D)//g; | |||||||||
| 90 | 6 | my $self = bless({ country_code => '672', number => $number, formatters => $formatters, validators => $validators, timezones => $timezones, areanames => \%areanames}, $class); | |||||||||
| 91 | 6 | ▶ | return $self if ($self->is_valid()); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 92 | 3 | my $prefix = qr/^(?:([0-258]\d{4})$)/; | |||||||||
| 93 | 3 | my @matches = $number =~ /$prefix/; | |||||||||
| 94 | 3 | ▶ | if (defined $matches[-1]) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 95 | 2 | ▶ | no warnings 'uninitialized'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 96 | 0 | $number =~ s/$prefix/3$1/; | |||||||||
| 97 | } | ||||||||||
| 98 | else { | ||||||||||
| 99 | 3 | $number =~ s/$prefix//; | |||||||||
| 100 | } | ||||||||||
| 101 | 3 | $self = bless({ country_code => '672', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); | |||||||||
| 102 | 3 | ▶ | return $self->is_valid() ? $self : undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 103 | } | ||||||||||
| 104 | 2 | 1; | |||||||||