【发布时间】:2012-11-24 22:49:29
【问题描述】:
有没有办法在 phpDoc 中将@method 签名中的参数标记为可选?
类似这样的:
/*
* @method bool alloc() alloc(int $filesize [, string &$result]) Allocates space for a file to be uploaded
*/
【问题讨论】:
有没有办法在 phpDoc 中将@method 签名中的参数标记为可选?
类似这样的:
/*
* @method bool alloc() alloc(int $filesize [, string &$result]) Allocates space for a file to be uploaded
*/
【问题讨论】:
通常,phpDocumentor 通过查看方法签名中 arg 的默认值来识别可选参数。因此,使用您的示例:
@method bool alloc() alloc(int $filesize, string &$result = '') Allocates space for ...
【讨论】: