Completed
Branch master (2d58e0)
by Arthur
01:43
created
src/Contracts/WscCommonsContract.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     const MAX_BYTES_READ = 65535,
13 13
         DEFAULT_TIMEOUT = 5,
14 14
         DEFAULT_FRAGMENT_SIZE = 4096,
15
-          DEFAULT_RESPONSE_HEADER    = 1024;
15
+            DEFAULT_RESPONSE_HEADER    = 1024;
16 16
     const SEC_WEBSOCKET_ACCEPT_PTTRN = '/Sec-WebSocket-Accept:\s(.*)$/mUi';
17 17
     const SERVER_KEY_ACCEPT          = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';
18 18
     // MASKS
Please login to merge, or discard this patch.
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/Components/WscMain.php 1 patch
Doc Comments   +13 added lines patch added patch discarded remove patch
@@ -167,6 +167,9 @@  discard block
 block discarded – undo
167 167
         return $this->options['fragment_size'];
168 168
     }
169 169
 
170
+    /**
171
+     * @param string $payload
172
+     */
170 173
     public function send($payload, $opcode = 'text', $masked = true)
171 174
     {
172 175
         if (!$this->is_connected) {
@@ -199,6 +202,12 @@  discard block
 block discarded – undo
199 202
         }
200 203
     }
201 204
 
205
+    /**
206
+     * @param boolean $final
207
+     * @param string $payload
208
+     * @param string $opcode
209
+     * @param boolean $masked
210
+     */
202 211
     protected function send_fragment($final, $payload, $opcode, $masked)
203 212
     {
204 213
         // Binary string for header.
@@ -375,6 +384,9 @@  discard block
 block discarded – undo
375 384
         return $this->receive(); // Receiving a close frame will close the socket now.
376 385
     }
377 386
 
387
+    /**
388
+     * @param string $data
389
+     */
378 390
     protected function write($data)
379 391
     {
380 392
         $written = fwrite($this->socket, $data);
@@ -412,6 +424,7 @@  discard block
 block discarded – undo
412 424
 
413 425
     /**
414 426
      * Helper to convert a binary to a string of '0' and '1'.
427
+     * @param string $string
415 428
      */
416 429
     protected static function sprintB($string)
417 430
     {
Please login to merge, or discard this patch.