Created
July 31, 2014 13:47
-
-
Save dhotson/4d61ec0b332614a9e723 to your computer and use it in GitHub Desktop.
Pheasant patch to make tests pass in HHVM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Pheasant/Database/Mysqli/ResultIterator.php b/lib/Pheasant/Database/Mysqli/ResultIterator.php | |
index 17efd64..dbcd755 100755 | |
--- a/lib/Pheasant/Database/Mysqli/ResultIterator.php | |
+++ b/lib/Pheasant/Database/Mysqli/ResultIterator.php | |
@@ -5,7 +5,7 @@ namespace Pheasant\Database\Mysqli; | |
class ResultIterator implements \SeekableIterator, \Countable | |
{ | |
private $_result; | |
- private $_position; | |
+ private $_position = 0; | |
private $_currentRow; | |
private $_hydrator; | |
@@ -67,7 +67,9 @@ class ResultIterator implements \SeekableIterator, \Countable | |
*/ | |
public function current() | |
{ | |
- return $this->_currentRow; | |
+ return $this->_currentRow | |
+ ? $this->_currentRow | |
+ : ($this->_currentRow = $this->_fetch()); | |
} | |
/** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment