mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-25 00:05:29 +00:00
3af6a04c69
As far as I can tell, EchoIteratorDecorator is functionally identical to IteratorDecorator from includes/libs/iterators/ in core, so why have a separate copy? (EchoIteratorDecorator does pass through the return value of next() or rewind(), if any, but there shouldn't be any per the Iterator interface.) Change-Id: Ic763ec19c15f67d9c9b42ebffb88c52b9056ed22
20 lines
476 B
PHP
20 lines
476 B
PHP
<?php
|
|
|
|
/**
|
|
* Wraps a non-recursive iterator with methods to be recursive
|
|
* without children.
|
|
*
|
|
* Alternatively wraps a recursive iterator to prevent recursing deeper
|
|
* than the wrapped iterator.
|
|
*/
|
|
class EchoNotRecursiveIterator extends IteratorDecorator implements RecursiveIterator {
|
|
public function hasChildren() {
|
|
return false;
|
|
}
|
|
|
|
public function getChildren() {
|
|
// @phan-suppress-next-line PhanTypeMismatchReturnProbablyReal Never called
|
|
return null;
|
|
}
|
|
}
|