diff --git a/src/Psalm/Internal/PluginManager/ConfigFile.php b/src/Psalm/Internal/PluginManager/ConfigFile.php index 4fd02542575..a945dd24931 100644 --- a/src/Psalm/Internal/PluginManager/ConfigFile.php +++ b/src/Psalm/Internal/PluginManager/ConfigFile.php @@ -10,6 +10,7 @@ use function assert; use function file_get_contents; use function file_put_contents; +use function sprintf; use function strpos; use function substr; @@ -143,6 +144,9 @@ private function saveXml(DOMDocument $config_xml): void } } - file_put_contents($this->path, $new_file_contents); + $result = file_put_contents($this->path, $new_file_contents); + if ($result === false) { + throw new RuntimeException(sprintf('Unable to save xml to %s', $this->path)); + } } }