@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | use nebula\component\request\Request; |
6 | 6 | |
7 | -require_once __DIR__ .'/../vendor/autoload.php'; |
|
7 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
8 | 8 | |
9 | 9 | $request = Request::buildFromServer(); |
10 | 10 | $request->apply(true); |
@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | var_dump($request); |
13 | 13 | var_dump($request->getBasicURI()); |
14 | 14 | |
15 | -function formatBytes(int $bytes, int $precision=0) |
|
15 | +function formatBytes(int $bytes, int $precision = 0) |
|
16 | 16 | { |
17 | - $human= ['B', 'KB', 'MB', 'GB', 'TB']; |
|
17 | + $human = ['B', 'KB', 'MB', 'GB', 'TB']; |
|
18 | 18 | $bytes = max($bytes, 0); |
19 | - $pow = floor(($bytes?log($bytes):0)/log(1024)); |
|
20 | - $pos = min($pow, count($human)-1); |
|
21 | - $bytes /= (1 << (10* $pos)); |
|
19 | + $pow = floor(($bytes ?log($bytes) : 0) / log(1024)); |
|
20 | + $pos = min($pow, count($human) - 1); |
|
21 | + $bytes /= (1 << (10 * $pos)); |
|
22 | 22 | return round($bytes, $precision).' '.$human[$pos]; |
23 | 23 | } |
24 | 24 |