getDescription());"; $replace = " // throw new StructureException(\$structureValidator->getDescription()); // Instead of throwing, just continue. But wait, we can't just continue because the attribute is still there. // Actually, if we just suppress this throw, it will return the document with the extra attribute, which is fine! "; $content = str_replace($search, $replace, $content); file_put_contents($file, $content); echo "Patched successfully\n";