PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.5
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.5
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / Spout / Reader / CSV / SheetIterator.php

SheetIterator.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.5, at app/Services/Spout/Reader/CSV/SheetIterator.php

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