14

我们必须如何记录(使用phpDocumentor )用PHP 中的define() 定义的常量?

我在文档中一无所获,但在 sample2.php 中找到了以下示例(我没有看到它的用途):

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

任何人都可以告诉我用 phpDocumentor 在 PHP 中记录常量的最佳方法是什么?

4

3 回答 3

6

定义语句通常只用描述性文本进行评论,所以这基本上就是您评论它的方式。

要了解有关 DocBlock 模板标签的更多信息/**#@+,请查看手册页

于 2010-02-03T14:58:47.013 回答
1

您在 phpDoc.org上有可以记录的元素

您还有一个记录 define() 的示例(第二段代码和周围的段落)。

于 2010-02-03T16:00:02.413 回答
1
/**
*@const
*/
const testing=6;
const anotherconstant=strlen('hello');

试试这个,你会看到它是不变的

于 2015-04-02T12:37:28.023 回答