$container is of type Everlution\Navigation\ContainerInterface, but the property $container was declared to be of type Everlution\Navigation\FilteredContainerInterface. Are you sure that you always receive this specific sub-class here, or does it make sense to add an instanceof check?
Our type inference engine has found a suspicous assignment of a value to a property.
This check raises an issue when a value that can be of a given class or a super-class
is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.
The expression $this->items of type Everlution\Navigation\Item\ItemInterface[] is implicitly converted to a boolean; are you sure this is intended? If so, consider using empty($expr) instead to make it clear that you intend to check for an array without elements.
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an
empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using empty(..) or !empty(...) instead.
Loading history...
33
$items = $this->container->getItems();
34
35
$sortable = [];
36
foreach ($items as $key => $item) {
37
if ($item instanceof SortableInterface) {
38
$sortable[$key] = $item;
39
unset($items[$key]);
40
}
41
}
42
43
uasort($sortable, [$this, 'ascending']);
44
$this->items = array_merge($sortable, $items);
45
}
46
47
return $this->items;
48
}
49
50
public function get(string $name): ItemInterface
51
{
52
return $this->items[$name];
53
}
54
55
private function ascending(SortableInterface $first, SortableInterface $second)
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.