Completed
Push — master ( 1ce931...36d359 )
by Adrien
05:27
created

Sheet::getName()   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
use Box\Spout\Reader\Wrapper\XMLReader;
7
8
/**
9
 * Class Sheet
10
 * Represents a sheet within a ODS file
11
 *
12
 * @package Box\Spout\Reader\ODS
13
 */
14
class Sheet implements SheetInterface
15
{
16
    /** @var \Box\Spout\Reader\ODS\RowIterator To iterate over sheet's rows */
17
    protected $rowIterator;
18
19
    /** @var int ID of the sheet */
20
    protected $id;
21
22
    /** @var int Index of the sheet, based on order in the workbook (zero-based) */
23
    protected $index;
24
25
    /** @var string Name of the sheet */
26
    protected $name;
27
28
    /**
29
     * @param XMLReader $xmlReader XML Reader, positioned on the "<table:table>" element
30
     * @param int $sheetIndex Index of the sheet, based on order in the workbook (zero-based)
31
     * @param \Box\Spout\Reader\ODS\ReaderOptions $options Reader's current options
32
     * @param string $sheetName Name of the sheet
33
     */
34 81
    public function __construct($xmlReader, $sheetIndex, $sheetName, $options)
35
    {
36 81
        $this->rowIterator = new RowIterator($xmlReader, $options);
37 81
        $this->index = $sheetIndex;
38 81
        $this->name = $sheetName;
39 81
    }
40
41
    /**
42
     * @api
43
     * @return \Box\Spout\Reader\ODS\RowIterator
44
     */
45 78
    public function getRowIterator()
46
    {
47 78
        return $this->rowIterator;
48
    }
49
50
    /**
51
     * @api
52
     * @return int Index of the sheet, based on order in the workbook (zero-based)
53
     */
54 3
    public function getIndex()
55
    {
56 3
        return $this->index;
57
    }
58
59
    /**
60
     * @api
61
     * @return string Name of the sheet
62
     */
63 3
    public function getName()
64
    {
65 3
        return $this->name;
66
    }
67
}
68