What is the correct way to document PHP constants (define) with phpDocumentor

拟墨画扇 提交于 2019-12-10 01:07:20

问题


How must we document (with phpDocumentor) constants defined with define() in PHP?

I found nothing in the docs, but found the following example (which I don't see it's use) in the sample2.php:

/**#@+
 * Constants
 */
/**
 * first constant
 */
define('testing', 6);
/**
 * second constant
 */
define('anotherconstant', strlen('hello'));

Anyone can tell me what's the best way to document constants in PHP with phpDocumentor?


回答1:


Define statements are in general only commented with a descriptive text, so that's basically how you comment it.

To read more about the DocBlock template tag, /**#@+, check out the manual page.




回答2:


You have at phpDoc.org the elements that can be documented.

You also have an example of documenting a define() (the second piece of code and surrounding paragraphs).




回答3:


/**
*@const
*/
const testing=6;
const anotherconstant=strlen('hello');

Try this you will See it As Constant



来源:https://stackoverflow.com/questions/2192751/what-is-the-correct-way-to-document-php-constants-define-with-phpdocumentor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!