line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Tiny::Plugin::Filtered::Filter; |
2
|
|
|
|
|
|
|
$Form::Tiny::Plugin::Filtered::Filter::VERSION = '2.21'; |
3
|
9
|
|
|
9
|
|
124
|
use v5.10; |
|
9
|
|
|
|
|
37
|
|
4
|
9
|
|
|
9
|
|
64
|
use strict; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
221
|
|
5
|
9
|
|
|
9
|
|
71
|
use warnings; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
229
|
|
6
|
9
|
|
|
9
|
|
43
|
use Moo; |
|
9
|
|
|
|
|
29
|
|
|
9
|
|
|
|
|
76
|
|
7
|
9
|
|
|
9
|
|
3325
|
use Types::Standard qw(HasMethods CodeRef); |
|
9
|
|
|
|
|
34
|
|
|
9
|
|
|
|
|
134
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has 'type' => ( |
10
|
|
|
|
|
|
|
is => 'ro', |
11
|
|
|
|
|
|
|
isa => HasMethods ['check'], |
12
|
|
|
|
|
|
|
required => 1, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'code' => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
isa => CodeRef, |
18
|
|
|
|
|
|
|
required => 1, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub filter |
22
|
|
|
|
|
|
|
{ |
23
|
49
|
|
|
49
|
0
|
105
|
my ($self, $obj, $value) = @_; |
24
|
|
|
|
|
|
|
|
25
|
49
|
100
|
|
|
|
173
|
if ($self->type->check($value)) { |
26
|
41
|
|
|
|
|
645
|
return $self->code->($obj, $value); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
8
|
|
|
|
|
101
|
return $value; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|