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

Breadcrumb

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

function CallbackPromise::__construct

Initializes callback promise.

Parameters

callable $callback Custom callback:

Throws

\Prophecy\Exception\InvalidArgumentException

File

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

Class

CallbackPromise
Evaluates promise callback.

Namespace

Prophecy\Promise

Code

public function __construct($callback) {
    if (!is_callable($callback)) {
        throw new InvalidArgumentException(sprintf('Callable expected as an argument to CallbackPromise, but got %s.', gettype($callback)));
    }
    $this->callback = $callback;
}
RSS feed
Powered by Drupal