| Summary: | Freature Request: Syntaxcomplition when using get_calling_class(). eg: /** @return get_calling_class() | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | harrieva |
| Component: | PDT | Assignee: | PHP Core <php.core-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | trivial | ||
| Priority: | P3 | CC: | zulus |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
*** This bug has been marked as a duplicate of bug 276082 *** |
Build Identifier: 20110301-1815 I love PDT because it detects the the returntype of a function by parsing the @return comment. Unfortunaly this does not work for derived classes and static functions. Here is an example: class base{ /** * @return base */ public static function getobj(){ $c = get_calling_class(); return new $c; } } class derived extends base{} $obj = derived::getobj(); in this case pdt would complete $obj as it was an instance of base. And this is the right behavior. Unfortiunaly im not able to force eclipse to hanlde $obj like an instance of "derived". My idea is, that when @return gets the type "get_calling_class()" Syntaxcomplition handles $obj like the class that is called... Example: /** * @return get_calling_class() */ public static function getobj(){ $c = get_calling_class(); return new $c; } } A special type eg "__calling__class__" could be possible to.... Regards, Hendrik Reproducible: Always