Changes to take care of unwanted (negative) indices

This commit is contained in:
Nils Rückmann
2015-09-07 02:17:17 +02:00
parent 367e5c0a20
commit c6f9dccff1
3 changed files with 8 additions and 7 deletions

View File

@@ -11,13 +11,14 @@ class BookListReverseIterator extends BookListIterator
$this->currentBook = $this->bookList->count() - 1;
}
/**
* (PHP 5 &gt;= 5.0.0)<br/>
* Move forward to next element
* @link http://php.net/manual/en/iterator.next.php
* @return void Any returned value is ignored.
*/
public function next()
{
$this->currentBook--;
}
public function valid()
{
return 0 <= $this->currentBook;
}
}