React\Promise\SimpleFulfilledTestThenable::then PHP Method

then() public method

public then ( callable $onFulfilled = null, callable $onRejected = null )
$onFulfilled callable
$onRejected callable
    public function then(callable $onFulfilled = null, callable $onRejected = null)
    {
        try {
            if ($onFulfilled) {
                $onFulfilled('foo');
            }
            return new self();
        } catch (\Throwable $exception) {
            return new RejectedPromise($exception);
        } catch (\Exception $exception) {
            return new RejectedPromise($exception);
        }
    }
SimpleFulfilledTestThenable