1 | <?php |
||
21 | trait ContainerTrait |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * @return mixed |
||
26 | */ |
||
27 | public function validation() |
||
31 | |||
32 | /** |
||
33 | * @param null $target |
||
34 | * |
||
35 | * @return mixed |
||
36 | */ |
||
37 | public function redirect($target = null) |
||
41 | |||
42 | /** |
||
43 | * @param $key |
||
44 | * |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function post($key) |
||
51 | |||
52 | /** |
||
53 | * @param $object |
||
54 | * @param null $params |
||
55 | * |
||
56 | * @return mixed |
||
57 | */ |
||
58 | public function new($object, $params = null) |
||
62 | |||
63 | /** |
||
64 | * @param string $key |
||
65 | * @param string|null $subKey |
||
66 | */ |
||
67 | public function unsetSession(string $key, string $subKey = null) |
||
71 | |||
72 | /** |
||
73 | * @return mixed |
||
74 | */ |
||
75 | public function pagination() |
||
79 | |||
80 | /** |
||
81 | * @param $value |
||
82 | */ |
||
83 | public function setPagination($value): void |
||
87 | |||
88 | |||
89 | /** |
||
90 | * @param string $key |
||
91 | * @param string $value |
||
92 | * @param string|null $subKey |
||
93 | */ |
||
94 | public function setSession(string $key, string $value, string $subKey = null): void |
||
98 | |||
99 | /** |
||
100 | * @return mixed |
||
101 | */ |
||
102 | public function db() |
||
106 | |||
107 | /** |
||
108 | * @return mixed |
||
109 | */ |
||
110 | abstract public function container(): ContainerInterface; |
||
111 | } |
||
112 |
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.