Page MenuHomeWickedGov Phorge

IteratorDecorator.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

IteratorDecorator.php

<?php
/**
* @license GPL-2.0-or-later
*/
/**
* Allows extending classes to decorate an Iterator with
* reduced boilerplate.
*
* @stable to extend
* @ingroup Maintenance
*/
abstract class IteratorDecorator implements Iterator {
protected Iterator $iterator;
/**
* @stable to call
*
* @param Iterator $iterator
*/
public function __construct( Iterator $iterator ) {
$this->iterator = $iterator;
}
/**
* @inheritDoc
* @stable to override
*/
#[\ReturnTypeWillChange]
public function current() {
return $this->iterator->current();
}
/**
* @inheritDoc
* @stable to override
*/
#[\ReturnTypeWillChange]
public function key() {
return $this->iterator->key();
}
/**
* @inheritDoc
* @stable to override
*/
public function next(): void {
$this->iterator->next();
}
/**
* @inheritDoc
* @stable to override
*/
public function rewind(): void {
$this->iterator->rewind();
}
/**
* @inheritDoc
* @stable to override
*/
public function valid(): bool {
return $this->iterator->valid();
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 18:36 (6 h, 11 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
f7/86/fff33a4c648030f7f7398fede850
Default Alt Text
IteratorDecorator.php (1 KB)

Event Timeline