Code Duplication    Length = 11-11 lines in 2 locations

src/PackedBoxList.php 2 locations

@@ 34-44 (lines=11) @@
31
     *
32
     * @return int
33
     */
34
    public function compare($boxA, $boxB)
35
    {
36
        $choice = $boxA->getItems()->count() - $boxB->getItems()->count();
37
        if ($choice === 0) {
38
            $choice = $boxB->getBox()->getInnerVolume() - $boxA->getBox()->getInnerVolume();
39
        }
40
        if ($choice === 0) {
41
            $choice = $boxA->getWeight() - $boxB->getWeight();
42
        }
43
44
        return $choice;
45
    }
46
47
    /**
@@ 55-65 (lines=11) @@
52
     *
53
     * @return int
54
     */
55
    public function reverseCompare($boxA, $boxB)
56
    {
57
        $choice = $boxB->getItems()->count() - $boxA->getItems()->count();
58
        if ($choice === 0) {
59
            $choice = $boxA->getBox()->getInnerVolume() - $boxB->getBox()->getInnerVolume();
60
        }
61
        if ($choice === 0) {
62
            $choice = $boxB->getWeight() - $boxA->getWeight();
63
        }
64
65
        return $choice;
66
    }
67
68
    /**