protected  function deepCopy($patches)
    {
        $patchesCopy = array();
        foreach ($patches as $patch) {
            $patchCopy = clone $patch;
            $patchesCopy[] = $patchCopy;
        }
        return $patchesCopy;
    }