From 1a30da6225654b9eaf490b301b2e69a745ac413d Mon Sep 17 00:00:00 2001 From: Andrew Nagy Date: Wed, 2 Feb 2022 18:16:06 +0000 Subject: [PATCH] Fixes #7560 manually look for DOMDocument --- src/Psalm/Config.php | 4 ++++ 1 file changed, 4 insertions(+) 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