加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > PHP > 正文

PhpDocs:可以在参数描述中链接方法吗?

发布时间:2020-05-31 00:42:19 所属栏目:PHP 来源:互联网
导读:是否可以链接到另一个方法/类/属性/等.在我的项目内部@deprecated标签内联?像这样: /** * Method description * @deprecated 1.0 Reason for deprecation, use {@link newMethod()} instead! * @param string $str * @param string|null $str2

是否可以链接到另一个方法/类/属性/等.在我的项目内部@deprecated标签内联?像这样:

/**
 * Method description
 * @deprecated 1.0 Reason for deprecation,use {@link newMethod()} instead!
 * @param string $str
 * @param string|null $str2
 * @return bool
*/
public function method($str,$str2) {
    // TODO: Code...
}

...

根据PHPdoc.org,你可以使用 @see标签.
/**
 * @see http://example.com/my/bar Documentation of Foo.
 * @see MyClass::$items           For the property whose items are counted.
 * @see MyClass::setItems()       To set the items for this collection.
 *
 * @return integer Indicates the number of items.
 */
function count()
{
     <...>
}

另外,PHPdoc.org recommends to use @see in case of a @deprecated method:

It is RECOMMENDED (but not required) to provide an additional description stating why the associated element is deprecated. If it is superceded by another method it is RECOMMENDED to add a @see tag in the same PHPDoc pointing to the new element.

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读