From 7d3aa2ef53b67db28b7f2589f2b041fcbeb2d7fd Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 31 Oct 2023 00:47:21 +0800 Subject: [PATCH] Fix call static methods --- src/Connection/AsyncTcpConnection.php | 2 +- src/Connection/ConnectionInterface.php | 2 +- src/Connection/TcpConnection.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Connection/AsyncTcpConnection.php b/src/Connection/AsyncTcpConnection.php index 79be70dbc..041f94d48 100644 --- a/src/Connection/AsyncTcpConnection.php +++ b/src/Connection/AsyncTcpConnection.php @@ -422,7 +422,7 @@ public function checkConnection(): void // 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); } diff --git a/src/Connection/ConnectionInterface.php b/src/Connection/ConnectionInterface.php index cee7d1044..0983cc245 100644 --- a/src/Connection/ConnectionInterface.php +++ b/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; diff --git a/src/Connection/TcpConnection.php b/src/Connection/TcpConnection.php index f03598c0b..fe594f7ee 100644 --- a/src/Connection/TcpConnection.php +++ b/src/Connection/TcpConnection.php @@ -1019,7 +1019,7 @@ public function destroy(): void // 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); }