From 98b97e522fceb4ae3b006f2bcf49cc23a48f5675 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Fri, 4 Aug 2023 11:57:42 +0200 Subject: [PATCH] Fix TextProcessing for 32bit: Adjust signature: getTask(int) -> getTask(int|float) Signed-off-by: Marcel Klehr --- lib/private/TextProcessing/Db/TaskMapper.php | 4 ++-- lib/private/TextProcessing/Manager.php | 4 ++-- lib/public/TextProcessing/IManager.php | 4 ++-- tests/lib/TextProcessing/TextProcessingTest.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/private/TextProcessing/Db/TaskMapper.php b/lib/private/TextProcessing/Db/TaskMapper.php index 508f3fdf3b8b7..60feb34c09a77 100644 --- a/lib/private/TextProcessing/Db/TaskMapper.php +++ b/lib/private/TextProcessing/Db/TaskMapper.php @@ -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) diff --git a/lib/private/TextProcessing/Manager.php b/lib/private/TextProcessing/Manager.php index f52482bbb3219..7a8cafa28142b 100644 --- a/lib/private/TextProcessing/Manager.php +++ b/lib/private/TextProcessing/Manager.php @@ -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(); diff --git a/lib/public/TextProcessing/IManager.php b/lib/public/TextProcessing/IManager.php index 90e25894d4f2e..9c2bbf61c2006 100644 --- a/lib/public/TextProcessing/IManager.php +++ b/lib/public/TextProcessing/IManager.php @@ -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; } diff --git a/tests/lib/TextProcessing/TextProcessingTest.php b/tests/lib/TextProcessing/TextProcessingTest.php index 797571019cebb..a3e1ac1549aee 100644 --- a/tests/lib/TextProcessing/TextProcessingTest.php +++ b/tests/lib/TextProcessing/TextProcessingTest.php @@ -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'); }