是否可以链接到另一个方法/类/属性/等。在我的项目内联内@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 https://docs.phpdoc.org/latest/guide/references/phpdoc/tags/see.html#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()
{
<...>
}
Also, PHPdoc.org 建议在 @deprecated 方法的情况下使用 @see https://docs.phpdoc.org/latest/guide/references/phpdoc/tags/deprecated.html#deprecated:
建议(但不要求)提供附加说明,说明相关元素为何被弃用。如果它被另一种方法取代,建议在指向新元素的同一个 PHPDoc 中添加 @see 标记。
But @see
并不总是需要的,例如“链接到@param标签描述中的另一个方法?” https://stackoverflow.com/q/75315415/8740349
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)