开发者

PHPDoc - which @[item] to use for "const" statement in my sources?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜