Terminate::compile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 12
loc 12
ccs 7
cts 7
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
crap 1
1
<?php
2
/*
3
 * This file is part of the Twig Bufferized Template package, an RunOpenCode project.
4
 *
5
 * (c) 2017 RunOpenCode
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace RunOpenCode\Twig\BufferizedTemplate\Tag\TemplateBuffer;
11
12
/**
13
 * Class Terminate
14
 *
15
 * Terminate last buffer and display output.
16
 *
17
 * @package RunOpenCode\Twig\BufferizedTemplate\Tag\TemplateBuffer
18
 *
19
 * @internal
20
 */
21 View Code Duplication
final class Terminate extends \Twig_Node
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26 4
    public function compile(\Twig_Compiler $compiler)
27
    {
28 4
        $compiler->addDebugInfo($this);
29
30
        $compiler
31 4
            ->write(sprintf('}, $this), %s);', $this->getAttribute('execution_priority')))
32 4
            ->write("\n");
33
34
        $compiler
35 4
            ->write(sprintf('%s->display();', $this->getAttribute('bufferized_context_variable_name')))
36 4
            ->write("\n");
37 4
    }
38
}
39