From dbfe5e04a81d0b951be802544758ea9a0b23f259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 1 Sep 2020 03:44:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/Annotation/Annotation.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/Annotation/Annotation.php b/system/Annotation/Annotation.php index 0df43547..f992cc31 100644 --- a/system/Annotation/Annotation.php +++ b/system/Annotation/Annotation.php @@ -4,6 +4,7 @@ namespace Snowflake\Annotation; use Exception; +use HttpServer\Route\Annotation\Websocket; use ReflectionClass; use ReflectionException; use ReflectionMethod; @@ -42,7 +43,10 @@ class Annotation extends BaseAnnotation */ public function register($name, $class) { - $this->_classMap[$name] = Snowflake::createObject($class); + if (!isset($this->_classMap[$name]) && is_string($this->_classMap[$name])) { + $this->_classMap[$name] = Snowflake::createObject($class); + } + return $this->_classMap[$name]; }