blib/lib/DTL/Fast/Filter/DefaultIfNone.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 86.6% 26 / 30 SCAR 6.9
CC
2
Cov
95%
filter
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/DTL/Fast/Filter/Date.pm ↑ Summary blib/lib/DTL/Fast/Tag/Templatetag.pm »
1 package DTL::Fast::Filter::DefaultIfNone;
2 2 ▶use strict; use utf8; use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use parent 'DTL::Fast::Filter::Default';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 $DTL::Fast::FILTER_HANDLERS{'default_if_none'} = __PACKAGE__;
6  
7 #@Override
8 sub filter
9 {
10 11 ▶ my $self = shift; # self
Subroutine filter: called CC=2 SCAR=7.0
Pod undocumented
11 11 shift; # filter_manager
12 11 my $value = shift;
13 11 my $context = shift;
14
15 11 ▶ return $value // $self->{'default'}->render($context);
Condition66%2/3
$value // $self->{"default"}->render($context)
l!l&&r!l&&!r
830
MC/DC0%0/2
$value // $self->{"default"}->render($context)
$value $self->{"default"}->render($context)
Truth table66%2/3
A // B
A= $valueB= $self->{"default"}->render($context)
ABresult
1X1
011
000
16 }
17  
18 2 1;
« blib/lib/DTL/Fast/Filter/Date.pm ↑ Summary blib/lib/DTL/Fast/Tag/Templatetag.pm »