blib/lib/DTL/Fast/Expression/Operator/Unary/Defined.pm

filter: Statementstmt 95.0% 19 / 20 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 89.2% 25 / 28 SCAR 6.9
CC
2
Cov
91%
render
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/DTL/Fast/Expression/Operator/Unary/Not.pm ↑ Summary blib/lib/DTL/Fast/Filter/Lower.pm »
1 package DTL::Fast::Expression::Operator::Unary::Defined;
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::Expression::Operator::Unary';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 $DTL::Fast::OPS_HANDLERS{'defined'} = __PACKAGE__;
6  
7 sub render
8 {
9 10 ▶ my( $self, $context) = @_;
Subroutine render: called CC=2 SCAR=7.2
Pod undocumented
10 10 my $result = undef;
11  
12
13 10 ▶ if( $self->{'a'}->{'undef'} )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'a'}{'undef'}) { } 0 10 10
14 {
15 0 $result = 1;
16 }
17 else
18 {
19 10 $result = defined $self->{'a'}->render($context, 1);
20 }
21
22 10 return $result;
23 }
24  
25 2 1;
« blib/lib/DTL/Fast/Expression/Operator/Unary/Not.pm ↑ Summary blib/lib/DTL/Fast/Filter/Lower.pm »