Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 3... Línea 3...
3
declare(strict_types=1);
3
declare(strict_types=1);
Línea 4... Línea 4...
4
 
4
 
Línea 5... Línea 5...
5
namespace OpenSpout\Reader\XLSX;
5
namespace OpenSpout\Reader\XLSX;
-
 
6
 
6
 
7
use OpenSpout\Reader\Common\ColumnWidth;
Línea 7... Línea 8...
7
use OpenSpout\Reader\Common\ColumnWidth;
8
use OpenSpout\Reader\SheetWithMergeCellsInterface;
8
use OpenSpout\Reader\SheetWithVisibilityInterface;
9
use OpenSpout\Reader\SheetWithVisibilityInterface;
-
 
10
 
9
 
11
/**
10
/**
12
 * @implements SheetWithVisibilityInterface<RowIterator>
11
 * @implements SheetWithVisibilityInterface<RowIterator>
13
 * @implements SheetWithMergeCellsInterface<RowIterator>
12
 */
14
 */
13
final class Sheet implements SheetWithVisibilityInterface
15
final readonly class Sheet implements SheetWithVisibilityInterface, SheetWithMergeCellsInterface
Línea 14... Línea 16...
14
{
16
{
15
    /** @var RowIterator To iterate over sheet's rows */
17
    /** @var RowIterator To iterate over sheet's rows */
Línea 16... Línea 18...
16
    private readonly RowIterator $rowIterator;
18
    private RowIterator $rowIterator;
17
 
19
 
Línea 18... Línea 20...
18
    /** @var SheetHeaderReader To read the header of the sheet, containing for instance the col widths */
20
    /** @var SheetHeaderReader To read the header of the sheet, containing for instance the col widths */
19
    private readonly SheetHeaderReader $headerReader;
21
    private SheetHeaderReader $headerReader;
Línea 20... Línea 22...
20
 
22
 
21
    /** @var int Index of the sheet, based on order in the workbook (zero-based) */
23
    /** @var int Index of the sheet, based on order in the workbook (zero-based) */
Línea 22... Línea 24...
22
    private readonly int $index;
24
    private int $index;
23
 
25
 
-
 
26
    /** @var string Name of the sheet */
-
 
27
    private string $name;
-
 
28
 
Línea 24... Línea 29...
24
    /** @var string Name of the sheet */
29
    /** @var bool Whether the sheet was the active one */
25
    private readonly string $name;
30
    private bool $isActive;
26
 
31
 
27
    /** @var bool Whether the sheet was the active one */
32
    /** @var bool Whether the sheet is visible */
28
    private readonly bool $isActive;
33
    private bool $isVisible;
29
 
34
 
-
 
35
    /** @var list<string> Merge cells list ["C7:E7", "A9:D10"] */
30
    /** @var bool Whether the sheet is visible */
36
    private array $mergeCells;
-
 
37
 
-
 
38
    /**
31
    private readonly bool $isVisible;
39
     * @param RowIterator  $rowIterator    The corresponding row iterator
-
 
40
     * @param int          $sheetIndex     Index of the sheet, based on order in the workbook (zero-based)
-
 
41
     * @param string       $sheetName      Name of the sheet
-
 
42
     * @param bool         $isSheetActive  Whether the sheet was defined as active
-
 
43
     * @param bool         $isSheetVisible Whether the sheet is visible
-
 
44
     * @param list<string> $mergeCells     Merge cells list ["C7:E7", "A9:D10"]
32
 
45
     */
33
    /**
46
    public function __construct(
34
     * @param RowIterator $rowIterator    The corresponding row iterator
47
        RowIterator $rowIterator,
35
     * @param int         $sheetIndex     Index of the sheet, based on order in the workbook (zero-based)
48
        SheetHeaderReader $headerReader,
36
     * @param string      $sheetName      Name of the sheet
49
        int $sheetIndex,
37
     * @param bool        $isSheetActive  Whether the sheet was defined as active
50
        string $sheetName,
38
     * @param bool        $isSheetVisible Whether the sheet is visible
51
        bool $isSheetActive,
-
 
52
        bool $isSheetVisible,
39
     */
53
        array $mergeCells
Línea 40... Línea 54...
40
    public function __construct(RowIterator $rowIterator, SheetHeaderReader $headerReader, int $sheetIndex, string $sheetName, bool $isSheetActive, bool $isSheetVisible)
54
    ) {
41
    {
55
        $this->rowIterator = $rowIterator;
42
        $this->rowIterator = $rowIterator;
56
        $this->headerReader = $headerReader;
Línea 89... Línea 103...
89
     */
103
     */
90
    public function isVisible(): bool
104
    public function isVisible(): bool
91
    {
105
    {
92
        return $this->isVisible;
106
        return $this->isVisible;
93
    }
107
    }
-
 
108
 
-
 
109
    /**
-
 
110
     * @return list<string> Merge cells list ["C7:E7", "A9:D10"]
-
 
111
     */
-
 
112
    public function getMergeCells(): array
-
 
113
    {
-
 
114
        return $this->mergeCells;
-
 
115
    }
94
}
116
}