Completed
Pull Request — master (#10)
by
unknown
02:00
created
src/Contracts/WebSocketServerContract.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@
 block discarded – undo
21 21
     const HEADER_HTTP1_1                   = 'HTTP/1.1 101 Web Socket Protocol Handshake';
22 22
     const HEADER_WEBSOCKET_ACCEPT_HASH     = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';
23 23
     const HEADERS_UPGRADE_KEY              = 'Upgrade',
24
-          HEADERS_CONNECTION_KEY           = 'Connection',
25
-          HEADERS_SEC_WEBSOCKET_ACCEPT_KEY = 'Sec-WebSocket-Accept';
24
+            HEADERS_CONNECTION_KEY           = 'Connection',
25
+            HEADERS_SEC_WEBSOCKET_ACCEPT_KEY = 'Sec-WebSocket-Accept';
26 26
     const HEADERS_UPGRADE_VALUE            = 'websocket',
27
-          HEADERS_CONNECTION_VALUE         = 'Upgrade';
27
+            HEADERS_CONNECTION_VALUE         = 'Upgrade';
28 28
     const HEADERS_EOL                      = "\r\n";
29 29
     const SEC_WEBSOCKET_KEY_PTRN           = '/Sec-WebSocket-Key:\s(.*)\n/';
30 30
 
Please login to merge, or discard this patch.
src/WebSocketServer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -312,7 +312,7 @@
 block discarded – undo
312 312
         }
313 313
 
314 314
         $key = $match[1];
315
-        $this->handshakes[(int)$client] = $key;
315
+        $this->handshakes[(int) $client] = $key;
316 316
         // sending header according to WebSocket Protocol
317 317
         $secWebSocketAccept = base64_encode(sha1(trim($key) . self::HEADER_WEBSOCKET_ACCEPT_HASH, true));
318 318
         $this->setHeadersUpgrade($secWebSocketAccept);
Please login to merge, or discard this patch.
src/Components/WscMain.php 2 patches
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     }
123 123
 
124 124
     /**
125
-     * @param        $payload
125
+     * @param        string $payload
126 126
      * @param string $opCode
127 127
      * @param bool   $masked
128 128
      *
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
     }
219 219
 
220 220
     /**
221
-     * @param $final
222
-     * @param $payload
223
-     * @param $opCode
224
-     * @param $masked
221
+     * @param boolean $final
222
+     * @param string $payload
223
+     * @param string $opCode
224
+     * @param boolean $masked
225 225
      *
226 226
      * @throws ConnectionException
227 227
      * @throws \Exception
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
      * @param integer $status  http://tools.ietf.org/html/rfc6455#section-7.4
424 424
      * @param string  $message A closing message, max 125 bytes.
425 425
      *
426
-     * @return bool|null|string
426
+     * @return null|string
427 427
      * @throws BadOpcodeException
428 428
      * @throws BadUriException
429 429
      * @throws ConnectionException
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
     }
553 553
 
554 554
     /**
555
-     * @return mixed|resource
555
+     * @return resource|null
556 556
      * @throws \InvalidArgumentException
557 557
      */
558 558
     private function getStreamContext()
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
     private function getPayloadData(string $data, int $payloadLength)
375 375
     {
376 376
         // Masking?
377
-        $mask = (bool) (\ord($data[1]) >> 7);  // Bit 0 in byte 1
377
+        $mask = (bool) (\ord($data[1]) >> 7); // Bit 0 in byte 1
378 378
         $payload = '';
379 379
         $maskingKey = '';
380 380
         // Get masking key.
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
      */
598 598
     private function getHeaders(string $pathWithQuery, array $headers): string
599 599
     {
600
-        return 'GET ' . $pathWithQuery . " HTTP/1.1\r\n" . \implode("\r\n", \array_map(function ($key, $value) {
600
+        return 'GET ' . $pathWithQuery . " HTTP/1.1\r\n" . \implode("\r\n", \array_map(function($key, $value) {
601 601
                 return "$key: $value";
602 602
             }, \array_keys($headers), $headers)) . "\r\n\r\n";
603 603
     }
Please login to merge, or discard this patch.