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.
Completed
Push — master ( fd551c...0e9a28 )
by Mewes
15:42 queued 08:25
created

DocumentNode   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 32
ccs 19
cts 19
cp 1
rs 10
c 0
b 0
f 0

2 Methods

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