You are here

public function Promise::reject in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/promises/src/Promise.php \GuzzleHttp\Promise\Promise::reject()

Reject the promise with the given reason.

Parameters

mixed $reason:

Throws

\RuntimeException if the promise is already resolved.

Overrides PromiseInterface::reject

3 calls to Promise::reject()
Promise::cancel in vendor/guzzlehttp/promises/src/Promise.php
Cancels the promise if possible.
Promise::invokeWaitFn in vendor/guzzlehttp/promises/src/Promise.php
Promise::waitIfPending in vendor/guzzlehttp/promises/src/Promise.php

File

vendor/guzzlehttp/promises/src/Promise.php, line 112

Class

Promise
Promises/A+ implementation that avoids recursion when possible.

Namespace

GuzzleHttp\Promise

Code

public function reject($reason) {
  $this
    ->settle(self::REJECTED, $reason);
}