2

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?

Dycey
  • 4,767
  • 5
  • 47
  • 86

1 Answers1

5

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.

Ehsan
  • 1,022
  • 11
  • 20
  • Ehsan's link takes you to the explanation of unpatched issue, that can be fixed by building , and patching from the GitHub source. Hopefully it will be fixed in 3.0. – Dycey Dec 08 '14 at 07:56