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;
}
}
/**
* @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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With