From fc38f9c6620762197a08564e8afaebf5c1423cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IT=E5=B0=8F=E5=BC=BAxqitw=2Ecn?= <360237521@qq.com> Date: Sun, 24 Jun 2018 12:19:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/lib/ParseLine.php | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 296da80..2c6b8f7 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ### 扩展安装: -+ 方法一:composer命令 `composer require itxq/wechat-sdk-php` ++ 方法一:composer命令 `composer require itxq/api-doc-php` + 方法二:直接下载压缩包,然后进入项目中执行 composer命令 `composer update` 来生成自动加载文件 diff --git a/src/lib/ParseLine.php b/src/lib/ParseLine.php index 70338c7..2e57ab2 100644 --- a/src/lib/ParseLine.php +++ b/src/lib/ParseLine.php @@ -25,7 +25,7 @@ class ParseLine * @return array */ public function parseLineTitle($line) { - return ['type' => $line[0], 'content' => $line[1]]; + return ['type' => isset($line[0]) ? $line[0] : '', 'content' => isset($line[1]) ? $line[1] : '']; } /** @@ -35,12 +35,12 @@ class ParseLine */ public function parseLineParam($line) { return [ - 'type' => $line[0], - 'param_type' => $line[1], - 'param_name' => $line[2], - 'param_title' => $line[3], - 'param_default' => $line[4], - 'param_require' => $line[5], + 'type' => isset($line[0]) ? $line[0] : '', + 'param_type' => isset($line[1]) ? $line[1] : '', + 'param_name' => isset($line[2]) ? $line[2] : '', + 'param_title' => isset($line[3]) ? $line[3] : '', + 'param_default' => isset($line[4]) ? $line[4] : '', + 'param_require' => isset($line[5]) ? $line[5] : '', ]; } @@ -51,8 +51,8 @@ class ParseLine */ public function parseLineCode($line) { return [ - 'type' => $line[0], - 'code' => $line[1], + 'type' => isset($line[0]) ? $line[0] : '', + 'code' => isset($line[1]) ? $line[1] : '', 'content' => isset($line[2]) ? $line[2] : '', ]; } @@ -64,9 +64,9 @@ class ParseLine */ public function parseLineReturn($line) { return [ - 'type' => $line[0], - 'return_type' => $line[1], - 'return_name' => $line[2], + 'type' => isset($line[0]) ? $line[0] : '', + 'return_type' => isset($line[1]) ? $line[1] : '', + 'return_name' => isset($line[2]) ? $line[2] : '', 'return_title' => isset($line[3]) ? $line[3] : '', ]; }