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