Skip to content

Commit f6e15b7

Browse files
authored
Update Promise.php
1 parent f6d32c8 commit f6e15b7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/vennv/vapm/Promise.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public function finally(callable $callback): Promise
391391
return $this;
392392
}
393393

394-
/**
394+
/**
395395
* @throws Throwable
396396
*/
397397
public function useCallbacks(): void
@@ -417,11 +417,9 @@ public function useCallbacks(): void
417417
$this->checkStatus($callbacks, $this->return);
418418
}
419419
} else if ($this->isRejected()) {
420-
if (is_callable($this->callbackReject) && is_callable($this->callbackFinally)) {
421-
$this->result = call_user_func($this->callbackReject, $result);
422-
call_user_func($this->callbackFinally);
423-
}
420+
if (is_callable($this->callbackReject)) $this->result = call_user_func($this->callbackReject, $result);
424421
}
422+
if (is_callable($this->callbackFinally)) call_user_func($this->callbackFinally);
425423
}
426424

427425
/**
@@ -644,4 +642,4 @@ public static function race(array $promises): Promise
644642
return $promise;
645643
}
646644

647-
}
645+
}

0 commit comments

Comments
 (0)