Fix type check

This commit is contained in:
Jake Barnby 2022-04-22 17:49:46 +12:00
parent 4a2b620611
commit e79343bae7
No known key found for this signature in database
GPG key ID: A4674EBC0E404657

View file

@ -11,12 +11,12 @@ class CoroutinePromiseAdapter implements PromiseAdapter
{
public function isThenable($value): bool
{
return $value instanceof Promise;
return $value instanceof CoroutinePromise;
}
public function convertThenable($thenable): Promise
{
if (!$thenable instanceof Promise) {
if (!$thenable instanceof CoroutinePromise) {
throw new InvariantViolation('Expected instance of SwoolePromise, got ' . Utils::printSafe($thenable));
}
return new Promise($thenable, $this);