for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Epesi\Core\Helpers;
class Utils
{
public static function bytesToHuman($bytes)
$units = [__('B'), __('KiB'), __('MiB'), __('GiB'), __('TiB'), __('PiB')];
for ($i = 0; $bytes > 1024; $i++) {
$bytes /= 1024;
}
return round($bytes, 2) . ' ' . $units[$i];
$units[$i]
array|string
concatenation
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
return round($bytes, 2) . ' ' . /** @scrutinizer ignore-type */ $units[$i];