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

DocumentNode   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A compile() 0 16 1
A getAllowedParents() 0 4 1
1
<?php
2
3
namespace Erelke\TwigSpreadsheetBundle\Twig\Node;
4
5
use Erelke\TwigSpreadsheetBundle\Wrapper\PhpSpreadsheetWrapper;
6
use Twig\Compiler as Twig_Compiler;
7
8
/**
9
 * Class DocumentNode.
10
 */
11
class DocumentNode extends BaseNode
12
{
13
    /**
14
     * @param Twig_Compiler $compiler
15
     */
16
    public function compile(Twig_Compiler $compiler)
17
    {
18
        $compiler->addDebugInfo($this)
19
            ->write("ob_start();\n")
20
            ->write(self::CODE_INSTANCE.' = new '.PhpSpreadsheetWrapper::class.'($context, $this->env, ')
21
                ->repr($this->attributes)
22
            ->raw(');'.PHP_EOL)
23
            ->write(self::CODE_INSTANCE.'->startDocument(')
24
                ->subcompile($this->getNode('properties'))
25
            ->raw(');'.PHP_EOL)
26
            ->subcompile($this->getNode('body'))
27
            ->addDebugInfo($this)
28
            ->write("ob_end_clean();\n")
29
            ->write(self::CODE_INSTANCE.'->endDocument();'.PHP_EOL)
30
            ->write('unset('.self::CODE_INSTANCE.');'.PHP_EOL);
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    public function getAllowedParents(): array
37
    {
38
        return [];
39
    }
40
}
41