6. phpDocumentor tags
@abstract
Document an abstract class, class variable or
method
/**
* example of basic @abstract usage in a class
* Use this if every single element of the class is abstract
* @abstract
*/
class myabstractclass
{
function function1($baz)
{
...
}
function function2()
{
...
}
}
7. phpDocumentor tags
@access
Access control for an element. @access private prevents
documentation of the following element (if enabled).
* This is possible, but redundant. An element has @access public by default
* @access public
*/
class class1
{
/**
* all text in this DocBlock will be ignored, unless command-line switch
* @access private
*/
var $private_var;
/**
* Protected is allowed, but does absolutely nothing.
* @access protected
*/
/**
* this function is documented
*/
function publicmethod()
{
}
}
8. phpDocumentor tags
@author
Author of current element
/**
* Page-Level DocBlock example.
* displays as Gregory Beaver<strong>cellog@php.
net</strong>
* , where underlined text is a "mailto:cellog@php.net" link
* @author Gregory Beaver <cellog@php.net>
*/
/**
* function datafunction
* another contributor authored this function
* @author Joe Shmoe
*/
function datafunction()
{
...
}
9. phpDocumentor tags
@category
Specify a category to organize the documented element's package
into
/**
* Page-Level DocBlock
* @package MyPackage
* @category mycategory
*/
/**
* @global array used for stuff
*/
function mine()
{
global $baz;
...
}
10. phpDocumentor tags
@deprecated
Document elements that have been deprecated and should not be used as
they may be removed at any time from a future version
/**
* @deprecated deprecated since version 2.0
*/
function uselessfunction()
{
...
}
/**
* also legal
* @deprecated
*/
class stupidclass
{
...
}
11. phpDocumentor tags
@example
Include an external example file with syntax
highlighting
/**
* My function
*
* Here is an inline example:
* <code>
* <?php
* echo strlen('6');
* ?>
* </code>
* @example /path/to/example.php How to use this function
* @example anotherexample.
inc This example is in the "examples" subdirectory
*/
function mine()
{
}