How to document class properties in PHP 5 with phpDocumentor

AlexV picture AlexV · Feb 3, 2010 · Viewed 26.5k times · Source

Take in consideration the following PHP 5 class:

class SomeClass
{
    //I want to document this property...
    private $foo;


    function __construct()
    {

    }

    public function SetFoo($value)
    {
        $this->foo = $value;
    }

    public function GetFoo()
    {
        return $this->foo;
    }
}

How in phpDocumentor will I document the $foo property? I'm not even sure it need to be documented but I would like to know how if if needs to...

I know how to document SetFoo() and GetFoo(), I'm just not sure about the private property (variable?).

Thanks!

Answer

Billy ONeal picture Billy ONeal · Feb 3, 2010
/**
 * This is what the variable does. The var line contains the type stored in this variable.
 * @var string
 */
private $foo;