Found at: http://publish.ez.no/article/articleprint/29/ |
PHP class documentation |
In this article I will explain a method of documenting your PHP classes. This article is based on the eZ phpdoc generator.
|
| A screenshot of the HTML class reference. |
//!! Module Name
//! A brief description of the class
/*!
This is a more complete description of the class.
*/
class MyClass
{
/*!
This is the contructor of MyClass. It handles....
*/
function MyClass()
{
}
/// This is a variable description.
var MyVar;
} |
//!! Module Name //! Short description. /*! This is the detailed description.. Here are some example code: \code $myObj = new MyClass(); \endcode \sa MyOtherClass */ |
/*!
This is a description of the function. The argument $value can be
of the type MyObjet.
*/
function aSmallFunction( $value )
{
} |
/// This variable does something special. Note: foo bar. var $myVar; |
/*!TODO First thing to do. Second thing to do. Yet, another thing to do. This one spans over two lines and contains more information about what to do. */ |
/*!
\static
This function is static.
*/
function aStaticFunction()
{
} |
/*!
\private
This function is private.
*/
function aPrivateFunction()
{
} |
eZ phpdoc v0.9
Usage: phpdoc.pl sourcedir... -o outputdir
--disable_todo ( will remove the todo listing )
Notice: phpdoc will search the sourcedir recursively and use all
.php files containing a class definition.
|
#ezphpdoc.pl classpath1/ classpath2/ /home/myuser/classpath3 -o /home/myuser/documentation |