add clear
This commit is contained in:
+5
-7
@@ -24,9 +24,10 @@ class Container
|
||||
const WX_OFFICIAL_ACCOUNT = 'WX_OFFICIAL_ACCOUNT';
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param Config $config
|
||||
* @return mixed
|
||||
* @param $class
|
||||
* @param $config
|
||||
* @return mixed|object|ReflectionClass
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public static function newInstance($class, $config)
|
||||
{
|
||||
@@ -38,7 +39,7 @@ class Container
|
||||
if (static::$_instance->exists($class)) {
|
||||
return static::$_instance->get($class);
|
||||
} else {
|
||||
return static::$_instance->generate($config);
|
||||
return static::$_instance->createObject($class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,9 +83,6 @@ class Container
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
if (!isset($this->container[$name])) {
|
||||
return $this->createObject($name);
|
||||
}
|
||||
return $this->container[$name];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user