phpDoc @method 签名中的可选参数

4

有没有一种方法可以在phpDoc的@method签名中将参数标记为可选的?

就像这样:

/*
* @method bool alloc() alloc(int $filesize [, string &$result]) Allocates space for a file to be uploaded
*/
1个回答

6
通常情况下,phpDocumentor 通过查看方法签名中参数的默认值来识别可选参数。因此,以您的示例为例:
@method bool alloc() alloc(int $filesize, string &$result = '') Allocates space for ...

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接