From 43ce6b348607a56461fb9833f77462ea3620adb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 16 Apr 2023 00:15:10 +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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Container.php b/Container.php index 95b11e0..8ab950e 100644 --- a/Container.php +++ b/Container.php @@ -99,6 +99,17 @@ class Container implements ContainerInterface } + /** + * @param string $interface + * @param object $object + * @return void + */ + public function bind(string $interface, object $object): void + { + $this->_singletons[$interface] = $object; + } + + /** * @param string $className * @return ReflectionClass