This commit is contained in:
2018-07-19 19:29:06 +08:00
parent 1ac3e837d2
commit a59be5976f
+3 -9
View File
@@ -112,24 +112,18 @@ abstract class Base
protected static $base;
/**
* @param $method
* @param $configPath
* @param mixed ...$params
* @return mixed
* @return static
* @throws \Exception
*/
public static function call($method, $configPath, ...$params)
public static function call($configPath)
{
if (!static::$base instanceof Base) {
static::$base = new static();
}
$class = static::$base;
$class->loadConfig($configPath);
if (!method_exists($class, $method)) {
throw new \Exception('未知的执行方法!');
}
return call_user_func([$class, $method], ...$params);
return $class;
}