diff --git a/src/Deferred.php b/src/Deferred.php index c748633f..9637461c 100644 --- a/src/Deferred.php +++ b/src/Deferred.php @@ -33,13 +33,13 @@ public function resolve($value = null): void { $this->promise(); - \call_user_func($this->resolveCallback, $value); + ($this->resolveCallback)($value); } public function reject(\Throwable $reason): void { $this->promise(); - \call_user_func($this->rejectCallback, $reason); + ($this->rejectCallback)($reason); } } diff --git a/tests/PromiseAdapter/CallbackPromiseAdapter.php b/tests/PromiseAdapter/CallbackPromiseAdapter.php index aa10436c..ec7ebab4 100644 --- a/tests/PromiseAdapter/CallbackPromiseAdapter.php +++ b/tests/PromiseAdapter/CallbackPromiseAdapter.php @@ -15,21 +15,21 @@ public function __construct(array $callbacks) public function promise(): ?PromiseInterface { - return call_user_func_array($this->callbacks['promise'], func_get_args()); + return ($this->callbacks['promise'])(...func_get_args()); } public function resolve(): ?PromiseInterface { - return call_user_func_array($this->callbacks['resolve'], func_get_args()); + return ($this->callbacks['resolve'])(...func_get_args()); } public function reject(): ?PromiseInterface { - return call_user_func_array($this->callbacks['reject'], func_get_args()); + return ($this->callbacks['reject'])(...func_get_args()); } public function settle(): ?PromiseInterface { - return call_user_func_array($this->callbacks['settle'], func_get_args()); + return ($this->callbacks['settle'])(...func_get_args()); } } diff --git a/tests/fixtures/SimpleTestCancellableThenable.php b/tests/fixtures/SimpleTestCancellableThenable.php index e433e221..10957690 100644 --- a/tests/fixtures/SimpleTestCancellableThenable.php +++ b/tests/fixtures/SimpleTestCancellableThenable.php @@ -22,7 +22,7 @@ public function cancel() $this->cancelCalled = true; if (is_callable($this->onCancel)) { - call_user_func($this->onCancel); + ($this->onCancel)(); } } }