Skip to content

Commit

Permalink
Fix psalm spotted type errors
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Sep 5, 2023
1 parent 011c963 commit 00ccbd3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions lib/private/Group/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ public function groupsExists(array $gids): array {
->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();
}
Expand Down Expand Up @@ -553,10 +553,10 @@ public function getGroupsDetails(array $gids): array {

$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();
Expand Down
8 changes: 4 additions & 4 deletions lib/public/Group/Backend/IBatchMethodsBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ public function groupsExists(array $gids): array;
/**
* @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;
Expand Down

0 comments on commit 00ccbd3

Please sign in to comment.