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

Breadcrumb

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

function Promise::finally

Overrides PromiseInterface::finally

1 call to Promise::finally()
Promise::always in vendor/react/promise/src/Promise.php

File

vendor/react/promise/src/Promise.php, line 97

Class

Promise
@template T @template-implements PromiseInterface<T>

Namespace

React\Promise

Code

public function finally(callable $onFulfilledOrRejected) : PromiseInterface {
    return $this->then(static function ($value) use ($onFulfilledOrRejected) : PromiseInterface {
        return resolve($onFulfilledOrRejected())->then(function () use ($value) {
            return $value;
        });
    }, static function (\Throwable $reason) use ($onFulfilledOrRejected) : PromiseInterface {
        return resolve($onFulfilledOrRejected())->then(function () use ($reason) : RejectedPromise {
            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