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.
Passed
Push — master ( 99c051...63fac8 )
by Mewes
18:46
created

MacroContextNodeVisitor::getPriority()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace MewesK\TwigSpreadsheetBundle\Twig\NodeVisitor;
4
5
use MewesK\TwigSpreadsheetBundle\Wrapper\PhpSpreadsheetWrapper;
6
7
/**
8
 * Class MacroContextNodeVisitor.
9
 */
10
class MacroContextNodeVisitor extends \Twig_BaseNodeVisitor
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function getPriority()
16
    {
17
        return 0;
18
    }
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    protected function doEnterNode(\Twig_Node $node, \Twig_Environment $env)
24
    {
25
        // add wrapper instance as argument on all method calls
26
        if ($node instanceof \Twig_Node_Expression_MethodCall) {
27
            $keyNode = new \Twig_Node_Expression_Constant(PhpSpreadsheetWrapper::INSTANCE_KEY, $node->getTemplateLine());
28
29
            // add wrapper even if it not exists, we fix that later
30
            $valueNode = new \Twig_Node_Expression_Name(PhpSpreadsheetWrapper::INSTANCE_KEY, $node->getTemplateLine());
31
            $valueNode->setAttribute('ignore_strict_check', true);
32
33
            /**
34
             * @var \Twig_Node_Expression_Array $argumentsNode
35
             */
36
            $argumentsNode = $node->getNode('arguments');
37
            $argumentsNode->addElement($valueNode, $keyNode);
38
        }
39
40
        return $node;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    protected function doLeaveNode(\Twig_Node $node, \Twig_Environment $env)
47
    {
48
        return $node;
49
    }
50
}
51