Home Backend Development PHP Tutorial PHP comment specifications_PHP tutorial

PHP comment specifications_PHP tutorial

Jul 21, 2016 pm 02:51 PM
class define function module php var Comment of specification

 @access

Scope of use: class, function, var, define, module

This tag is used to indicate the access permission of the keyword: private, public or protected

 @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

Specify unused or obsolete keywords

@example

This tag is used to parse a piece of file content and highlight them. Phpdoc will try to read the file content from the file path given by this tag

@const

Scope of use: define

Used to specify the constants defined in php

@final

Usage scope: class, function, var

Specifies that the keyword is a final class, method, or attribute, and is 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

Specify the global variable referenced in this function

 @ingore

Used to ignore specified keywords in the document

 @license

Equivalent to <a> in the html tag, first is the URL, then the content to be displayed

For example <a href=”http://www.baidu.com”>Baidu</a>

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

Scope of use: 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

Specify the parameters of a function

@return

Specifies the return pointer of a method or function

@static

Specifies that the Guan Jianzi is static.

@var

Specify the variable type

 @version

Specify version information

 @todo

Indicate areas that should be improved or have not been implemented

 @throws

Indicates the error exception that this function may throw and the circumstances in which it occurs

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 specifically includes the following:

 {@link}

Usage is the same as @link

 {@source}

Display the content of a function or method

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/371748.htmlTechArticle@access Scope of use: class, function, var, define, module This tag is used to indicate the access of keywords Permissions: private, public or protected @author Specify the author @copyright Scope of use: c...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

CakePHP Date and Time

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

CakePHP Project Configuration

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

CakePHP File upload

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

CakePHP Routing

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

Discuss CakePHP

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP Quick Guide

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

How To Set Up Visual Studio Code (VS Code) for PHP Development

See all articles