@@ -211,6 +211,9 @@ protected function parseController($class)
211
211
if ($ methodItem ===false ){
212
212
continue ;
213
213
}
214
+ if (in_array ("NotDebug " , $ classTextAnnotations )) {
215
+ $ methodItem ['notDebug ' ] = true ;
216
+ }
214
217
$ methodList [] = $ methodItem ;
215
218
216
219
}
@@ -236,6 +239,13 @@ protected function parseApiMethod($refClass,$refMethod,$routeGroup){
236
239
if (in_array ("NotParse " , $ textAnnotations )) {
237
240
return false ;
238
241
}
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
+ }
239
249
// 无标题,且有文本注释
240
250
if (empty ($ methodItem ['title ' ]) && !empty ($ textAnnotations ) && count ($ textAnnotations ) > 0 ) {
241
251
$ methodItem ['title ' ] = Utils::getLang ($ textAnnotations [0 ]);
@@ -293,15 +303,15 @@ protected function parseApiMethod($refClass,$refMethod,$routeGroup){
293
303
$ resKeys []=$ resItem ['name ' ];
294
304
}
295
305
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 ' ]))){
297
307
$ returnData []=$ returnItem ;
298
308
}
299
309
}
300
310
301
311
foreach ($ responsesData as $ resItem ) {
302
312
$ resData = $ resItem ;
303
313
$ 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 ' ])){
305
315
return true ;
306
316
}
307
317
return false ;
0 commit comments