Code Duplication    Length = 11-11 lines in 2 locations

src/PackedBoxList.php 1 location

@@ 109-119 (lines=11) @@
106
     *
107
     * @return int
108
     */
109
    private function compare(PackedBox $boxA, PackedBox $boxB): int
110
    {
111
        $choice = $boxB->getItems()->count() <=> $boxA->getItems()->count();
112
        if ($choice === 0) {
113
            $choice = $boxB->getInnerVolume() <=> $boxA->getInnerVolume();
114
        }
115
        if ($choice === 0) {
116
            $choice = $boxA->getWeight() <=> $boxB->getWeight();
117
        }
118
119
        return $choice;
120
    }
121
122
    /**

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