From 35069ad86a96923b0e39c897bb839058de4b4b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 5 Sep 2023 12:08:10 +0200 Subject: [PATCH] Fix psalm spotted type errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Group/Database.php | 16 ++++++++-------- .../Group/Backend/IBatchMethodsBackend.php | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php index 4cfc3c1f45a..20e56a03d0a 100644 --- a/lib/private/Group/Database.php +++ b/lib/private/Group/Database.php @@ -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(); diff --git a/lib/public/Group/Backend/IBatchMethodsBackend.php b/lib/public/Group/Backend/IBatchMethodsBackend.php index 109f398677f..2af00e42825 100644 --- a/lib/public/Group/Backend/IBatchMethodsBackend.php +++ b/lib/public/Group/Backend/IBatchMethodsBackend.php @@ -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 + * @return array * @since 28.0.0 */ public function getGroupsDetails(array $gids): array;