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.
Completed
Push — master ( ad565c...b5b947 )
by Mewes
02:25
created

MacroContextNodeVisitor::getPriority()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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