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

Breadcrumb

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

function HttpFulfilledPromise::then

Overrides Promise::then

File

vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php, line 21

Class

HttpFulfilledPromise

Namespace

Http\Client\Promise

Code

public function then(?callable $onFulfilled = null, ?callable $onRejected = null) {
    if (null === $onFulfilled) {
        return $this;
    }
    try {
        return new self($onFulfilled($this->response));
    } catch (Exception $e) {
        return new HttpRejectedPromise($e);
    }
}

API Navigation

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