| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\Notifications\Iterator; |
| 4 | |
| 5 | use IteratorDecorator; |
| 6 | use RecursiveIterator; |
| 7 | |
| 8 | /** |
| 9 | * Wraps a non-recursive iterator with methods to be recursive |
| 10 | * without children. |
| 11 | * |
| 12 | * Alternatively wraps a recursive iterator to prevent recursing deeper |
| 13 | * than the wrapped iterator. |
| 14 | */ |
| 15 | class NotRecursiveIterator extends IteratorDecorator implements RecursiveIterator { |
| 16 | public function hasChildren(): bool { |
| 17 | return false; |
| 18 | } |
| 19 | |
| 20 | public function getChildren(): ?RecursiveIterator { |
| 21 | // @phan-suppress-next-line PhanTypeMismatchReturnProbablyReal Never called |
| 22 | return null; |
| 23 | } |
| 24 | } |