diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 97ad17a0..2192c6db 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -784,13 +784,28 @@ - - wrapContext($onFulfilledOrRejected)]]> - wrapContext($onFulfilledOrRejected)]]> - + + $onFulfilled + $onRejected + + wrapContext($onFulfilledOrRejected)]]> + wrapContext($onRejected)]]> $value + + ]]> + + + cancel + catch + finally + + + + + PromiseInterface + @@ -973,10 +988,6 @@ context]]> - - $onFulfilled - $onRejected - context]]> @@ -993,6 +1004,8 @@ $coroutine + catch + finally getClient getClient getClient @@ -1095,6 +1108,11 @@ $reduce($c, $value, $i++, $total) + + ]]> + ]]> + |T>]]> + @@ -1351,6 +1369,23 @@ ) + + + ]]> + ]]> + ]]> + ]]> + ]]> + ]]> + ]]> + ]]> + + + + + PromiseInterface + + mergeWith @@ -1366,4 +1401,14 @@ getCode()]]> + + + ]]> + ]]> + ]]> + ]]> + ]]> + ]]> + + diff --git a/src/Internal/Transport/CompletableResult.php b/src/Internal/Transport/CompletableResult.php index 6b2b5dc9..f7e66cad 100644 --- a/src/Internal/Transport/CompletableResult.php +++ b/src/Internal/Transport/CompletableResult.php @@ -77,8 +77,8 @@ public function __construct( $this->layer = $layer; $this->promise = $promise->then( - \Closure::fromCallable([$this, 'onFulfilled']), - \Closure::fromCallable([$this, 'onRejected']), + $this->onFulfilled(...), + $this->onRejected(...), ); } @@ -171,11 +171,17 @@ public function cancel(): void $this->promise()->cancel(); } + /** + * @deprecated + */ public function otherwise(callable $onRejected): PromiseInterface { return $this->catch($this->wrapContext($onRejected)); } + /** + * @deprecated + */ public function always(callable $onFulfilledOrRejected): PromiseInterface { return $this->finally($this->wrapContext($onFulfilledOrRejected));