From 3694bbf105113d6e9ef91eae31371fbdbc2531dd Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Tue, 23 Feb 2021 03:31:10 +0800 Subject: [PATCH] modify --- Annotation/Annotation.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Annotation/Annotation.php b/Annotation/Annotation.php index 1313c10b..d185cd43 100644 --- a/Annotation/Annotation.php +++ b/Annotation/Annotation.php @@ -121,20 +121,9 @@ class Annotation extends Component { try { $reflect = $this->reflectClass($class); - if (empty($reflect)) { + if (empty($reflect) || !$reflect->isInstantiable()) { return []; } - if (!$reflect->isInstantiable()) { - return []; - } - - $construct = $reflect->getConstructor(); - if (!empty($construct) && count($params = $construct->getParameters()) > 0) { - if (!$params[0]->isOptional()) { - return []; - } - } - $object = $reflect->newInstance(); $this->resolveMethod($reflect, $class, $alias, $object); return $this->targets($reflect);