【问题标题】:PHPDocumentor - what's wrong with my DocBlock?PHPDocumentor - 我的 DocBlock 有什么问题?
【发布时间】: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 。只是一个挑剔:)
  • 好收获。阿波利斯。

标签: php phpdoc docblocks


【解决方案1】:

phpDocumentor 2.8.1 版也有同样的问题。看来这是这个版本的一个错误: enter link description here

我用了version 2.7.0,现在很好。

【讨论】:

  • Ehsan 的链接将带您了解未修补问题的说明,该问题可以通过构建来修复,并从 GitHub 源代码修补。希望它会在 3.0 中得到修复。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-11
  • 2015-06-06
  • 2012-09-10
  • 2013-06-29
  • 2016-02-03
相关资源
最近更新 更多