[ Index ]

PHP Cross Reference of phpBB-3.3.5-deutsch

title

Body

[close]

/vendor/guzzlehttp/promises/src/ -> PromiseInterface.php (summary)

(no description)

File Size: 97 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

PromiseInterface:: (7 methods):
  then()
  otherwise()
  getState()
  resolve()
  reject()
  cancel()
  wait()


Interface: PromiseInterface  - X-Ref

A promise represents the eventual result of an asynchronous operation.

The primary way of interacting with a promise is through its then method,
which registers callbacks to receive either a promise’s eventual value or
the reason why the promise cannot be fulfilled.

then(callable $onFulfilled = null,callable $onRejected = null)   X-Ref
Appends fulfillment and rejection handlers to the promise, and returns
a new promise resolving to the return value of the called handler.

param: callable $onFulfilled Invoked when the promise fulfills.
param: callable $onRejected  Invoked when the promise is rejected.
return: PromiseInterface

otherwise(callable $onRejected)   X-Ref
Appends a rejection handler callback to the promise, and returns a new
promise resolving to the return value of the callback if it is called,
or to its original fulfillment value if the promise is instead
fulfilled.

param: callable $onRejected Invoked when the promise is rejected.
return: PromiseInterface

getState()   X-Ref
Get the state of the promise ("pending", "rejected", or "fulfilled").

The three states can be checked against the constants defined on
PromiseInterface: PENDING, FULFILLED, and REJECTED.

return: string

resolve($value)   X-Ref
Resolve the promise with the given value.

param: mixed $value

reject($reason)   X-Ref
Reject the promise with the given reason.

param: mixed $reason

cancel()   X-Ref
Cancels the promise if possible.


wait($unwrap = true)   X-Ref
Waits until the promise completes if possible.

Pass $unwrap as true to unwrap the result of the promise, either
returning the resolved value or throwing the rejected exception.

If the promise cannot be waited on, then the promise will be rejected.

param: bool $unwrap
return: mixed



Generated: Mon Oct 4 17:42:11 2021 Cross-referenced by PHPXref 0.7.1