Kraken\Promise\PromiseCancelled::then PHP Метод

then() публичный Метод

public then ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
$onFulfilled callable
$onRejected callable
$onCancel callable
    public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null)
    {
        if (null === $onCancel) {
            return $this;
        }
        try {
            return Promise::doResolve($onCancel($this->getReason()))->then(function () {
                return Promise::doCancel($this->getReason());
            }, function () {
                return Promise::doCancel($this->getReason());
            });
        } catch (Error $ex) {
        } catch (Exception $ex) {
        }
        return Promise::doCancel($this->getReason());
    }