简体   繁体   中英

What are or how is this documentation comments used in PHP

I often see this type of comments which are well documented.

/*
* @author      some name
* @category    Core
* @package     /dir/name
* @version     1.6.4
*/

function ... (){}

*** code here ***

I wonder since so many people are using this (most open source)

What are they and how I get into using this method or find out more about this kind of stuff.

I am not looking for a quick answer, here do your research:

Hopefully a helpful answer, explaining what it is, what the benefits are from taking the time to write extra code etc...

They are documentation tags within the comments of a PHP file. Commonly used with applications that generate documentation such as PHP Documentator

From the intro :

phpDocumentor 2 is a tool with which it is possible to generate documentation from your PHP source code. With this documentation you can provide your consumers with more information regarding the functionality embedded within your source and not only what is usable to them from your user interface.

They are called annotations and are usually (but not only) used for documentation purposes. Try to read this: http://en.wikipedia.org/wiki/PHPDoc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM