【发布时间】:2014-12-27 04:35:13
【问题描述】:
我在一些遗留代码中加入了一些 cmets,我遇到了 PHPDocumentor 的一个小问题。
这是一个例子:
/**
* Constructs the Widget object
*
* Basic constructor for the widget object.
* Another line of pointless explanation, badly worded.
*
* @param string $id The ID of the widget
* @param int $size The Size of the widget
* @throws InvalidArgumentException
*/
public function __construct($id, $size) {
if (!is_string($id) || !is_integer($size)) {
throw new InvalidArgumentException('$id must be a string, $size an integer');
}
$this->id = $id;
$this->size = $size;
}
我从命令行运行 PHPDocumentor,并得到一个充满文档的可爱文件夹。
文档看起来不错,但我得到了 PHPDocumentor 编译错误:
Argument $id is missing from the Docblock of __construct
这只是 PHPDocumenator 不必要的抱怨,还是我明显遗漏了什么?
【问题讨论】:
-
你确定它指向那个文件吗?
-
是的!文档本身看起来很完整,但它仍然在 errors.html 文件中抛出错误。
-
是否可以在另一个非 ASCII 键盘布局中输入任何字母?
-
__construct 不返回,所以不应该有 @return void 。只是一个挑剔:)
-
好收获。阿波利斯。