PHP Annotation Specification

Source: Internet
Author: User
Tags deprecated

There are three common comments for PHP:

1. A single-line comment starting with ' # ';

2. A single-line comment starting with '//';

3. A multiline comment that is closed with '/* ' and ' */'.

The Common PHP Comment specification summary is as follows:

/**
* @name Name
* @abstract declaration variable/class/method
* @access indicates access to this variable, class, function/method
* @author function Author's name and email address
* @category Organization Packages
* @copyright Specify Copyright information
* @const Specified constants
* @deprecate indicates deprecated or deprecated information myeclipse encoding settings
* @example Example
* @exclude indicates that the current comment will not be analyzed and does not appear in the text block
* @final indicates that this is a final class, method, property, prohibit derivation, modification.
* @global indicate the global variables referenced in this function
* @include indicate the information contained in the file
* @link define an online connection
* @module define the module information for attribution
* @modulegroup module groups that define attribution
* @package Define the information of the packages that belong to
* @param define parameter information for a function or method
* @return Define the return information of a function or method
* @see define functions, variables to be referenced, and add the corresponding super connections.
* @since indicates which version of the API function or method was introduced from
* @static indicates that variables, classes, functions are static.
* @throws indicates an error that could be thrown by this function, which is extremely occurring
* @todo indicate areas that should be improved or not implemented
* @var Define description variables/properties.
* @version define version information
*/

Detailed explanations are as follows:

@access
Scope of Use: Class,function,var,define,module
The tag is used to indicate access rights for the keyword: private, public, or proteced
@author
Specify the author
@copyright
Scope of Use: Class,function,var,define,module,use
Specify copyright information
@deprecated
Scope of Use: Class,function,var,define,module,constent,global,include
Identify unused or deprecated keywords
@example
This tag is used to parse the contents of a file and highlight them. Phpdoc will attempt to read the file contents from the file path that the token gives
@const
Scope of Use: Define
Constants used to indicate define in PHP
@final
Scope of Use: Class,function,var
Indicates that the keyword is a final class, method, property, prohibit derivation, modification.
@filesource
Similar to example, except that the tag directly reads and displays the contents of the currently parsed PHP file.
@global
Indicates the global variable referenced in this function
@ingore
Used to omit the specified keyword from the document
@license
Equivalent to the <A&GT in the HTML tag, first the URL, then the content to be displayed
For example <a href= "http://www.baidu.com" > Baidu </a>
Can write @license http://www.baidu.com Baidu
@link
Similar to license
But you can also refer to any one of the keywords in the document by using link
@name
Specifies an alias for the keyword.
@package
Scope of Use: page-level, define,function,include
Class-Level->class,var,methods
Used to logically divide one or several keywords into a group.
@abstrcut
Indicates that the current class is an abstract class
@param
Indicates the parameters of a function
@return
Indicates that the return of a method or function refers to the
@static
Indicates that the off-build word is static.
@var
Indicate variable type
@version
Specifying version information
@todo
Identify areas that should be improved or not implemented
@throws
Indicates that this function may throw an error exception, which can occur in extreme cases
As mentioned above, ordinary document tag tags must be at the beginning of each line at the @ mark, in addition, there is a tag called inline tag, with {@}, including the following:
{@link}
Usage with @link
{@source}
Show the contents of a function or method

PHP Annotation Specification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.