views:

52

answers:

1

Hi,

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.
}

So, how do I doc n-number of string params?

+3  A: 

E.g. PhpDocumentor suggests using an ellipsis

/**
 * 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)
{
VolkerK
Beat me to it. Reference: http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.param.pkg.html
Pekka