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