Re: PEAR javadoc-style docs
| From: | Ulf Wendel | Date: | Wed, 10 May 2000 20:43:10 +0000 |
| Subject: | Re: PEAR javadoc-style docs | ||
| References: | 1 2 3 | Groups: | php.pear php.version4 |
| Request: | Send a blank email to php-pear+get-84@lists.php.net to get a copy of this message | ||
Andrei Zmievski wrote:
>
> On Wed, 10 May 2000, Ulf Wendel wrote:
> > +++ allowed variable types +++
> >
> > - enum(value1, [value2])
> > - string
> > - int
> > - double
> > - float
> > - boolean
> > - object [name of object]
>
> We also need 'mixed'.
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.
Ulf
Same on class vars (@var).
>
> -Andrei
>
> "Man, if you gotta ask you'll never know."
> - Louis Armstrong, when asked "What is jazz?"