| Conditions | 4 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function getItems(): array |
||
| 32 | { |
||
| 33 | if (empty($this->items)) { |
||
| 34 | $items = $this->container->getItems(); |
||
| 35 | |||
| 36 | $sortable = []; |
||
| 37 | foreach ($items as $key => $item) { |
||
| 38 | if ($item instanceof SortableInterface) { |
||
| 39 | $sortable[$key] = $item; |
||
| 40 | unset($items[$key]); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | uasort($sortable, [$this, 'ascending']); |
||
| 45 | $this->items = array_merge($sortable, $items); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $this->items; |
||
| 49 | } |
||
| 61 |