blib/lib/DTL/Fast/Tag/Firstofdefined.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.5% 28 / 29 SCAR 11.0
CC
3
Cov
100%
render
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/DTL/Fast/Tag/Dump.pm ↑ Summary blib/lib/DTL/Fast/Filter/Truncatecharshtml.pm »
1 package DTL::Fast::Tag::Firstofdefined;
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::Tag::Firstof';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 $DTL::Fast::TAG_HANDLERS{'firstofdefined'} = __PACKAGE__;
6  
7 # conditional rendering
8 sub render
9 {
10 12 ▶ my( $self, $context, $global_safe) = @_;
Subroutine render: called CC=3 SCAR=11.0
Pod undocumented
11 12 my $result = '';
12
13 12 foreach my $source (@{$self->{'sources'}})
14 {
15 27 ▶ if( defined ($result = $source->render($context, $global_safe)))
Branch: 1 branch
BranchTrueFalseTotal
if (defined($result = $source->render($context, $global_safe))) 12 15 27
16 {
17 12 last;
18 }
19 }
20 12 return $result;
21 }
22  
23 2 1;
« blib/lib/DTL/Fast/Tag/Dump.pm ↑ Summary blib/lib/DTL/Fast/Filter/Truncatecharshtml.pm »