Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Typehint return value as instance of static
Typehint return value as instance of static [message #643897] Wed, 08 December 2010 11:10
Taco  is currently offline Taco
Messages: 1
Registered: December 2010
Junior Member
In my current project I have a parent class that has a method similar to the following:

...
public static function load($id)
{
return new static($id);
}
...

This gives each childclass a static method load() that will instantiate an object of that class when called, so Foo::load($id) will return an object of type Foo and Bar::load($id) will return an object of the type Bar.

It would be nice if it is possible to let PDT know what type will be returned (e.g. an object of the class in which the method was called).

Something like:

/**
* @return static
*/

Can this be done?
Previous Topic:Eclipse Key Settings for Tab Navigation
Next Topic:Enable jsp partitions in xml document
Goto Forum:
  


Current Time: Fri Aug 01 20:37:07 EDT 2014

Powered by FUDForum. Page generated in 0.09820 seconds