Total Complexity | 7 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class Iterator implements \Iterator |
||
8 | { |
||
9 | /** |
||
10 | * Spreadsheet to iterate. |
||
11 | * |
||
12 | * @var Spreadsheet |
||
13 | */ |
||
14 | private $subject; |
||
15 | |||
16 | /** |
||
17 | * Current iterator position. |
||
18 | * |
||
19 | * @var int |
||
20 | */ |
||
21 | private $position = 0; |
||
22 | |||
23 | /** |
||
24 | * Create a new worksheet iterator. |
||
25 | */ |
||
26 | 393 | public function __construct(Spreadsheet $subject) |
|
30 | 393 | } |
|
31 | |||
32 | /** |
||
33 | * Rewind iterator. |
||
34 | */ |
||
35 | 393 | public function rewind(): void |
|
36 | { |
||
37 | 393 | $this->position = 0; |
|
38 | 393 | } |
|
39 | |||
40 | /** |
||
41 | * Current Worksheet. |
||
42 | */ |
||
43 | 393 | public function current(): Worksheet |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * Current key. |
||
50 | */ |
||
51 | 1 | public function key(): int |
|
52 | { |
||
53 | 1 | return $this->position; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * Next value. |
||
58 | */ |
||
59 | 393 | public function next(): void |
|
62 | 393 | } |
|
63 | |||
64 | /** |
||
65 | * Are there more Worksheet instances available? |
||
66 | * |
||
67 | * @return bool |
||
68 | */ |
||
69 | 393 | public function valid() |
|
74 |