Skip to content

Commit

Permalink
Merge pull request #49114 from nextcloud/fix/qbmapper/find-entities-r…
Browse files Browse the repository at this point in the history
…eturn-type

fix(QBMapper): Fix findEntities() return type to be list<T>
  • Loading branch information
nickvergessen authored Nov 7, 2024
2 parents 9290b85 + 2c65d0c commit c6002ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/private/TaskProcessing/Db/TaskMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/public/AppFramework/Db/QBMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<Entity> all fetched entities
* @psalm-return list<T> all fetched entities
* @throws Exception
* @since 14.0.0
*/
Expand Down

0 comments on commit c6002ed

Please sign in to comment.