This commit is contained in:
2021-07-12 17:48:05 +08:00
parent 6a4d1ec3da
commit 98a39dff91
+2 -5
View File
@@ -40,7 +40,7 @@ class Service extends Component
* @return mixed * @return mixed
* @throws Exception * @throws Exception
*/ */
public function get($id, $try = true): mixed public function get($id, bool $try = true): mixed
{ {
if (isset($this->_components[$id])) { if (isset($this->_components[$id])) {
return $this->_components[$id]; return $this->_components[$id];
@@ -56,13 +56,10 @@ class Service extends Component
if (is_object($config)) { if (is_object($config)) {
return $this->_components[$id] = $config; return $this->_components[$id] = $config;
} }
$object = Snowflake::createObject($config);
} else { } else {
$config = $this->_alias[$id]; $config = $this->_alias[$id];
$object = Snowflake::createObject($config);
} }
return $this->_components[$id] = $object; return $this->_components[$id] = Snowflake::createObject($config);
} }
/** /**