PHPstan analysis.

This commit is contained in:
2023-05-26 13:04:15 +00:00
parent acd209b351
commit 4c8f71d9d8
8 changed files with 264 additions and 55 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($bytes) - 1) / 3);
$fact = floor((strlen((string)$bytes) - 1) / 3);
return sprintf("%.{$precision}f", $bytes / pow(1024, $fact)) . $size[$fact];
}