mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 16:39:59 -04:00
Merge pull request #35334 from nextcloud/revert-34032-backport/34019/stable24
Revert "[stable24] Fix quota type to int"
This commit is contained in:
commit
87cbbb48d9
3 changed files with 23 additions and 6 deletions
|
|
@ -4404,7 +4404,8 @@
|
|||
<InvalidReturnType occurrences="1">
|
||||
<code>IImage|null</code>
|
||||
</InvalidReturnType>
|
||||
<InvalidScalarArgument occurrences="1">
|
||||
<InvalidScalarArgument occurrences="2">
|
||||
<code>$quota</code>
|
||||
<code>$this->lastLogin</code>
|
||||
</InvalidScalarArgument>
|
||||
<NullableReturnStatement occurrences="1">
|
||||
|
|
@ -4528,6 +4529,14 @@
|
|||
<code>\Test\Util\User\Dummy</code>
|
||||
</UndefinedClass>
|
||||
</file>
|
||||
<file src="lib/private/legacy/OC_Util.php">
|
||||
<InvalidReturnStatement occurrences="1">
|
||||
<code>OC_Helper::computerFileSize($userQuota)</code>
|
||||
</InvalidReturnStatement>
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>float</code>
|
||||
</InvalidReturnType>
|
||||
</file>
|
||||
<file src="lib/public/AppFramework/ApiController.php">
|
||||
<NoInterfaceProperties occurrences="1">
|
||||
<code>$this->request->server</code>
|
||||
|
|
@ -4625,4 +4634,12 @@
|
|||
<code>PreconditionNotMetException</code>
|
||||
</InvalidClass>
|
||||
</file>
|
||||
<file src="lib/public/Util.php">
|
||||
<InvalidReturnStatement occurrences="1">
|
||||
<code>\OC_Helper::computerFileSize($str)</code>
|
||||
</InvalidReturnStatement>
|
||||
<InvalidReturnType occurrences="1">
|
||||
<code>float|false</code>
|
||||
</InvalidReturnType>
|
||||
</file>
|
||||
</files>
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class OC_Helper {
|
|||
/**
|
||||
* Make a computer file size
|
||||
* @param string $str file size in human readable format
|
||||
* @return int|false a file size in bytes
|
||||
* @return float|bool a file size in bytes
|
||||
*
|
||||
* Makes 2kB to 2048.
|
||||
*
|
||||
|
|
@ -104,7 +104,7 @@ class OC_Helper {
|
|||
public static function computerFileSize($str) {
|
||||
$str = strtolower($str);
|
||||
if (is_numeric($str)) {
|
||||
return (int)$str;
|
||||
return (float)$str;
|
||||
}
|
||||
|
||||
$bytes_array = [
|
||||
|
|
@ -131,7 +131,7 @@ class OC_Helper {
|
|||
|
||||
$bytes = round($bytes);
|
||||
|
||||
return (int)$bytes;
|
||||
return $bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -605,7 +605,7 @@ class OC_Helper {
|
|||
/**
|
||||
* Get storage info including all mount points and quota
|
||||
*/
|
||||
private static function getGlobalStorageInfo(int $quota, IUser $user, IMountPoint $mount): array {
|
||||
private static function getGlobalStorageInfo(float $quota, IUser $user, IMountPoint $mount): array {
|
||||
$rootInfo = \OC\Files\Filesystem::getFileInfo('', 'ext');
|
||||
$used = $rootInfo['size'];
|
||||
if ($used < 0) {
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class OC_Util {
|
|||
* Get the quota of a user
|
||||
*
|
||||
* @param IUser|null $user
|
||||
* @return int|\OCP\Files\FileInfo::SPACE_UNLIMITED|false Quota bytes
|
||||
* @return float Quota bytes
|
||||
*/
|
||||
public static function getUserQuota(?IUser $user) {
|
||||
if (is_null($user)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue