From 048f49b27f15738bc6b7d0485ca7ce0e85ca676d Mon Sep 17 00:00:00 2001 From: whwyy Date: Mon, 18 Dec 2023 17:10:34 +0800 Subject: [PATCH] eee --- Container.php | 2 +- Scanner.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Container.php b/Container.php index cd2b84f..cbc3c79 100644 --- a/Container.php +++ b/Container.php @@ -165,7 +165,7 @@ class Container implements ContainerInterface throw new ReflectionException('Class ' . $className . ' cannot be instantiated'); } - if (($handler = $reflect->getConstructor()) !== null && empty($construct)) { + if (($handler = $reflect->getConstructor()) !== null) { $construct = $this->getMethodParams($handler); } $newInstance = $reflect->newInstanceArgs($construct); diff --git a/Scanner.php b/Scanner.php index bbe9d11..7198f10 100644 --- a/Scanner.php +++ b/Scanner.php @@ -98,8 +98,7 @@ class Scanner extends Component return; } $object = $this->container->parse($class); - $methods = $this->container->getReflectionClass($class); - foreach ($methods->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { + foreach ($reflect->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { if ($method->isStatic() || $method->getDeclaringClass()->getName() != $class) { continue; }