mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 01:30:15 +00:00
Merge "Use IteratorDecorator from core"
This commit is contained in:
commit
ddb3b68edc
|
@ -1106,7 +1106,6 @@
|
|||
"EchoHtmlDigestEmailFormatter": "includes/formatters/EchoHtmlDigestEmailFormatter.php",
|
||||
"EchoHtmlEmailFormatter": "includes/formatters/EchoHtmlEmailFormatter.php",
|
||||
"EchoIcon": "includes/formatters/EchoIcon.php",
|
||||
"EchoIteratorDecorator": "includes/iterator/IteratorDecorator.php",
|
||||
"EchoLocalCache": "includes/cache/LocalCache.php",
|
||||
"EchoMentionInSummaryPresentationModel": "includes/formatters/MentionInSummaryPresentationModel.php",
|
||||
"EchoMentionPresentationModel": "includes/formatters/MentionPresentationModel.php",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Applies a callback to all values returned from the iterator
|
||||
*/
|
||||
class EchoCallbackIterator extends EchoIteratorDecorator {
|
||||
class EchoCallbackIterator extends IteratorDecorator {
|
||||
/** @var callable */
|
||||
protected $callable;
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
* Alternatively wraps a recursive iterator to prevent recursing deeper
|
||||
* than the wrapped iterator.
|
||||
*/
|
||||
class EchoNotRecursiveIterator extends EchoIteratorDecorator implements RecursiveIterator {
|
||||
class EchoNotRecursiveIterator extends IteratorDecorator implements RecursiveIterator {
|
||||
public function hasChildren() {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue