update:更新获取方法

This commit is contained in:
JaguarJack
2020-09-06 10:58:13 +08:00
parent 96751d6974
commit f301f149fb
2 changed files with 20 additions and 11 deletions

View File

@@ -2,6 +2,8 @@
namespace catcher\library;
use think\exception\ClassNotFoundException;
class ParseClass
{
protected $namespace;
@@ -74,18 +76,23 @@ class ParseClass
return $methods;
}
/**
* 获取 CLASS
* 获取class
*
* @return \ReflectionClass
* @time 2020年09月06日
* @throws \ReflectionException
* @return \ReflectionClass
*/
public function getClass()
{
$class = $this->namespace . $this->module . '\\controller\\'. ucfirst($this->controller);
return new \ReflectionClass($this->namespace . $this->module . '\\controller\\'.
if (class_exists($class)) {
return new \ReflectionClass($class);
}
ucfirst($this->controller));
throw new ClassNotFoundException($this->controller . ' not found');
}
/**