From d2146f7977c898769df96b7e74f2ff90fd15d6fe Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Sat, 11 May 2019 08:39:03 +0200 Subject: [PATCH] fix ability to recursively call the respond method. Fixes #173 --- src/WebSockets/Messages/PusherChannelProtocolMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebSockets/Messages/PusherChannelProtocolMessage.php b/src/WebSockets/Messages/PusherChannelProtocolMessage.php index a2b7b25..8c36595 100644 --- a/src/WebSockets/Messages/PusherChannelProtocolMessage.php +++ b/src/WebSockets/Messages/PusherChannelProtocolMessage.php @@ -31,7 +31,7 @@ class PusherChannelProtocolMessage implements PusherMessage { $eventName = Str::camel(Str::after($this->payload->event, ':')); - if (method_exists($this, $eventName)) { + if (method_exists($this, $eventName) && $eventName !== 'respond') { call_user_func([$this, $eventName], $this->connection, $this->payload->data ?? new stdClass()); } }