微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

是否可以链接到另一个方法/类/属性/等.在我的项目内部@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.

原文地址:https://www.jb51.cc/php/130395.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐