Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace OpenSpout\Reader\CSV;
6
 
7
use OpenSpout\Reader\SheetInterface;
8
 
9
/**
10
 * @implements SheetInterface<RowIterator>
11
 */
12
final class Sheet implements SheetInterface
13
{
14
    /** @var RowIterator To iterate over the CSV's rows */
15
    private readonly RowIterator $rowIterator;
16
 
17
    /**
18
     * @param RowIterator $rowIterator Corresponding row iterator
19
     */
20
    public function __construct(RowIterator $rowIterator)
21
    {
22
        $this->rowIterator = $rowIterator;
23
    }
24
 
25
    public function getRowIterator(): RowIterator
26
    {
27
        return $this->rowIterator;
28
    }
29
 
30
    /**
31
     * @return int Index of the sheet
32
     */
33
    public function getIndex(): int
34
    {
35
        return 0;
36
    }
37
 
38
    /**
39
     * @return string Name of the sheet - empty string since CSV does not support that
40
     */
41
    public function getName(): string
42
    {
43
        return '';
44
    }
45
 
46
    /**
47
     * @return bool Always TRUE as there is only one sheet
48
     */
49
    public function isActive(): bool
50
    {
51
        return true;
52
    }
53
}