1 | <?php |
||
7 | trait ArgumentAwarePluginTrait { |
||
8 | |||
9 | /** |
||
10 | * @param $definition |
||
11 | * |
||
12 | * @return array |
||
13 | */ |
||
14 | protected function buildArguments($definition) { |
||
23 | |||
24 | /** |
||
25 | * @param $argument |
||
26 | * |
||
27 | * @return array |
||
28 | */ |
||
29 | protected function buildArgumentType($argument) { |
||
33 | |||
34 | /** |
||
35 | * @param $argument |
||
36 | * @param $definition |
||
37 | * |
||
38 | * @return string |
||
39 | */ |
||
40 | protected function buildArgumentDescription($argument, $definition) { |
||
43 | |||
44 | /** |
||
45 | * @param $argument |
||
46 | * @param $definition |
||
47 | * |
||
48 | * @return null |
||
49 | */ |
||
50 | protected function buildArgumentDefault($argument, $definition) { |
||
53 | |||
54 | } |
||
55 |
This check compares calls to functions or methods with their respective definitions. If the call has more 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.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.