Community
Participate
Working Groups
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)?
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