public function getProcess() {
if (!count($this->arguments)) {
throw new \LogicException('You must add() command arguments before calling getProcess().');
}
$options = $this->options;
$script = implode(' ', array_map('escapeshellarg', $this->arguments));
if ($this->inheritEnv) {
$env = $this->env ? $this->env + $_ENV : null;
}
else {
$env = $this->env;
}
return new Process($script, $this->cwd, $env, $this->stdin, $this->timeout, $options);
}