| Summary: | Adding a new return type which reference to a child class | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Christian Kaps <ck-bugs.eclipse> | ||||||
| Component: | PDT | Assignee: | PHP Core <php.core-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | enhancement | ||||||||
| Priority: | P2 | CC: | ganoro, silviya | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
nice request ;) (I think it already exists btw) >> nice request ;) (I think it already exists btw)
Exists in PDT?
I meant the feature request probably exists ;) Created attachment 183277 [details]
patch
Now you can use "self" to propose the child class
Created attachment 183278 [details]
unit test patch
updated the patch and applied it to head,thanks! Closing Using self as return type works |
In the following scenario it isn't possible to get the methods of a child class displayed in the code assist. <?php abstract class Member { /** * @return Member */ public function setStatic($isStatic) { $this->isStatic = $isStatic; return $this; } } class Property extends Member { /** * @return Property */ public function setFinal($isFinal) { $this->isFinal = $isFinal; return $this; } } $property = new Property; $property->setStatic(true) -> ?; The entry setFinal() cannot be displayed here because the return type is Member and the Member class has only the method setStatic(). Is it possible to add a self or this return type which refers to the child class(Property)?