class MappedIterator implements Iterator {
/** @var Iterator */
protected $baseIterator;
- /** @var Closure */
+ /** @var callable */
protected $vCallback;
/**
* The keys of the base iterator are reused verbatim.
*
* @param Iterator|Array $iter
- * @param Closure $vCallback
+ * @param callable $vCallback
* @throws MWException
*/
- public function __construct( $iter, Closure $vCallback ) {
+ public function __construct( $iter, $vCallback ) {
if ( is_array( $iter ) ) {
$this->baseIterator = new ArrayIterator( $iter );
} elseif ( $iter instanceof Iterator ) {
throw new MWException( "Invalid base iterator provided." );
}
$this->vCallback = $vCallback;
- }
+ }
/**
* @return void
* @since 1.21
*/
class ScopedCallback {
- /** @var Closure */
+ /** @var callable */
protected $callback;
/**
- * @param $callback Closure
+ * @param callable $callback
*/
- public function __construct( Closure $callback ) {
+ public function __construct( $callback ) {
$this->callback = $callback;
}
protected $mConn = null;
protected $mOpened = false;
- /** @var array of Closure */
+ /** @var callable[] */
protected $mTrxIdleCallbacks = array();
- /** @var array of Closure */
+ /** @var callable[] */
protected $mTrxPreCommitCallbacks = array();
protected $mTablePrefix;
* after the database is updated so that the jobs will see the data when they actually run.
* It can also be used for updates that easily cause deadlocks if locks are held too long.
*
- * @param Closure $callback
+ * @param callable $callback
* @since 1.20
*/
- final public function onTransactionIdle( Closure $callback ) {
+ final public function onTransactionIdle( $callback ) {
$this->mTrxIdleCallbacks[] = $callback;
if ( !$this->mTrxLevel ) {
$this->runOnTransactionIdleCallbacks();
* This is useful for updates that easily cause deadlocks if locks are held too long
* but where atomicity is strongly desired for these updates and some related updates.
*
- * @param Closure $callback
+ * @param callable $callback
* @since 1.22
*/
- final public function onTransactionPreCommitOrIdle( Closure $callback ) {
+ final public function onTransactionPreCommitOrIdle( $callback ) {
if ( $this->mTrxLevel ) {
$this->mTrxPreCommitCallbacks[] = $callback;
} else {