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 ( 99c051...63fac8 )
by Mewes
18:46
created

CellNode::compile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 16
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 14
nc 1
nop 1
crap 2
1
<?php
2
3
namespace MewesK\TwigSpreadsheetBundle\Twig\Node;
4
5
/**
6
 * Class CellNode.
7
 */
8
class CellNode extends BaseNode
9
{
10
    /**
11
     * @param \Twig_Compiler $compiler
12
     */
13
    public function compile(\Twig_Compiler $compiler)
14
    {
15
        $compiler->addDebugInfo($this)
16
            ->write(self::CODE_FIX_CONTEXT)
17
            ->write(self::CODE_INSTANCE.'->setCellIndex(')
18
                ->subcompile($this->getNode('index'))
19
            ->raw(');'.PHP_EOL)
20
            ->write("ob_start();\n")
21
            ->subcompile($this->getNode('body'))
22
            ->write('$cellValue = trim(ob_get_clean());'.PHP_EOL)
23
            ->write(self::CODE_INSTANCE.'->startCell($cellValue, ')
24
                ->subcompile($this->getNode('properties'))
25
            ->raw(');'.PHP_EOL)
26
            ->write(self::CODE_INSTANCE.'->endCell();'.PHP_EOL)
27
            ->write('unset($cellValue);'.PHP_EOL);
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function getAllowedParents(): array
34
    {
35
        return [
36
            RowNode::class,
37
        ];
38
    }
39
}
40