Skip to content

Commit

Permalink
Fix TextProcessing for 32bit: Adjust signature: getTask(int) -> getTa…
Browse files Browse the repository at this point in the history
…sk(int|float)

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Aug 4, 2023
1 parent af113dd commit 98b97e5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/private/TextProcessing/Db/TaskMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public function __construct(
}

/**
* @param int $id
* @param int|float $id
* @return Task
* @throws Exception
* @throws DoesNotExistException
* @throws MultipleObjectsReturnedException
*/
public function find(int $id): Task {
public function find(int|float $id): Task {
$qb = $this->db->getQueryBuilder();
$qb->select(Task::$columns)
->from($this->tableName)
Expand Down
4 changes: 2 additions & 2 deletions lib/private/TextProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ public function scheduleTask(OCPTask $task): void {
}

/**
* @param int $id The id of the task
* @param int|float $id The id of the task
* @return OCPTask
* @throws RuntimeException If the query failed
* @throws NotFoundException If the task could not be found
*/
public function getTask(int $id): OCPTask {
public function getTask(int|float $id): OCPTask {
try {
$taskEntity = $this->taskMapper->find($id);
return $taskEntity->toPublicTask();
Expand Down
4 changes: 2 additions & 2 deletions lib/public/TextProcessing/IManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ public function runTask(Task $task): string;
public function scheduleTask(Task $task) : void;

/**
* @param int $id The id of the task
* @param int|float $id The id of the task
* @return Task
* @throws RuntimeException If the query failed
* @throws NotFoundException If the task could not be found
* @since 27.1.0
*/
public function getTask(int $id): Task;
public function getTask(int|float $id): Task;
}
2 changes: 1 addition & 1 deletion tests/lib/TextProcessing/TextProcessingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function setUp(): void {
$this->taskMapper
->expects($this->any())
->method('find')
->willReturnCallback(function (int $id) {
->willReturnCallback(function (int|float $id) {
if (!isset($this->tasksDb[$id])) {
throw new DoesNotExistException('Could not find it');
}
Expand Down

0 comments on commit 98b97e5

Please sign in to comment.