line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Filtering Directive for Validation Class Field Definitions |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Validation::Class::Directive::Filtering; |
4
|
|
|
|
|
|
|
|
5
|
108
|
|
|
108
|
|
68951
|
use strict; |
|
108
|
|
|
|
|
206
|
|
|
108
|
|
|
|
|
2845
|
|
6
|
108
|
|
|
108
|
|
528
|
use warnings; |
|
108
|
|
|
|
|
185
|
|
|
108
|
|
|
|
|
3062
|
|
7
|
|
|
|
|
|
|
|
8
|
108
|
|
|
108
|
|
543
|
use base 'Validation::Class::Directive'; |
|
108
|
|
|
|
|
179
|
|
|
108
|
|
|
|
|
7896
|
|
9
|
|
|
|
|
|
|
|
10
|
108
|
|
|
108
|
|
593
|
use Validation::Class::Util; |
|
108
|
|
|
|
|
259
|
|
|
108
|
|
|
|
|
767
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '7.900057'; # VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'mixin' => 1; |
16
|
|
|
|
|
|
|
has 'field' => 1; |
17
|
|
|
|
|
|
|
has 'multi' => 0; |
18
|
|
|
|
|
|
|
has 'dependencies' => sub {{ |
19
|
|
|
|
|
|
|
normalization => ['alias'], |
20
|
|
|
|
|
|
|
validation => [] |
21
|
|
|
|
|
|
|
}}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub normalize { |
24
|
|
|
|
|
|
|
|
25
|
1002
|
|
|
1002
|
0
|
1789
|
my ($self, $proto, $field, $param) = @_; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# by default fields should have a filtering directive |
28
|
|
|
|
|
|
|
# unless already specified |
29
|
|
|
|
|
|
|
|
30
|
1002
|
100
|
|
|
|
3380
|
$field->{filtering} = $proto->filtering unless defined $field->{filtering}; |
31
|
|
|
|
|
|
|
|
32
|
1002
|
|
|
|
|
2832
|
return $self; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |