PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.5.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.5.1
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
fluent-cart / vendor / openspout / openspout / src / Reader / CSV / SheetIterator.php

SheetIterator.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.5.1, at vendor/openspout/openspout/src/Reader/CSV/SheetIterator.php

81 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\OpenSpout\Reader\CSV;
4
5 use FluentCart\OpenSpout\Reader\SheetIteratorInterface;
6 /**
7 * Iterate over CSV unique "sheet".
8 */
9 class SheetIterator implements SheetIteratorInterface
10 {
11 /** @var Sheet The CSV unique "sheet" */
12 protected $sheet;
13 /** @var bool Whether the unique "sheet" has already been read */
14 protected $hasReadUniqueSheet = \false;
15 /**
16 * @param Sheet $sheet Corresponding unique sheet
17 */
18 public function __construct($sheet)
19 {
20 $this->sheet = $sheet;
21 }
22 /**
23 * Rewind the Iterator to the first element.
24 *
25 * @see http://php.net/manual/en/iterator.rewind.php
26 */
27 #[\ReturnTypeWillChange]
28 public function rewind() : void
29 {
30 $this->hasReadUniqueSheet = \false;
31 }
32 /**
33 * Checks if current position is valid.
34 *
35 * @see http://php.net/manual/en/iterator.valid.php
36 */
37 #[\ReturnTypeWillChange]
38 public function valid() : bool
39 {
40 return !$this->hasReadUniqueSheet;
41 }
42 /**
43 * Move forward to next element.
44 *
45 * @see http://php.net/manual/en/iterator.next.php
46 */
47 #[\ReturnTypeWillChange]
48 public function next() : void
49 {
50 $this->hasReadUniqueSheet = \true;
51 }
52 /**
53 * Return the current element.
54 *
55 * @see http://php.net/manual/en/iterator.current.php
56 */
57 #[\ReturnTypeWillChange]
58 public function current() : Sheet
59 {
60 return $this->sheet;
61 }
62 /**
63 * Return the key of the current element.
64 *
65 * @see http://php.net/manual/en/iterator.key.php
66 */
67 #[\ReturnTypeWillChange]
68 public function key() : int
69 {
70 return 1;
71 }
72 /**
73 * Cleans up what was created to iterate over the object.
74 */
75 #[\ReturnTypeWillChange]
76 public function end() : void
77 {
78 // do nothing
79 }
80 }
81