Conditions | 3 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public static function sortByPriority(array &$haystack): void |
||
23 | { |
||
24 | uasort($haystack, function ($a, $b) { |
||
25 | $prorityOfA = $a instanceof Priority ? $a->getPriority() : 0; |
||
26 | $prorityOfB = $b instanceof Priority ? $b->getPriority() : 0; |
||
27 | |||
28 | return $prorityOfA <=> $prorityOfB; |
||
29 | }); |
||
32 |