| 1 | package Data::FormValidator::Constraints::Business::DK::Phonenumber; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use vars qw($VERSION @EXPORT_OK); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 3 | ▶ | use Business::DK::Phonenumber qw(validate render); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 3 | ▶ | use base qw(Exporter); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 3 | $VERSION = '0.10'; | |||||||||
| 10 | 3 | @EXPORT_OK = qw(valid_dk_phonenumber match_dk_phonenumber); | |||||||||
| 11 | |||||||||||
| 12 | 3 | ▶ | use constant VALID => 1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 3 | ▶ | use constant INVALID => undef; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 4 | ▶ | sub valid_dk_phonenumber { | ||||||||
|
Subroutine
valid_dk_phonenumber: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 16 | 6 | ▶ | return sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 17 | 6 | my $dfv = shift; | |||||||||
| 18 | |||||||||||
| 19 | 6 | $dfv->name_this('valid_dk_phonenumber'); | |||||||||
| 20 | |||||||||||
| 21 | 6 | my $phonenumber = $dfv->get_current_constraint_value(); | |||||||||
| 22 | |||||||||||
| 23 | 6 | ▶ | if ( validate($phonenumber) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 4 | return VALID; | |||||||||
| 25 | } else { | ||||||||||
| 26 | 2 | return INVALID; | |||||||||
| 27 | } | ||||||||||
| 28 | } | ||||||||||
| 29 | 4 | } | |||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | sub match_dk_phonenumber { | ||||||||
|
Subroutine
match_dk_phonenumber: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 32 | 0 | my ( $dfv, $format ) = @_; | |||||||||
| 33 | |||||||||||
| 34 | 0 | ▶ | my $phonenumber = ref $dfv ? $dfv->get_current_constraint_value : $dfv; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | |||||||||||
| 36 | 0 | my ($untainted_phonenumber) = render($phonenumber); | |||||||||
| 37 | |||||||||||
| 38 | 0 | return $untainted_phonenumber; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 3 | 1; | |||||||||
| 42 | |||||||||||
| 43 | __END__ | ||||||||||