line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Filter::Length; |
2
|
3
|
|
|
3
|
|
1654
|
use strict; use utf8; use warnings FATAL => 'all'; |
|
3
|
|
|
3
|
|
6
|
|
|
3
|
|
|
3
|
|
67
|
|
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
82
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
100
|
|
3
|
3
|
|
|
3
|
|
14
|
use parent 'DTL::Fast::Filter'; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
16
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
$DTL::Fast::FILTER_HANDLERS{'length'} = __PACKAGE__; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#@Override |
8
|
|
|
|
|
|
|
sub filter |
9
|
|
|
|
|
|
|
{ |
10
|
6
|
|
|
6
|
0
|
12
|
shift; # self |
11
|
6
|
|
|
|
|
7
|
shift; # filter_manager |
12
|
6
|
|
|
|
|
9
|
my $value = shift; # value |
13
|
6
|
|
|
|
|
8
|
shift; # context |
14
|
|
|
|
|
|
|
|
15
|
6
|
100
|
|
|
|
22
|
if( ref $value eq 'ARRAY' ) |
16
|
|
|
|
|
|
|
{ |
17
|
3
|
|
|
|
|
4
|
$value = scalar @$value; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
else |
20
|
|
|
|
|
|
|
{ |
21
|
3
|
|
50
|
|
|
11
|
$value = length( $value // '' ); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
6
|
|
|
|
|
17
|
return $value; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |