JSNode::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types = 1);
2
3
namespace Fousky\JSBlockBundle\Twig\Node;
4
5
use Twig\Compiler;
6
use Twig\Node\Node;
7
8
class JSNode extends Node
9
{
10
    public function __construct(Node $method, $lineno = 0, $tag = null)
11
    {
12
        parent::__construct(['method' => $method], [], $lineno, $tag);
13
    }
14
15
    public function compile(Compiler $compiler)
16
    {
17
        $compiler
18
            ->addDebugInfo($this)
19
            ->write("print \$this->env->getExtension('Fousky\\JSBlockBundle\\Twig\\JSBlockExtension')->")
20
            ->raw($this->getNode('method')->getAttribute('value'))
21
            ->raw("();\n");
22
    }
23
}
24