2016-12-23 38 views
3

是否可以鏈接到另一個方法/類/屬性/等。在我的項目裏面內嵌@deprecated標籤?像這樣:PhpDocs:可能鏈接參數描述中的方法?

/** 
* 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... 
} 

... 

+0

您可以使用[@see](https://www.phpdoc.org/docs/latest/references/phpdoc/tags/see.html)標記 – Dragos

回答

2

根據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

它建議(但不是必需的),以提供額外的描述說明爲什麼相關聯的元件被棄用。如果它被另一種方法取代,建議在指向新元素的同一PHPDoc中添加@see標記。