How can I mark up constants using PHPDoc?开发者_开发知识库 What @-tag should I use? I've thought of @var, but that's not appropriate.
The short answer is that there isn't one. And there doesn't need to be one either. The documentation generator is smart enough to be able to see the constant declaration. So just put the summary there without any @-tags. That should be all that you need to do...
class foo {
/**
* This constant does something that you need.
*/
const FOO = 'bar';
}
For constants, you use @type.
精彩评论