Improve type safety
This commit is contained in:
1 file changed
+1
-1
@@ -89,7 +89,7 @@ public function flush_to_logfile():void {
|
||||
private function _human_filesize(int $bytes, int $decimals = 2):string {
|
||||
|
||||
$size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
$factor = floor((strlen((string)$bytes) - 1) / 3);
|
||||
$factor = (int)floor((strlen((string)$bytes) - 1) / 3);
|
||||
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . $size[$factor];
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user