diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index 4631f9e9d5bfe..72072a2588c67 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -801,7 +801,7 @@ private static function calculateFreeSpace($trashbinSize, $user) {
$availableSpace = $quota;
}
- return $availableSpace;
+ return (int)$availableSpace;
}
/**
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml
index 402458985c0da..da22e228cd4ec 100644
--- a/build/psalm-baseline.xml
+++ b/build/psalm-baseline.xml
@@ -4404,8 +4404,7 @@
IImage|null
-
- $quota
+
$this->lastLogin
@@ -4490,19 +4489,16 @@
$matches[1][$last_match][0]
-
+
(INF > 0)? INF: PHP_INT_MAX
INF
- max($upload_max_filesize, $post_max_size)
- min($upload_max_filesize, $post_max_size)
int
-
+
$includeExtStorage ? 'ext' : false
$path
- $quota
'ext'
@@ -4532,22 +4528,6 @@
\Test\Util\User\Dummy
-
-
- OC_Helper::computerFileSize($userQuota)
-
-
- float
-
-
- is_string($expected)
-
-
- is_bool($expected)
- is_bool($setting[1])
- is_int($expected)
-
-
$this->request->server
@@ -4645,29 +4625,4 @@
PreconditionNotMetException
-
-
- $cursor
-
-
-
-
- array
- array|bool
- mixed
-
-
-
-
- \OC_Helper::computerFileSize($str)
-
-
- float
-
-
-
-
- $e->getCode()
-
-
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index 733085c0f3a9d..b7838c56ef080 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -420,11 +420,11 @@ public static function freeSpace($dir) {
*/
public static function uploadLimit() {
$ini = \OC::$server->get(IniGetWrapper::class);
- $upload_max_filesize = OCP\Util::computerFileSize($ini->get('upload_max_filesize'));
- $post_max_size = OCP\Util::computerFileSize($ini->get('post_max_size'));
- if ((int)$upload_max_filesize === 0 and (int)$post_max_size === 0) {
+ $upload_max_filesize = (int)OCP\Util::computerFileSize($ini->get('upload_max_filesize'));
+ $post_max_size = (int)OCP\Util::computerFileSize($ini->get('post_max_size'));
+ if ($upload_max_filesize === 0 && $post_max_size === 0) {
return INF;
- } elseif ((int)$upload_max_filesize === 0 or (int)$post_max_size === 0) {
+ } elseif ($upload_max_filesize === 0 || $post_max_size === 0) {
return max($upload_max_filesize, $post_max_size); //only the non 0 value counts
} else {
return min($upload_max_filesize, $post_max_size);
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index 959e8c0260964..8869815160210 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -657,20 +657,8 @@ public static function checkServer(\OC\SystemConfig $config) {
}
}
foreach ($dependencies['ini'] as $setting => $expected) {
- if (is_bool($expected)) {
- if ($iniWrapper->getBool($setting) !== $expected) {
- $invalidIniSettings[] = [$setting, $expected];
- }
- }
- if (is_int($expected)) {
- if ($iniWrapper->getNumeric($setting) !== $expected) {
- $invalidIniSettings[] = [$setting, $expected];
- }
- }
- if (is_string($expected)) {
- if (strtolower($iniWrapper->getString($setting)) !== strtolower($expected)) {
- $invalidIniSettings[] = [$setting, $expected];
- }
+ if (strtolower($iniWrapper->getString($setting)) !== strtolower($expected)) {
+ $invalidIniSettings[] = [$setting, $expected];
}
}
@@ -682,9 +670,6 @@ public static function checkServer(\OC\SystemConfig $config) {
$webServerRestart = true;
}
foreach ($invalidIniSettings as $setting) {
- if (is_bool($setting[1])) {
- $setting[1] = $setting[1] ? 'on' : 'off';
- }
$errors[] = [
'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], var_export($setting[1], true)]),
'hint' => $l->t('Adjusting this setting in php.ini will make Nextcloud run again')
diff --git a/lib/public/Search/SearchResult.php b/lib/public/Search/SearchResult.php
index 685dad0f0ca94..5371b77ef0a56 100644
--- a/lib/public/Search/SearchResult.php
+++ b/lib/public/Search/SearchResult.php
@@ -50,7 +50,7 @@ final class SearchResult implements JsonSerializable {
* @param string $name the translated name of the result section or group, e.g. "Mail"
* @param bool $isPaginated
* @param SearchResultEntry[] $entries
- * @param null $cursor
+ * @param ?int|?string $cursor
*
* @since 20.0.0
*/
diff --git a/lib/public/Share.php b/lib/public/Share.php
index 6aeadb3a6ed88..cb6b145bcfb25 100644
--- a/lib/public/Share.php
+++ b/lib/public/Share.php
@@ -64,7 +64,7 @@ public static function getItemSharedWithUser($itemType, $itemSource, $user, $own
* @param int $format (optional) Format type must be defined by the backend
* @param mixed $parameters
* @param bool $includeCollections
- * @return array
+ * @return void
* @since 5.0.0
* @deprecated 17.0.0
*/
@@ -77,7 +77,7 @@ public static function getItemSharedWithBySource($itemType, $itemSource, $format
* Based on the given token the share information will be returned - password protected shares will be verified
* @param string $token
* @param bool $checkPasswordProtection
- * @return array|bool false will be returned in case the token is unknown or unauthorized
+ * @return void
* @since 5.0.0 - parameter $checkPasswordProtection was added in 7.0.0
* @deprecated 17.0.0
*/
@@ -93,7 +93,7 @@ public static function getShareByToken($token, $checkPasswordProtection = true)
* @param mixed $parameters
* @param int $limit Number of items to return (optional) Returns all by default
* @param bool $includeCollections
- * @return mixed Return depends on format
+ * @return void
* @since 5.0.0
* @deprecated 17.0.0
*/
diff --git a/lib/public/Util.php b/lib/public/Util.php
index c8b55bb10e2c2..e5bb2a955ae93 100644
--- a/lib/public/Util.php
+++ b/lib/public/Util.php
@@ -372,7 +372,7 @@ public static function humanFileSize($bytes) {
/**
* Make a computer file size (2 kB to 2048)
* @param string $str file size in a fancy format
- * @return float a file size in bytes
+ * @return float|false a file size in bytes
*
* Inspired by: https://www.php.net/manual/en/function.filesize.php#92418
* @since 4.0.0
diff --git a/remote.php b/remote.php
index 5254b2b741909..59ba837228899 100644
--- a/remote.php
+++ b/remote.php
@@ -81,7 +81,7 @@ function handleException($e) {
}
if ($e instanceof RemoteException) {
// we shall not log on RemoteException
- OC_Template::printErrorPage($e->getMessage(), '', $e->getCode());
+ OC_Template::printErrorPage($e->getMessage(), '', (int)$e->getCode());
} else {
\OC::$server->getLogger()->logException($e, ['app' => 'remote']);
OC_Template::printExceptionErrorPage($e, $statusCode);