As far as I'm aware PHPDoc is the only way to get it to work in PhpED.
<?php
class App
{
/**
* @return App
*/
function GetThis($A = 0)
{
echo $A;
return $this;
}
/**
* @return App
*/
function OK()
{
echo 'OK';
return $this;
}
}
$Ap = new App();
$Ap->GetThis(2)->OK();
$Ap->GetThis()->
?> |
I do sometimes use a competitor product to PhpED and that does provide code completion based on the actual return value, so it would be nice if PhpED did it as well.
It would be
very useful for working with API's such as with Zend framework and Magento, where PHPDoc is not always fully utilised.
Even if full type tracking wasn't implemented, checking for a simple
return $this would probably be straight-forward.