From cc4a09d2dafd3182af596168e7db85609b0bcef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 22 Feb 2021 18:26:33 +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 --- Annotation/Annotation.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Annotation/Annotation.php b/Annotation/Annotation.php index bd18b401..406debea 100644 --- a/Annotation/Annotation.php +++ b/Annotation/Annotation.php @@ -122,9 +122,13 @@ class Annotation extends Component if (empty($reflect)) { return []; } - $depend = Snowflake::getDi()->getDependencies($class); - $object = $reflect->newInstanceArgs($depend); + $constructor = $reflect->getConstructor()->getParameters(); + if (count($constructor) > 0) { + return []; + } + + $object = $reflect->newInstance(); $this->resolveMethod($reflect, $class, $alias, $object); return $this->targets($reflect); }