【问题标题】:phpDocumentor 2 tags not workingphpDocumentor 2标签不起作用
【发布时间】:2013-11-22 03:46:20
【问题描述】:

我使用 Pear 安装了 phpDocumentor 2,如 phpdoc.org 上所述。这样做时,我编译了我的 cmets

 /**
  * Calls class1
  * @see class2
  * @access public
  */
 class class1 {

 }

 /**
  * Calls class2
  * you can {@link class1}
  */
 class class2 {

 }

除非你说@see class2 Class 2,否则第一个不起作用,第二个无论如何都不起作用。它只是像它看起来一样打印,而不是将大括号作为内联标签读取。所以,我的问题是 - 我在这里做错了吗?还有其他人遇到类似的事情吗?我下载了 phpDocs 1.x 并没有这个问题,但如果可能的话我想要 phpDocs 2..

谢谢!

【问题讨论】:

    标签: phpdoc phpdocumentor2


    【解决方案1】:

    phpDocumentor 2.x 尚未实现 1.x 中可用的内联链接标记 ("{@link}")。它在 TODO 列表中。我建议在这里也使用@see 标记,但显然你不能将其用作内联标记。

    我希望 @see 标记仅适用于目标类名称(“@see class2”),而不需要描述文本(“@see class2 Class 2”)。我认为你描述的行为是一个错误,可以在这里报告——https://github.com/phpDocumentor/phpDocumentor2/issues

    顺便说一句,@access 标签没有关于类本身的上下文。 public/protected/private 的可见性范围仅适用于类方法和类属性,不适用于类本身。此外,它早在 PHP4 时代就被添加到 phpDocumentor 1.x 中,在 PHP 中完全没有这种可见性范围之前(在 PHP5 中添加)。因此,它实际上不再有用了。即使在 1.x 中,如果针对为 PHP5 编写的代码使用 PHP5 运行,代码范围关键字将覆盖 @access 标记所说的任何内容。我不相信 phpDocumentor 2.x 甚至会打扰实现@access 标签,这是正确的。

    【讨论】:

    • 这肯定回答了我的问题,我在其他地方看不到。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-28
    • 1970-01-01
    • 2021-01-25
    • 1970-01-01
    • 2012-01-15
    • 2012-05-30
    相关资源
    最近更新 更多