Page MenuHomeWickedGov Phorge

CallbackIterator.php
No OneTemporary

Size
573 B
Referenced Files
None
Subscribers
None

CallbackIterator.php

<?php
namespace MediaWiki\Extension\Notifications\Iterator;
use Iterator;
use IteratorDecorator;
/**
* Applies a callback to all values returned from the iterator
*/
class CallbackIterator extends IteratorDecorator {
/** @var callable */
protected $callable;
public function __construct( Iterator $iterator, $callable ) {
parent::__construct( $iterator );
$this->callable = $callable;
}
public function current() {
return call_user_func( $this->callable, $this->iterator->current() );
}
}
class_alias( CallbackIterator::class, 'EchoCallbackIterator' );

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 17:16 (1 d, 12 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ba/26/4b808650a5dd7f58c97d33b324e5
Default Alt Text
CallbackIterator.php (573 B)

Event Timeline