Kraken\Promise\PromiseCancelled::done PHP Method

done() public method

public done ( callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null )
$onFulfilled callable
$onRejected callable
$onCancel callable
    public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onCancel = null)
    {
        if (null === $onCancel) {
            $this->throwError($this->getReason());
        }
        $result = $onCancel($this->getReason());
        if ($result instanceof self) {
            $this->throwError($result->getReason());
        }
        if ($result instanceof PromiseInterface) {
            $result->done();
        }
    }