CHAPTER 16 ■ GENERATING DOCUMENTATION WITH PHPDOCUMENTOR
- Encapsulated Keys/values.
- This class is essentially a wrapper for this array
- @var array
*/
private $params = array();
/**
- An error message.
- @var string
*/
private $error = "";
// ...
As you can see, I provide a summary sentence for each property and fuller information for the first
two. We use the @var tag to define each property’s type. If we were to use the same phpdoc command line
arguments as usual to generate output at this point, you would only see documentation for the public
$applicationName property. This is because private methods and properties do not appear in
documentation by default.
Whether or not you choose to document private elements depends in large part on your intended
audience. If you are writing for client coders, then you should probably hide your classes’ internals. If,
on the other hand, your project is under development, your team members may need more detailed
documentation. You can make phpDocumentor include private elements by using the -pp (--
parseprivate) command line argument when you invoke the script:
phpdoc -d /home/projects/megaquiz/ \
-t /home/projects/docs/megaquiz/ \
-ti 'Mega Quiz' \
-dn 'megaquiz' \
-pp on
Notice that you must explicitly set the -pp flag to on; it is not enough to include the flag on its own.
You can see the documented properties in Figure 16–5.