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 ( 82ab4e...5bf5e4 )
by Mewes
06:05 queued 02:02
created

HeaderFooterNode::compile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 13
Ratio 100 %

Code Coverage

Tests 12
CRAP Score 1

Importance

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