PHPDocument-what';我的DocBlock有问题


PHPDocumentor - what's wrong with my DocBlock?

我在一些遗留代码中添加了一些注释,并且我遇到了PHPDocument的一个小问题。

这里有一个例子:

/**
 * 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;
}

我从命令行运行PHPDocument,得到了一个充满文档的可爱文件夹。

文档看起来不错,但我收到了PHPDocument的编译错误,大致如下:

Argument $id is missing from the Docblock of __construct

是PHPDocumentor不必要地发牢骚,还是我明显错过了什么?

我在phpDocumentor 2.8.1版本中遇到了同样的问题。这似乎是这个版本中的一个错误:在此处输入链接描述

我使用了2.7.0版本,现在它很好。