php-src/ext/spl/internal/emptyiterator.inc

62 lines
982 B
PHP
Raw Normal View History

2004-04-27 18:15:00 +00:00
<?php
/** @file emptyiterator.inc
2004-10-31 20:59:39 +00:00
* @ingroup SPL
* @brief class EmptyIterator
* @author Marcus Boerger
2009-05-02 01:52:54 +00:00
* @date 2003 - 2009
*
* SPL - Standard PHP Library
*/
2004-10-31 20:59:39 +00:00
/** @ingroup SPL
2004-04-27 18:15:00 +00:00
* @brief An empty Iterator
* @author Marcus Boerger
* @version 1.0
2005-02-17 00:24:57 +00:00
* @since PHP 5.1
2004-04-27 18:15:00 +00:00
*/
class EmptyIterator implements Iterator
{
/** No operation.
* @return void
*/
2004-04-27 18:15:00 +00:00
function rewind()
{
// nothing to do
}
/** @return \c false
*/
2004-04-27 18:15:00 +00:00
function valid()
{
return false;
}
/** This function must not be called. It throws an exception upon access.
* @throw Exception
* @return void
*/
2004-04-27 18:15:00 +00:00
function current()
{
throw new Exception('Accessing the value of an EmptyIterator');
}
/** This function must not be called. It throws an exception upon access.
* @throw Exception
* @return void
*/
2004-04-27 18:15:00 +00:00
function key()
{
throw new Exception('Accessing the key of an EmptyIterator');
}
/** No operation.
* @return void
*/
2004-04-27 18:15:00 +00:00
function next()
{
// nothing to do
}
}
?>