From ac56a7b80d5746cc98e1ec1ff81d41c5165928c8 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Sat, 6 Jun 2020 09:21:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BF=85=E8=A6=81=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/library/ParseClass.php | 40 +++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/extend/catcher/library/ParseClass.php b/extend/catcher/library/ParseClass.php index c3c11f0..9848127 100644 --- a/extend/catcher/library/ParseClass.php +++ b/extend/catcher/library/ParseClass.php @@ -1,7 +1,6 @@ getClass(); @@ -28,7 +32,11 @@ class ParseClass return $methods; } - + /** + * 获取所有方法 + * + * @return array + */ public function methods() { $class = $this->getClass(); @@ -63,7 +71,12 @@ class ParseClass return $methods; } - + /** + * 获取 CLASS + * + * @return \ReflectionClass + * @throws \ReflectionException + */ public function getClass() { @@ -72,12 +85,22 @@ class ParseClass ucfirst($this->controller)); } - + /** + * @param $method + * @return bool + */ protected function isMagicMethod($method) { return strpos($method, '__') !== false; } + /** + * + * @param $module + * @return $this + * @author JaguarJack + * @date 2020/6/6 + */ public function setModule($module) { $composer = \json_decode(file_get_contents(root_path() . 'composer.json'), true); @@ -94,7 +117,14 @@ class ParseClass return $this; } - + /** + * + * @param $module + * @param $controller + * @return $this + * @author JaguarJack + * @date 2020/6/6 + */ public function setRule($module, $controller) { $this->module = $module;