line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Tiny::Plugin::Filtered::Filter; |
2
|
|
|
|
|
|
|
$Form::Tiny::Plugin::Filtered::Filter::VERSION = '2.20'; |
3
|
9
|
|
|
9
|
|
153
|
use v5.10; |
|
9
|
|
|
|
|
33
|
|
4
|
9
|
|
|
9
|
|
57
|
use strict; |
|
9
|
|
|
|
|
25
|
|
|
9
|
|
|
|
|
189
|
|
5
|
9
|
|
|
9
|
|
47
|
use warnings; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
231
|
|
6
|
9
|
|
|
9
|
|
45
|
use Moo; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
73
|
|
7
|
9
|
|
|
9
|
|
3443
|
use Types::Standard qw(HasMethods CodeRef); |
|
9
|
|
|
|
|
29
|
|
|
9
|
|
|
|
|
80
|
|
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
|
109
|
my ($self, $obj, $value) = @_; |
24
|
|
|
|
|
|
|
|
25
|
49
|
100
|
|
|
|
174
|
if ($self->type->check($value)) { |
26
|
41
|
|
|
|
|
650
|
return $self->code->($obj, $value); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
8
|
|
|
|
|
116
|
return $value; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|