Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/254.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在PHPDoc中提及属性?_Php_Phpdoc - Fatal编程技术网

如何在PHPDoc中提及属性?

如何在PHPDoc中提及属性?,php,phpdoc,Php,Phpdoc,我试图在我的类的其他注释中提到我的类的一个属性,即在该类的一个方法中 例如,如果我们有以下代码: (请搜索:property$提提--@property Village::提提不起作用) 如何在PHPDoc中提及属性?如果需要在docblock文本中使用$antify,通常会使用内联see{@see element description}: /** * Name tells the story... * * Now somewhere at this exact point I want

我试图在我的类的其他注释中提到我的类的一个属性,即在该类的一个方法中

例如,如果我们有以下代码:

(请搜索:
property$提提--@property Village::提提不起作用


如何在PHPDoc中提及属性?

如果需要在docblock文本中使用
$antify
,通常会使用内联see
{@see element description}

/**
 * Name tells the story...
 *
 * Now somewhere at this exact point I want to mention the
 * {@see Village::$mention} property.
 *
 * @return array Rednecks unset.
 * @see Village::$mention
 * @uses Village::$mention
 */
public function redneck() {
    if(sizeof($data)) {
        unset($data);
    }

    return $data;
}
@see
@uses
独立标记也可用,但不用于将链接嵌入docblock叙述文本


请注意,较旧的phpDocumentor只允许inlink链接标记
{@link url | element description}

提及的目的是什么?您可以使用@see注释。一般来说,您使用什么并不重要,只要它是人类可读的(IDE通常以任何一种方式获得它)就可以简单地引用某些内容,而不必详细说明。就像
@see
了解方法一样。是的,无论如何,
@see
是一条路要走。谢谢各位。
/**
 * Name tells the story...
 *
 * Now somewhere at this exact point I want to mention the
 * {@see Village::$mention} property.
 *
 * @return array Rednecks unset.
 * @see Village::$mention
 * @uses Village::$mention
 */
public function redneck() {
    if(sizeof($data)) {
        unset($data);
    }

    return $data;
}