Getting PDT code completion to recognise runtime return types from base class?

Posted by Keith Humm on Stack Overflow See other posts from Stack Overflow or by Keith Humm
Published on 2010-03-23T22:52:38Z Indexed on 2010/03/23 23:23 UTC
Read the original article Hit count: 289

Hi guys,

I've got an abstract base class:

abstract class BaseClass {
  /**
   * @return CLASSNAME
   */
  public function fluent() {
    // do stuff
    return $this;
  }
}

Generally, i would put BaseClass where CLASSNAME is and all would be fine, PDT would pick up the phpdoc return type and happily autocomplete.

Until, that is, I subclass BaseClass and add additional methods, and code compete on an instance of the derived class. PDT will only recognise the methods from BaseClass and not those from the derived class.

What I need is something like @return self or @return this.

Does PDT have such functionality? Or is there an alternate trick without having to declare these methods in every derived class?

© Stack Overflow or respective owner

Related posts about php

Related posts about eclipse-pdt