From 9c67fb556ffb05fc0a6cbfb4b5787ed576a0acec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sun, 16 Apr 2023 16:57:27 +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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Container.php b/Container.php index 66061c9..d584467 100644 --- a/Container.php +++ b/Container.php @@ -168,6 +168,11 @@ class Container implements ContainerInterface $object = self::configure($reflect->newInstanceArgs($construct), $config); + $targetAttributes = $reflect->getAttributes(); + foreach ($targetAttributes as $attribute) { + $attribute->newInstance()->dispatch($object); + } + $this->resolveProperties($reflect, $object); if (method_exists($object, 'init') && $className !== 'Symfony\Component\Console\Application') { call_user_func([$object, 'init']);