@@ -558,7 +558,7 @@ |
||
| 558 | 558 | * @param string $type |
| 559 | 559 | * @param bool $masked |
| 560 | 560 | * |
| 561 | - * @return bool|string |
|
| 561 | + * @return false|string |
|
| 562 | 562 | */ |
| 563 | 563 | private function hybi10Encode(string $payload, string $type = 'text', bool $masked = TRUE) |
| 564 | 564 | { |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * @date 11.05.18 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -declare(strict_types = 1); |
|
| 15 | +declare(strict_types=1); |
|
| 16 | 16 | |
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\Client; |
| 18 | 18 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function connect() : void |
| 129 | 129 | { |
| 130 | - $resource = @stream_socket_client('tcp://' . $this->configuration->getHost() . ':' . $this->configuration->getPort()); |
|
| 130 | + $resource = @stream_socket_client('tcp://'.$this->configuration->getHost().':'.$this->configuration->getPort()); |
|
| 131 | 131 | |
| 132 | 132 | if (!$resource) { |
| 133 | 133 | throw new Exceptions\ConnectionException('Opening socket failed.'); |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | private function parseData(array $response) : void |
| 299 | 299 | { |
| 300 | 300 | if (!$this->connected && isset($response['Sec-Websocket-Accept'])) { |
| 301 | - if (base64_encode(pack('H*', sha1($this->configuration->getKey() . '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'))) === $response['Sec-Websocket-Accept']) { |
|
| 301 | + if (base64_encode(pack('H*', sha1($this->configuration->getKey().'258EAFA5-E914-47DA-95CA-C5AB0DC85B11'))) === $response['Sec-Websocket-Accept']) { |
|
| 302 | 302 | $this->connected = TRUE; |
| 303 | 303 | } |
| 304 | 304 | } |
@@ -338,15 +338,15 @@ discard block |
||
| 338 | 338 | $origin = $this->configuration->getOrigin() ? $this->configuration->getOrigin() : 'null'; |
| 339 | 339 | |
| 340 | 340 | return |
| 341 | - "GET {$this->configuration->getPath()} HTTP/1.1" . "\r\n" . |
|
| 342 | - "Origin: {$origin}" . "\r\n" . |
|
| 343 | - "Host: {$host}:{$this->configuration->getPort()}" . "\r\n" . |
|
| 344 | - "Sec-WebSocket-Key: {$this->configuration->getKey()}" . "\r\n" . |
|
| 345 | - "User-Agent: IPubWebSocketClient/" . self::VERSION . "\r\n" . |
|
| 346 | - "Upgrade: websocket" . "\r\n" . |
|
| 347 | - "Connection: Upgrade" . "\r\n" . |
|
| 348 | - "Sec-WebSocket-Protocol: wamp" . "\r\n" . |
|
| 349 | - "Sec-WebSocket-Version: 13" . "\r\n" . "\r\n"; |
|
| 341 | + "GET {$this->configuration->getPath()} HTTP/1.1"."\r\n". |
|
| 342 | + "Origin: {$origin}"."\r\n". |
|
| 343 | + "Host: {$host}:{$this->configuration->getPort()}"."\r\n". |
|
| 344 | + "Sec-WebSocket-Key: {$this->configuration->getKey()}"."\r\n". |
|
| 345 | + "User-Agent: IPubWebSocketClient/".self::VERSION."\r\n". |
|
| 346 | + "Upgrade: websocket"."\r\n". |
|
| 347 | + "Connection: Upgrade"."\r\n". |
|
| 348 | + "Sec-WebSocket-Protocol: wamp"."\r\n". |
|
| 349 | + "Sec-WebSocket-Version: 13"."\r\n"."\r\n"; |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $parsed['status'] = $field; |
| 382 | 382 | |
| 383 | 383 | } else { |
| 384 | - $content .= $field . "\r\n"; |
|
| 384 | + $content .= $field."\r\n"; |
|
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | 387 | |
@@ -18,10 +18,8 @@ |
||
| 18 | 18 | |
| 19 | 19 | use Nette; |
| 20 | 20 | use Nette\Utils; |
| 21 | - |
|
| 22 | 21 | use React\EventLoop; |
| 23 | 22 | use React\Stream; |
| 24 | - |
|
| 25 | 23 | use IPub\WebSocketsWAMPClient\Exceptions; |
| 26 | 24 | use Tracy\Debugger; |
| 27 | 25 | |
@@ -17,9 +17,7 @@ |
||
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\Logger; |
| 18 | 18 | |
| 19 | 19 | use Nette; |
| 20 | - |
|
| 21 | 20 | use Psr\Log; |
| 22 | - |
|
| 23 | 21 | use IPub; |
| 24 | 22 | |
| 25 | 23 | /** |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * @date 11.05.18 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -declare(strict_types = 1); |
|
| 15 | +declare(strict_types=1); |
|
| 16 | 16 | |
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\Logger; |
| 18 | 18 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $this->formatter->writeln($message); |
| 197 | 197 | |
| 198 | 198 | } else { |
| 199 | - echo $message . "\r\n"; |
|
| 199 | + echo $message."\r\n"; |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | * @date 11.05.18 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -declare(strict_types = 1); |
|
| 15 | +declare(strict_types=1); |
|
| 16 | 16 | |
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\DI; |
| 18 | 18 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | ]; |
| 105 | 105 | |
| 106 | 106 | foreach ($commands as $name => $cmd) { |
| 107 | - $builder->addDefinition($this->prefix('commands' . lcfirst($name))) |
|
| 107 | + $builder->addDefinition($this->prefix('commands'.lcfirst($name))) |
|
| 108 | 108 | ->setType($cmd) |
| 109 | 109 | ->addTag(Console\DI\ConsoleExtension::TAG_COMMAND); |
| 110 | 110 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * @date 11.05.18 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -declare(strict_types = 1); |
|
| 15 | +declare(strict_types=1); |
|
| 16 | 16 | |
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\Client; |
| 18 | 18 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * @date 11.05.18 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -declare(strict_types = 1); |
|
| 15 | +declare(strict_types=1); |
|
| 16 | 16 | |
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\Exceptions; |
| 18 | 18 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * @date 11.05.18 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -declare(strict_types = 1); |
|
| 15 | +declare(strict_types=1); |
|
| 16 | 16 | |
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\Commands; |
| 18 | 18 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * @date 11.05.18 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -declare(strict_types = 1); |
|
| 15 | +declare(strict_types=1); |
|
| 16 | 16 | |
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\Logger\Formatter; |
| 18 | 18 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * @date 11.05.18 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -declare(strict_types = 1); |
|
| 15 | +declare(strict_types=1); |
|
| 16 | 16 | |
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\Logger\Formatter; |
| 18 | 18 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * @date 11.05.18 |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -declare(strict_types = 1); |
|
| 15 | +declare(strict_types=1); |
|
| 16 | 16 | |
| 17 | 17 | namespace IPub\WebSocketsWAMPClient\Exceptions; |
| 18 | 18 | |