parent::withValues($values) of type object<Equip\Structure\Dictionary> is not a sub-type of object<Equip\Structure\SortedDictionary>. It seems like you assume a child class of the class Equip\Structure\Dictionary to be always present.
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.
parent::withValue($key, $value) of type object<Equip\Structure\Dictionary> is not a sub-type of object<Equip\Structure\SortedDictionary>. It seems like you assume a child class of the class Equip\Structure\Dictionary to be always present.
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.
parent::withoutValue($key) of type object<Equip\Structure\Dictionary> is not a sub-type of object<Equip\Structure\SortedDictionary>. It seems like you assume a child class of the class Equip\Structure\Dictionary to be always present.
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.
Loading history...
25
1
);
26
}
27
28
/**
29
* Sorts values, respecting keys.
30
*
31
* @return void
32
*/
33
4
protected function sortValues()
34
{
35
4
asort($this->values);
36
4
}
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)
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.