Home >Backend Development >PHP Tutorial >Resource file in Delphi PHP file comment mark and specification summary
PHP comment tag
@access
Usage scope: class, function, var, define, module
This tag is used to indicate the access permission of keywords: private, public or protected
@author
Specify the author
@copyright
Usage scope: 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
The Markers are used to parse a section of file content 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 Baidu
can be written as @license http://www.baidu.com Baidu
@link
Similar to license
But you can also point to any keyword in the document through link
@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
Specifies the parameters of a function
@return
Specifies the return pointer of a method or function
@static
Specifies 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
Common document markup It 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
Comment specifications
a. Comments must be in the form of
/**
* Annotation content
*/
b. For functions that reference global variables, glboal tags must be used.
c. For variables, their types must be marked with var (int, string, bool...)
d. Functions must indicate their parameters and return values through param and return markers
e. For keywords that appear twice or more , ignore the redundant ones through ingore, and keep only one
f. Where other functions or classes are called, link or other tags should be used to link to the corresponding part to facilitate reading of the document.
g. Use non-documentation comments where necessary to improve code readability.
h. Keep descriptive content concise and to the point, using phrases rather than sentences whenever possible.
i. Global variables, static variables and constants must be described with corresponding tags
The above introduces the summary of resource files in Delphi, PHP file comment marks and specifications, including the content of resource files in Delphi. I hope it will be helpful to friends who are interested in PHP tutorials.