【问题标题】:Doxygen - overridden method - the comment is not inherited, why?Doxygen - 被覆盖的方法 - 注释没有被继承,为什么?
【发布时间】:2016-08-29 16:31:06
【问题描述】:

我在 PHP 中有两个类:FigureCircleCircle 扩展 FigureFigure 有一个方法 draw()Circle 继承并覆盖了这个方法。

draw() 方法在父类中被注释,但它在 Circle 类中没有注释,因为它应该继承它。

/**
 * Description of Figure  
 *
 * @author admin
 */
class Figure{

    /**
     * Does something
     */
    public function draw() {

    }
}

/**
 * Description of Circle  
 *
 * @author admin
 */
class Circle extends Figure{


    public function draw() {
        //overriden method
    }
}

Doxygen 说: “警告:没有记录类 Circle 的成员 draw()(函数)。”

如何让 Doxygen 放入继承的注释中?

【问题讨论】:

  • 您使用的是哪个版本的 doxygen(当前版本是 1.8.11)?你能给出一个小代码示例来说明问题吗?
  • 是的,我用的是1.8.11版本。

标签: php doxygen


【解决方案1】:

您需要告诉 doxygen 从哪里获取文档,使用 @copydoc annotation

/**
 * Description of Circle  
 *
 * @author admin
 */
class Circle extends Figure {

    /**
     * @copydoc Figure::draw()
     */
    public function draw() {
        //overriden method
    }
}

@copydoc 下方的文档块中,您可以添加更多文档,例如为什么要覆盖该方法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-28
    • 1970-01-01
    • 2017-06-28
    • 2015-10-07
    • 2016-05-29
    相关资源
    最近更新 更多