| 1 | package DTL::Fast::Tag::BlockSuper; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | 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 | 1 | ▶ | use parent 'DTL::Fast::Tag::Simple'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | $DTL::Fast::TAG_HANDLERS{'block_super'} = __PACKAGE__; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | #@Override | ||||||||||||||||||||||||||||
| 8 | sub render | ||||||||||||||||||||||||||||
| 9 | { | ||||||||||||||||||||||||||||
| 10 | 2 | ▶ | my( $self, $context ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
render: called CC=7 SCAR=20.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 2 | my $result = ''; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 2 | my $ns = $context->{'ns'}->[-1]; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 2 | ▶ | if ( # there is an inheritance and we are in block | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
my $descendants = $ns->{"_dtl_descendants"} and exists $ns->{"_dtl_rendering_block"}
MC/DC0%0/2
my $descendants = $ns->{"_dtl_descendants"} and exists $ns->{"_dtl_rendering_block"}
my $descendants = $ns->{"_dtl_descendants"}
exists $ns->{"_dtl_rendering_block"}
Truth table33%1/3
A and B
A= my $descendants = $ns->{"_dtl_descendants"}B= exists $ns->{"_dtl_rendering_block"}
| |||||||||||||||||||||||||||||
| 16 | my $descendants = $ns->{'_dtl_descendants'} | ||||||||||||||||||||||||||||
| 17 | and exists $ns->{'_dtl_rendering_block'} | ||||||||||||||||||||||||||||
| 18 | ) | ||||||||||||||||||||||||||||
| 19 | { | ||||||||||||||||||||||||||||
| 20 | 2 | my $current_template = $ns->{'_dtl_rendering_template'}; | |||||||||||||||||||||||||||
| 21 | 2 | my $current_block_name = $ns->{'_dtl_rendering_block'}->{'block_name'}; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 2 | ▶ | for( my $i = 0; $i < scalar @$descendants; $i++ ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | { | ||||||||||||||||||||||||||||
| 25 | 2 | ▶ | if ( $descendants->[$i] == $current_template ) # found self | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | { | ||||||||||||||||||||||||||||
| 27 | 2 | ▶ | for( my $j = $i + 1; $j < scalar @$descendants; $j++ ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | { | ||||||||||||||||||||||||||||
| 29 | 2 | ▶ | if ( $descendants->[$j]->{'blocks'}->{$current_block_name} ) # found parent block | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | { | ||||||||||||||||||||||||||||
| 31 | 2 | $context->push_scope(); | |||||||||||||||||||||||||||
| 32 | 2 | $ns->{'_dtl_rendering_template'} = $descendants->[$j]; | |||||||||||||||||||||||||||
| 33 | 2 | $ns->{'_dtl_rendering_block'} = $descendants->[$j]->{'blocks'}->{$current_block_name}; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 2 | $result = $descendants->[$j]->{'blocks'}->{$current_block_name}->SUPER::render($context); | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 2 | $context->pop_scope(); | |||||||||||||||||||||||||||
| 38 | 2 | last; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | 2 | last; | |||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 2 | return $result; | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 1 | 1; | |||||||||||||||||||||||||||