line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Tiny::Plugin::Filtered::Filter; |
2
|
|
|
|
|
|
|
$Form::Tiny::Plugin::Filtered::Filter::VERSION = '2.19'; |
3
|
9
|
|
|
9
|
|
130
|
use v5.10; |
|
9
|
|
|
|
|
34
|
|
4
|
9
|
|
|
9
|
|
49
|
use strict; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
200
|
|
5
|
9
|
|
|
9
|
|
57
|
use warnings; |
|
9
|
|
|
|
|
23
|
|
|
9
|
|
|
|
|
228
|
|
6
|
9
|
|
|
9
|
|
57
|
use Moo; |
|
9
|
|
|
|
|
20
|
|
|
9
|
|
|
|
|
89
|
|
7
|
9
|
|
|
9
|
|
3291
|
use Types::Standard qw(HasMethods CodeRef); |
|
9
|
|
|
|
|
28
|
|
|
9
|
|
|
|
|
64
|
|
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
|
100
|
my ($self, $obj, $value) = @_; |
24
|
|
|
|
|
|
|
|
25
|
49
|
100
|
|
|
|
193
|
if ($self->type->check($value)) { |
26
|
41
|
|
|
|
|
610
|
return $self->code->($obj, $value); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
8
|
|
|
|
|
108
|
return $value; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|