private function didRepackActuallyHelp(PackedBox $oldBoxA, PackedBox $oldBoxB, PackedBox $newBoxA, PackedBox $newBoxB): bool
    {
        $oldList = new PackedBoxList();
        $oldList->insertFromArray([$oldBoxA, $oldBoxB]);

        $newList = new PackedBoxList();
        $newList->insertFromArray([$newBoxA, $newBoxB]);

        return $newList->getWeightVariance() < $oldList->getWeightVariance();
    }
private function didRepackActuallyHelp(PackedBox $oldBoxA, PackedBox $oldBoxB, PackedBox $newBoxA, PackedBox $newBoxB): bool
    {
        $oldList = new PackedBoxList();
        $oldList->insertFromArray([$oldBoxA, $oldBoxB]);

        $newList = new PackedBoxList();
        $newList->insertFromArray([$newBoxA, $newBoxB]);

        return $newList->getWeightVariance() < $oldList->getWeightVariance();
    }
private function didRepackActuallyHelp ( PackedBox $ oldBoxA , PackedBox $ oldBoxB , PackedBox $ newBoxA , PackedBox $ newBoxB ) : bool { $ oldList = new PackedBoxList ( ) ; $ oldList -> insertFromArray ( [ $ oldBoxA , $ oldBoxB ] ) ; $ newList = new PackedBoxList ( ) ; $ newList -> insertFromArray ( [ $ newBoxA , $ newBoxB ] ) ; return $ newList -> getWeightVariance ( ) < $ oldList -> getWeightVariance ( ) ; }
Not every attempted repack is actually helpful - sometimes moving an item between two otherwise identical
boxes, or sometimes the box used for the now lighter set of items actually weighs more when empty causing
an increase in total weight.

@param PackedBox $oldBoxA
@param PackedBox $oldBoxB
@param PackedBox $newBoxA
@param PackedBox $newBoxB

@return bool
Not every attempted repack is actually helpful - sometimes moving an item between two otherwise identical boxes or sometimes the box used for the now lighter set of items actually weighs more when empty causing an increase in total weight .