改名
This commit is contained in:
@@ -71,7 +71,7 @@ class Container extends BaseObject
|
|||||||
public function get($class, $constrict = [], $config = []): mixed
|
public function get($class, $constrict = [], $config = []): mixed
|
||||||
{
|
{
|
||||||
if (isset($this->_singletons[$class])) {
|
if (isset($this->_singletons[$class])) {
|
||||||
return $this->_singletons[$class];
|
return clone $this->_singletons[$class];
|
||||||
} else if (!isset($this->_constructs[$class])) {
|
} else if (!isset($this->_constructs[$class])) {
|
||||||
return $this->resolve($class, $constrict, $config);
|
return $this->resolve($class, $constrict, $config);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ class Service extends Component
|
|||||||
if (is_object($config)) {
|
if (is_object($config)) {
|
||||||
return $this->_components[$id] = $config;
|
return $this->_components[$id] = $config;
|
||||||
}
|
}
|
||||||
$object = clone Snowflake::createObject($config);
|
$object = Snowflake::createObject($config);
|
||||||
} else {
|
} else {
|
||||||
$config = $this->_alias[$id];
|
$config = $this->_alias[$id];
|
||||||
|
|
||||||
$object = clone Snowflake::createObject($config);
|
$object = Snowflake::createObject($config);
|
||||||
}
|
}
|
||||||
return $this->_components[$id] = $object;
|
return $this->_components[$id] = $object;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user