Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 180189 - code completion from phpDoc for inherited objects/classes and interfaces
code completion from phpDoc for inherited objects/classes and interfaces
Product: php
Classification: Unclassified
Component: Editor
PC All
: P4 (vote)
: 6.x
Assigned To: rmatous
Depends on:
  Show dependency treegraph
Reported: 2010-02-03 02:59 UTC by koubel
Modified: 2010-05-17 11:34 UTC (History)
1 user (show)

See Also:

nice code completion for parent (52.23 KB, image/jpeg)
2010-02-04 02:09 UTC, koubel
no php doc in completion for childs (44.69 KB, image/jpeg)
2010-02-04 02:10 UTC, koubel

Note You need to log in before you can comment on or make changes to this bug.
Description koubel 2010-02-03 02:59:53 UTC
current code completion doesn't support "automatic" code completion for phpdoc in inherited classes. Hence using deep object hierarchy is little bit uncomfortable.


abstract class MyParent {
  * method1 description
  * @param string $arg first argument
  * @return string
 public function method1($arg) {

  * method2 description
  * @param string $arg first argument 
  * @return string
 abstract public function method2($arg);

class MyChild extends MyParent {

 public function method1($arg) {
   return parent::method1($ehancedArg);

 public function method2($arg) {
  ... ...
  return $retVal;

when I type
$var = new MyChild();
$var->method1 or $var->method2 I get empty code completion box,
and I expect box with phpDoc information which are defined in

MyChild inherits MyParent and behavior of methods is same or very similar,
so I expect inheritance of documentation, specially in abstract methods
and interfaces implementations.

Btw this is default behaviour of phpDocumentor tool which is used for generation documentation from sources with phpdoc comments. Support for inline @{inheritdoc} would be also very welcome.

See which describes @{inheritdoc} tag
and default phpdoc inheritance also.
Comment 1 rmatous 2010-02-03 03:20:53 UTC
if you had in mind CC like this:
var = new MyChild();
$var->method1->| or $var->method2->|

then, the problem is that string (@return string) isn't object in PHP if you didn't explicitly added your won impl. for it.

Changing the doc's type to MyChild (or whatever other object) like this: 
@return MyChild
should work
Comment 2 koubel 2010-02-04 02:05:34 UTC
Sorry, I made a mistake in description.
The code completion problem with previous OOP code is
when I type just

$var = new MyChild();

I expect same result as for

$var = new MyParent();

because MyChild inherits from MyParent a behaviour of methods described
via phpdoc in parent is same in child. It's especially expected on abstract methods.

I try to add screen shots for both described situations.
Comment 3 koubel 2010-02-04 02:09:34 UTC
Created attachment 93833 [details]
nice code completion for parent
Comment 4 koubel 2010-02-04 02:10:15 UTC
Created attachment 93834 [details]
no php doc in completion for childs
Comment 5 koubel 2010-02-04 02:13:22 UTC
example is little bit odd, because I cannot instantiate abstract class directly but works good for demonstration of "inheritance" of phpdoc in OOP code.
Comment 7 koubel 2010-05-12 15:35:49 UTC
Just notice, I tried today test it with latest build from but IDE is after while in state "Checking for external changes - Suspended". IDE isn't friezed, but it seems "Checking for external changes" never finises. I'll wait a few days for a new release and try to search related issues.
Comment 8 rmatous 2010-05-12 16:15:50 UTC
Never ending refresh will be probably following issue:
Comment 9 Quality Engineering 2010-05-13 05:06:42 UTC
Integrated into 'main-golden', will be available in build *201005122200* on (upload may still be in progress)
Comment 10 Filip Zamboj 2010-05-17 11:34:36 UTC
Product Version: NetBeans IDE Dev (Build 100517-f3e07cd88d57)

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo