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

AlignmentNode::getAllowedParents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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