/**
* Save json encoded function&method signature to a map.
* @return int - Exit code for process
*/
private static function dumpSignaturesToFile(CodeBase $code_base, string $filename) : int
{
$encoded_signatures = json_encode($code_base->exportFunctionAndMethodSet(), JSON_PRETTY_PRINT);
if (!file_put_contents($filename, $encoded_signatures)) {
error_log(sprintf("Could not save contents to path '%s'\n", $filename));
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}