| Conditions | 5 |
| Paths | 5 |
| Total Lines | 12 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 22 | public function compare($itemA, $itemB) |
|
| 28 | { |
||
| 29 | 22 | if ($itemA->getVolume() > $itemB->getVolume()) { |
|
| 30 | 11 | return 1; |
|
| 31 | 22 | } elseif ($itemA->getVolume() < $itemB->getVolume()) { |
|
| 32 | 10 | return -1; |
|
| 33 | 20 | } elseif ($itemA->getWeight() !== $itemB->getWeight()) { |
|
| 34 | 3 | return $itemA->getWeight() - $itemB->getWeight(); |
|
| 35 | 20 | } elseif ($itemA->getDescription() < $itemB->getDescription()) { |
|
| 36 | 4 | return 1; |
|
| 37 | } else { |
||
| 38 | 18 | return -1; |
|
| 39 | } |
||
| 76 |