Re: phpdoc conventions on methods
| From: | Hannes Magnusson | Date: | Thu, 16 Aug 2007 08:30:05 +0000 |
| Subject: | Re: phpdoc conventions on methods | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969377367@lists.php.net to get a copy of this message | ||
On 8/16/07, Stanislav Malyshev <stas@zend.com> wrote:
> What are the standards/conventions on the following matters:
>
> 1. Method names in reference.xml (when descripting class) - should I use
> class->method or class->method() (with or without braces)? I see both
> - compare PDO and DOM docs.
If you wrap it inside a <function /> element then drop the (),
otherwise I'd say keep them
> 2. Function names in function description (refname) - with or without
> braces? I see most of the functions don't have braces in names.
Function name should not contain () inside refname.
> 3. Same for method name - dominant use seems to be with braces though
> some don't use braces - see SPL or SDO docs for example.
*I* prefer consistency with the functions, without ().
> 4. Should one use class name in method description in reference.xml - is
> it Class->method or just method? DOM uses class, PDO doesn't. SPL
> doesn't have the section at all...
class->method, especially if you wrap it in <function />
> 5. Should method use Class::method or Class->method? SPL uses ::, PDO
> uses ->.
There is no rule on that :]
Just try to be consistent within the chapter.
We don't have a "official" OO doc-style, what comes closest is the
pecl/http docs.
You could send a file, or two, to the list and have people check it
out for you...
I really recommend it, then you at least have couple of files you can
use as skel for the rest
-Hannes