| 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 ) { |
|
| 78 | |||
| 79 | /** |
||
| 80 | * @since 2.0 |
||
| 81 | * |
||
| 82 | * @return integer |
||
| 83 | */ |
||
| 84 | 2 | public function getMemoryUsed() { |
|
| 87 | |||
| 88 | /** |
||
| 89 | * @since 2.0 |
||
| 90 | * |
||
| 91 | * @return float |
||
| 92 | */ |
||
| 93 | 2 | public function getTimeUsed() { |
|
| 96 | |||
| 97 | } |
||
| 98 |
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.