From e4cc1c17b251264b3fd9f117a7a71e887ce55e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=9E=9C=E7=9A=84=E5=A6=82=E6=9E=9C?= Date: Wed, 1 Feb 2023 16:02:49 +0800 Subject: [PATCH] =?UTF-8?q?ParamFrom=E6=94=AF=E6=8C=81=E6=9D=A5=E8=87=AA?= =?UTF-8?q?=E5=A4=9A=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Scanner.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Scanner.php b/src/Scanner.php index 1114fb1..bd53b82 100644 --- a/src/Scanner.php +++ b/src/Scanner.php @@ -245,6 +245,7 @@ static function scanToMarkdown(string $controllerPath, string $controllerNameSpa foreach ($apiTag->allowMethod as $allowMethodItem) { $allMethodStr .= "{$allowMethodItem->toString()},"; } + $allMethodStr = rtrim($allMethodStr,','); } $finalDoc .= "**Allow Method:** {$allMethodStr}"; $finalDoc = self::buildLine($finalDoc); @@ -404,11 +405,9 @@ private static function scanAllController(string $controllerPath,bool $save2Cach if (is_file($controllerPath)) { $files[] = $controllerPath; } else { - $files = File::scanDirectory($controllerPath); - if(isset($files['files'])){ - $files = $files['files']; - }else{ - return $list; + $temp = File::scanDirectory($controllerPath); + if(isset($temp['files'])){ + $files = $temp['files']; } } @@ -600,6 +599,7 @@ private static function buildRequestParamsTable(array $array):string foreach ($item->from as $fromItem) { $fromStr .= "{$fromItem->toString()},"; } + $fromStr = rtrim($fromStr,','); }