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