You are here

public function RejectedPromise::reject in Zircon Profile 8

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

Reject the promise with the given reason.

Parameters

mixed $reason:

Throws

\RuntimeException if the promise is already resolved.

Overrides PromiseInterface::reject

File

vendor/guzzlehttp/promises/src/RejectedPromise.php, line 73

Class

RejectedPromise
A promise that has been rejected.

Namespace

GuzzleHttp\Promise

Code

public function reject($reason) {
  if ($reason !== $this->reason) {
    throw new \LogicException("Cannot reject a rejected promise");
  }
}