Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
8 | class EventManager |
||
9 | { |
||
10 | private $events; |
||
11 | |||
12 | private $data = []; |
||
13 | |||
14 | /** |
||
15 | * BasicEventManager constructor. |
||
16 | * |
||
17 | * @param $events |
||
18 | * |
||
19 | 8 | * @return EventManager |
|
20 | */ |
||
21 | 8 | public function init(array $events): self |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | 8 | * @param $listener |
|
30 | */ |
||
31 | 8 | public function startGuarding(callable $listener) |
|
37 | } |
||
38 | |||
39 | public function start() |
||
46 |
This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.