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 Failed
Pull Request — master (#23)
by
unknown
04:15
created

HeaderFooterTokenParser::getTag()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace MyWheels\TwigSpreadsheetBundle\Twig\TokenParser;
4
5
use MyWheels\TwigSpreadsheetBundle\Twig\Node\HeaderFooterNode;
6
use MyWheels\TwigSpreadsheetBundle\Wrapper\HeaderFooterWrapper;
7
8
/**
9
 * Class HeaderFooterTokenParser.
10
 */
11
class HeaderFooterTokenParser extends BaseTokenParser
12
{
13
    /**
14
     * @var string
15
     */
16
    private $baseType;
17
18
    /**
19
     * HeaderFooterTokenParser constructor.
20
     *
21
     * @param array  $attributes optional attributes for the corresponding node
22
     * @param string $baseType
23
     *
24
     * @throws \InvalidArgumentException
25
     */
26 8
    public function __construct(array $attributes = [], string $baseType = HeaderFooterWrapper::BASETYPE_HEADER)
27
    {
28 8
        parent::__construct($attributes);
29
30 8
        $this->baseType = HeaderFooterWrapper::validateBaseType(strtolower($baseType));
31 8
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 3
    public function configureParameters(\Twig_Token $token): array
37
    {
38
        return [
39
            'type' => [
40 3
                'type' => self::PARAMETER_TYPE_VALUE,
41 3
                'default' => new \Twig_Node_Expression_Constant(null, $token->getLine()),
0 ignored issues
show
Deprecated Code introduced by
The class Twig_Node_Expression_Constant has been deprecated with message: since Twig 2.7, use "Twig\Node\Expression\ConstantExpression" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

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

Loading history...
42
            ],
43
            'properties' => [
44 3
                'type' => self::PARAMETER_TYPE_ARRAY,
45 3
                'default' => new \Twig_Node_Expression_Array([], $token->getLine()),
0 ignored issues
show
Deprecated Code introduced by
The class Twig_Node_Expression_Array has been deprecated with message: since Twig 2.7, use "Twig\Node\Expression\ArrayExpression" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

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

Loading history...
46
            ],
47
        ];
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     *
53
     * @throws \InvalidArgumentException
54
     */
55 3
    public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node
56
    {
57 3
        return new HeaderFooterNode($nodes, $this->getAttributes(), $lineNo, $this->getTag(), $this->baseType);
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63 11
    public function getTag()
64
    {
65 11
        return 'xls'.$this->baseType;
66
    }
67
}
68