2014-07-30 03:18:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allows extending classes to decorate an Iterator with
|
|
|
|
* reduced boilerplate.
|
|
|
|
*/
|
|
|
|
abstract class EchoIteratorDecorator implements Iterator {
|
2020-12-16 21:31:09 +00:00
|
|
|
/** @var Iterator */
|
2014-07-30 03:18:48 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|