Skip to main content



      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
Eclipse UserFriend
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: Tue Jul 01 09:56:45 EDT 2025

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

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

Back to the top