Conditions | 3 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
14 | public function compare(PackedBox $boxA, PackedBox $boxB): int |
||
15 | 16 | { |
|
16 | $choice = $boxB->items->count() <=> $boxA->items->count(); |
||
17 | 16 | ||
18 | 13 | if ($choice === 0) { |
|
19 | $choice = $boxB->getVolumeUtilisation() <=> $boxA->getVolumeUtilisation(); |
||
20 | 16 | } |
|
21 | 13 | if ($choice === 0) { |
|
22 | $choice = $boxB->getUsedVolume() <=> $boxA->getUsedVolume(); |
||
23 | } |
||
24 | 16 | ||
25 | return $choice; |
||
26 | } |
||
28 |