function Promise::__construct
Same name in this branch
- 11.1.x vendor/php-http/guzzle7-adapter/src/Promise.php \Http\Adapter\Guzzle7\Promise::__construct()
- 11.1.x vendor/guzzlehttp/promises/src/Promise.php \GuzzleHttp\Promise\Promise::__construct()
Parameters
callable(callable(T):void,callable(\Throwable):void):void $resolver:
(callable(callable(T):void,callable(\Throwable):void):void)|null $canceller:
File
-
vendor/
react/ promise/ src/ Promise.php, line 32
Class
- Promise
- @template T @template-implements PromiseInterface<T>
Namespace
React\PromiseCode
public function __construct(callable $resolver, ?callable $canceller = null) {
$this->canceller = $canceller;
// Explicitly overwrite arguments with null values before invoking
// resolver function. This ensure that these arguments do not show up
// in the stack trace in PHP 7+ only.
$cb = $resolver;
$resolver = $canceller = null;
$this->call($cb);
}