Luminova Framework

PHP Luminova: Fulfilled Promise Object

Last updated: 2025-12-30 09:50:20

Fulfield promise object represents an already completed promise. Use Luminova’s Fulfilled Promise to simplify promise handling.

The Fulfilled class represents a promise that is already resolved with a known value.This is helpful when you want to return a precomputed result as a promise, without additional asynchronous logic.


Class Definition


constructor

Creates a promise that is already fulfilled (resolved).

public __construct(mixed $value)

Parameters

ParameterTypeDescription
$valuemixedThe value used to immediately resolve the promise.

Usage

use Luminova\Promise\Fulfilled;

$promise = new Fulfilled('Resolved Value');

$promise->then(function ($value) {
    echo "Resolved: " . $value; // Output: Resolved: Resolved Value
});