Reputation: 42798
How should I properly use PHPdoc to document chainable methods in a class, as seen in the below example - what is the correct usage?
class myClass {
/**
* @return myClass
*/
function one()
{
return $this;
}
/**
* @return self
*/
function two()
{
return $this;
}
/**
* @return $this
*/
function three()
{
return $this;
}
}
Upvotes: 6
Views: 510
Reputation: 2860
/**
* @return myClass
*/
I'm not a phpDoc expert but's that's how they do it in Zend framework. So I think it's reliable
Upvotes: 6