@@ -27,22 +27,27 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function getCommand($hostConnection = true) |
| 29 | 29 | { |
| 30 | - if(is_null($this->username)) |
|
| 31 | - throw new \InvalidArgumentException("You must specify a SSH username"); |
|
| 30 | + if(is_null($this->username)) { |
|
| 31 | + throw new \InvalidArgumentException("You must specify a SSH username"); |
|
| 32 | + } |
|
| 32 | 33 | |
| 33 | - if(is_null($this->host)) |
|
| 34 | - throw new \InvalidArgumentException("You must specify a SSH host to connect"); |
|
| 34 | + if(is_null($this->host)) { |
|
| 35 | + throw new \InvalidArgumentException("You must specify a SSH host to connect"); |
|
| 36 | + } |
|
| 35 | 37 | |
| 36 | 38 | $command = new ShellCommand($this->executable); |
| 37 | 39 | |
| 38 | - if($this->port != 22) |
|
| 39 | - $command->addArgument("p", $this->port); |
|
| 40 | + if($this->port != 22) { |
|
| 41 | + $command->addArgument("p", $this->port); |
|
| 42 | + } |
|
| 40 | 43 | |
| 41 | - if(!is_null($this->publicKey)) |
|
| 42 | - $command->addArgument("i", $this->publicKey); |
|
| 44 | + if(!is_null($this->publicKey)) { |
|
| 45 | + $command->addArgument("i", $this->publicKey); |
|
| 46 | + } |
|
| 43 | 47 | |
| 44 | - if($hostConnection) |
|
| 45 | - $command->addParameter($this->getHostConnection()); |
|
| 48 | + if($hostConnection) { |
|
| 49 | + $command->addParameter($this->getHostConnection()); |
|
| 50 | + } |
|
| 46 | 51 | |
| 47 | 52 | return $command; |
| 48 | 53 | } |