1 | <?php |
||
7 | trait CachedService |
||
8 | { |
||
9 | /** |
||
10 | * Respond to service call. |
||
11 | * |
||
12 | * @param array $parameters |
||
13 | * |
||
14 | * @return mixed |
||
15 | */ |
||
16 | public static function call(...$parameters) |
||
22 | |||
23 | /** |
||
24 | * Resolve the base service for the cached service. |
||
25 | * |
||
26 | * @return string |
||
27 | */ |
||
28 | private static function resolveBaseService() |
||
36 | |||
37 | /** |
||
38 | * Translate the cached service name to the base service name. |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | private static function translateBaseService() |
||
49 | } |
||
50 |
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.