Jelajahi Sumber

replaced long notation with combined assignment

Mark Magyar 2 tahun lalu
induk
melakukan
df39972cfd
3 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 2 2
      src/Protocols/Http.php
  2. 1 1
      src/Protocols/Ws.php
  3. 1 1
      src/Worker.php

+ 2 - 2
src/Protocols/Http.php

@@ -131,10 +131,10 @@ class Http
         }
 
         if ($pos = stripos($header, "\r\nContent-Length: ")) {
-            $length = $length + (int)substr($header, $pos + 18, 10);
+            $length += (int)substr($header, $pos + 18, 10);
             $hasContentLength = true;
         } else if (preg_match("/\r\ncontent-length: ?(\d+)/i", $header, $match)) {
-            $length = $length + (int)$match[1];
+            $length += (int)$match[1];
             $hasContentLength = true;
         } else {
             $hasContentLength = false;

+ 1 - 1
src/Protocols/Ws.php

@@ -277,7 +277,7 @@ class Ws
                 }
                 return '';
             }
-            $connection->context->tmpWebsocketData = $connection->context->tmpWebsocketData . $frame;
+            $connection->context->tmpWebsocketData .= $frame;
             // Check buffer is full.
             if ($connection->onBufferFull && $connection->maxSendBufferSize <= strlen($connection->context->tmpWebsocketData)) {
                 try {

+ 1 - 1
src/Worker.php

@@ -2161,7 +2161,7 @@ class Worker
      */
     public static function log(mixed $msg, bool $decorated = false): void
     {
-        $msg = $msg . "\n";
+        $msg .= "\n";
         if (!static::$daemonize) {
             static::safeEcho($msg, $decorated);
         }