| Conditions | 3 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php namespace Modules\Core\Navigation; |
||
| 7 | public static function order(Collection $items) |
||
| 8 | { |
||
| 9 | return $items->sort( |
||
| 10 | function ($item1, $item2) { |
||
| 11 | $item1 = self::getItem($item1); |
||
| 12 | $item2 = self::getItem($item2); |
||
| 13 | |||
| 14 | if ($item1['weight'] > $item2['weight']) { |
||
| 15 | return 1; |
||
| 16 | } |
||
| 17 | if ($item1['weight'] < $item2['weight']) { |
||
| 18 | return -1; |
||
| 19 | } |
||
| 20 | |||
| 21 | return 0; |
||
| 22 | } |
||
| 23 | ); |
||
| 24 | } |
||
| 25 | |||
| 35 |