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