使用 PhpDoc 记录 PHP 多重继承
我有像这样的多重继承: 我可以在 PHP 中使用多个类来扩展一个类吗?(请不要讨论这种方法本身)并希望我的 IDE 了解继承的类方法和属性。有没有办法用 PhpDoc 来做到这一点?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
目前看来还没有办法轻松做到。我已在 PhpStorm 问题跟踪器上创建了一张票证。也许他们会添加对此功能的支持。
http://youtrack.jetbrains.net/issue/WI-1730
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.
http://youtrack.jetbrains.net/issue/WI-1730
@method
注释应该用于实现__call
的类。相关说明,对于__get
、__set
和__isset
,@property
注释。我唯一不确定的是 Eclipse PDT 是否支持这些注释。我知道 NetBeans 可以。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.类级别不支持多重继承。这意味着您一次不能延长一门以上的课程。然而,接口支持多重继承。一个接口可以扩展任意数量的其他接口
一次。
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.