Static code analysis.
This commit is contained in:
@ -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];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user