Skip to content

Commit 6251dde

Browse files
committed
更新3.0.6
1 parent f4df56d commit 6251dde

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/parseApi/ParseAnnotation.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ protected function parseController($class)
211211
if ($methodItem===false){
212212
continue;
213213
}
214+
if (in_array("NotDebug", $classTextAnnotations)) {
215+
$methodItem['notDebug'] = true;
216+
}
214217
$methodList[] = $methodItem;
215218

216219
}
@@ -236,6 +239,13 @@ protected function parseApiMethod($refClass,$refMethod,$routeGroup){
236239
if (in_array("NotParse", $textAnnotations)) {
237240
return false;
238241
}
242+
if (
243+
in_array("NotDebug", $textAnnotations) ||
244+
(isset($config['notDebug']) && $config['notDebug']===true) ||
245+
(isset($this->currentApp['notDebug']) && $this->currentApp['notDebug']===true)
246+
) {
247+
$methodItem['notDebug'] = true;
248+
}
239249
// 无标题,且有文本注释
240250
if (empty($methodItem['title']) && !empty($textAnnotations) && count($textAnnotations) > 0) {
241251
$methodItem['title'] = Utils::getLang($textAnnotations[0]);
@@ -293,15 +303,15 @@ protected function parseApiMethod($refClass,$refMethod,$routeGroup){
293303
$resKeys[]=$resItem['name'];
294304
}
295305
foreach ($methodItem['return'] as $returnItem){
296-
if (!(in_array($returnItem['name'],$resKeys) && $returnItem['source']==='controller' && !empty($returnItem['replaceGlobal']))){
306+
if (!(in_array($returnItem['name'],$resKeys) && !empty($returnItem['source']) && $returnItem['source']==='controller' && !empty($returnItem['replaceGlobal']))){
297307
$returnData[]=$returnItem;
298308
}
299309
}
300310

301311
foreach ($responsesData as $resItem) {
302312
$resData = $resItem;
303313
$globalFind = Utils::getArrayFind($methodItem['return'],function ($item)use ($resItem){
304-
if ($item['name'] == $resItem['name'] && $item['source']==='controller' && !empty($item['replaceGlobal'])){
314+
if ($item['name'] == $resItem['name'] && !empty($item['source']) && $item['source']==='controller' && !empty($item['replaceGlobal'])){
305315
return true;
306316
}
307317
return false;

0 commit comments

Comments
 (0)