Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CallbackPromise.php

function CallbackPromise::execute

Overrides PromiseInterface::execute

File

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

Class

CallbackPromise
Evaluates promise callback.

Namespace

Prophecy\Promise

Code

public function execute(array $args, ObjectProphecy $object, MethodProphecy $method) {
    $callback = $this->callback;
    if ($callback instanceof Closure && method_exists('Closure', 'bind') && (new ReflectionFunction($callback))->getClosureThis() !== null) {
        $callback = Closure::bind($callback, $object) ?? $this->callback;
    }
    return call_user_func($callback, $args, $object, $method);
}
RSS feed
Powered by Drupal