Doxygen - 覆盖方法 - 注释不是继承的,为什么


Doxygen - overridden method - the comment is not inherited, why?

我在PHP中有两个类:FigureCircleCircle扩展Figure . Figure有一个方法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
    }
}

氧气 说:"警告:类 Circle 的成员 draw(((函数(未被记录。">

如何让Doxygen放入继承的评论中?

您需要使用@copydoc注释告诉 doxygen 从哪里获取文档。

/**
 * Description of Circle  
 *
 * @author admin
 */
class Circle extends Figure {
    /**
     * @copydoc Figure::draw()
     */
    public function draw() {
        //overriden method
    }
}

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