Skip to content

Commit

Permalink
Throw exception if file_put_contents failed
Browse files Browse the repository at this point in the history
  • Loading branch information
a.dmitryuk committed Feb 18, 2022
1 parent f72f2f6 commit dc87641
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Psalm/Internal/PluginManager/ConfigFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,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));
}
}
}

0 comments on commit dc87641

Please sign in to comment.