class FluentPromise implements PromiseInterface (View source)

A decorated Promise which allows for chaining callbacks.

Traits

Methods

mixed
forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

static never
throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

__construct(PromiseInterface $guzzlePromise)

Create a new fluent promise instance.

PromiseInterface
then(callable|null $onFulfilled = null, callable|null $onRejected = null)

No description

PromiseInterface
otherwise(callable $onRejected)

No description

void
resolve($value)

No description

void
reject($reason)

No description

void
cancel()

No description

wait(bool $unwrap = true)

No description

string
getState()

No description

PromiseInterface
getGuzzlePromise()

Get the underlying Guzzle promise.

mixed
__call(string $method, array $parameters)

Proxy requests to the underlying promise interface and update the local promise.

Details

protected mixed forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

protected mixed forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

static protected never throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

never

Exceptions

BadMethodCallException

__construct(PromiseInterface $guzzlePromise)

Create a new fluent promise instance.

Parameters

PromiseInterface $guzzlePromise

PromiseInterface then(callable|null $onFulfilled = null, callable|null $onRejected = null)

No description

Parameters

callable|null $onFulfilled
callable|null $onRejected

Return Value

PromiseInterface

PromiseInterface otherwise(callable $onRejected)

No description

Parameters

callable $onRejected

Return Value

PromiseInterface

void resolve($value)

No description

Parameters

$value

Return Value

void

void reject($reason)

No description

Parameters

$reason

Return Value

void

void cancel()

No description

Return Value

void

wait(bool $unwrap = true)

No description

Parameters

bool $unwrap

string getState()

No description

Return Value

string

PromiseInterface getGuzzlePromise()

Get the underlying Guzzle promise.

Return Value

PromiseInterface

mixed __call(string $method, array $parameters)

Proxy requests to the underlying promise interface and update the local promise.

Parameters

string $method
array $parameters

Return Value

mixed

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.