php - Doxygen - 重写方法 - 注释不被继承,为什么?

标签 php doxygen

我在 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
    }
}

多氧根说: “警告:未记录类 Circle 的成员 draw()(函数)。”

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

最佳答案

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

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

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

@copydoc 下方的文档 block 中,您可以添加更多文档,例如为什么重写该方法。

关于php - Doxygen - 重写方法 - 注释不被继承,为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37024286/

相关文章:

doxygen 不生成点的图像文件

php - 添加 mysql 列以在 csv php 中输出?

php - fatal error : Call to a member function execute() on boolean

svn - 在 SVN 存储库中包含 doxygen 文档

python - Python 的 Doxygen : one paragraph to document both file and package

c++ - Doxygen 没有列出嵌套的命名空间

php - 在 SQL Server 数据库中存储丹麦语字母的最佳方式是什么?

php - 复选框 css 仅适用于第一个循环项

php - 如何在 Laravel 中使用 Angular

documentation - 如何包含 .iuml 路径以在 Doxygen 中生成 PlantUML 图