function FulfilledPromise::then
Same name in this branch
- 11.1.x vendor/react/promise/src/Internal/FulfilledPromise.php \React\Promise\Internal\FulfilledPromise::then()
- 11.1.x vendor/guzzlehttp/promises/src/FulfilledPromise.php \GuzzleHttp\Promise\FulfilledPromise::then()
Overrides Promise::then
File
-
vendor/
php-http/ promise/ src/ FulfilledPromise.php, line 25
Class
- FulfilledPromise
- A promise already fulfilled.
Namespace
Http\PromiseCode
public function then(?callable $onFulfilled = null, ?callable $onRejected = null) {
if (null === $onFulfilled) {
return $this;
}
try {
return new self($onFulfilled($this->result));
} catch (\Exception $e) {
return new RejectedPromise($e);
}
}