public function dumpToFile(string $dumpFile)
{
$this->guardAgainstIncompleteCredentials();
$tempFileHandle = tmpfile();
fwrite($tempFileHandle, $this->getContentsOfCredentialsFile());
$temporaryCredentialsFile = stream_get_meta_data($tempFileHandle)['uri'];
$command = $this->getDumpCommand($dumpFile, $temporaryCredentialsFile);
$process = new Process($command);
if (!is_null($this->timeout)) {
$process->setTimeout($this->timeout);
}
$process->run();
$this->checkIfDumpWasSuccessFul($process, $dumpFile);
}