JSNode   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A compile() 0 8 1
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