From 98a39dff9138069ef0af3092946d05cc73969d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 12 Jul 2021 17:48:05 +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/Di/Service.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/System/Di/Service.php b/System/Di/Service.php index 298320cc..43d21d4c 100644 --- a/System/Di/Service.php +++ b/System/Di/Service.php @@ -40,7 +40,7 @@ class Service extends Component * @return mixed * @throws Exception */ - public function get($id, $try = true): mixed + public function get($id, bool $try = true): mixed { if (isset($this->_components[$id])) { return $this->_components[$id]; @@ -56,13 +56,10 @@ class Service extends Component if (is_object($config)) { return $this->_components[$id] = $config; } - $object = Snowflake::createObject($config); } else { $config = $this->_alias[$id]; - - $object = Snowflake::createObject($config); } - return $this->_components[$id] = $object; + return $this->_components[$id] = Snowflake::createObject($config); } /**