This commit is contained in:
2025-07-11 15:32:33 +08:00
parent 855da03137
commit 7de790d65f
+2 -2
View File
@@ -167,8 +167,8 @@ class Container implements ContainerInterface
throw new ReflectionException('Class ' . $className . ' cannot be instantiated'); throw new ReflectionException('Class ' . $className . ' cannot be instantiated');
} }
if (($handler = $reflect->getConstructor()) !== null) { if (empty($construct) && ($handler = $reflect->getConstructor()) !== null) {
$construct = $this->mergeParams($this->getMethodParams($handler), $construct); $construct = $this->getMethodParams($handler);
} }
$newInstance = $reflect->newInstanceArgs($construct); $newInstance = $reflect->newInstanceArgs($construct);