改名
This commit is contained in:
@@ -76,7 +76,7 @@ class Container extends BaseObject
|
|||||||
return $this->resolve($class, $constrict, $config);
|
return $this->resolve($class, $constrict, $config);
|
||||||
}
|
}
|
||||||
$definition = $this->_constructs[$class];
|
$definition = $this->_constructs[$class];
|
||||||
var_dump($definition);
|
var_dump($class, $definition);
|
||||||
if (is_callable($definition, TRUE)) {
|
if (is_callable($definition, TRUE)) {
|
||||||
return call_user_func($definition, $this, $constrict, $config);
|
return call_user_func($definition, $this, $constrict, $config);
|
||||||
} else if (is_array($definition)) {
|
} else if (is_array($definition)) {
|
||||||
@@ -132,7 +132,6 @@ class Container extends BaseObject
|
|||||||
foreach ($constrict as $index => $param) {
|
foreach ($constrict as $index => $param) {
|
||||||
$dependencies[$index] = $param;
|
$dependencies[$index] = $param;
|
||||||
}
|
}
|
||||||
var_dump($reflect);
|
|
||||||
if (!$reflect->isInstantiable()) {
|
if (!$reflect->isInstantiable()) {
|
||||||
throw new NotFindClassException($reflect->getName());
|
throw new NotFindClassException($reflect->getName());
|
||||||
}
|
}
|
||||||
@@ -169,11 +168,16 @@ class Container extends BaseObject
|
|||||||
};
|
};
|
||||||
$constructs = $reflection->getConstructor();
|
$constructs = $reflection->getConstructor();
|
||||||
if (!($constructs instanceof \ReflectionMethod)) {
|
if (!($constructs instanceof \ReflectionMethod)) {
|
||||||
return [$reflection, $this->_constructs[$class] = []];
|
return [
|
||||||
|
$reflection, $this->_constructs[$class] = [
|
||||||
|
'class' => $class
|
||||||
|
]
|
||||||
|
];
|
||||||
}
|
}
|
||||||
foreach ($constructs->getParameters() as $key => $param) {
|
foreach ($constructs->getParameters() as $key => $param) {
|
||||||
$dependencies[] = $this->resolveDefaultValue($param);
|
$dependencies[] = $this->resolveDefaultValue($param);
|
||||||
}
|
}
|
||||||
|
$dependencies['class'] = $class;
|
||||||
$this->_constructs[$class] = $dependencies;
|
$this->_constructs[$class] = $dependencies;
|
||||||
return [$reflection, $dependencies];
|
return [$reflection, $dependencies];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user