Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-05-16 11:58:26 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-05-16 11:58:26 +0300
commit53169890d6dccfcc48d80930e33824084d68aa1c (patch)
tree7069b6671b919e5a1200ac2c106224181e03343b /lib
parentad405e93767cfaf0ba34011010bb26dc4c05f60a (diff)
Fix psalm errors fron the end of the baseline file
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/legacy/OC_Helper.php10
-rw-r--r--lib/private/legacy/OC_Util.php21
-rw-r--r--lib/public/Search/SearchResult.php2
-rw-r--r--lib/public/Share.php6
-rw-r--r--lib/public/Util.php2
5 files changed, 13 insertions, 28 deletions
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index 6aa0b582c21..226f73a0711 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -95,7 +95,7 @@ class OC_Helper {
/**
* Make a computer file size
* @param string $str file size in human readable format
- * @return float|bool a file size in bytes
+ * @return float|false a file size in bytes
*
* Makes 2kB to 2048.
*
@@ -420,11 +420,11 @@ class OC_Helper {
*/
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 ee7fb517d98..516ccc8283c 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -158,7 +158,7 @@ class OC_Util {
* Get the quota of a user
*
* @param IUser|null $user
- * @return float Quota bytes
+ * @return float|\OCP\Files\FileInfo::SPACE_UNLIMITED|false Quota bytes
*/
public static function getUserQuota(?IUser $user) {
if (is_null($user)) {
@@ -657,20 +657,8 @@ class OC_Util {
}
}
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 @@ class OC_Util {
$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 685dad0f0ca..5371b77ef0a 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 6aeadb3a6ed..cb6b145bcfb 100644
--- a/lib/public/Share.php
+++ b/lib/public/Share.php
@@ -64,7 +64,7 @@ class Share extends \OC\Share\Constants {
* @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 @@ class Share extends \OC\Share\Constants {
* 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 @@ class Share extends \OC\Share\Constants {
* @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 c8b55bb10e2..e5bb2a955ae 100644
--- a/lib/public/Util.php
+++ b/lib/public/Util.php
@@ -372,7 +372,7 @@ class Util {
/**
* 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