Completed
Push — master ( 4a6546...7f8b95 )
by Adrien
02:30
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\CSV;
4
5
use Box\Spout\Reader\SheetInterface;
6
7
/**
8
 * Class Sheet
9
 *
10
 * @package Box\Spout\Reader\CSV
11
 */
12
class Sheet implements SheetInterface
13
{
14
    /** @var \Box\Spout\Reader\CSV\RowIterator To iterate over the CSV's rows */
15
    protected $rowIterator;
16
17
    /**
18
     * @param resource $filePointer Pointer to the CSV file to read
19
     * @param \Box\Spout\Reader\CSV\ReaderOptions $options
20
     * @param \Box\Spout\Common\Helper\GlobalFunctionsHelper $globalFunctionsHelper
21
     */
22 81
    public function __construct($filePointer, $options, $globalFunctionsHelper)
23
    {
24 81
        $this->rowIterator = new RowIterator($filePointer, $options, $globalFunctionsHelper);
25 81
    }
26
27
    /**
28
     * @api
29
     * @return \Box\Spout\Reader\CSV\RowIterator
30
     */
31 78
    public function getRowIterator()
32
    {
33 78
        return $this->rowIterator;
34
    }
35
36
    /**
37
     * @api
38
     * @return int Index of the sheet
39
     */
40 3
    public function getIndex()
41
    {
42 3
        return 0;
43
    }
44
45
    /**
46
     * @api
47
     * @return string Name of the sheet - empty string since CSV does not support that
48
     */
49 3
    public function getName()
50
    {
51 3
        return '';
52
    }
53
54
    /**
55
     * @api
56
     * @return bool Always TRUE as there is only one sheet
57
     */
58 3
    public function isActive()
59
    {
60 3
        return true;
61
    }
62
}
63