Fix psalm spotted type errors

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-09-05 12:08:10 +02:00
parent 2c8b415c55
commit 35069ad86a
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
2 changed files with 12 additions and 12 deletions

View File

@ -359,11 +359,11 @@ class Database extends ABackend implements
->where($qb->expr()->in('gid', $qb->createNamedParameter($chunk, IQueryBuilder::PARAM_STR_ARRAY)))
->executeQuery();
while ($row = $result->fetch()) {
$this->groupCache[$row['gid']] = [
'displayname' => $row['displayname'],
'gid' => $row['gid'],
$this->groupCache[(string)$row['gid']] = [
'displayname' => (string)$row['displayname'],
'gid' => (string)$row['gid'],
];
$existingGroups[] = $gid;
$existingGroups[] = (string)$row['gid'];
}
$result->closeCursor();
}
@ -553,10 +553,10 @@ class Database extends ABackend implements
$result = $query->executeQuery();
while ($row = $result->fetch()) {
$details[$row['gid']] = ['displayName' => $row['displayname']];
$this->groupCache[$row['gid']] = [
'displayname' => $row['displayname'],
'gid' => $row['gid'],
$details[(string)$row['gid']] = ['displayName' => (string)$row['displayname']];
$this->groupCache[(string)$row['gid']] = [
'displayname' => (string)$row['displayname'],
'gid' => (string)$row['gid'],
];
}
$result->closeCursor();

View File

@ -48,13 +48,13 @@ interface IBatchMethodsBackend {
/**
* @brief Batch method to get the group details of a list of groups
*
* The default implementation in ABackend will just call getGroupDetail in
* a loop. But a GroupBackend implementation should provides a more optimized
* override this method to provide a more optimized way to execute this operation.
* The default implementation in ABackend will just call getGroupDetails in
* a loop. But a GroupBackend implementation should override this method
* to provide a more optimized way to execute this operation.
*
* @throw \RuntimeException if called on a backend that doesn't implements IGroupDetailsBackend
*
* @return array<string, array{displayName: string}>
* @return array<string, array{displayName?: string}>
* @since 28.0.0
*/
public function getGroupsDetails(array $gids): array;