You are here

public function NotPromiseInstance::then in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/promises/tests/NotPromiseInstance.php \GuzzleHttp\Promise\Tests\NotPromiseInstance::then()

Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.

Parameters

callable $onFulfilled Invoked when the promise fulfills.:

callable $onRejected Invoked when the promise is rejected.:

Return value

PromiseInterface

Overrides Thennable::then

1 call to NotPromiseInstance::then()
NotPromiseInstance::otherwise in vendor/guzzlehttp/promises/tests/NotPromiseInstance.php
Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.

File

vendor/guzzlehttp/promises/tests/NotPromiseInstance.php, line 16

Class

NotPromiseInstance

Namespace

GuzzleHttp\Promise\Tests

Code

public function then(callable $res = null, callable $rej = null) {
  return $this->nextPromise
    ->then($res, $rej);
}