Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 6 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Utils |
||
15 | { |
||
16 | /** |
||
17 | * Remove time and memory limits |
||
18 | */ |
||
19 | public static function setUnlimitedRuntime(): void |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Get the Namespace from a class object |
||
29 | */ |
||
30 | public static function getNamespace(object $class): string |
||
31 | { |
||
32 | return (new \ReflectionClass($class))->getNamespaceName(); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Get the directory from a class object |
||
37 | */ |
||
38 | public static function getDirname(object $class): string |
||
39 | { |
||
40 | return dirname((new \ReflectionClass($class))->getFileName()); |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Return an array of the current memory usage in MB |
||
45 | */ |
||
46 | public static function getMemoryUsage(float $divider = 1048576.2, string $suffix = ' MB'): array |
||
53 | ]; |
||
54 | } |
||
55 | } |
||
56 |