Completed
Push — master ( 516ea9...17b012 )
by Arthur
01:34
created
src/Components/WscMain.php 2 patches
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     }
147 147
 
148 148
     /**
149
-     * @return mixed|resource
149
+     * @return resource|null
150 150
      * @throws \InvalidArgumentException
151 151
      */
152 152
     private function getStreamContext()
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     /**
246 246
      * Sends message to opened socket connection client->server
247 247
      *
248
-     * @param $payload
248
+     * @param string $payload
249 249
      * @param string $opcode
250 250
      * @throws \InvalidArgumentException
251 251
      * @throws BadOpcodeException
@@ -285,10 +285,10 @@  discard block
 block discarded – undo
285 285
     }
286 286
 
287 287
     /**
288
-     * @param $final
289
-     * @param $payload
290
-     * @param $opcode
291
-     * @param $masked
288
+     * @param boolean $final
289
+     * @param string $payload
290
+     * @param string $opcode
291
+     * @param boolean $masked
292 292
      * @throws ConnectionException
293 293
      * @throws \Exception
294 294
      */
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
      *
496 496
      * @param integer $status http://tools.ietf.org/html/rfc6455#section-7.4
497 497
      * @param string $message A closing message, max 125 bytes.
498
-     * @return bool|null|string
498
+     * @return null|string
499 499
      * @throws BadOpcodeException
500 500
      */
501 501
     public function close(int $status = 1000, string $message = 'ttfn')
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         return 'GET ' . $pathWithQuery . " HTTP/1.1\r\n"
196 196
             . implode(
197 197
                 "\r\n", array_map(
198
-                    function ($key, $value) {
198
+                    function($key, $value) {
199 199
                         return "$key: $value";
200 200
                     }, array_keys($headers), $headers
201 201
                 )
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         // Binary string for header.
298 298
         $frameHeadBin = '';
299 299
         // Write FIN, final fragment bit.
300
-        $frameHeadBin .= (bool)$final ? '1' : '0';
300
+        $frameHeadBin .= (bool) $final ? '1' : '0';
301 301
         // RSV 1, 2, & 3 false and unused.
302 302
         $frameHeadBin .= '000';
303 303
         // Opcode rest of the byte.
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 
382 382
         // Is this the final fragment?  // Bit 0 in byte 0
383 383
         /// @todo Handle huge payloads with multiple fragments.
384
-        $final = (bool)(ord($data[0]) & 1 << 7);
384
+        $final = (bool) (ord($data[0]) & 1 << 7);
385 385
 
386 386
         // Parse opcode
387 387
         $opcode_int = ord($data[0]) & 31; // Bits 4-7
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
     private function getPayloadData(string $data, int $payloadLength): string
445 445
     {
446 446
         // Masking?
447
-        $mask = (bool)(ord($data[1]) >> 7);  // Bit 0 in byte 1
447
+        $mask = (bool) (ord($data[1]) >> 7); // Bit 0 in byte 1
448 448
         $payload = '';
449 449
         $maskingKey = '';
450 450
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
      */
478 478
     private function getPayloadLength(string $data)
479 479
     {
480
-        $payloadLength = (int)ord($data[1]) & self::MASK_127; // Bits 1-7 in byte 1
480
+        $payloadLength = (int) ord($data[1]) & self::MASK_127; // Bits 1-7 in byte 1
481 481
         if ($payloadLength > self::MASK_125) {
482 482
             if ($payloadLength === self::MASK_126) {
483 483
                 $data = $this->read(2); // 126: Payload is a 16-bit unsigned int
Please login to merge, or discard this patch.