diff --git a/library/think/App.php b/library/think/App.php index cb0306f3..3ad78006 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -130,7 +130,13 @@ class App } } - // 执行函数或者闭包方法 支持参数调用 + /** + * 执行函数或者闭包方法 支持参数调用 + * @access public + * @param string|array|\Closure $function 函数或者闭包 + * @param array $vars 变量 + * @return mixed + */ public static function invokeFunction($function, $vars = []) { $reflect = new \ReflectionFunction($function); @@ -140,7 +146,13 @@ class App return $reflect->invokeArgs($args); } - // 调用反射执行类的方法 支持参数绑定 + /** + * 调用反射执行类的方法 支持参数绑定 + * @access public + * @param string|array $method 方法 + * @param array $vars 变量 + * @return mixed + */ public static function invokeMethod($method, $vars = []) { if (empty($vars)) { @@ -160,7 +172,13 @@ class App return $reflect->invokeArgs(isset($class) ? $class : null, $args); } - // 绑定参数 + /** + * 绑定参数 + * @access public + * @param \ReflectionMethod $reflect 反射类 + * @param array $vars 变量 + * @return array + */ private static function bindParams($reflect, $vars) { $args = []; @@ -186,7 +204,13 @@ class App return $args; } - // 执行 模块/控制器/操作 + /** + * 执行模块 + * @access public + * @param array $result 模块/控制器/操作 + * @param array $config 配置参数 + * @return mixed + */ public static function module($result, $config) { if (is_string($result)) { @@ -254,7 +278,13 @@ class App return $data; } - // 初始化模块 + /** + * 初始化模块 + * @access public + * @param string $module 模块名 + * @param array $config 配置参数 + * @return void + */ private static function initModule($module, $config) { // 定位模块目录 @@ -308,6 +338,7 @@ class App * @access public * @param \think\Request $request * @param array $config + * @return array * @throws Exception */ public static function route($request, array $config) diff --git a/library/think/Build.php b/library/think/Build.php index 7b26a103..5cc2147e 100644 --- a/library/think/Build.php +++ b/library/think/Build.php @@ -13,7 +13,12 @@ namespace think; class Build { - // 根据传入的build资料创建目录和文件 + /** + * 根据传入的build资料创建目录和文件 + * @access protected + * @param array $build build列表 + * @return void + */ public static function run(array $build = []) { // 锁定 @@ -39,7 +44,12 @@ class Build unlink($lockfile); } - // 创建目录 + /** + * 创建目录 + * @access protected + * @param array $list 目录列表 + * @return void + */ protected static function buildDir($list) { foreach ($list as $dir) { @@ -50,7 +60,12 @@ class Build } } - // 创建文件 + /** + * 创建文件 + * @access protected + * @param array $list 文件列表 + * @return void + */ protected static function buildFile($list) { foreach ($list as $file) { @@ -64,7 +79,13 @@ class Build } } - // 创建模块 + /** + * 创建模块 + * @access public + * @param string $module 模块名 + * @param array $list build列表 + * @return void + */ public static function module($module = '', $list = []) { $module = APP_MULTI_MODULE ? $module : ''; @@ -138,7 +159,12 @@ class Build } } - // 创建模块的欢迎页面 + /** + * 创建模块的欢迎页面 + * @access public + * @param string $module 模块名 + * @return void + */ protected static function buildHello($module) { $filename = APP_PATH . ($module ? $module . DS : '') . CONTROLLER_LAYER . DS . 'Index' . (CLASS_APPEND_SUFFIX ? ucfirst(CONTROLLER_LAYER) : '') . EXT; @@ -152,7 +178,12 @@ class Build } } - // 创建模块的公共文件 + /** + * 创建模块的公共文件 + * @access public + * @param string $module 模块名 + * @return void + */ protected static function buildCommon($module) { $filename = APP_PATH . ($module ? $module . DS : '') . 'config.php'; diff --git a/library/think/Controller.php b/library/think/Controller.php index bfaf7da2..8dafcbbe 100644 --- a/library/think/Controller.php +++ b/library/think/Controller.php @@ -110,7 +110,7 @@ class Controller /** * 模板变量赋值 - * @access protected + * @access public * @param mixed $name 要显示的模板变量 * @param mixed $value 变量的值 * @return void @@ -122,7 +122,7 @@ class Controller /** * 初始化模板引擎 - * @access protected + * @access public * @param array|string $engine 引擎参数 * @return void */ @@ -133,7 +133,7 @@ class Controller /** * 验证数据 - * @access protected + * @access public * @param array $data 数据 * @param string|array $validate 验证器名或者验证规则数组 * @param array $message 提示信息 diff --git a/library/think/Cookie.php b/library/think/Cookie.php index 3ababc3b..167df72f 100644 --- a/library/think/Cookie.php +++ b/library/think/Cookie.php @@ -13,7 +13,6 @@ namespace think; class Cookie { - protected static $config = [ // cookie 名称前缀 'prefix' => '',