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.

OddCompiler::compile()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 20
Code Lines 12

Duplication

Lines 20
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 20
loc 20
rs 9.4285
cc 3
eloc 12
nc 2
nop 2
1
<?php
2
3
namespace TwigJs\Compiler\Expression\Test;
4
5
use TwigJs\JsCompiler;
6
use TwigJs\TypeCompilerInterface;
7
8 View Code Duplication
class OddCompiler 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_Expression_Test_Odd';
13
    }
14
15
    public function compile(JsCompiler $compiler, \Twig_NodeInterface $node)
16
    {
17
        if (!$node instanceof \Twig_Node_Expression_Test_Odd) {
18
            throw new \RuntimeException(
19
                sprintf(
20
                    '$node must be an instanceof of \Twig_Node_Expression_Test_Odd, but got "%s".',
21
                    get_class($node)
22
                )
23
            );
24
        }
25
26
        $compiler->subcompile(
27
            new \Twig_Node_Expression_Test(
28
                $node->getNode('node'),
29
                $node->getAttribute('name'),
30
                $node->hasNode('arguments') ? $node->getNode('arguments') : null,
31
                $node->getLine()
0 ignored issues
show
Deprecated Code introduced by
The method Twig_Node::getLine() has been deprecated with message: since 1.27 (to be removed in 2.0)

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
32
            )
33
        );
34
    }
35
}
36