| Total Complexity | 5 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class Pretty |
||
| 10 | { |
||
| 11 | public const DEFAULT_DECIMALS = 2; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Static class. Private Constructor. |
||
| 15 | */ |
||
| 16 | // @codeCoverageIgnoreStart |
||
| 17 | private function __construct() |
||
| 18 | { |
||
| 19 | } |
||
| 20 | // @codeCoverageIgnoreEnd |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param int $number |
||
| 24 | * @param null|string $unit |
||
| 25 | * @param int|null $decimals |
||
| 26 | * @return string |
||
| 27 | */ |
||
| 28 | 7 | public static function bytes(int $number, ?string $unit = null, ?int $decimals = null): string |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param float $value |
||
| 36 | * @param int|null $units |
||
| 37 | * @param int|null $precision |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | 20 | public static function time(float $value, ?int $units = null, ?int $precision = null): string |
|
| 47 | } |
||
| 48 | } |
||
| 49 |