Re: PEAR javadoc-style docs
| From: | Andrei Zmievski | Date: | Wed, 10 May 2000 20:45:34 +0000 |
| Subject: | Re: PEAR javadoc-style docs | ||
| References: | 1 2 3 4 | Groups: | php.pear php.version4 |
| Request: | Send a blank email to php-version4+get-14786@lists.php.net to get a copy of this message | ||
On Wed, 10 May 2000, Ulf Wendel wrote:
> I don't think so. Functions that except arguments of different types are
> documented by repeating the @param tags. Here's an example to show what
> I mean. getValues() accepts a string or an array of string. To document
> it I would follow javadoc and write:
>
> /**
> * [...]
> * @param string $elname name of an element
> * @param array $elname list fo element names ($k => $name)
> * @return boolean $ok
> * [...]
> */
> function getValues($elname) {
> if (!is_array($elname))
> $elname = array($elname);
> [...]
>
> The generated reference will look something like:
>
> boolean getValues( string $elname )
> boolean getValues( array $elname )
>
> Same on class variables.
How do you document something like preg_replace() which takes three
arguments any one of which can be a string or an array and can also
return string or array?
-Andrei
* We reason deeply, when we forcibly feel. *