@@ -195,7 +195,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -327,7 +327,7 @@ |
||
327 | 327 | } |
328 | 328 | |
329 | 329 | $key = $match[1]; |
330 | - $this->handshakes[(int)$client] = $key; |
|
330 | + $this->handshakes[(int) $client] = $key; |
|
331 | 331 | |
332 | 332 | // sending header according to WebSocket Protocol |
333 | 333 | $secWebSocketAccept = base64_encode(sha1(trim($key) . self::HEADER_WEBSOCKET_ACCEPT_HASH, true)); |
@@ -139,7 +139,7 @@ |
||
139 | 139 | */ |
140 | 140 | public function getUniqueSocketId(): int |
141 | 141 | { |
142 | - return (int)$this->socketConnection; |
|
142 | + return (int) $this->socketConnection; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |