From 57fa79788076ae79d0041ac0d76786607202e98b Mon Sep 17 00:00:00 2001 From: Dmitriy Derepko Date: Thu, 8 Jan 2026 14:47:01 +0400 Subject: [PATCH] chore: highlight deprecations --- src/Internal/Transport/CompletableResult.php | 4 ++-- src/Internal/Workflow/Process/Scope.php | 6 ++++++ src/Workflow.php | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) 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 * }) * ;