Defer   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A compile() 0 13 1
1
<?php
2
namespace Boekkooi\Bundle\TwigJackBundle\Twig\Node;
3
4
use Twig_Compiler;
5
6
/**
7
 * @author Warnar Boekkooi <[email protected]>
8
 */
9
class Defer extends \Twig_Node_Block
10
{
11
    /**
12
     * Compiles the node to PHP.
13
     *
14
     * @param Twig_Compiler $compiler A Twig_Compiler instance
15
     */
16 1
    public function compile(Twig_Compiler $compiler)
17
    {
18 1
        $name = $this->getAttribute('name');
19
20
        $compiler
21 1
            ->addDebugInfo($this)
22 1
            ->write("public function block_{$name}(\$context, array \$blocks = array())\n", "{\n")
23 1
            ->indent()
24 1
                ->subcompile($this->getNode('body'))
25 1
            ->outdent()
26 1
            ->write("}\n\n")
27
        ;
28 1
    }
29
}
30