Search code examples
phpeclipseoopintellisenseeclipse-pdt

PDT - no help for object returned by function


I have a Collector class, where all instances are saved. When I need work with database in some other class, I just call

$db = Collector::get("database");

this works great, but Eclipse PDT doesn't give me a help when I type

$db->
     ^^^^^^^ - no help here

It obvious because without running, it can't know what function get returns.

My question is, if I can say to Eclipse that this return instance of Database object, and later it could show me intellisense.


Solution

  • PHP is more flexible and loosely typed than other languages, as such, help systems in IDE's dont always work. Personally I have become accustomed to not relying on them.

    It depends on the IDE, but you may need to make sure all your classes/functions are documented with correct javadoc style comments.