GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DoCompiler::compile()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 15
rs 9.4285
cc 2
eloc 9
nc 2
nop 2
1
<?php
2
3
namespace TwigJs\Compiler;
4
5
use TwigJs\JsCompiler;
6
use TwigJs\TypeCompilerInterface;
7
8
class DoCompiler implements TypeCompilerInterface
9
{
10
    public function getType()
11
    {
12
        return 'Twig_Node_Do';
13
    }
14
15
    public function compile(JsCompiler $compiler, \Twig_NodeInterface $node)
16
    {
17
        if (!$node instanceof \Twig_Node_Do) {
18
            throw new \RuntimeException(
19
                sprintf('$node must be an instanceof of \Twig_Node_Do, but got "%s".', get_class($node))
20
            );
21
        }
22
23
        $compiler
24
            ->addDebugInfo($node)
25
            ->write('')
26
            ->subcompile($node->getNode('expr'))
27
            ->raw(";\n")
28
        ;
29
    }
30
}
31