line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::FormValidator::Constraints::Business::DK::Phonenumber; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2527
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
82
|
|
5
|
2
|
|
|
2
|
|
10
|
use vars qw($VERSION @EXPORT_OK); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
127
|
|
6
|
2
|
|
|
2
|
|
1034
|
use Business::DK::Phonenumber qw(validate render); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
155
|
|
7
|
2
|
|
|
2
|
|
13
|
use base qw(Exporter); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
179
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.10'; |
10
|
|
|
|
|
|
|
@EXPORT_OK = qw(valid_dk_phonenumber match_dk_phonenumber); |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
11
|
use constant VALID => 1; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
116
|
|
13
|
2
|
|
|
2
|
|
11
|
use constant INVALID => undef; |
|
2
|
|
|
|
|
31
|
|
|
2
|
|
|
|
|
376
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub valid_dk_phonenumber { |
16
|
|
|
|
|
|
|
return sub { |
17
|
6
|
|
|
6
|
|
6768
|
my $dfv = shift; |
18
|
|
|
|
|
|
|
|
19
|
6
|
|
|
|
|
21
|
$dfv->name_this('valid_dk_phonenumber'); |
20
|
|
|
|
|
|
|
|
21
|
6
|
|
|
|
|
32
|
my $phonenumber = $dfv->get_current_constraint_value(); |
22
|
|
|
|
|
|
|
|
23
|
6
|
100
|
|
|
|
32
|
if ( validate($phonenumber) ) { |
24
|
4
|
|
|
|
|
7
|
return VALID; |
25
|
|
|
|
|
|
|
} else { |
26
|
2
|
|
|
|
|
4
|
return INVALID; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
4
|
|
|
4
|
1
|
4071
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub match_dk_phonenumber { |
32
|
0
|
|
|
0
|
1
|
|
my ( $dfv, $format ) = @_; |
33
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
|
|
|
my $phonenumber = ref $dfv ? $dfv->get_current_constraint_value : $dfv; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my ($untainted_phonenumber) = render($phonenumber); |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return $untainted_phonenumber; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |