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

Breadcrumb

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

function Create::rejectionFor

Creates a rejected promise for a reason if the reason is not a promise. If the provided reason is a promise, then it is returned as-is.

Parameters

mixed $reason Promise or reason.:

1 call to Create::rejectionFor()
Promise::then in vendor/guzzlehttp/promises/src/Promise.php
Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.

File

vendor/guzzlehttp/promises/src/Create.php, line 39

Class

Create

Namespace

GuzzleHttp\Promise

Code

public static function rejectionFor($reason) : PromiseInterface {
    if ($reason instanceof PromiseInterface) {
        return $reason;
    }
    return new RejectedPromise($reason);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal