为什么我会以这种格式看到这么多评论?

Bra*_*ons 2 php comments

我看到这么多PHP评论的格式为:

/**
 * (c) Copyright Someone 2009
 * legal crap
 * blorp
 */
Run Code Online (Sandbox Code Playgroud)

这只是按照惯例,还是有原因的?我认为这只是某些人做到的一种方式,但我现在想知道我发现我的语法荧光笔做到了这一点:它是红色的没有星号http://img.skitch.com/20090628-ef9riek8m5d75udssrqewhkasn.png

这只发生在我开始使用这种格式,然后停止使用它时.为什么评论是这样做的?

cle*_*tus 10

那些是phpDocumentor评论./**以文档生成器(按照惯例)开头的注释用于为项目创建文档.这是phpDocumentor快速入门指南.


Óla*_*age 7

许多文档生成器可以读取这样的格式.

许多IDE也使用它来帮助编码.(例如Zend Studio和其他人)

/**
 * Title
 * 
 * @author Me
 * @copyright 2009
 * @name test
 * 
 * @param int $foo
 * @return bool 
 */
function test($foo)
{
    return is_int($foo);
}
Run Code Online (Sandbox Code Playgroud)