1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-24 18:13:00 +01:00

ChunkedIterator for Traversable - Fixed

This commit is contained in:
hakre 2013-09-08 11:04:12 +02:00
parent 875452a58b
commit 1f55162736

View File

@ -25,16 +25,16 @@ class ChunkedIterator extends \IteratorIterator
public function rewind()
{
parent::rewind();
$this->next();
}
public function next()
{
$this->chunk = array();
$inner = $this->getInnerIterator();
for ($i = 0; $i < $this->chunkSize && $inner->valid(); $i++) {
$this->chunk[] = $inner->current();
$inner->next();
for ($i = 0; $i < $this->chunkSize && parent::valid(); $i++) {
$this->chunk[] = parent::current();
parent::next();
}
}