From ab6afe0111b25bd2d764bb807f086808ae7a5534 Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Tue, 2 Apr 2024 17:13:35 +0200 Subject: fix: Fix new psalm errors from update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not sure about the SimpleContainer modification, let’s see what CI says about that. Signed-off-by: Côme Chilliet --- .../TwoFactorAuth/Db/ProviderUserAssignmentDao.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lib/private/Authentication') diff --git a/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php b/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php index db5da97f275..458ed690e56 100644 --- a/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php +++ b/lib/private/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDao.php @@ -91,8 +91,6 @@ class ProviderUserAssignmentDao { /** * Delete all provider states of a user and return the provider IDs * - * @param string $uid - * * @return list */ public function deleteByUser(string $uid): array { @@ -100,7 +98,7 @@ class ProviderUserAssignmentDao { $selectQuery = $qb1->select('*') ->from(self::TABLE_NAME) ->where($qb1->expr()->eq('uid', $qb1->createNamedParameter($uid))); - $selectResult = $selectQuery->execute(); + $selectResult = $selectQuery->executeQuery(); $rows = $selectResult->fetchAll(); $selectResult->closeCursor(); @@ -108,15 +106,15 @@ class ProviderUserAssignmentDao { $deleteQuery = $qb2 ->delete(self::TABLE_NAME) ->where($qb2->expr()->eq('uid', $qb2->createNamedParameter($uid))); - $deleteQuery->execute(); + $deleteQuery->executeStatement(); - return array_map(function (array $row) { + return array_values(array_map(function (array $row) { return [ - 'provider_id' => $row['provider_id'], - 'uid' => $row['uid'], - 'enabled' => (int) $row['enabled'] === 1, + 'provider_id' => (string)$row['provider_id'], + 'uid' => (string)$row['uid'], + 'enabled' => ((int) $row['enabled']) === 1, ]; - }, $rows); + }, $rows)); } public function deleteAll(string $providerId): void { -- cgit v1.2.3