Skip to main content


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 16:10
Taco  is currently offline Taco Friend
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 Sep 13 03:00:41 GMT 2024

Powered by FUDForum. Page generated in 0.04718 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top