diff --git a/src/Internal/Transport/CompletableResult.php b/src/Internal/Transport/CompletableResult.php index 91f82f68..4d1e7472 100644 --- a/src/Internal/Transport/CompletableResult.php +++ b/src/Internal/Transport/CompletableResult.php @@ -110,7 +110,7 @@ public function cancel(): void } /** - * @deprecated + * @deprecated use {@see catch()} instead */ public function otherwise(callable $onRejected): PromiseInterface { @@ -118,7 +118,7 @@ public function otherwise(callable $onRejected): PromiseInterface } /** - * @deprecated + * @deprecated use {@see finally()} instead */ public function always(callable $onFulfilledOrRejected): PromiseInterface { diff --git a/src/Internal/Workflow/Process/Scope.php b/src/Internal/Workflow/Process/Scope.php index 94972bd4..7eeee570 100644 --- a/src/Internal/Workflow/Process/Scope.php +++ b/src/Internal/Workflow/Process/Scope.php @@ -259,11 +259,17 @@ public function finally(callable $onFulfilledOrRejected): PromiseInterface return $this->deferred->promise()->finally($onFulfilledOrRejected); } + /** + * @deprecated use {@see catch()} instead + */ public function otherwise(callable $onRejected): PromiseInterface { return $this->catch($onRejected); } + /** + * @deprecated use {@see finally()} instead + */ public function always(callable $onFulfilledOrRejected): PromiseInterface { return $this->finally($onFulfilledOrRejected); diff --git a/src/Workflow.php b/src/Workflow.php index 06bbb4be..f52ccc87 100644 --- a/src/Workflow.php +++ b/src/Workflow.php @@ -901,7 +901,7 @@ public static function newUntypedExternalWorkflowStub(WorkflowExecution $executi * ->then(function ($result) { * // Execution result * }) - * ->otherwise(function (\Throwable $error) { + * ->catch(function (\Throwable $error) { * // Execution error * }) * ;