Code Duplication    Length = 11-11 lines in 2 locations

src/Packer.php 1 location

@@ 225-235 (lines=11) @@
222
     *
223
     * @return int
224
     */
225
    private static function compare(PackedBox $boxA, PackedBox $boxB): int
226
    {
227
        $choice = $boxB->getItems()->count() <=> $boxA->getItems()->count();
228
        if ($choice === 0) {
229
            $choice = $boxA->getInnerVolume() <=> $boxB->getInnerVolume();
230
        }
231
        if ($choice === 0) {
232
            $choice = $boxA->getWeight() <=> $boxB->getWeight();
233
        }
234
235
        return $choice;
236
    }
237
}
238

src/PackedBoxList.php 1 location

@@ 103-113 (lines=11) @@
100
     *
101
     * @return int
102
     */
103
    private function compare(PackedBox $boxA, PackedBox $boxB): int
104
    {
105
        $choice = $boxB->getItems()->count() <=> $boxA->getItems()->count();
106
        if ($choice === 0) {
107
            $choice = $boxB->getInnerVolume() <=> $boxA->getInnerVolume();
108
        }
109
        if ($choice === 0) {
110
            $choice = $boxA->getWeight() <=> $boxB->getWeight();
111
        }
112
113
        return $choice;
114
    }
115
116
    /**