function reject
Creates a rejected promise for the supplied `$reason`.
If `$reason` is a value, it will be the rejection value of the returned promise.
If `$reason` is a promise, its completion value will be the rejected value of the returned promise.
This can be useful in situations where you need to reject a promise without throwing an exception. For example, it allows you to propagate a rejection with the value of another promise.
Return value
PromiseInterface<never>
1 string reference to 'reject'
- Create::promiseFor in vendor/
guzzlehttp/ promises/ src/ Create.php - Creates a promise for a value if the value is not a promise.
File
-
vendor/
react/ promise/ src/ functions.php, line 62
Namespace
React\PromiseCode
function reject(\Throwable $reason) : PromiseInterface {
return new RejectedPromise($reason);
}