phpDoc @method签名中的可选参数

Pit*_*ziq 3 php phpdoc

有没有办法将@method签名中的参数标记为phpDoc中的可选项?

像这样的东西:

/*
* @method bool alloc() alloc(int $filesize [, string &$result]) Allocates space for a file to be uploaded
*/
Run Code Online (Sandbox Code Playgroud)

ash*_*azg 5

通常,phpDocumentor通过查看方法签名中arg的默认值来识别可选参数.因此,使用您的示例:

@method bool alloc() alloc(int $filesize, string &$result = '') Allocates space for ...
Run Code Online (Sandbox Code Playgroud)