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.

FlushCompiler::compile()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 13
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 13
loc 13
rs 9.4285
cc 2
eloc 7
nc 2
nop 2
1
<?php
2
3
namespace TwigJs\Compiler;
4
5
use TwigJs\JsCompiler;
6
use TwigJs\TypeCompilerInterface;
7
8 View Code Duplication
class FlushCompiler implements TypeCompilerInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    public function getType()
11
    {
12
        return 'Twig_Node_Flush';
13
    }
14
15
    public function compile(JsCompiler $compiler, \Twig_NodeInterface $node)
16
    {
17
        if (!$node instanceof \Twig_Node_Flush) {
18
            throw new \RuntimeException(
19
                sprintf(
20
                    '$node must be an instanceof of \Twig_Node_Flush, but got "%s".',
21
                    get_class($node)
22
                )
23
            );
24
        }
25
26
        throw new \LogicException('Flushing is not supported in Javascript templates.');
27
    }
28
}
29