PHPDocumentor - what's wrong with my DocBlock?
我在一些遗留代码中添加了一些注释,我遇到了 PHPDocumentor 的一个小问题。
这是一个例子:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | /** * 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 编译错误,如下所示:
1 | Argument $id is missing from the Docblock of __construct |
这只是 PHPDocumenator 不必要的抱怨,还是我明显遗漏了什么?