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

Sheet   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 84.62%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 53
ccs 11
cts 13
cp 0.8462
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRowIterator() 0 4 1
A getIndex() 0 4 1
A getName() 0 4 1
A isActive() 0 4 1
A isVisible() 0 4 1
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