I see so many PHP comments in the format of:
我看到这么多PHP评论的格式为:
/**
* (c) Copyright Someone 2009
* legal crap
* blorp
*/
Is this just by convention, or is there a reason? I thought it was just a way that some people did it, but I am now wondering after I discovered that my syntax highlighter does this:It's red without asterisks http://img.skitch.com/20090628-ef9riek8m5d75udssrqewhkasn.png
这只是按照惯例,还是有原因的?我认为这只是某些人做到的一种方式,但我现在想知道我发现我的语法荧光笔做到了这一点:它是红色的没有星号http://img.skitch.com/20090628-ef9riek8m5d75udssrqewhkasn.png
This only happens when I've started to use this format, and then stop using it. Why are comments done this way?
这只发生在我开始使用这种格式,然后停止使用它时。为什么评论是这样做的?
2 个解决方案
#1
Those are phpDocumentor comments. Comments starting with /**
are used by documentation generators (by convention) to create documentation for the project. Here is a quick start guide for phpDocumentor.
那些是phpDocumentor评论。文件生成器(按照惯例)使用以/ **开头的注释来为项目创建文档。这是phpDocumentor的快速入门指南。
#2
Many documentation generators can read from formats like this.
许多文档生成器可以读取这样的格式。
This is also used by many IDE's to help with coding. (for example Zend Studio and others)
许多IDE也使用它来帮助编码。 (例如Zend Studio和其他人)
/**
* Title
*
* @author Me
* @copyright 2009
* @name test
*
* @param int $foo
* @return bool
*/
function test($foo)
{
return is_int($foo);
}
#1
Those are phpDocumentor comments. Comments starting with /**
are used by documentation generators (by convention) to create documentation for the project. Here is a quick start guide for phpDocumentor.
那些是phpDocumentor评论。文件生成器(按照惯例)使用以/ **开头的注释来为项目创建文档。这是phpDocumentor的快速入门指南。
#2
Many documentation generators can read from formats like this.
许多文档生成器可以读取这样的格式。
This is also used by many IDE's to help with coding. (for example Zend Studio and others)
许多IDE也使用它来帮助编码。 (例如Zend Studio和其他人)
/**
* Title
*
* @author Me
* @copyright 2009
* @name test
*
* @param int $foo
* @return bool
*/
function test($foo)
{
return is_int($foo);
}