Bug fix in Basic class string to bytes convert

This commit is contained in:
Clemens Schwaighofer
2019-09-20 16:25:14 +09:00
parent a6918bac6f
commit 98bf11e0c9
3 changed files with 17 additions and 2 deletions

View File

@@ -42,3 +42,12 @@ parameters:
- www/lib/smarty-3.1.30/
# ignore composer
- www/vendor
# ignore errores with
# ignoreErrors:
#- 'error regex'
#-
# message: 'error regex'
# path: %currentWorkingDirectory%/www/some/*
# paths:
# - ...
# - ...

View File

@@ -1,3 +1,9 @@
phan --progress-bar -C -o analysis.txt
# main static checker
phan --progress-bar -C -o 4dev/tmp/analysis.txt
# sub static checker
phpstan analyse -c phpstan.neon --memory-limit=4G -l 0 www
# only if we work with composer only
www/: psalm (this needs the composer autoloader defined)
# for linting
parallel-lint www/

View File

@@ -1512,7 +1512,7 @@ class Basic
// labels in order of size
$labels = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');
// calc file size, round down too two digits, add label based max change
return round($number / pow(1024, ($i = floor(log($number, 1024)))), 2).($space ? ' ' : '').(isset($labels[(int)$i]) ? $labels[(int)$i] : '>EB');
return round($number / pow(1024, ($i = floor(log((float)$number, 1024)))), 2).($space ? ' ' : '').(isset($labels[(int)$i]) ? $labels[(int)$i] : '>EB');
}
return (string)$number;
}