添加必要注释
This commit is contained in:
parent
9a07ae1e1b
commit
ac56a7b80d
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace catcher\library;
|
namespace catcher\library;
|
||||||
|
|
||||||
use think\helper\Str;
|
|
||||||
|
|
||||||
class ParseClass
|
class ParseClass
|
||||||
{
|
{
|
||||||
@ -11,6 +10,11 @@ class ParseClass
|
|||||||
|
|
||||||
protected $controller;
|
protected $controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取父类方法
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function parentMethods()
|
public function parentMethods()
|
||||||
{
|
{
|
||||||
$class = $this->getClass();
|
$class = $this->getClass();
|
||||||
@ -28,7 +32,11 @@ class ParseClass
|
|||||||
return $methods;
|
return $methods;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有方法
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
public function methods()
|
public function methods()
|
||||||
{
|
{
|
||||||
$class = $this->getClass();
|
$class = $this->getClass();
|
||||||
@ -63,7 +71,12 @@ class ParseClass
|
|||||||
return $methods;
|
return $methods;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 CLASS
|
||||||
|
*
|
||||||
|
* @return \ReflectionClass
|
||||||
|
* @throws \ReflectionException
|
||||||
|
*/
|
||||||
public function getClass()
|
public function getClass()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -72,12 +85,22 @@ class ParseClass
|
|||||||
ucfirst($this->controller));
|
ucfirst($this->controller));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $method
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
protected function isMagicMethod($method)
|
protected function isMagicMethod($method)
|
||||||
{
|
{
|
||||||
return strpos($method, '__') !== false;
|
return strpos($method, '__') !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param $module
|
||||||
|
* @return $this
|
||||||
|
* @author JaguarJack <njphper@gmail.com>
|
||||||
|
* @date 2020/6/6
|
||||||
|
*/
|
||||||
public function setModule($module)
|
public function setModule($module)
|
||||||
{
|
{
|
||||||
$composer = \json_decode(file_get_contents(root_path() . 'composer.json'), true);
|
$composer = \json_decode(file_get_contents(root_path() . 'composer.json'), true);
|
||||||
@ -94,7 +117,14 @@ class ParseClass
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param $module
|
||||||
|
* @param $controller
|
||||||
|
* @return $this
|
||||||
|
* @author JaguarJack <njphper@gmail.com>
|
||||||
|
* @date 2020/6/6
|
||||||
|
*/
|
||||||
public function setRule($module, $controller)
|
public function setRule($module, $controller)
|
||||||
{
|
{
|
||||||
$this->module = $module;
|
$this->module = $module;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user