Skip to content

Commit

Permalink
Update Promise.php
Browse files Browse the repository at this point in the history
  • Loading branch information
VennDev authored Aug 3, 2024
1 parent f6d32c8 commit f6e15b7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/vennv/vapm/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public function finally(callable $callback): Promise
return $this;
}

/**
/**
* @throws Throwable
*/
public function useCallbacks(): void
Expand All @@ -417,11 +417,9 @@ public function useCallbacks(): void
$this->checkStatus($callbacks, $this->return);
}
} else if ($this->isRejected()) {
if (is_callable($this->callbackReject) && is_callable($this->callbackFinally)) {
$this->result = call_user_func($this->callbackReject, $result);
call_user_func($this->callbackFinally);
}
if (is_callable($this->callbackReject)) $this->result = call_user_func($this->callbackReject, $result);
}
if (is_callable($this->callbackFinally)) call_user_func($this->callbackFinally);
}

/**
Expand Down Expand Up @@ -644,4 +642,4 @@ public static function race(array $promises): Promise
return $promise;
}

}
}

0 comments on commit f6e15b7

Please sign in to comment.