【问题标题】:Optional argument in phpDoc @method signaturephpDoc @method 签名中的可选参数
【发布时间】:2012-11-24 22:49:29
【问题描述】:

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

类似这样的:

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

【问题讨论】:

    标签: php phpdoc


    【解决方案1】:

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

    @method bool alloc() alloc(int $filesize, string &$result = '') Allocates space for ...
    

    【讨论】:

      猜你喜欢
      • 2012-11-06
      • 2018-08-10
      • 2010-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-26
      • 2011-01-01
      相关资源
      最近更新 更多