Completed
Push — develop_3.0 ( 40ee38...69b0fb )
by Adrien
01:52
created

Sheet::isVisible()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Box\Spout\Reader\CSV;
4
5
use Box\Spout\Reader\SheetInterface;
6
7
/**
8
 * Class Sheet
9
 */
10
class Sheet implements SheetInterface
11
{
12
    /** @var \Box\Spout\Reader\CSV\RowIterator To iterate over the CSV's rows */
13
    protected $rowIterator;
14
15
    /**
16
     * @param RowIterator $rowIterator Corresponding row iterator
17
     */
18 27
    public function __construct(RowIterator $rowIterator)
19
    {
20 27
        $this->rowIterator = $rowIterator;
21 27
    }
22
23
    /**
24
     * @return \Box\Spout\Reader\CSV\RowIterator
25
     */
26 26
    public function getRowIterator()
27
    {
28 26
        return $this->rowIterator;
29
    }
30
31
    /**
32
     * @return int Index of the sheet
33
     */
34 1
    public function getIndex()
35
    {
36 1
        return 0;
37
    }
38
39
    /**
40
     * @return string Name of the sheet - empty string since CSV does not support that
41
     */
42 1
    public function getName()
43
    {
44 1
        return '';
45
    }
46
47
    /**
48
     * @return bool Always TRUE as there is only one sheet
49
     */
50 1
    public function isActive()
51
    {
52 1
        return true;
53
    }
54
55
    /**
56
     * @return bool Always TRUE as the only sheet is always visible
57
     */
58
    public function isVisible()
59
    {
60
        return true;
61
    }
62
}
63