From a69c60a4a423d84d66a7057b968af10d216f06b3 Mon Sep 17 00:00:00 2001 From: Tomas Date: Wed, 13 Dec 2023 09:21:24 +0200 Subject: [PATCH] Declare `@throws` in HandlesTasks delegate --- src/Endpoints/Delegates/HandlesTasks.php | 7 +++++++ src/Endpoints/Tasks.php | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/Endpoints/Delegates/HandlesTasks.php b/src/Endpoints/Delegates/HandlesTasks.php index 58c0080f..44fbb77b 100644 --- a/src/Endpoints/Delegates/HandlesTasks.php +++ b/src/Endpoints/Delegates/HandlesTasks.php @@ -9,6 +9,7 @@ use Meilisearch\Contracts\TasksQuery; use Meilisearch\Contracts\TasksResults; use Meilisearch\Endpoints\Tasks; +use Meilisearch\Exceptions\TimeOutException; trait HandlesTasks { @@ -38,11 +39,17 @@ public function cancelTasks(CancelTasksQuery $options = null): array return $this->tasks->cancelTasks($options); } + /** + * @throws TimeOutException + */ public function waitForTask($uid, int $timeoutInMs = 5000, int $intervalInMs = 50): array { return $this->tasks->waitTask($uid, $timeoutInMs, $intervalInMs); } + /** + * @throws TimeOutException + */ public function waitForTasks($uids, int $timeoutInMs = 5000, int $intervalInMs = 50): array { return $this->tasks->waitTasks($uids, $timeoutInMs, $intervalInMs); diff --git a/src/Endpoints/Tasks.php b/src/Endpoints/Tasks.php index 82d9dc11..30b4a920 100644 --- a/src/Endpoints/Tasks.php +++ b/src/Endpoints/Tasks.php @@ -56,6 +56,9 @@ public function waitTask($taskUid, int $timeoutInMs, int $intervalInMs): array throw new TimeOutException(); } + /** + * @throws TimeOutException + */ public function waitTasks(array $taskUids, int $timeoutInMs, int $intervalInMs): array { $tasks = [];