diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 790de749a3d..673dcfe0682 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -704,6 +704,10 @@ public static function loadFromXML( */ private static function loadDomDocument(string $base_dir, string $file_contents): DOMDocument { + if(!class_exists('DOMDocument')) { + throw new ConfigException('DOMDocument class not found. Have you installed the php-xml module?'); + } + $dom_document = new DOMDocument(); // there's no obvious way to set xml:base for a document when loading it from string