Static code analysis.

This commit is contained in:
2023-05-31 09:00:20 +00:00
parent 4c8f71d9d8
commit 19f27e6d0c
10 changed files with 1798 additions and 43 deletions

View File

@ -24,7 +24,7 @@ class AppExtension extends AbstractExtension
public function formatBytes($bytes, $precision = 2)
{
$size = ['B','kB','MB','GB','TB','PB','EB','ZB','YB'];
$fact = floor((strlen((string)$bytes) - 1) / 3);
$fact = (int)(floor((strlen((string)$bytes) - 1) / 3));
return sprintf("%.{$precision}f", $bytes / pow(1024, $fact)) . $size[$fact];
}