1 | <?php |
||
18 | abstract class AbstractList extends AbstractCollection implements ListInterface |
||
19 | { |
||
20 | /** |
||
21 | * Returns the index of the first instance of the element, -1 if the element |
||
22 | * doesn't exist |
||
23 | * |
||
24 | * @param mixed $element |
||
25 | * @return int |
||
26 | */ |
||
27 | 2 | public function indexOf($element): int |
|
33 | |||
34 | /** |
||
35 | * Returns the index of the last instance of the element, -1 if the element |
||
36 | * doesn't exist |
||
37 | * |
||
38 | * @param mixed $element |
||
39 | * @return int |
||
40 | */ |
||
41 | 2 | public function lastIndexOf($element): int |
|
50 | |||
51 | /** |
||
52 | * Returns a new ListInterface ranging from $fromIndex inclusive to |
||
53 | * $toIndex exclusive |
||
54 | * |
||
55 | * @param int $fromIndex |
||
56 | * @param int $toIndex |
||
57 | * @return ListInterface |
||
58 | * @throws \OutOfBoundsException If to or from index does not exist |
||
59 | */ |
||
60 | 4 | public function subList(int $fromIndex, int $toIndex): ListInterface |
|
70 | } |
||
71 |
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.