Skip to content

Commit

Permalink
fix psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed Sep 1, 2024
1 parent cda7029 commit 1fbb6a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions lib/private/AllConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function setUserValue($userId, $appName, $key, $value, $preCondition = nu
}
}

$userPreferences->setValueMixed($userId, $appName, $key, $value);
$userPreferences->setValueMixed($userId, $appName, $key, (string)$value);
}

/**
Expand Down Expand Up @@ -314,7 +314,14 @@ public function getAllUserValues(?string $userId): array {
return [];
}

return \OC::$server->get(UserPreferences::class)->getAllValues($userId);
$values = \OC::$server->get(UserPreferences::class)->getAllValues($userId);
$result = [];
foreach($values as $app => $list) {
foreach($list as $key => $value) {
$result[$app][$key] = (string)$value;
}
}
return $result;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/private/UserPreferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function hasKey(string $userId, string $app, string $key, ?bool $lazy = f
$this->loadPreferences($userId, $lazy);

if ($lazy === null) {
$appCache = $this->getAllValues($userId, $app);
$appCache = $this->getValues($userId, $app);
return isset($appCache[$key]);
}

Expand Down Expand Up @@ -451,7 +451,7 @@ public function getValueMixed(
string $userId,
string $app,
string $key,
string $default = '',
?string $default = '',
?bool $lazy = false
): string {
try {
Expand Down

0 comments on commit 1fbb6a9

Please sign in to comment.