Home >Backend Development >PHP Tutorial >php comment specification

php comment specification

高洛峰
高洛峰Original
2016-12-01 09:42:361009browse

@access
Scope of use: class, function, var, define, module
This tag is used to indicate the access permission of keywords: private, public or protected
@author
Indicate the author
@copyright
Scope of use: class, function , var, define, module, use
Indicate copyright information
@deprecated
Scope of use: class, function, var, define, module, constent, global, include
Indicate unused or obsolete keywords
@example
This tag is used Parse the contents of a file and highlight them. Phpdoc will try to read the file content from the file path given by this tag
@const
Using scope: define
Used to specify the constant defined in php
@final
Using scope: class, function, var
Indicate that the keyword is a The final class, method, and attribute are prohibited from being derived or modified.
@filesource
Similar to example, except that this tag will directly read the content of the currently parsed php file and display it.
@global
Indicates the global variable referenced in this function
@ingore
Used to ignore specified keywords in the document
@license
Equivalent to in the html tag, first is the URL, and then is to be displayed The content
For example,
can be written as @license http://www.baidu.com Baidu
@link
Similar to license
but you can also use link Point to any keyword in the document
@name
Specify an alias for the keyword.
@package
Usage scope: page level -> define, function, include
Class level ->class, var, methods
Used to logically group 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 the return pointer of a method or function
@static
Indicates that the keyword is static.
@var
Indicate the variable type
@version
Indicate the version information
@todo
Indicate the areas that should be improved or not implemented
@throws
Indicate the error exceptions that this function may throw, and the extreme situations
As mentioned above, Ordinary document tags must be marked with @ at the beginning of each line. In addition, there is also a tag called inline tag, represented by {@}, which includes the following types:
{@link}
Usage is the same as @link
{@source}
Display the content of a function or method