public function __toString()
{
$arguments = ['ssh'];
if ($this->identityFile) {
$arguments[] = '-i ' . escapeshellarg($this->identityFile);
}
if ($this->port) {
$arguments[] = '-p ' . $this->port;
}
$arguments[] = '-o ConnectTimeout=10';
$arguments[] = $this->user ? $this->user . '@' . $this->host : $this->host;
$arguments[] = escapeshellarg($this->command);
return implode(' ', $arguments);
}