1 | <?php |
||
25 | class OrderedMap extends AbstractMap |
||
26 | { |
||
27 | private $map; |
||
28 | |||
29 | private $list; |
||
30 | |||
31 | 29 | public function __construct(AbstractMap $map, AbstractList $list) |
|
36 | |||
37 | /** |
||
38 | * Adds an element to the Map |
||
39 | * |
||
40 | * @param KeyType $key The key to add |
||
|
|||
41 | * @param ValueType $value The value to add |
||
42 | */ |
||
43 | 25 | public function insert(Pair $pair) |
|
58 | |||
59 | /** |
||
60 | * Checks if a key exists |
||
61 | * |
||
62 | * @param KeyType $key The key to search for |
||
63 | * @return boolean |
||
64 | */ |
||
65 | 24 | public function containsKey($key) : bool |
|
69 | |||
70 | /** |
||
71 | * Removes an item from the map |
||
72 | * |
||
73 | * @param KeyType $key The key of the keypair to remove |
||
74 | */ |
||
75 | 1 | public function remove($key) |
|
82 | |||
83 | /** |
||
84 | * Gets an item from the map, looking it up by the specified key |
||
85 | * |
||
86 | * @param KeyType $key |
||
87 | * @return OrderedPair |
||
88 | */ |
||
89 | 5 | public function getPair($key) : Pair |
|
90 | { |
||
91 | 5 | return is_int($key) |
|
92 | ? $this->list->get($key) |
||
93 | 5 | : $this->map->getPair($key); |
|
94 | } |
||
95 | |||
96 | 7 | public function getIterator() |
|
100 | |||
101 | 27 | public function size() : int |
|
105 | |||
106 | 1 | public function indexOfKey($key) |
|
110 | } |
||
111 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.