From 2c65d0c0d14d8b227d485063dfd4995b07978ea3 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Wed, 6 Nov 2024 16:31:39 +0100 Subject: [PATCH] fix(QBMapper): Fix findEntities() return type to be list Signed-off-by: provokateurin --- lib/private/TaskProcessing/Db/TaskMapper.php | 6 +++--- lib/public/AppFramework/Db/QBMapper.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/private/TaskProcessing/Db/TaskMapper.php b/lib/private/TaskProcessing/Db/TaskMapper.php index 2bdee4fa13415..91fd68820ae56 100644 --- a/lib/private/TaskProcessing/Db/TaskMapper.php +++ b/lib/private/TaskProcessing/Db/TaskMapper.php @@ -114,7 +114,7 @@ public function findByUserAndTaskType(?string $userId, ?string $taskType = null, if ($customId !== null) { $qb->andWhere($qb->expr()->eq('custom_id', $qb->createPositionalParameter($customId))); } - return array_values($this->findEntities($qb)); + return $this->findEntities($qb); } /** @@ -133,7 +133,7 @@ public function findUserTasksByApp(?string $userId, string $appId, ?string $cust if ($customId !== null) { $qb->andWhere($qb->expr()->eq('custom_id', $qb->createPositionalParameter($customId))); } - return array_values($this->findEntities($qb)); + return $this->findEntities($qb); } /** @@ -178,7 +178,7 @@ public function findTasks( $qb->andWhere($qb->expr()->isNotNull('ended_at')); $qb->andWhere($qb->expr()->lt('ended_at', $qb->createPositionalParameter($endedBefore, IQueryBuilder::PARAM_INT))); } - return array_values($this->findEntities($qb)); + return $this->findEntities($qb); } /** diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index 243310fe93301..4071a4a47a4ce 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -320,8 +320,8 @@ protected function mapRowToEntity(array $row): Entity { * Runs a sql query and returns an array of entities * * @param IQueryBuilder $query - * @return Entity[] all fetched entities - * @psalm-return T[] all fetched entities + * @return list all fetched entities + * @psalm-return list all fetched entities * @throws Exception * @since 14.0.0 */