From acc96b78dbd0ad7318a9521a390c82bb9b003c2d Mon Sep 17 00:00:00 2001 From: whale Date: Sat, 23 May 2020 17:29:09 +0800 Subject: [PATCH] fix a bug --- src/ZM/Annotation/AnnotationParser.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ZM/Annotation/AnnotationParser.php b/src/ZM/Annotation/AnnotationParser.php index f6e8fc52..ca951cdd 100644 --- a/src/ZM/Annotation/AnnotationParser.php +++ b/src/ZM/Annotation/AnnotationParser.php @@ -167,7 +167,8 @@ class AnnotationParser //Swoole 事件时走此switch switch ($asp_name) { case "connectType": //websocket连接类型 - $func = function (WSConnection $connection) use ($rest) { + $func = function (?WSConnection $connection) use ($rest) { + if($connection === null) return false; return $connection->getType() == $rest ? true : false; }; break;