Re: new entities needed for phpDocumentor tags
| From: | Greg Beaver | Date: | Wed, 23 Jul 2003 17:58:49 +0000 |
| Subject: | Re: new entities needed for phpDocumentor tags | ||
| References: | 1 2 3 4 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-1103@lists.php.net to get a copy of this message | ||
Alexander Merz wrote:
Greg Beaver wrote:abstract functions/abstract classes, I understand the confusion now.for clearifing: what you mean with abstract? An abstract function or an abstract in the way of an abstract of a talk?Why not place static function declarations, or deprecated functionnote.abstract? What is the difference to the Intro section?
This is also clear, thank you. Personally, I can't wait for PHP 5, when all of this becomes moot (static class variables are in essence namespace-safe global variables that will allow exposing public global variables). There is another question I realize is the one that really needs asking: should there be a new distinction in the PEAR documentation standard between private and protected class elements? PEAR classes are often designed not just to be used, but to be extended. In other words, a class may serve two purposes, that of simple use (phpDocumentor is designed to be used out of the box, no modifications), and extension (designing new templates, adding a new converter, a new tag, etc.). Those who just wish to use phpDocumentor need a different set of documentation from those who wish to extend phpDocumentor. The current peardoc design is very friendly to those who only wish to use a class, but is somewhat unhelpful to those who wish to extend a class. There are many cases where a variable/function should never be accessed globally, but should be available to child classes for polymorphism, and it would be very useful to document this in peardoc. I don't intend to disrupt everything that is working about peardoc, but I would really like to see a bit more low-level detail as a possibility. For instance, when I was digging through the source code for PEAR_Common (which is undocumented), I discovered the usage of a global array variable $_PEAR_Common_maintainer_roles, and found no way to access this variable through the methods of PEAR_Common. I wanted to use this variable to validate an input that should be in that global array, and so was forced to use it directly. One could argue that I should have just pretended it didn't exist because it is supposed to be a private variable, but just because the design was not ideal according to PEAR coding standards shouldn't mean that it also should be impossible to write a useful solution that uses a private global variable. In this case, it would be very, very useful to document these private global variables, because there is a real need to know what they are in order to extend the class's functionality. The only other solution is to force the authors of the package to re-write it so that we can access these variables through the class. I don't see a clean answer to this problem, but perhaps you have one that I've overlooked? Greg---- http://pear.php.net/manual/en/standards.naming.php --- If your package needs to define global variables, their name should start with a single underscore followed by the package name and another underscore. For example, the PEAR package uses a global variable called $_PEAR_destructor_object_list. ---- Private class members (meaning class members that are intented to be used only from within the same class in which they are declared; PHP does not yet support truly-enforceable private namespaces) are preceded by a single underscore. For example: ---- By PCS globals are private members of an class. Private stuff isn't part of peardoc.title.globals (many packages have global variables)Globals should be noted in the constants section (because the packages should use constants instead of globals :-)