Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
47 | public function call( Closure $func, $args = null ) { |
||
48 | |||
49 | declare( ticks=1 ); |
||
50 | |||
51 | self::$memory = memory_get_usage(); |
||
52 | self::$max = 0; |
||
53 | |||
54 | register_tick_function( |
||
55 | 'call_user_func_array', |
||
56 | array( '\Onoi\CallbackContainer\CallFuncMemorySniffer', 'memoryTick' ), |
||
57 | array() |
||
58 | ); |
||
59 | |||
60 | $this->time = microtime( true ); |
||
|
|||
61 | $result = is_array( $args ) ? call_user_func_array( $func, $args ): call_user_func( $func ); |
||
62 | $this->time = microtime( true ) - $this->time; |
||
63 | |||
64 | unregister_tick_function( 'call_user_func_array' ); |
||
65 | |||
66 | return $result; |
||
67 | } |
||
68 | |||
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.