line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::FormValidator::Constraints::Business::DK::Phonenumber; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
5336
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
96
|
|
4
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
81
|
|
5
|
2
|
|
|
2
|
|
14
|
use vars qw($VERSION @EXPORT_OK); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
148
|
|
6
|
2
|
|
|
2
|
|
3552
|
use Business::DK::Phonenumber qw(validate render); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
187
|
|
7
|
2
|
|
|
2
|
|
17
|
use base qw(Exporter); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
225
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '0.09'; |
10
|
|
|
|
|
|
|
@EXPORT_OK = qw(valid_dk_phonenumber match_dk_phonenumber); |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
12
|
use constant VALID => 1; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
117
|
|
13
|
2
|
|
|
2
|
|
12
|
use constant INVALID => undef; |
|
2
|
|
|
|
|
42
|
|
|
2
|
|
|
|
|
459
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub valid_dk_phonenumber { |
16
|
|
|
|
|
|
|
return sub { |
17
|
6
|
|
|
6
|
|
19389
|
my $dfv = shift; |
18
|
|
|
|
|
|
|
|
19
|
6
|
|
|
|
|
47
|
$dfv->name_this('valid_dk_phonenumber'); |
20
|
|
|
|
|
|
|
|
21
|
6
|
|
|
|
|
50
|
my $phonenumber = $dfv->get_current_constraint_value(); |
22
|
|
|
|
|
|
|
|
23
|
6
|
100
|
|
|
|
49
|
if ( validate($phonenumber) ) { |
24
|
4
|
|
|
|
|
11
|
return VALID; |
25
|
|
|
|
|
|
|
} else { |
26
|
2
|
|
|
|
|
9
|
return INVALID; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
4
|
|
|
4
|
1
|
10253
|
} |
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__ |