Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. functions.php

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\Promise

Code

function reject(\Throwable $reason) : PromiseInterface {
    return new RejectedPromise($reason);
}
RSS feed
Powered by Drupal