@@ -124,6 +124,9 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | + /** |
|
128 | + * @param string $host |
|
129 | + */ |
|
127 | 130 | private function proxy($host, $ip, $port, $auth) |
128 | 131 | { |
129 | 132 | // Set the stream context options if they're already set in the config |
@@ -154,7 +157,7 @@ discard block |
||
154 | 157 | |
155 | 158 | |
156 | 159 | /** |
157 | - * @return mixed|resource |
|
160 | + * @return resource|null |
|
158 | 161 | * @throws \InvalidArgumentException |
159 | 162 | */ |
160 | 163 | private function getStreamContext() |
@@ -257,7 +260,7 @@ discard block |
||
257 | 260 | /** |
258 | 261 | * Sends message to opened socket connection client->server |
259 | 262 | * |
260 | - * @param $payload |
|
263 | + * @param string $payload |
|
261 | 264 | * @param string $opcode |
262 | 265 | * @throws \InvalidArgumentException |
263 | 266 | * @throws BadOpcodeException |
@@ -329,7 +332,7 @@ discard block |
||
329 | 332 | * |
330 | 333 | * @param integer $status http://tools.ietf.org/html/rfc6455#section-7.4 |
331 | 334 | * @param string $message A closing message, max 125 bytes. |
332 | - * @return bool|null|string |
|
335 | + * @return null|string |
|
333 | 336 | * @throws \InvalidArgumentException |
334 | 337 | * @throws BadOpcodeException |
335 | 338 | * @throws BadUriException |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $context |
138 | 138 | ); |
139 | 139 | |
140 | - $write = "CONNECT $host HTTP/1.1\r\n"; |
|
140 | + $write = "CONNECT $host HTTP/1.1\r\n"; |
|
141 | 141 | if ($auth) { |
142 | 142 | $write .= "Proxy-Authorization: Basic $auth\r\n"; |
143 | 143 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | . implode( |
206 | 206 | "\r\n", |
207 | 207 | array_map( |
208 | - function ($key, $value) { |
|
208 | + function($key, $value) { |
|
209 | 209 | return "$key: $value"; |
210 | 210 | }, |
211 | 211 | array_keys($headers), |
@@ -190,7 +190,7 @@ |
||
190 | 190 | $this->has_proxy = true; |
191 | 191 | $this->proxy_ip = $ip; |
192 | 192 | $this->proxy_port = $port; |
193 | - $this->proxy_auth = ($username && $password) ? base64_encode($username.':'.$password) : null; |
|
193 | + $this->proxy_auth = ($username && $password) ? base64_encode($username . ':' . $password) : null; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | public function getProxy(&$ip, &$port, &$auth) |