Completed
Push — master ( f101b6...0f7687 )
by Arthur
01:56
created
src/Components/WSClientTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     private function getPayloadLength(string $data)
64 64
     {
65
-        $payloadLength = (int)ord($data[1]) & self::MASK_127; // Bits 1-7 in byte 1
65
+        $payloadLength = (int) ord($data[1]) & self::MASK_127; // Bits 1-7 in byte 1
66 66
         if ($payloadLength > self::MASK_125) {
67 67
             if ($payloadLength === self::MASK_126) {
68 68
                 $data = $this->read(2); // 126: Payload is a 16-bit unsigned int
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     private function getPayloadData(string $data, int $payloadLength): string
85 85
     {
86 86
         // Masking?
87
-        $mask = (bool)(ord($data[1]) >> 7);  // Bit 0 in byte 1
87
+        $mask = (bool) (ord($data[1]) >> 7); // Bit 0 in byte 1
88 88
         $payload = '';
89 89
         $maskingKey = '';
90 90
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
         // Is this the final fragment?  // Bit 0 in byte 0
128 128
         /// @todo Handle huge payloads with multiple fragments.
129
-        $final = (bool)(ord($data[0]) & 1 << 7);
129
+        $final = (bool) (ord($data[0]) & 1 << 7);
130 130
 
131 131
         // Parse opcode
132 132
         $opcodeInt = ord($data[0]) & 31; // Bits 4-7
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         // Binary string for header.
196 196
         $frameHeadBin = '';
197 197
         // Write FIN, final fragment bit.
198
-        $frameHeadBin .= (bool)$final ? '1' : '0';
198
+        $frameHeadBin .= (bool) $final ? '1' : '0';
199 199
         // RSV 1, 2, & 3 false and unused.
200 200
         $frameHeadBin .= '000';
201 201
         // Opcode rest of the byte.
Please login to merge, or discard this patch.