phpphpdocphpdocumentor2

phpDocumentor: DocBlock with @var tags duplicates descriptions


I have this DocBlock in a php abstract class:

/**
* @var string $foo a useful foo and <code>some.code()</code> too
* @var string $bar a useless bar
*
* @todo do something with <code>$this->bar</code>
*/
protected $foo, $bar;

I parsed this class with phpDocumentor; and here's the html result:

As you can see both $foo and $bar shares the same description (the $foo one) and markdown is not parsed too. On the other hand markdown of @todo tag is properly parsed.

Where am I wrong? Did I miss something?

I found a bug ticket about markdown in @var tags: Has it something to do with this issue maybe?


Solution

  • I always document above the var itself. Maybe that's the issue

    /**
    * @var string $foo a useful foo and <code>some.code()</code> too
    */
    protected $foo;
    /*
    * @var string $bar a useless bar
    *
    * @todo do something with <code>$this->bar</code>
    */
    protected $bar;