This commit is contained in:
2021-08-05 17:31:25 +08:00
parent 9ee9008019
commit c95753523f
+4 -5
View File
@@ -135,12 +135,11 @@ class Container extends BaseObject
if ($construct->getNumberOfParameters() < 1) {
return $reflect->newInstance();
}
if (empty($dependencies)) {
return $reflect->newInstanceWithoutConstructor();
if (!empty($dependencies)) {
$parameters = $this->mergeParam($this->resolveMethodParameters($construct), $dependencies);
return $reflect->newInstanceArgs($parameters);
}
$parameters = $this->resolveMethodParameters($construct);
$parameters = $this->mergeParam($parameters, $dependencies);
return $reflect->newInstanceArgs($parameters);
return $reflect->newInstanceWithoutConstructor();
}