From dc08bcd81f1913d400a1fcee6a1463197686db69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 16 Apr 2023 02:18:22 +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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Container.php b/Container.php index e2a28ef..f49c99a 100644 --- a/Container.php +++ b/Container.php @@ -158,7 +158,9 @@ class Container implements ContainerInterface $object = self::configure($reflect->newInstanceArgs($construct), $config); $this->resolveProperties($reflect, $object); - + if (method_exists($object, 'init')) { + call_user_func([$object, 'init']); + } return $object; }