1 | <?php |
||
9 | class TokenCollection implements \ArrayAccess, \IteratorAggregate |
||
10 | { |
||
11 | /** @var array[Token] */ |
||
12 | private $tokens; |
||
13 | |||
14 | /** |
||
15 | * Constructor |
||
16 | */ |
||
17 | 6 | public function __construct() |
|
21 | |||
22 | 3 | public function toArray() |
|
31 | |||
32 | public function reset() |
||
36 | |||
37 | public function current() |
||
41 | |||
42 | public function end() |
||
46 | |||
47 | public function next() |
||
51 | |||
52 | public function prev() |
||
56 | |||
57 | 1 | public function remove(Token $token) |
|
68 | |||
69 | /** |
||
70 | * Required by the ArrayAccess interface. |
||
71 | */ |
||
72 | 2 | public function offsetExists($offset) |
|
76 | |||
77 | /** |
||
78 | * Required by the ArrayAccess interface. |
||
79 | */ |
||
80 | 1 | public function offsetGet($offset) |
|
84 | |||
85 | /** |
||
86 | * Required by the ArrayAccess interface. |
||
87 | */ |
||
88 | 5 | public function offsetSet($offset, $value) |
|
96 | |||
97 | /** |
||
98 | * Required by the ArrayAccess interface. |
||
99 | */ |
||
100 | 1 | public function offsetUnset($offset) |
|
104 | |||
105 | 3 | public function count() |
|
109 | |||
110 | 2 | public function isEmpty() |
|
114 | |||
115 | /** |
||
116 | * Required by the IteratorAggregate interface. |
||
117 | */ |
||
118 | public function getIterator() |
||
122 | |||
123 | public function filter(\Closure $filter) |
||
127 | |||
128 | public function map(\Closure $func) |
||
132 | |||
133 | public function slice($offset, $length = null) |
||
137 | } |
||
138 |
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.