Skip to content

Commit 09cd568

Browse files
committed
Fixed #14
1 parent 0ada55f commit 09cd568

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#Changelog
22
All notable changes will be documented in this file
33

4+
## 0.4.2
5+
6+
- [Internal] Fixed issue #14 - EntityIterator cursor bug
7+
48
## 0.4.1
59

610
- [Internal] Added ArrayAccess to EntityIterator

src/Entity/EntityIterator.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ public function key()
5252

5353
public function current()
5454
{
55+
while(!$this->offsetExists($this->cursor)) {
56+
$this->next();
57+
}
5558
return $this->data[$this->cursor];
5659
}
5760

@@ -159,8 +162,6 @@ public function offsetSet($offset, $value)
159162
*/
160163
public function offsetUnset($offset)
161164
{
162-
if ($this->offsetExists($offset)) {
163-
unset($this->data[$offset]);
164-
}
165+
unset($this->data[$offset]);
165166
}
166167
}

0 commit comments

Comments
 (0)