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 ( 0dcb27...fb7903 )
by Mewes
11:26
created

CellNode::compile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 0
cts 17
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 15
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('$cellProperties = ')
24
            ->subcompile($this->getNode('properties'))
25
            ->raw(';'.PHP_EOL)
26
            ->write(self::CODE_INSTANCE.'->startCell($cellValue, $cellProperties);'.PHP_EOL)
27
            ->write('unset($cellIndex, $cellValue, $cellProperties);'.PHP_EOL)
28
            ->write(self::CODE_INSTANCE.'->endCell();'.PHP_EOL);
29
    }
30
31
    /**
32
     * @return string[]
33
     */
34
    public function getAllowedParents(): array
35
    {
36
        return [
37
            RowNode::class,
38
        ];
39
    }
40
}
41