You are here

public function CallbackPromise::execute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php \Prophecy\Promise\CallbackPromise::execute()

Evaluates promise callback.

Parameters

array $args:

ObjectProphecy $object:

MethodProphecy $method:

Return value

mixed

Overrides PromiseInterface::execute

File

vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php, line 56

Class

CallbackPromise
Callback promise.

Namespace

Prophecy\Promise

Code

public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) {
  $callback = $this->callback;
  if ($callback instanceof Closure && method_exists('Closure', 'bind')) {
    $callback = Closure::bind($callback, $object);
  }
  return call_user_func($callback, $args, $object, $method);
}