Skip to content

Commit

Permalink
fix!
Browse files Browse the repository at this point in the history
  • Loading branch information
VennDev authored Aug 30, 2024
1 parent 13cc0ba commit c6b443a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vennv/vapm/Async.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ public function getId(): int
public static function await(mixed $await): mixed
{
if (!$await instanceof Promise && !$await instanceof Async) {
if (!Utils::isClass(Async::class)) {
throw new RuntimeException(Error::ASYNC_AWAIT_MUST_CALL_IN_ASYNC_FUNCTION);
}
if (is_callable($await)) {
$await = new Async($await);
} else {
if (!Utils::isClass(Async::class)) {
throw new RuntimeException(Error::ASYNC_AWAIT_MUST_CALL_IN_ASYNC_FUNCTION);
}
return $await;
}
}
Expand All @@ -82,7 +82,7 @@ public static function await(mixed $await): mixed
}
} while ($return === null);

return $return instanceof Promise ? $return->getResult() : $return;
return $return->getResult();
}

}

0 comments on commit c6b443a

Please sign in to comment.