This commit is contained in:
as2252258@163.com
2021-02-23 02:46:55 +08:00
parent cba743f43e
commit 5b57b8d4b3
2 changed files with 325 additions and 323 deletions
+1 -3
View File
@@ -92,9 +92,7 @@ class Service extends Component
} else {
$this->_definition[$id] = $definition;
}
$this->_components[$id] = Snowflake::createObject($definition);
var_dump($this->_components[$id]);
return $this->_components[$id];
return $this->get($id);
}
/**
+5 -1
View File
@@ -99,7 +99,11 @@ class Snowflake
if (!isset($className['class']) || empty($className['class'])) {
throw new Exception('Object configuration must be an array containing a "class" element.');
}
return static::$container->get($className['class'], $construct, $className);
$class = $className['class'];
unset($className['class']);
return static::$container->get($class, $construct, $className);
} else if (is_callable($className, TRUE)) {
return call_user_func($className, $construct);
} else {