Skip to content

Commit

Permalink
Merge #599
Browse files Browse the repository at this point in the history
599: Declare `@throws` in HandlesTasks delegate r=brunoocasali a=norkunas

# Pull Request

## Related issue
Fixes #<issue_number>

## What does this PR do?
- Adds ``@throws`` php docs

## PR checklist
Please check if your PR fulfills the following requirements:
- [ ] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?


Co-authored-by: Tomas <norkunas.tom@gmail.com>
  • Loading branch information
meili-bors[bot] and norkunas authored Dec 15, 2023
2 parents c5d217c + a69c60a commit 15b2acb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Endpoints/Delegates/HandlesTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Meilisearch\Contracts\TasksQuery;
use Meilisearch\Contracts\TasksResults;
use Meilisearch\Endpoints\Tasks;
use Meilisearch\Exceptions\TimeOutException;

trait HandlesTasks
{
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/Endpoints/Tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down

0 comments on commit 15b2acb

Please sign in to comment.