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

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