浏览代码

Fix call static methods

Anton 2 年之前
父节点
当前提交
7d3aa2ef53
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      src/Connection/AsyncTcpConnection.php
  2. 1 1
      src/Connection/ConnectionInterface.php
  3. 1 1
      src/Connection/TcpConnection.php

+ 1 - 1
src/Connection/AsyncTcpConnection.php

@@ -422,7 +422,7 @@ class AsyncTcpConnection extends TcpConnection
             // Try to emit protocol::onConnect
             if ($this->protocol && method_exists($this->protocol, 'onConnect')) {
                 try {
-                    $this->protocol->onConnect($this);
+                    $this->protocol::onConnect($this);
                 } catch (Throwable $e) {
                     $this->error($e);
                 }

+ 1 - 1
src/Connection/ConnectionInterface.php

@@ -58,7 +58,7 @@ abstract class ConnectionInterface
      * Application layer protocol.
      * The format is like this Workerman\\Protocols\\Http.
      *
-     * @var ?string
+     * @var ?class-string
      */
     public ?string $protocol = null;
 

+ 1 - 1
src/Connection/TcpConnection.php

@@ -1019,7 +1019,7 @@ class TcpConnection extends ConnectionInterface implements JsonSerializable
         // Try to emit protocol::onClose
         if ($this->protocol && method_exists($this->protocol, 'onClose')) {
             try {
-                $this->protocol->onClose($this);
+                $this->protocol::onClose($this);
             } catch (Throwable $e) {
                 $this->error($e);
             }