From 4ad88d7b88f3437da1bd0b3c953b94fc37910324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 31 Aug 2020 23:57:51 +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 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/system/Annotation/Annotation.php b/system/Annotation/Annotation.php index 4dced1a2..5e27e65b 100644 --- a/system/Annotation/Annotation.php +++ b/system/Annotation/Annotation.php @@ -72,21 +72,32 @@ class Annotation extends BaseAnnotation /** - * @return Http + * @return string|Http * @throws */ public function getHttp() { - return make($this->_classMap['http'], $this->_classMap['http']); + if (is_object($this->_classMap['http'])) { + return $this->_classMap['http']; + } + + return $this->_classMap['http'] = Snowflake::createObject($this->_classMap['http']); } /** - * @return Websocket + * @return string|Websocket * @throws */ public function getWebsocket() { + if (is_object($this->_classMap['websocket'])) { + return $this->_classMap['websocket']; + } + + return $this->_classMap['websocket'] = Snowflake::createObject($this->_classMap['websocket']); + + return make($this->_classMap['websocket'], $this->_classMap['websocket']); }