I have multiple inheritance like this one: Can I extend a class using more than 1 class in PHP? (let's not discuss this approach itself please) and want my IDE to know about inherited class methods and properties. Is there a way to do it with PhpDoc?
Asked
Active
Viewed 6,081 times
7
-
Is your question more related to PhpDoc or more related to "how displays the appropriate auto-completion inside the editor"? – Savageman Apr 22 '10 at 09:58
-
1I don't like to call this trick multiple inheritance, but rather delegation. – Ionuț G. Stan Apr 22 '10 at 10:01
-
Savageman, it's about PhpDoc but it's also good to know if there are IDE specific tricks. – Sam Dark Apr 23 '10 at 12:37
3 Answers
12
It seems there is currently no way to do it easily. I've created a ticket at PhpStorm issue tracker. Maybe they will add support for this feature.

Sam Dark
- 5,291
- 1
- 34
- 52
-
1
-
9This works in PHPStorm simply by using the special phpDoc param `@mixin` like so: `/* @mixin \Another\Class\Or\Namespace */` in the top of the class. – h2ooooooo May 30 '15 at 15:23
3
The @method
anotation should be used for classes implementing __call
. On a related note, for __get
, __set
and __isset
, the @property
annotations should be used. The only thing I don't know for sure is whether Eclipse PDT supports these annotations. I know NetBeans does.

Ionuț G. Stan
- 176,118
- 18
- 189
- 202
-
Thanks, I know I can use these but it's hard to redeclare all "inherited" methods and properties one by one. My hope is that there is some kind of PhpDoc I've missed that can delegate class methods and properties to another class. btw., PhpStorm supports both @property and @method. – Sam Dark Apr 23 '10 at 12:36
-3
there is no support for multiple inheritances at class level. This means you can't extend more than one class at a time. However multiple inheritance is supported in interfaces. An interface can extend an arbitrary number of other interfaces at a time.

Offshore PHP Outsourcing India
- 107
- 1
- 2