Merge "Use IteratorDecorator from core"

This commit is contained in:
jenkins-bot 2022-05-03 15:23:04 +00:00 committed by Gerrit Code Review
commit ddb3b68edc
4 changed files with 2 additions and 37 deletions

View file

@ -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",

View file

@ -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;

View file

@ -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();
}
}

View file

@ -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;
}