phpphpdocdocblocks

PHPDocumentor - what's wrong with my DocBlock?


I'm putting in some comments in some legacy code, and I've run across a small issue with PHPDocumentor.

Here's an example:

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

I run PHPDocumentor from the command-line, and get a lovely folder full of documentation.

The documentation looks fine, but I get PHPDocumentor compilation errors along the lines of:

Argument $id is missing from the Docblock of __construct

Is it just PHPDocumenator whining unnecessarily, or is there something obvious I'm missing?


Solution

  • I had the same issue with phpDocumentor version 2.8.1. It seems it's a bug in this version: enter link description here

    I used version 2.7.0 and it's fine now.