This commit is contained in:
2021-03-31 17:57:42 +08:00
parent 05edfdd247
commit 6f5073f8a7
2 changed files with 17 additions and 2 deletions
+7 -1
View File
@@ -139,13 +139,19 @@ class Service extends Component
*/
public function remove($id): bool
{
unset($this->_components[$id]);
$component = $this->_components[$id];
$className = get_class($component);
unset($component, $this->_components[$id]);
unset($this->_definition[$id]);
if (isset($this->_alias[$id])) {
unset($this->_components[$this->_alias[$id]]);
unset($this->_definition[$this->_alias[$id]]);
unset($this->_alias[$id]);
}
Snowflake::getDi()->unset($className);
return $this->has($id);
}
}