如何记录可变数量的参数 [英] How to doc a variable number of parameters
本文介绍了如何记录可变数量的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何记录可变数量的参数?我正在用PHP和JavaScript编写应用程序.目前,我(在JavaScript中):
How do I doc a variable number of parameters? I am writing an application in PHP and JavaScript. Currently I have (in JavaScript):
/**
* Description
* @param {String} description
*/
function fn()
{
// arguments holds all strings.
}
那么,如何记录n个字符串参数?
So, how do I doc n-number of string params?
推荐答案
例如 PhpDocumentor 建议使用省略号
/**
* Example of unlimited parameters.
* Returns a formatted var_dump for debugging purposes
* (since the recurrences of $v are not listed in the actual function signature in the code,
* you may wish to highlight they are "optional" in their description)
* @param string $s string to display
* @param mixed $v variable to display with var_dump()
* @param mixed $v,... unlimited OPTIONAL number of additional variables to display with var_dump()
*/
function fancy_debug($s,$v)
{
这篇关于如何记录可变数量的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文