Whenever I need to use Netbeans intelligence to display properties / methods, I explicitly declare a new object and then re-reference it. Sort of..
$moo = new Cow(); $moo = Cow::getById(1); $hasMilk = $moo->hasMilk();
Is there a way to avoid this by entering the type of the variable when it is received? Or at least a hack to trick Netbeans?
Thanks!
PS: the main reason for solving this is something, if I forgot to comment on line 1, and when obj is not found, it works with a fresh object !: (
source share