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 ( b43f4a...009a79 )
by Mewes
10:25
created

RowWrapper::start()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3.0261

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 6
cts 7
cp 0.8571
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
nc 3
nop 1
crap 3.0261
1
<?php
2
3
namespace MewesK\TwigSpreadsheetBundle\Wrapper;
4
5
/**
6
 * Class SheetWrapper.
7
 */
8
class RowWrapper extends BaseWrapper
9
{
10
    /**
11
     * @var SheetWrapper
12
     */
13
    protected $sheetWrapper;
14
15
    /**
16
     * RowWrapper constructor.
17
     *
18
     * @param array             $context
19
     * @param \Twig_Environment $environment
20
     * @param SheetWrapper      $sheetWrapper
21
     */
22 115
    public function __construct(array $context, \Twig_Environment $environment, SheetWrapper $sheetWrapper)
23
    {
24 115
        parent::__construct($context, $environment);
25
26 115
        $this->sheetWrapper = $sheetWrapper;
27 115
    }
28
29
    /**
30
     * @param null|int $index
31
     *
32
     * @throws \LogicException
33
     */
34 77
    public function start(int $index = null)
35
    {
36 77
        if ($this->sheetWrapper->getObject() === null) {
37
            throw new \LogicException();
38
        }
39
40 77
        if ($index === null) {
41 77
            $this->sheetWrapper->increaseRow();
42
        } else {
43 3
            $this->sheetWrapper->setRow($index);
44
        }
45 77
    }
46
47
    /**
48
     * @throws \LogicException
49
     */
50 73
    public function end()
51
    {
52 73
        if ($this->sheetWrapper->getObject() === null) {
53
            throw new \LogicException();
54
        }
55
56 73
        $this->sheetWrapper->setColumn(null);
57 73
    }
58
}
59