Merge pull request #49114 from nextcloud/fix/qbmapper/find-entities-return-type

fix(QBMapper): Fix findEntities() return type to be list<T>
This commit is contained in:
Joas Schilling 2024-11-07 10:35:54 +01:00 committed by GitHub
commit c6002ed3e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -114,7 +114,7 @@ class TaskMapper extends QBMapper {
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 @@ class TaskMapper extends QBMapper {
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 @@ class TaskMapper extends QBMapper {
$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);
}
/**

View file

@ -320,8 +320,8 @@ abstract class QBMapper {
* 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
*/