This commit is contained in:
2021-02-22 20:00:49 +08:00
parent 9db887f7de
commit a11a26a5e7
+1 -3
View File
@@ -120,14 +120,12 @@ class Container extends BaseObject
{ {
[$reflect, $dependencies] = $this->resolveDependencies($class); [$reflect, $dependencies] = $this->resolveDependencies($class);
foreach ($constrict as $index => $param) { foreach ($constrict as $index => $param) {
if (is_array($param)) {
continue;
}
$dependencies[$index] = $param; $dependencies[$index] = $param;
} }
if (!$reflect->isInstantiable()) { if (!$reflect->isInstantiable()) {
throw new Exception($reflect->getName() . ' con\'t instantiable'); throw new Exception($reflect->getName() . ' con\'t instantiable');
} }
var_dump($dependencies);
if (empty($config)) { if (empty($config)) {
return $reflect->newInstanceArgs($dependencies ?? []); return $reflect->newInstanceArgs($dependencies ?? []);
} }