@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function __construct($host, $port, $password, $timeout) |
| 41 | 41 | { |
| 42 | - $this->host = $host; |
|
| 42 | + $this->host = $host; |
|
| 43 | 43 | $this->port = $port; |
| 44 | 44 | $this->password = $password; |
| 45 | 45 | $this->timeout = $timeout; |
@@ -73,8 +73,9 @@ discard block |
||
| 73 | 73 | stream_set_timeout($this->socket, 3, 0); |
| 74 | 74 | |
| 75 | 75 | // check authorization |
| 76 | - if ($this->authorize()) |
|
| 77 | - return true; |
|
| 76 | + if ($this->authorize()) { |
|
| 77 | + return true; |
|
| 78 | + } |
|
| 78 | 79 | |
| 79 | 80 | return false; |
| 80 | 81 | } |
@@ -86,8 +87,9 @@ discard block |
||
| 86 | 87 | */ |
| 87 | 88 | public function disconnect() |
| 88 | 89 | { |
| 89 | - if ($this->socket) |
|
| 90 | - fclose($this->socket); |
|
| 90 | + if ($this->socket) { |
|
| 91 | + fclose($this->socket); |
|
| 92 | + } |
|
| 91 | 93 | } |
| 92 | 94 | |
| 93 | 95 | /** |
@@ -109,8 +111,9 @@ discard block |
||
| 109 | 111 | */ |
| 110 | 112 | public function sendCommand($command) |
| 111 | 113 | { |
| 112 | - if (!$this->isConnected()) |
|
| 113 | - return false; |
|
| 114 | + if (!$this->isConnected()) { |
|
| 115 | + return false; |
|
| 116 | + } |
|
| 114 | 117 | |
| 115 | 118 | // send command packet |
| 116 | 119 | $this->writePacket(Rcon::PACKET_COMMAND, Rcon::SERVERDATA_EXECCOMMAND, $command); |