public function reset()
{
if ($this->process) {
try {
$this->process->stop();
} catch (\Exception $e) {
// ignore, we're trying to reset
}
}
if ($this->onFinish) {
call_user_func($this->onFinish);
}
$this->startedAt = null;
$this->finishedAt = null;
$this->returnCode = null;
$this->process = null;
$this->onFinish = null;
$this->outputFiles->reset();
}