Phpdocumentor Manuals-Installation and label use1. Installation
Must contain: PHP 5.3. Version 3 or above, Intl for PHP extension, Graphviz
installation mode using the Pear command
Pear Channel-discover pear.phpdoc.org
Pear Install Phpdoc/phpdocumentor
2.DocBlock Basic Syntax
DocBlock (document Block)
/**
* Phpdocumentor test.
*
*/
DocBlock is used within the following structural elements
L namespace
L require (_once)
L include (_once)
L class
L Interface
L Trait
L function (including methods)
L Property
L constant
l variables, both local and global scope.
DocBlock Example
/**
* Abstract: The method to achieve the user's age.
* @param string $name user name, use Chinese
* @return
*/
Function Getage ($name) {
......
}
DocBlock consists of three parts
1. Summary
An overview of the entire feature
2. Description
Description of the feature or markup extension
Algorithm description
Example description
Copyright License Description ...
Description of the tag
3. Mark
@api
@author
@category
@copyright
@deprecated
@example
@filesource
@global
@ignore
@internal
@license
@link
@method
@package
@param
@property
@property-read
@property-write
@return
@see
@since
@source
@subpackage
@throws
@todo
@uses & @used-by
@var
@version
3. Use of tags
type:string, int, bool, floot, array, void, etc.
See http://phpdoc.org/docs/latest/references/phpdoc/types.html
@api mark the elements of the structure to fit third-party parts
@author Document Author tags
Using syntax
@author [name] [<email Address>]
@package encapsulates the package name a group of related classes, package names encapsulated by functions
Using syntax
@package [Level 1]\[level 2]\[etc.]
@copyright Copyright Information
Using syntax
@copyright [Description]
Instructions for @deprecated deprecation
Using syntax
@deprecated [<version>] [<description>]
@example the location of the sample code
Using syntax
@example [Location] [<start-line> [<number-of-lines>]][<description>]
@example/www/web/default/test.php 1 3 code in the test.php file from the first line to the third row
@ignore tell Phpdocumentor to ignore the processed
Using syntax
@ignore [<description>]
@ignore Phpdoc ignores the definition of OS constants and does not appear in the document
Define ("OS", "Windows");
@license License Description
Using syntax
@license [<url>] [name]
@link links outside for more detailed information
Using syntax
@link [URI] [<description>]
@method Simple to understand that the __call magic function is a method that needs to be called
Using syntax
@method [return type] [name] ([[[Type] [Parameter]<, ...]) [<description>]
Set integer @method void Setinteger (integer $integer)
@param parameters of a function or method
Using syntax
@param [Type] [name] [<description>]
A string parameter @param string $myArgument me
@property represents properties that are called using the __get () and __set () Magic Methods
Using syntax
@property [Type] [name] [<description>]
@return The return value of a method or function
Using syntax
@return [Type] [<description>]
@see view the associated structure element or Web site
Using syntax
@see [URI | Fqsen] [<description>]
@see \phpdocumentor:: $items View the Items property under the Phpdocumentor class
Fqsen Explanation: Structure element name \my\space\myclass::mymethod ()
@since from which version is starting to use
@since [Version] [<description>]
@source Show Source code
@source [<start-line> [<number-of-lines>]][<description>]
@throws Throw Error description
@throws [Type] [<description>]
@todo Follow-up description to be developed
@uses & @used-by View reference related structural elements
@uses [Fqsen] [<description>]
@var variables or properties
@var ["Type"] [$element _name][<description>]
Using Phpdoc/phpdocumentor to generate API documentation
Thank you for your attention websites blog!
Phpdocumentor Manuals-Installation and label use