10.02.2013 Views

PHP Programming Language - Cultural View

PHP Programming Language - Cultural View

PHP Programming Language - Cultural View

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PHP</strong>Doc 178<br />

Now, the page has its documentation, and the define has its own documentation.<br />

So, a DocBlock is a page-level DocBlock IF AND ONLY IF it is both:<br />

1. The first DocBlock in a file<br />

2. Either:<br />

1. Contains a @package tag, or<br />

2. Is immediately followed by another DocBlock for any documentable <strong>PHP</strong> element (this is deprecated, always<br />

use a @package tag)<br />

A Page-level DocBlock may have any of the standard phpDocumentor Tags (see Standard phpDocumentor Tags)<br />

plus the following tags:<br />

• @package<br />

• @subpackage<br />

phpDocumentor will not document a file like the first example, there must be at least one documentable <strong>PHP</strong><br />

element in the file.<br />

Tags<br />

Tags are single words prefixed by a "@" symbol. Tags inform parsers how to present information and modify<br />

display of documentation as well as allow the IDE to define variable types. All tags are optional, but if you use a tag,<br />

they do have specific requirements to parse properly.<br />

Common tags<br />

Tag Usage Description<br />

@abstract Documents an abstract class, class variable or method.<br />

@access public, private or protected Documents access control for an element. @access private indicates that documentation of element be<br />

@author author name<br />

<br />

prevented.<br />

Documents the author of the current element.<br />

@copyright name date Documents copyright information.<br />

@deprecated version Documents a method as deprecated.<br />

@deprec same as @deprecated<br />

@example /path/to/example Documents the location of an external saved example file.<br />

@exception documents an exception thrown by a method — also see @throws.<br />

@global type $globalvarname Documents a global variable or its use in a function or method.<br />

@ignore Prevents the documentation of an element<br />

@internal private information for advanced developers<br />

@link URL<br />

@name global variable name Specifies an alias for a variable. For example, $GLOBALS['myvariable'] becomes $myvariable<br />

@magic phpdoc.de compatibility "phpDocumentor tags" [1] .<br />

@package name of a package Documents a group of related classes and functions.<br />

@param type [$varname] description<br />

@return type description This tag should not be used for constructors or methods defined with a void return type.<br />

@see Documents an association to another method or class.<br />

@since version Documents when a method was added to a class.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!