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

AlignmentNode::__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 AlignmentNode.
11
 */
12
class AlignmentNode extends BaseNode
13
{
14
    /**
15
     * @var string
16
     */
17
    private $alignment;
18
19
    /**
20
     * AlignmentNode constructor.
21
     *
22
     * @param array       $nodes
23
     * @param array       $attributes
24
     * @param int         $lineNo
25
     * @param string|null $tag
26
     * @param string      $alignment
27
     *
28
     * @throws InvalidArgumentException
29
     */
30
    public function __construct(array $nodes = [], array $attributes = [], int $lineNo = 0, string $tag = null, string $alignment = HeaderFooterWrapper::ALIGNMENT_CENTER)
31
    {
32
        parent::__construct($nodes, $attributes, $lineNo, $tag);
33
34
        $this->alignment = HeaderFooterWrapper::validateAlignment(strtolower($alignment));
35
    }
36
37
    /**
38
     * @param Twig_Compiler $compiler
39
     */
40
    public function compile(Twig_Compiler $compiler)
41
    {
42
        $compiler->addDebugInfo($this)
43
            ->write(self::CODE_FIX_CONTEXT)
44
            ->write(self::CODE_INSTANCE.'->startAlignment(')
45
                ->repr($this->alignment)
46
            ->raw(');'.PHP_EOL)
47
            ->write("ob_start();\n")
48
            ->subcompile($this->getNode('body'))
49
            ->write('$alignmentValue = trim(ob_get_clean());'.PHP_EOL)
50
            ->write(self::CODE_INSTANCE.'->endAlignment($alignmentValue);'.PHP_EOL)
51
            ->write('unset($alignmentValue);'.PHP_EOL);
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function getAllowedParents(): array
58
    {
59
        return [
60
            HeaderFooterNode::class,
61
        ];
62
    }
63
}
64