From b8d7e7052ffb9d7da173e42927e921d2716a9723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 16 Apr 2023 00:59:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Container.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Container.php b/Container.php index 8ab950e..e2a28ef 100644 --- a/Container.php +++ b/Container.php @@ -88,6 +88,20 @@ class Container implements ContainerInterface } + /** + * @param string $id + * @return void + * @throws ReflectionException + */ + public function parse(string $id): void + { + if (isset($this->_singletons[$id])) { + return; + } + $this->make($id); + } + + /** * @param string $interface * @param string $class