Brief summary of PHP file annotation mark and specification

Source: Internet
Author: User
Tags html tags php file

PHP Comment Markup

@access
Use scope: Class,function,var,define,module
This tag is used to indicate access rights for keywords: private, public, or proteced br>
@author
Indicates the author

@copyright
Use scope: Class,function,var,define,module,use
indicates copyright

@depr ecated
Use: class,function,var,define,module,constent,global,include
to indicate unused or deprecated keywords

@example
The tag is used to parse a piece of file content and highlight them. Phpdoc will attempt to read the file contents from the file path that is marked

@const
Use scope: Define
to indicate define constants in PHP

@final
Scope of use: class,funct Ion,var
Indicates that the keyword is a final class, method, property, and prohibits derivation, modification. The

@filesource
is similar to example, except that the tag will directly read the contents of the currently parsed PHP file and display it.

@global
indicate global variables referenced in this function

@ingore
to ignore specified keywords in the document

@license
equivalent to <a> in HTML tags;, the first First the URL, then the content to display
such as <a href= "http://www.baidu.com" > Baidu </a>
can write @license http://www.baidu.com Baidu The

@link
is similar to license
but can also specify an alias for the keyword by using link to refer to any one of the keywords

@name
in the document.

@package
Use scope: page-level-> define,function,inClude
Class-level->class,var,methods
is used to logically divide one or several keywords into a group. The

@abstrcut
Indicates that the current class is an abstract class

@param
Indicates the parameter of a function

@return
Indicates the return of a method or function

@stati C
Indicates that the closed word is static.

@var
indicate variable type

@version
Indicate version information

@todo
indicate where it should be improved or not implemented

@throws
to indicate this function Error exceptions that may be thrown, extreme occurrences

Normal document tag tags must be at the beginning of each line at the @ mark, in addition to a tag called inline tag, which is represented by {@}, specifically including the following:

{@link}
Use the same @link

{@source}
Display the contents of a function or method

Comment Specification

A. Note must be

/**
* Comment Content
/


B. For functions that reference global variables, you must use the glboal tag.

C. For variables, the type must be marked with VAR (int,string,bool ...).

D. Functions must indicate their arguments and return values

E through the Param and returns tags. For keywords that appear two or two times or more, you have to ignore the excess by Ingore, leaving only one.

F. Where other functions or classes are invoked, link or other tags are linked to the appropriate section to facilitate the reading of documents.

G. Use of non-document annotations where necessary to improve code readability.

H. Descriptive content as concise as possible, using phrases rather than sentences.

I. Global variables, static variables and constants must be indicated with the corresponding markup

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.