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.
Test Setup Failed
Push — master ( 78f8b7...0f754d )
by Elemér
04:15
created

HeaderFooterNode::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 5
1
<?php
2
3
namespace Erelke\TwigSpreadsheetBundle\Twig\Node;
4
5
use Erelke\TwigSpreadsheetBundle\Wrapper\HeaderFooterWrapper;
6
use InvalidArgumentException;
7
use Twig\Compiler as Twig_Compiler;
8
9
/**
10
 * Class HeaderFooterNode.
11
 */
12
class HeaderFooterNode extends BaseNode
13
{
14
    /**
15
     * @var string
16
     */
17
    private $baseType;
18
19
    /**
20
     * HeaderFooterNode constructor.
21
     *
22
     * @param array       $nodes
23
     * @param array       $attributes
24
     * @param int         $lineNo
25
     * @param string|null $tag
26
     * @param string      $baseType
27
     *
28
     * @throws InvalidArgumentException
29
     */
30
    public function __construct(array $nodes = [], array $attributes = [], int $lineNo = 0, string $tag = null, string $baseType = HeaderFooterWrapper::BASETYPE_HEADER)
31
    {
32
        parent::__construct($nodes, $attributes, $lineNo, $tag);
33
34
        $this->baseType = HeaderFooterWrapper::validateBaseType(strtolower($baseType));
35
    }
36
37
    /**
38
     * @param Twig_Compiler $compiler
39
     */
40 View Code Duplication
    public function compile(Twig_Compiler $compiler)
0 ignored issues
show
Duplication introduced by
This method 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...
41
    {
42
        $compiler->addDebugInfo($this)
43
            ->write(self::CODE_FIX_CONTEXT)
44
            ->write(self::CODE_INSTANCE.'->startHeaderFooter(')
45
                ->repr($this->baseType)->raw(', ')
46
                ->subcompile($this->getNode('type'))->raw(', ')
47
                ->subcompile($this->getNode('properties'))
48
            ->raw(');'.PHP_EOL)
49
            ->subcompile($this->getNode('body'))
50
            ->addDebugInfo($this)
51
            ->write(self::CODE_INSTANCE.'->endHeaderFooter();'.PHP_EOL);
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function getAllowedParents(): array
58
    {
59
        return [
60
            SheetNode::class,
61
        ];
62
    }
63
}
64