Tags
Tags are single words prefixed by a "@" symbol. Tags inform parsers how to present information and modify display of documentation as well as allow the IDE to define variable types. All tags are optional, but if you use a tag, they do have specific requirements to parse properly.
Tag | Usage | Description |
---|---|---|
@abstract | Documents an abstract class, class variable or method. | |
@access | public, private or protected | Documents access control for an element. @access private indicates that documentation of element be prevented. |
@author | author name <author@email> | Documents the author of the current element. |
@copyright | name date | Documents copyright information. |
@deprecated | version | Documents a method as deprecated. |
@deprec | Same as @deprecated | |
@example | /path/to/example | Documents the location of an external saved example file. |
@exception | Documents an exception thrown by a method — also see @throws. | |
@global | type $globalvarname | Documents a global variable or its use in a function or method. |
@ignore | Prevents the documentation of an element | |
@internal | Private information for advanced developers | |
@link | URL | |
@name | global variable name | Specifies an alias for a variable. For example, $GLOBALS['myvariable'] becomes $myvariable |
@magic | phpdoc.de compatibility "phpDocumentor tags". http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html. | |
@package | name of a package | Documents a group of related classes and functions. |
@param | type [$varname] description | |
@return | type description | This tag should not be used for constructors or methods defined with a void return type.[citation needed] |
@see | element | Documents an association to any element (global variable, include, page, class, function, define, method, variable). |
@since | version | Documents when a method was added to a class. |
@static | Documents a static class or method | |
@staticvar | type | Documents a static variable's use in a function or class |
@subpackage | ||
@throws | Documents an exception thrown by a method. | |
@todo | Documents things that need to be done to the code at a later date. | |
@var | type | A data type for a class variable |
@version | Provides the version number of a class or method. |
In addition, some parsers allow two additional inline tags: {@id}, used to allow direct linking to sections in a tutorial, and {@toc}, used to generate a table of contents from {@id}s in the file. Think of {@id} like an <a name="idname"> HTML tag as it serves the same function.
For more in depth discussion of PHPDoc tags, see http://manual.phpdoc.org/HTMLSmartyConverter/PHP/phpDocumentor/tutorial_tags.pkg.html