如何表明该方法是PHPDoc接口的一部分?
发布时间:2020-05-26 01:46:24 所属栏目:PHP 来源:互联网
导读:如何表明该方法是 PHPDoc接口的一部分? 例如: /** * @implements BarInterface */class Foo implements BarInterface{ /** * @thisMethodIsHereBecauseItIsAPartOf(BarInterface) */ public function doBar(
如何表明该方法是 PHPDoc接口的一部分? 例如: /** * @implements BarInterface */ class Foo implements BarInterface { /** * @thisMethodIsHereBecauseItIsAPartOf("BarInterface") */ public function doBar() { } } 是否有适当的替换@thisMethodIsHereBecauseItIsAPartOf(“BarInterface”)?
您不需要记录它,因为您使用实现BarInterface和源代码文档系统通常会自动处理这些. 但是你也可以使用@inherit(doc): /** * @implements BarInterface */ class Foo implements BarInterface { /** * @inherit * {@inherit} * {@inheritdoc} */ public function doBar() { } } 关于你的@implements BarInterface,这是多余的,因为它已经写在类定义中了.由于注释计为代码,并且您不应该编写多余的代码,我建议您将其删除. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |