mediawiki-extensions-Echo/includes/iterator/IteratorDecorator.php
Umherirrender d7556b1d96 Add missing @var and improve documentation
Change-Id: I729d5ff5afd4d45022fa0a4e42d060d35543b567
2020-12-17 20:55:49 +01:00

35 lines
619 B
PHP

<?php
/**
* Allows extending classes to decorate an Iterator with
* reduced boilerplate.
*/
abstract class EchoIteratorDecorator implements Iterator {
/** @var Iterator */
protected $iterator;
public function __construct( Iterator $iterator ) {
$this->iterator = $iterator;
}
public function current() {
return $this->iterator->current();
}
public function key() {
return $this->iterator->key();
}
public function next() {
return $this->iterator->next();
}
public function rewind() {
return $this->iterator->rewind();
}
public function valid() {
return $this->iterator->valid();
}
}