Conditions | 4 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function getItems(): array |
||
31 | { |
||
32 | if (!$this->items) { |
||
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 | |||
60 |
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.