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

filter: Statementstmt 100% 27 / 27 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 3 totaltotal 92.6% 38 / 41 SCAR 11.0
CC
3
Cov
100%
parse_parameters
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/DTL/Fast/Filter/Lengthis.pm ↑ Summary blib/lib/DTL/Fast/Tag/Firstof.pm »
1 package DTL::Fast::Tag::Autoescape;
2 9 ▶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 9 ▶use parent 'DTL::Fast::Tag';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 9 $DTL::Fast::TAG_HANDLERS{'autoescape'} = __PACKAGE__;
6  
7 #@Override
8 23 ▶sub get_close_tag{ return 'endautoescape';}
Subroutine get_close_tag: called CC=1 SCAR=0.0
Pod undocumented
9  
10 #@Override
11 sub parse_parameters
12 {
13 14 ▶ my $self = shift;
Subroutine parse_parameters: called CC=3 SCAR=11.0
Pod undocumented
14
15 14 ▶ if( $self->{'parameter'} eq 'on' )
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'parameter'} eq 'on') { } 2 12 14
elsif ($self->{'parameter'} eq 'off') { } 11 1 12
16 {
17 2 $self->{'safe'} = 0;
18 }
19 elsif( $self->{'parameter'} eq 'off' )
20 {
21 11 $self->{'safe'} = 1;
22 }
23 else
24 {
25 1 die $self->get_parse_error("autoescape tag undertands only `on` and `off` parameters");
26 }
27 13 return $self;
28 }
29  
30 #@Override
31 sub render
32 {
33 12 ▶ my $self = shift;
Subroutine render: called CC=1 SCAR=0.0
Pod undocumented
34 12 my $context = shift;
35  
36 12 $context->push_scope()->set('_dtl_safe' => $self->{'safe'});
37 12 my $result = $self->SUPER::render($context);
38 12 $context->pop_scope();
39
40 12 return $result;
41 }
42  
43 9 1;
« blib/lib/DTL/Fast/Filter/Lengthis.pm ↑ Summary blib/lib/DTL/Fast/Tag/Firstof.pm »