diff --git a/src/Psalm/ErrorBaseline.php b/src/Psalm/ErrorBaseline.php index 227132769d2..9a22ec8295b 100644 --- a/src/Psalm/ErrorBaseline.php +++ b/src/Psalm/ErrorBaseline.php @@ -269,7 +269,7 @@ private static function writeToFile( $codeNode = $baselineDoc->createElement('code'); $textContent = trim($selection); if ($textContent !== htmlspecialchars($textContent)) { - $codeNode->append($baselineDoc->createCDATASection($textContent)); + $codeNode->appendChild($baselineDoc->createCDATASection($textContent)); } else { $codeNode->textContent = trim($textContent); }