在父类中,我有:
/**
* Render the widget.
* @param array $options
* @return string
*/
abstract public function render(array $options=[]);
在儿童班上,我有:
/**
* {@inheritDoc}
*/
public function render(array $options=[]) { /*...*/ }
但是phpdoc为子类提供了以下错误:
Argument $options is missing from the Docblock of render()
为什么?
编辑:如果我在http://phpdoc.org/docs/latest/guides/inheritance.html,无论inheritDoc是否存在,都应继承方法params。
@inheritDoc并不是为这个目的而设计的。
{@inheritcoc}内联标记用于子类的类DocBlocks中。phpDocumentor将自动从父类继承@author标记、@version标记和@copyright标记。
看看这里的官方文件。
如果您不在子类中重新声明方法,那么我认为各种输出转换器的结构只会向您显示继承方法的列表。一些转换器将至少包含docblock中方法的简短描述(HTML:Smarty:PHP),而其他转换器则不包含
根据这里的公认答案。