Conditions | 2 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
43 | 14 | protected function attachTimesListener($pointer, $event, $limit, callable $listener) |
|
44 | { |
||
45 | 14 | $emitter = $this; |
|
46 | return function() use($emitter, $listener, $event, $pointer, &$limit) { |
||
47 | 14 | if (--$limit === 0) |
|
48 | { |
||
49 | 14 | unset($limit); |
|
50 | 14 | unset($emitter->eventListeners[$event][$pointer]); |
|
51 | } |
||
52 | |||
53 | 14 | $args = func_get_args(); |
|
54 | 14 | $this->getLoop()->onTick(function() use($listener, $args) { |
|
55 | 14 | $listener(...$args); |
|
56 | 14 | }); |
|
57 | 14 | }; |
|
58 | } |
||
59 | } |
||
60 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.