Passed
Pull Request — develop_3.0 (#496)
by Adrien
05:43 queued 03:06
created

Sheet::getRowIterator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Box\Spout\Reader\ODS;
4
5
use Box\Spout\Reader\SheetInterface;
6
7
/**
8
 * Class Sheet
9
 * Represents a sheet within a ODS file
10
 */
11
class Sheet implements SheetInterface
12
{
13
    /** @var \Box\Spout\Reader\ODS\RowIterator To iterate over sheet's rows */
14
    protected $rowIterator;
15
16
    /** @var int ID of the sheet */
17
    protected $id;
18
19
    /** @var int Index of the sheet, based on order in the workbook (zero-based) */
20
    protected $index;
21
22
    /** @var string Name of the sheet */
23
    protected $name;
24
25
    /** @var bool Whether the sheet was the active one */
26
    protected $isActive;
27
28
    /** @var bool Whether the sheet is visible */
29
    protected $isVisible;
30
31
    /**
32
     * @param RowIterator $rowIterator The corresponding row iterator
33
     * @param int $sheetIndex Index of the sheet, based on order in the workbook (zero-based)
34
     * @param string $sheetName Name of the sheet
35
     * @param bool $isSheetActive Whether the sheet was defined as active
36
     * @param bool $isSheetVisible Whether the sheet is visible
37
     */
38 29
    public function __construct($rowIterator, $sheetIndex, $sheetName, $isSheetActive, $isSheetVisible)
39
    {
40 29
        $this->rowIterator = $rowIterator;
41 29
        $this->index = $sheetIndex;
42 29
        $this->name = $sheetName;
43 29
        $this->isActive = $isSheetActive;
44 29
        $this->isVisible = $isSheetVisible;
45 29
    }
46
47
    /**
48
     * @return \Box\Spout\Reader\ODS\RowIterator
49
     */
50 26
    public function getRowIterator()
51
    {
52 26
        return $this->rowIterator;
53
    }
54
55
    /**
56
     * @return int Index of the sheet, based on order in the workbook (zero-based)
57
     */
58 1
    public function getIndex()
59
    {
60 1
        return $this->index;
61
    }
62
63
    /**
64
     * @return string Name of the sheet
65
     */
66 1
    public function getName()
67
    {
68 1
        return $this->name;
69
    }
70
71
    /**
72
     * @return bool Whether the sheet was defined as active
73
     */
74 2
    public function isActive()
75
    {
76 2
        return $this->isActive;
77
    }
78
79
    /**
80
     * @return bool Whether the sheet is visible
81
     */
82 1
    public function isVisible()
83
    {
84 1
        return $this->isVisible;
85
    }
86
}
87