1 | <?php |
||
5 | class SortedDictionary extends Dictionary |
||
6 | { |
||
7 | 2 | public function withValues(array $values) |
|
13 | |||
14 | 2 | public function withValue($key, $value) |
|
20 | |||
21 | 1 | public function withoutValue($key) |
|
27 | |||
28 | /** |
||
29 | * Sorts values, respecting keys. |
||
30 | * |
||
31 | * @return void |
||
32 | */ |
||
33 | 4 | protected function sortValues() |
|
37 | |||
38 | /** |
||
39 | * Sorts the dictionary if it is not the same. |
||
40 | * |
||
41 | * @param SortedDictionary $copy |
||
42 | * |
||
43 | * @return SortedDictionary |
||
44 | */ |
||
45 | 4 | private function sortChanged(SortedDictionary $copy) |
|
53 | } |
||
54 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.