Total Complexity | 4 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class MemoryUsage |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * Static class. Private Constructor. |
||
12 | */ |
||
13 | // @codeCoverageIgnoreStart |
||
14 | private function __construct() |
||
15 | { |
||
16 | } |
||
17 | // @codeCoverageIgnoreEnd |
||
18 | |||
19 | /** |
||
20 | * @param bool $real |
||
21 | * @param null|string $unit |
||
22 | * @param int|null $decimals |
||
23 | * @return string |
||
24 | */ |
||
25 | 2 | public static function get(bool $real = false, ?string $unit = null, ?int $decimals = null): string |
|
26 | { |
||
27 | return |
||
28 | 2 | Pretty::bytes(memory_get_usage($real), $unit, $decimals); |
|
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param bool $real |
||
33 | * @param null|string $unit |
||
34 | * @param int|null $decimals |
||
35 | * @return string |
||
36 | */ |
||
37 | 2 | public static function getPeak(bool $real = false, ?string $unit = null, ?int $decimals = null): string |
|
41 | } |
||
42 | |||
43 | 4 | public static function report(?string $unit = null, ?int $decimals = null): MemoryUsageReport |
|
55 |