Conditions | 2 |
Paths | 2 |
Total Lines | 5 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
60 | public static function formatToBytes(string $format): float |
||
61 | { |
||
62 | $unit = \preg_replace(self::$unitsRegexPattern, '', $format); |
||
63 | $format = \preg_replace(self::$numberRegex, '', $format); |
||
64 | return $unit ? \round($format * (1024 ** \stripos(self::$unitsPattern, $unit[0]))) : \round($format); |
||
|
|||
65 | } |
||
66 | } |