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 | public static function memoryTick() { |
||
38 | |||
39 | /** |
||
40 | * @since 2.0 |
||
41 | * |
||
42 | * @param Closure $func |
||
43 | * @param array|null $args |
||
44 | * |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function call( Closure $func, $args = null ) { |
||
68 | |||
69 | /** |
||
70 | * @since 2.0 |
||
71 | * |
||
72 | * @return integer |
||
73 | */ |
||
74 | public function getMemoryUsed() { |
||
77 | |||
78 | /** |
||
79 | * @since 2.0 |
||
80 | * |
||
81 | * @return float |
||
82 | */ |
||
83 | public function getTimeUsed() { |
||
86 | |||
87 | } |
||
88 |
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.