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

AlignmentTokenParser   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 40
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A createNode() 0 4 1
A getTag() 0 4 1
1
<?php
2
3
namespace MewesK\TwigSpreadsheetBundle\Twig\TokenParser;
4
5
use MewesK\TwigSpreadsheetBundle\Twig\Node\AlignmentNode;
6
use MewesK\TwigSpreadsheetBundle\Wrapper\HeaderFooterWrapper;
7
8
/**
9
 * Class AlignmentTokenParser.
10
 */
11
class AlignmentTokenParser extends BaseTokenParser
12
{
13
    /**
14
     * @var string
15
     */
16
    private $alignment;
17
18
    /**
19
     * AlignmentTokenParser constructor.
20
     *
21
     * @param array  $attributes optional attributes for the corresponding node
22
     * @param string $alignment
23
     *
24
     * @throws \InvalidArgumentException
25
     */
26 8
    public function __construct(array $attributes = [], string $alignment = HeaderFooterWrapper::ALIGNMENT_CENTER)
27
    {
28 8
        parent::__construct($attributes);
29
30 8
        $this->alignment = HeaderFooterWrapper::validateAlignment(strtolower($alignment));
31 8
    }
32
33
    /**
34
     * {@inheritdoc}
35
     *
36
     * @throws \InvalidArgumentException
37
     */
38 3
    public function createNode(array $nodes = [], int $lineNo = 0): \Twig_Node
39
    {
40 3
        return new AlignmentNode($nodes, $this->getAttributes(), $lineNo, $this->getTag(), $this->alignment);
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 11
    public function getTag()
47
    {
48 11
        return 'xls'.$this->alignment;
49
    }
50
}
51