改名
This commit is contained in:
@@ -122,10 +122,9 @@ class Annotation extends Component
|
|||||||
if (empty($reflect)) {
|
if (empty($reflect)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
if (!$reflect->isInstantiable()) {
|
$depend = Snowflake::getDi()->getDependencies($class);
|
||||||
return $this->targets($reflect);
|
|
||||||
}
|
$object = $reflect->newInstanceArgs($depend);
|
||||||
$object = $reflect->newInstance();
|
|
||||||
$this->resolveMethod($reflect, $class, $alias, $object);
|
$this->resolveMethod($reflect, $class, $alias, $object);
|
||||||
return $this->targets($reflect);
|
return $this->targets($reflect);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,6 +192,16 @@ class Container extends BaseObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $class
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getDependencies($class): mixed
|
||||||
|
{
|
||||||
|
return $this->_constructs[$class] ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $class
|
* @param $class
|
||||||
* @return ReflectionClass|null
|
* @return ReflectionClass|null
|
||||||
|
|||||||
Reference in New Issue
Block a user