Completed
Push — master ( 7c9e4e...388b15 )
by Arthur
02:59
created
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 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         return 'GET ' . $pathWithQuery . " HTTP/1.1\r\n"
160 160
             . implode(
161 161
                 "\r\n", array_map(
162
-                    function ($key, $value) {
162
+                    function($key, $value) {
163 163
                         return "$key: $value";
164 164
                     }, array_keys($headers), $headers
165 165
                 )
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         // Binary string for header.
261 261
         $frameHeadBin = '';
262 262
         // Write FIN, final fragment bit.
263
-        $frameHeadBin .= (bool)$final ? '1' : '0';
263
+        $frameHeadBin .= (bool) $final ? '1' : '0';
264 264
         // RSV 1, 2, & 3 false and unused.
265 265
         $frameHeadBin .= '000';
266 266
         // Opcode rest of the byte.
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
         // Is this the final fragment?  // Bit 0 in byte 0
332 332
         /// @todo Handle huge payloads with multiple fragments.
333
-        $final = (bool)(ord($data[0]) & 1 << 7);
333
+        $final = (bool) (ord($data[0]) & 1 << 7);
334 334
 
335 335
         // Parse opcode
336 336
         $opcode_int = ord($data[0]) & 31; // Bits 4-7
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
     private function getPayloadData(string $data, int $payloadLength)
391 391
     {
392 392
         // Masking?
393
-        $mask = (bool)(ord($data[1]) >> 7);  // Bit 0 in byte 1
393
+        $mask = (bool) (ord($data[1]) >> 7); // Bit 0 in byte 1
394 394
         $payload = '';
395 395
         $maskingKey = '';
396 396
         // Get masking key.
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
      */
421 421
     private function getPayloadLength(string $data)
422 422
     {
423
-        $payloadLength = (int)ord($data[1]) & self::MASK_127; // Bits 1-7 in byte 1
423
+        $payloadLength = (int) ord($data[1]) & self::MASK_127; // Bits 1-7 in byte 1
424 424
         if ($payloadLength > self::MASK_125) {
425 425
             if ($payloadLength === self::MASK_126) {
426 426
                 $data = $this->read(2); // 126: Payload is a 16-bit unsigned int
Please login to merge, or discard this patch.