Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
92 | public function getPrettySize(): string |
||
93 | { |
||
94 | $size = $this->getLength(); |
||
95 | |||
96 | if ($size >= 1073741824) { |
||
97 | return round($size / 1073741824, 2) . ' GB'; |
||
98 | } |
||
99 | |||
100 | if ($size >= 1048576) { |
||
101 | return round($size / 1048576, 2) . ' MB'; |
||
102 | } |
||
103 | |||
104 | if ($size >= 1024) { |
||
105 | return round($size / 1024, 2) . ' kB'; |
||
106 | } |
||
107 | |||
108 | return (string)$size; |
||
109 | } |
||
110 | } |