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

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