1 | <?php |
||
13 | class CallFuncMemorySniffer { |
||
14 | |||
15 | /** |
||
16 | * @var integer |
||
17 | */ |
||
18 | private static $max; |
||
19 | |||
20 | /** |
||
21 | * @var integer |
||
22 | */ |
||
23 | private static $memory; |
||
24 | |||
25 | /** |
||
26 | * @var integer |
||
27 | */ |
||
28 | private $time; |
||
29 | |||
30 | /** |
||
31 | * @since 2.0 |
||
32 | */ |
||
33 | 2 | public static function memoryTick() { |
|
38 | |||
39 | /** |
||
40 | * @since 2.0 |
||
41 | * |
||
42 | * @param Closure|callable $func |
||
43 | * @param array|null $args |
||
44 | * |
||
45 | * @return mixed |
||
46 | * @throws RuntimeException |
||
47 | */ |
||
48 | 3 | public function call( $func, $args = null ) { |
|
73 | |||
74 | /** |
||
75 | * @since 2.0 |
||
76 | * |
||
77 | * @return integer |
||
78 | */ |
||
79 | 2 | public function getMemoryUsed() { |
|
82 | |||
83 | /** |
||
84 | * @since 2.0 |
||
85 | * |
||
86 | * @return float |
||
87 | */ |
||
88 | 2 | public function getTimeUsed() { |
|
91 | |||
92 | } |
||
93 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.