This commit is contained in:
2020-08-31 23:57:51 +08:00
parent a09225952c
commit 4ad88d7b88
+14 -3
View File
@@ -72,21 +72,32 @@ class Annotation extends BaseAnnotation
/** /**
* @return Http * @return string|Http
* @throws * @throws
*/ */
public function getHttp() 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 * @throws
*/ */
public function getWebsocket() 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']); return make($this->_classMap['websocket'], $this->_classMap['websocket']);
} }