PHPDoc comments suggestions

From: Date: Mon, 17 Mar 2003 19:30:55 +0000
Subject: PHPDoc comments suggestions
Groups: php.pear.dev php.pear.doc 
Request: Send a blank email to pear-dev+get-14375@lists.php.net to get a copy of this message
Hi there. Thanks for your feedback on the peardoc2 converter, I've done a bit more work on it based on the results of testing, and are ready for the next round of testing from you users, to make sure output is acceptable. I've also taken a quick appraisal of the PHPDoc comments in PEAR, and have some suggestions that will improve things immensely when the documentation is generated. 1) for inline code examples, use <code></code> /** * Short description * * Long description starts here, and * here is a code example: * <code> * $myvar = dosomething(); * </code> */ phpDocumentor will highlight the source code as PHP source in every output format including PDF, if you're running PHP 4.3.0+ and have the tokenizer extension loaded. 2) for large redundant sections like a series of private variables, use docblock templates /**#@+ * @access private */ /** * @var string */ var $_priv1; /** * @var string */ var $_priv2; /**#@-*/ see http://phpdoc.org/docs/HTMLSmartyConverter/PHP/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblocktemplate 3) if a function or parameter is an object, and the class is parsed, use the classname and phpDocumentor will recognize it and link to its documentation class yours {} class mine {} /** * @param mine my class, passed in * @return yours|false either your class, or false if it's Easter */ function doohickey() {
    if (todayiseaster()) return false;
    return new yours;
} see http://phpdoc.org/docs/HTMLSmartyConverter/PHP/phpDocumentor/tutorial_tags.return.pkg.html That's all, there are other features that you can read about in the phpDocumentor manual, for those who want to know the full possibilities. Greg -- phpDocumentor http://www.phpdoc.org

« previous php.pear.dev (#14375) next »