| Conditions | 5 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | private static function calcFileSizeUnit($size) |
||
| 37 | { |
||
| 38 | $units = ['K', 'M', 'G', 'T']; |
||
| 39 | $byte = 1024; |
||
| 40 | |||
| 41 | if (is_numeric($size) || is_int($size)) { |
||
| 42 | return $size; |
||
| 43 | } else if (is_string($size) && preg_match('/^([0-9]+(?:\.[0-9]+)?)(' . implode('|', $units) . ')B?$/i', $size, $matches)) { |
||
| 44 | return $matches[1] * pow($byte, array_search($matches[2], $units) + 1); |
||
| 45 | } |
||
| 46 | return false; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.