class AuthorCollectionIterator
@template-implements Iterator<int,Author>
Hierarchy
- class \PharIo\Manifest\AuthorCollectionIterator implements \Iterator
Expanded class hierarchy of AuthorCollectionIterator
File
-
vendor/
phar-io/ manifest/ src/ values/ AuthorCollectionIterator.php, line 17
Namespace
PharIo\ManifestView source
class AuthorCollectionIterator implements Iterator {
/** @var Author[] */
private $authors;
/** @var int */
private $position = 0;
public function __construct(AuthorCollection $authors) {
$this->authors = $authors->getAuthors();
}
public function rewind() : void {
$this->position = 0;
}
public function valid() : bool {
return $this->position < count($this->authors);
}
public function key() : int {
return $this->position;
}
public function current() : Author {
return $this->authors[$this->position];
}
public function next() : void {
$this->position++;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
AuthorCollectionIterator::$authors | private | property | @var Author[] |
AuthorCollectionIterator::$position | private | property | @var int |
AuthorCollectionIterator::current | public | function | |
AuthorCollectionIterator::key | public | function | |
AuthorCollectionIterator::next | public | function | |
AuthorCollectionIterator::rewind | public | function | |
AuthorCollectionIterator::valid | public | function | |
AuthorCollectionIterator::__construct | public | function |